mirror of
https://github.com/chromium/crashpad.git
synced 2025-03-09 14:06:33 +00:00
Initializes contexts on ios x64 builds
In a later CL, in some cases these structs were not zero-initialized which caused some iOS tests to fail. We now zero-initialize these structs which should be harmless now, and useful later. Bug: 1250098 Change-Id: I933e80e56714a1d8988deae3aa56ec36ed98ef03 Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/3538665 Reviewed-by: Justin Cohen <justincohen@chromium.org> Commit-Queue: Alex Gough <ajgo@chromium.org>
This commit is contained in:
parent
68aba08c48
commit
36c88b15b7
@ -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 =
|
||||
|
@ -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
|
||||
|
@ -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),
|
||||
|
Loading…
x
Reference in New Issue
Block a user