diff options
author | ted.mielczarek@gmail.com <ted.mielczarek@gmail.com@4c0a9323-5329-0410-9bdc-e9ce6186880e> | 2011-07-26 12:00:20 +0000 |
---|---|---|
committer | ted.mielczarek@gmail.com <ted.mielczarek@gmail.com@4c0a9323-5329-0410-9bdc-e9ce6186880e> | 2011-07-26 12:00:20 +0000 |
commit | d01a9f8bc4be2c54027b66fc41f566d41d3c030a (patch) | |
tree | b865ef061b49f135c7d368f118aa89dc8de70114 /src/client/mac | |
parent | Fix a sizeof(pointer) vs sizeof(pointee) issue caught by client. (diff) | |
download | breakpad-d01a9f8bc4be2c54027b66fc41f566d41d3c030a.tar.xz |
Fix compilation using the OS X 10.7 SDK by #ifdefing out PPC support when targeting 10.7, as PPC support has been removed from the 10.7 SDK
A=Rafael Ávila de Espíndola <respindola@mozilla.com>, R=ted at https://bugzilla.mozilla.org/show_bug.cgi?id=673789
git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@817 4c0a9323-5329-0410-9bdc-e9ce6186880e
Diffstat (limited to 'src/client/mac')
-rw-r--r-- | src/client/mac/handler/minidump_generator.cc | 17 | ||||
-rw-r--r-- | src/client/mac/handler/minidump_generator.h | 6 |
2 files changed, 22 insertions, 1 deletions
diff --git a/src/client/mac/handler/minidump_generator.cc b/src/client/mac/handler/minidump_generator.cc index 8d670429..087d4d70 100644 --- a/src/client/mac/handler/minidump_generator.cc +++ b/src/client/mac/handler/minidump_generator.cc @@ -33,7 +33,6 @@ #include <mach/host_info.h> #include <mach/i386/thread_status.h> #include <mach/mach_vm.h> -#include <mach/ppc/thread_status.h> #include <mach/vm_statistics.h> #include <mach-o/dyld.h> #include <mach-o/loader.h> @@ -43,6 +42,11 @@ #include <CoreFoundation/CoreFoundation.h> #include "client/mac/handler/minidump_generator.h" + +#ifdef HAS_PPC_SUPPORT +#include <mach/ppc/thread_status.h> +#endif + #include "client/minidump_file_writer-inl.h" #include "common/mac/file_id.h" #include "common/mac/string_utilities.h" @@ -336,10 +340,12 @@ bool MinidumpGenerator::WriteStackFromStartAddress( bool MinidumpGenerator::WriteStack(breakpad_thread_state_data_t state, MDMemoryDescriptor *stack_location) { switch (cpu_type_) { +#ifdef HAS_PPC_SUUPORT case CPU_TYPE_POWERPC: return WriteStackPPC(state, stack_location); case CPU_TYPE_POWERPC64: return WriteStackPPC64(state, stack_location); +#endif case CPU_TYPE_I386: return WriteStackX86(state, stack_location); case CPU_TYPE_X86_64: @@ -352,10 +358,12 @@ bool MinidumpGenerator::WriteStack(breakpad_thread_state_data_t state, bool MinidumpGenerator::WriteContext(breakpad_thread_state_data_t state, MDLocationDescriptor *register_location) { switch (cpu_type_) { +#ifdef HAS_PPC_SUPPORT case CPU_TYPE_POWERPC: return WriteContextPPC(state, register_location); case CPU_TYPE_POWERPC64: return WriteContextPPC64(state, register_location); +#endif case CPU_TYPE_I386: return WriteContextX86(state, register_location); case CPU_TYPE_X86_64: @@ -368,10 +376,12 @@ bool MinidumpGenerator::WriteContext(breakpad_thread_state_data_t state, u_int64_t MinidumpGenerator::CurrentPCForStack( breakpad_thread_state_data_t state) { switch (cpu_type_) { +#ifdef HAS_PPC_SUPPORT case CPU_TYPE_POWERPC: return CurrentPCForStackPPC(state); case CPU_TYPE_POWERPC64: return CurrentPCForStackPPC64(state); +#endif case CPU_TYPE_I386: return CurrentPCForStackX86(state); case CPU_TYPE_X86_64: @@ -382,6 +392,7 @@ u_int64_t MinidumpGenerator::CurrentPCForStack( } } +#ifdef HAS_PCC_SUPPORT bool MinidumpGenerator::WriteStackPPC(breakpad_thread_state_data_t state, MDMemoryDescriptor *stack_location) { ppc_thread_state_t *machine_state = @@ -539,6 +550,8 @@ bool MinidumpGenerator::WriteContextPPC64( return true; } +#endif + bool MinidumpGenerator::WriteStackX86(breakpad_thread_state_data_t state, MDMemoryDescriptor *stack_location) { i386_thread_state_t *machine_state = @@ -663,12 +676,14 @@ bool MinidumpGenerator::GetThreadState(thread_act_t target_thread, mach_msg_type_number_t *count) { thread_state_flavor_t flavor; switch (cpu_type_) { +#ifdef HAS_PPC_SUPPORT case CPU_TYPE_POWERPC: flavor = PPC_THREAD_STATE; break; case CPU_TYPE_POWERPC64: flavor = PPC_THREAD_STATE64; break; +#endif case CPU_TYPE_I386: flavor = i386_THREAD_STATE; break; diff --git a/src/client/mac/handler/minidump_generator.h b/src/client/mac/handler/minidump_generator.h index 224ad1c2..55c4c8a3 100644 --- a/src/client/mac/handler/minidump_generator.h +++ b/src/client/mac/handler/minidump_generator.h @@ -43,6 +43,10 @@ #include "dynamic_images.h" +#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_7 + #define HAS_PPC_SUPPORT +#endif + namespace google_breakpad { using std::string; @@ -128,6 +132,7 @@ class MinidumpGenerator { int FindExecutableModule(); // Per-CPU implementations of these methods +#ifdef HAS_PPC_SUPPORT bool WriteStackPPC(breakpad_thread_state_data_t state, MDMemoryDescriptor *stack_location); bool WriteContextPPC(breakpad_thread_state_data_t state, @@ -138,6 +143,7 @@ class MinidumpGenerator { bool WriteContextPPC64(breakpad_thread_state_data_t state, MDLocationDescriptor *register_location); u_int64_t CurrentPCForStackPPC64(breakpad_thread_state_data_t state); +#endif bool WriteStackX86(breakpad_thread_state_data_t state, MDMemoryDescriptor *stack_location); bool WriteContextX86(breakpad_thread_state_data_t state, |