diff options
Diffstat (limited to 'src/client/mac/handler/minidump_generator.h')
-rw-r--r-- | src/client/mac/handler/minidump_generator.h | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/src/client/mac/handler/minidump_generator.h b/src/client/mac/handler/minidump_generator.h index 33d84c1c..0d3424c3 100644 --- a/src/client/mac/handler/minidump_generator.h +++ b/src/client/mac/handler/minidump_generator.h @@ -46,6 +46,26 @@ namespace google_breakpad { using std::string; +#if TARGET_CPU_X86_64 || TARGET_CPU_PPC64 +#define TOP_OF_THREAD0_STACK 0x00007fff5fbff000 +#else +#define TOP_OF_THREAD0_STACK 0xbffff000 +#endif + +#if TARGET_CPU_X86_64 +typedef x86_thread_state64_t breakpad_thread_state_t; +typedef MDRawContextAMD64 MinidumpContext; +#elif TARGET_CPU_X86 +typedef i386_thread_state_t breakpad_thread_state_t; +typedef MDRawContextX86 MinidumpContext; +#elif TARGET_CPU_PPC64 +typedef ppc_thread_state64_t breakpad_thread_state_t; +typedef MDRawContextPPC64 MinidumpContext; +#elif TARGET_CPU_PPC +typedef ppc_thread_state_t breakpad_thread_state_t; +typedef MDRawContextPPC MinidumpContext; +#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. @@ -93,7 +113,7 @@ class MinidumpGenerator { // Helpers u_int64_t CurrentPCForStack(breakpad_thread_state_data_t state); - bool WriteStackFromStartAddress(vm_address_t start_addr, + bool WriteStackFromStartAddress(mach_vm_address_t start_addr, MDMemoryDescriptor *stack_location); bool WriteStack(breakpad_thread_state_data_t state, MDMemoryDescriptor *stack_location); @@ -103,7 +123,9 @@ class MinidumpGenerator { bool WriteCVRecord(MDRawModule *module, int cpu_type, const char *module_path); bool WriteModuleStream(unsigned int index, MDRawModule *module); - size_t CalculateStackSize(vm_address_t start_addr); + + size_t CalculateStackSize(mach_vm_address_t start_addr); + int FindExecutableModule(); // disallow copy ctor and operator= |