Breakpad PPC bustage fix. r=ted
authorJosh Aas <joshmoz@gmail.com>
Tue, 15 Sep 2009 15:58:49 -0400
changeset 32506 9c3a70ea7acf1cbec97427a319e674bc77818d3a
parent 32505 eb15507581d625557a0001359f42d67a53989267
child 32507 9a19776b0676fafda4df33a82879ea01440fd017
push id9129
push userjosh@mozilla.com
push dateTue, 15 Sep 2009 19:59:24 +0000
treeherdermozilla-central@9c3a70ea7acf [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersted
milestone1.9.3a1pre
Breakpad PPC bustage fix. r=ted
toolkit/crashreporter/google-breakpad/src/client/mac/handler/minidump_generator.cc
--- a/toolkit/crashreporter/google-breakpad/src/client/mac/handler/minidump_generator.cc
+++ b/toolkit/crashreporter/google-breakpad/src/client/mac/handler/minidump_generator.cc
@@ -318,56 +318,43 @@ bool MinidumpGenerator::WriteStackFromSt
   return result;
 }
 
 #if TARGET_CPU_PPC || TARGET_CPU_PPC64
 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);
 }
 
 u_int64_t
 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,
                                      MDLocationDescriptor *register_location) {
   TypedMDRVA<MinidumpContext> context(&writer_);
   breakpad_thread_state_t *machine_state =
     reinterpret_cast<breakpad_thread_state_t *>(state);
 
   if (!context.Allocate())
     return false;
 
   *register_location = context.location();
   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);
   AddReg(xer);
   AddReg(ctr);
   AddReg(lr);
   AddReg(vrsave);