diff --git a/client/ios_handler/exception_processor.mm b/client/ios_handler/exception_processor.mm index 3211228c..5aa4c78d 100644 --- a/client/ios_handler/exception_processor.mm +++ b/client/ios_handler/exception_processor.mm @@ -294,7 +294,7 @@ static __attribute__((noinline)) id HANDLE_UNCAUGHT_NSEXCEPTION( SetNSExceptionAnnotations(exception, name, reason); LOG(WARNING) << "Handling Objective-C exception name: " << name << " reason: " << reason << " with sinkhole: " << sinkhole; - NativeCPUContext cpu_context; + NativeCPUContext cpu_context{}; CaptureContext(&cpu_context); ExceptionPreprocessorState* preprocessor_state = diff --git a/snapshot/ios/exception_snapshot_ios_intermediate_dump.cc b/snapshot/ios/exception_snapshot_ios_intermediate_dump.cc index a45d4cc2..7530912a 100644 --- a/snapshot/ios/exception_snapshot_ios_intermediate_dump.cc +++ b/snapshot/ios/exception_snapshot_ios_intermediate_dump.cc @@ -66,6 +66,13 @@ using Key = IntermediateDumpKey; ExceptionSnapshotIOSIntermediateDump::ExceptionSnapshotIOSIntermediateDump() : ExceptionSnapshot(), +#if defined(ARCH_CPU_X86_64) + context_x86_64_(), +#elif defined(ARCH_CPU_ARM64) + context_arm64_(), +#else +#error Port to your CPU architecture +#endif context_(), codes_(), thread_id_(0), @@ -379,11 +386,9 @@ void ExceptionSnapshotIOSIntermediateDump:: } #if defined(ARCH_CPU_X86_64) - context_x86_64_ = {}; context_x86_64_.rip = frames[0]; // instruction pointer context_x86_64_.rsp = frames[1]; #elif defined(ARCH_CPU_ARM64) - context_arm64_ = {}; context_arm64_.sp = 0; context_arm64_.pc = frames[0]; context_arm64_.regs[30] = frames[1]; // link register diff --git a/snapshot/ios/thread_snapshot_ios_intermediate_dump.cc b/snapshot/ios/thread_snapshot_ios_intermediate_dump.cc index b7ede298..ed7b28aa 100644 --- a/snapshot/ios/thread_snapshot_ios_intermediate_dump.cc +++ b/snapshot/ios/thread_snapshot_ios_intermediate_dump.cc @@ -68,6 +68,11 @@ using Key = IntermediateDumpKey; ThreadSnapshotIOSIntermediateDump::ThreadSnapshotIOSIntermediateDump() : ThreadSnapshot(), +#if defined(ARCH_CPU_X86_64) + context_x86_64_(), +#elif defined(ARCH_CPU_ARM64) + context_arm64_(), +#endif context_(), stack_(), thread_id_(0),