mirror of
https://github.com/yuzu-emu/breakpad.git
synced 2024-12-23 16:05:32 +00:00
Patch from Jeremy Moskovich to build with 10.5 SDK correctly. Also removed externals directory.
A=jeremy R=nealsid git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@328 4c0a9323-5329-0410-9bdc-e9ce6186880e
This commit is contained in:
parent
ea78675fbd
commit
a0a0de39a8
|
@ -39,20 +39,20 @@
|
|||
#define DEBUGLOG if (gDebugLog) fprintf
|
||||
#define IGNORE_DEBUGGER "BREAKPAD_IGNORE_DEBUGGER"
|
||||
|
||||
#import "client/mac/Framework/Breakpad.h"
|
||||
#import "client/mac/crash_generation/Inspector.h"
|
||||
#import "client/mac/Framework/OnDemandServer.h"
|
||||
#import "client/mac/handler/protected_memory_allocator.h"
|
||||
#import "common/mac/MachIPC.h"
|
||||
#import "common/mac/SimpleStringDictionary.h"
|
||||
|
||||
#import "client/mac/crash_generation/Inspector.h"
|
||||
#import "client/mac/handler/exception_handler.h"
|
||||
#import "client/mac/Framework/Breakpad.h"
|
||||
#import "client/mac/Framework/OnDemandServer.h"
|
||||
#import "client/mac/handler/protected_memory_allocator.h"
|
||||
|
||||
#import <sys/stat.h>
|
||||
#import <sys/sysctl.h>
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
#import "exception_handler.h"
|
||||
#import "string_utilities.h"
|
||||
|
||||
using google_breakpad::KeyValueEntry;
|
||||
using google_breakpad::SimpleStringDictionary;
|
||||
|
|
|
@ -418,9 +418,9 @@ bool MinidumpGenerator::WriteStack(breakpad_thread_state_data_t state,
|
|||
reinterpret_cast<breakpad_thread_state_t *>(state);
|
||||
|
||||
#if TARGET_CPU_X86_64
|
||||
mach_vm_address_t start_addr = machine_state->__rsp;
|
||||
mach_vm_address_t start_addr = REGISTER_FROM_THREADSTATE(machine_state, rsp);
|
||||
#else
|
||||
mach_vm_address_t start_addr = machine_state->esp;
|
||||
mach_vm_address_t start_addr = REGISTER_FROM_THREADSTATE(machine_state, esp);
|
||||
#endif
|
||||
return WriteStackFromStartAddress(start_addr, stack_location);
|
||||
}
|
||||
|
@ -431,9 +431,9 @@ MinidumpGenerator::CurrentPCForStack(breakpad_thread_state_data_t state) {
|
|||
reinterpret_cast<breakpad_thread_state_t *>(state);
|
||||
|
||||
#if TARGET_CPU_X86_64
|
||||
return machine_state->__rip;
|
||||
return REGISTER_FROM_THREADSTATE(machine_state, rip);
|
||||
#else
|
||||
return machine_state->eip;
|
||||
return REGISTER_FROM_THREADSTATE(machine_state, eip);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -449,10 +449,9 @@ bool MinidumpGenerator::WriteContext(breakpad_thread_state_data_t state,
|
|||
*register_location = context.location();
|
||||
MinidumpContext *context_ptr = context.get();
|
||||
|
||||
#define AddReg(a) context_ptr->a = REGISTER_FROM_THREADSTATE(machine_state, a)
|
||||
#if TARGET_CPU_X86
|
||||
context_ptr->context_flags = MD_CONTEXT_X86;
|
||||
|
||||
#define AddReg(a) context_ptr->a = machine_state->a
|
||||
AddReg(eax);
|
||||
AddReg(ebx);
|
||||
AddReg(ecx);
|
||||
|
@ -472,8 +471,6 @@ bool MinidumpGenerator::WriteContext(breakpad_thread_state_data_t state,
|
|||
|
||||
AddReg(eip);
|
||||
#else
|
||||
|
||||
#define AddReg(a) context_ptr->a = machine_state->__ ## a
|
||||
context_ptr->context_flags = MD_CONTEXT_AMD64;
|
||||
AddReg(rax);
|
||||
AddReg(rbx);
|
||||
|
@ -501,6 +498,7 @@ bool MinidumpGenerator::WriteContext(breakpad_thread_state_data_t state,
|
|||
AddReg(fs);
|
||||
AddReg(gs);
|
||||
#endif
|
||||
#undef AddReg(a)
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -66,6 +66,18 @@ typedef ppc_thread_state_t breakpad_thread_state_t;
|
|||
typedef MDRawContextPPC MinidumpContext;
|
||||
#endif
|
||||
|
||||
// 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
|
||||
// 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
|
||||
// symbol Apple's headers use.
|
||||
#define REGISTER_FROM_THREADSTATE(a, b) ((a)->__ ## b)
|
||||
#else
|
||||
#define REGISTER_FROM_THREADSTATE(a, b) (a->b)
|
||||
#endif
|
||||
|
||||
// Creates a minidump file of the current process. If there is exception data,
|
||||
// use SetExceptionInformation() to add this to the minidump. The minidump
|
||||
// file is generated by the Write() function.
|
||||
|
|
Loading…
Reference in a new issue