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
This commit is contained in:
parent
1cbdeae78d
commit
d01a9f8bc4
2 changed files with 22 additions and 1 deletions
|
@ -33,7 +33,6 @@
|
||||||
#include <mach/host_info.h>
|
#include <mach/host_info.h>
|
||||||
#include <mach/i386/thread_status.h>
|
#include <mach/i386/thread_status.h>
|
||||||
#include <mach/mach_vm.h>
|
#include <mach/mach_vm.h>
|
||||||
#include <mach/ppc/thread_status.h>
|
|
||||||
#include <mach/vm_statistics.h>
|
#include <mach/vm_statistics.h>
|
||||||
#include <mach-o/dyld.h>
|
#include <mach-o/dyld.h>
|
||||||
#include <mach-o/loader.h>
|
#include <mach-o/loader.h>
|
||||||
|
@ -43,6 +42,11 @@
|
||||||
#include <CoreFoundation/CoreFoundation.h>
|
#include <CoreFoundation/CoreFoundation.h>
|
||||||
|
|
||||||
#include "client/mac/handler/minidump_generator.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 "client/minidump_file_writer-inl.h"
|
||||||
#include "common/mac/file_id.h"
|
#include "common/mac/file_id.h"
|
||||||
#include "common/mac/string_utilities.h"
|
#include "common/mac/string_utilities.h"
|
||||||
|
@ -336,10 +340,12 @@ bool MinidumpGenerator::WriteStackFromStartAddress(
|
||||||
bool MinidumpGenerator::WriteStack(breakpad_thread_state_data_t state,
|
bool MinidumpGenerator::WriteStack(breakpad_thread_state_data_t state,
|
||||||
MDMemoryDescriptor *stack_location) {
|
MDMemoryDescriptor *stack_location) {
|
||||||
switch (cpu_type_) {
|
switch (cpu_type_) {
|
||||||
|
#ifdef HAS_PPC_SUUPORT
|
||||||
case CPU_TYPE_POWERPC:
|
case CPU_TYPE_POWERPC:
|
||||||
return WriteStackPPC(state, stack_location);
|
return WriteStackPPC(state, stack_location);
|
||||||
case CPU_TYPE_POWERPC64:
|
case CPU_TYPE_POWERPC64:
|
||||||
return WriteStackPPC64(state, stack_location);
|
return WriteStackPPC64(state, stack_location);
|
||||||
|
#endif
|
||||||
case CPU_TYPE_I386:
|
case CPU_TYPE_I386:
|
||||||
return WriteStackX86(state, stack_location);
|
return WriteStackX86(state, stack_location);
|
||||||
case CPU_TYPE_X86_64:
|
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,
|
bool MinidumpGenerator::WriteContext(breakpad_thread_state_data_t state,
|
||||||
MDLocationDescriptor *register_location) {
|
MDLocationDescriptor *register_location) {
|
||||||
switch (cpu_type_) {
|
switch (cpu_type_) {
|
||||||
|
#ifdef HAS_PPC_SUPPORT
|
||||||
case CPU_TYPE_POWERPC:
|
case CPU_TYPE_POWERPC:
|
||||||
return WriteContextPPC(state, register_location);
|
return WriteContextPPC(state, register_location);
|
||||||
case CPU_TYPE_POWERPC64:
|
case CPU_TYPE_POWERPC64:
|
||||||
return WriteContextPPC64(state, register_location);
|
return WriteContextPPC64(state, register_location);
|
||||||
|
#endif
|
||||||
case CPU_TYPE_I386:
|
case CPU_TYPE_I386:
|
||||||
return WriteContextX86(state, register_location);
|
return WriteContextX86(state, register_location);
|
||||||
case CPU_TYPE_X86_64:
|
case CPU_TYPE_X86_64:
|
||||||
|
@ -368,10 +376,12 @@ bool MinidumpGenerator::WriteContext(breakpad_thread_state_data_t state,
|
||||||
u_int64_t MinidumpGenerator::CurrentPCForStack(
|
u_int64_t MinidumpGenerator::CurrentPCForStack(
|
||||||
breakpad_thread_state_data_t state) {
|
breakpad_thread_state_data_t state) {
|
||||||
switch (cpu_type_) {
|
switch (cpu_type_) {
|
||||||
|
#ifdef HAS_PPC_SUPPORT
|
||||||
case CPU_TYPE_POWERPC:
|
case CPU_TYPE_POWERPC:
|
||||||
return CurrentPCForStackPPC(state);
|
return CurrentPCForStackPPC(state);
|
||||||
case CPU_TYPE_POWERPC64:
|
case CPU_TYPE_POWERPC64:
|
||||||
return CurrentPCForStackPPC64(state);
|
return CurrentPCForStackPPC64(state);
|
||||||
|
#endif
|
||||||
case CPU_TYPE_I386:
|
case CPU_TYPE_I386:
|
||||||
return CurrentPCForStackX86(state);
|
return CurrentPCForStackX86(state);
|
||||||
case CPU_TYPE_X86_64:
|
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,
|
bool MinidumpGenerator::WriteStackPPC(breakpad_thread_state_data_t state,
|
||||||
MDMemoryDescriptor *stack_location) {
|
MDMemoryDescriptor *stack_location) {
|
||||||
ppc_thread_state_t *machine_state =
|
ppc_thread_state_t *machine_state =
|
||||||
|
@ -539,6 +550,8 @@ bool MinidumpGenerator::WriteContextPPC64(
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
bool MinidumpGenerator::WriteStackX86(breakpad_thread_state_data_t state,
|
bool MinidumpGenerator::WriteStackX86(breakpad_thread_state_data_t state,
|
||||||
MDMemoryDescriptor *stack_location) {
|
MDMemoryDescriptor *stack_location) {
|
||||||
i386_thread_state_t *machine_state =
|
i386_thread_state_t *machine_state =
|
||||||
|
@ -663,12 +676,14 @@ bool MinidumpGenerator::GetThreadState(thread_act_t target_thread,
|
||||||
mach_msg_type_number_t *count) {
|
mach_msg_type_number_t *count) {
|
||||||
thread_state_flavor_t flavor;
|
thread_state_flavor_t flavor;
|
||||||
switch (cpu_type_) {
|
switch (cpu_type_) {
|
||||||
|
#ifdef HAS_PPC_SUPPORT
|
||||||
case CPU_TYPE_POWERPC:
|
case CPU_TYPE_POWERPC:
|
||||||
flavor = PPC_THREAD_STATE;
|
flavor = PPC_THREAD_STATE;
|
||||||
break;
|
break;
|
||||||
case CPU_TYPE_POWERPC64:
|
case CPU_TYPE_POWERPC64:
|
||||||
flavor = PPC_THREAD_STATE64;
|
flavor = PPC_THREAD_STATE64;
|
||||||
break;
|
break;
|
||||||
|
#endif
|
||||||
case CPU_TYPE_I386:
|
case CPU_TYPE_I386:
|
||||||
flavor = i386_THREAD_STATE;
|
flavor = i386_THREAD_STATE;
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -43,6 +43,10 @@
|
||||||
|
|
||||||
#include "dynamic_images.h"
|
#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 {
|
namespace google_breakpad {
|
||||||
|
|
||||||
using std::string;
|
using std::string;
|
||||||
|
@ -128,6 +132,7 @@ class MinidumpGenerator {
|
||||||
int FindExecutableModule();
|
int FindExecutableModule();
|
||||||
|
|
||||||
// Per-CPU implementations of these methods
|
// Per-CPU implementations of these methods
|
||||||
|
#ifdef HAS_PPC_SUPPORT
|
||||||
bool WriteStackPPC(breakpad_thread_state_data_t state,
|
bool WriteStackPPC(breakpad_thread_state_data_t state,
|
||||||
MDMemoryDescriptor *stack_location);
|
MDMemoryDescriptor *stack_location);
|
||||||
bool WriteContextPPC(breakpad_thread_state_data_t state,
|
bool WriteContextPPC(breakpad_thread_state_data_t state,
|
||||||
|
@ -138,6 +143,7 @@ class MinidumpGenerator {
|
||||||
bool WriteContextPPC64(breakpad_thread_state_data_t state,
|
bool WriteContextPPC64(breakpad_thread_state_data_t state,
|
||||||
MDLocationDescriptor *register_location);
|
MDLocationDescriptor *register_location);
|
||||||
u_int64_t CurrentPCForStackPPC64(breakpad_thread_state_data_t state);
|
u_int64_t CurrentPCForStackPPC64(breakpad_thread_state_data_t state);
|
||||||
|
#endif
|
||||||
bool WriteStackX86(breakpad_thread_state_data_t state,
|
bool WriteStackX86(breakpad_thread_state_data_t state,
|
||||||
MDMemoryDescriptor *stack_location);
|
MDMemoryDescriptor *stack_location);
|
||||||
bool WriteContextX86(breakpad_thread_state_data_t state,
|
bool WriteContextX86(breakpad_thread_state_data_t state,
|
||||||
|
|
Loading…
Reference in a new issue