aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorted.mielczarek <ted.mielczarek@4c0a9323-5329-0410-9bdc-e9ce6186880e>2009-09-30 12:01:15 +0000
committerted.mielczarek <ted.mielczarek@4c0a9323-5329-0410-9bdc-e9ce6186880e>2009-09-30 12:01:15 +0000
commitb73230385c3d0d256a704ead20396714db43d7bb (patch)
tree62cac03d7e0519ee620c3175076f270973b2fc23 /src
parentNew uploader for Linux with unit tests, and gflags/glog libraries (diff)
downloadbreakpad-b73230385c3d0d256a704ead20396714db43d7bb.tar.xz
Fix compilation of OS X handler on PPC with 10.5 SDK. r=nealsid at http://breakpad.appspot.com/30001
git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@404 4c0a9323-5329-0410-9bdc-e9ce6186880e
Diffstat (limited to 'src')
-rw-r--r--src/client/mac/handler/minidump_generator.cc21
-rw-r--r--src/client/mac/handler/minidump_generator.h2
2 files changed, 5 insertions, 18 deletions
diff --git a/src/client/mac/handler/minidump_generator.cc b/src/client/mac/handler/minidump_generator.cc
index 9424c565..e91a3952 100644
--- a/src/client/mac/handler/minidump_generator.cc
+++ b/src/client/mac/handler/minidump_generator.cc
@@ -323,11 +323,7 @@ bool MinidumpGenerator::WriteStack(breakpad_thread_state_data_t state,
MDMemoryDescriptor *stack_location) {
breakpad_thread_state_t *machine_state =
reinterpret_cast<breakpad_thread_state_t *>(state);
-#if TARGET_CPU_PPC
- mach_vm_address_t start_addr = machine_state->r1;
-#else
- mach_vm_address_t start_addr = machine_state->__r1;
-#endif
+ mach_vm_address_t start_addr = REGISTER_FROM_THREADSTATE(machine_state, r1);
return WriteStackFromStartAddress(start_addr, stack_location);
}
@@ -336,11 +332,7 @@ MinidumpGenerator::CurrentPCForStack(breakpad_thread_state_data_t state) {
breakpad_thread_state_t *machine_state =
reinterpret_cast<breakpad_thread_state_t *>(state);
-#if TARGET_CPU_PPC
- return machine_state->srr0;
-#else
- return machine_state->__srr0;
-#endif
+ return REGISTER_FROM_THREADSTATE(machine_state, srr0);
}
bool MinidumpGenerator::WriteContext(breakpad_thread_state_data_t state,
@@ -356,13 +348,8 @@ bool MinidumpGenerator::WriteContext(breakpad_thread_state_data_t state,
MinidumpContext *context_ptr = context.get();
context_ptr->context_flags = MD_CONTEXT_PPC_BASE;
-#if TARGET_CPU_PPC64
-#define AddReg(a) context_ptr->a = machine_state->__ ## a
-#define AddGPR(a) context_ptr->gpr[a] = machine_state->__r ## a
-#else
-#define AddReg(a) context_ptr->a = machine_state->a
-#define AddGPR(a) context_ptr->gpr[a] = machine_state->r ## a
-#endif
+#define AddReg(a) context_ptr->a = REGISTER_FROM_THREADSTATE(machine_state, a)
+#define AddGPR(a) context_ptr->gpr[a] = REGISTER_FROM_THREADSTATE(machine_state, r ## a)
AddReg(srr0);
AddReg(cr);
diff --git a/src/client/mac/handler/minidump_generator.h b/src/client/mac/handler/minidump_generator.h
index 8b4f327e..b065fba9 100644
--- a/src/client/mac/handler/minidump_generator.h
+++ b/src/client/mac/handler/minidump_generator.h
@@ -68,7 +68,7 @@ typedef MDRawContextPPC MinidumpContext;
// Use the REGISTER_FROM_THREADSTATE to access a register name from the
// breakpad_thread_state_t structure.
-#if __DARWIN_UNIX03 || !TARGET_CPU_X86 || TARGET_CPU_X86_64
+#if __DARWIN_UNIX03 || TARGET_CPU_X86_64 || TARGET_CPU_PPC64
// In The 10.5 SDK Headers Apple prepended __ to the variable names in the
// i386_thread_state_t structure. There's no good way to tell what version of
// the SDK we're compiling against so we just toggle on the same preprocessor