diff options
author | ted.mielczarek <ted.mielczarek@4c0a9323-5329-0410-9bdc-e9ce6186880e> | 2007-05-03 20:12:41 +0000 |
---|---|---|
committer | ted.mielczarek <ted.mielczarek@4c0a9323-5329-0410-9bdc-e9ce6186880e> | 2007-05-03 20:12:41 +0000 |
commit | 255bbe93ed7aef5418000339b6cdb5677bf9e4d6 (patch) | |
tree | 86c899bc72e39e4eac5ad3c892ce04a7240bbe2e /src/client | |
parent | Issue 159: reviewer Waylonis (diff) | |
download | breakpad-255bbe93ed7aef5418000339b6cdb5677bf9e4d6.tar.xz |
Issue 152 - Patch by Dave Camp, Reviewer Chris Rogers
git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@152 4c0a9323-5329-0410-9bdc-e9ce6186880e
Diffstat (limited to 'src/client')
-rw-r--r-- | src/client/mac/handler/exception_handler.cc | 3 | ||||
-rw-r--r-- | src/client/mac/handler/minidump_generator.cc | 17 | ||||
-rw-r--r-- | src/client/mac/handler/minidump_generator.h | 7 |
3 files changed, 15 insertions, 12 deletions
diff --git a/src/client/mac/handler/exception_handler.cc b/src/client/mac/handler/exception_handler.cc index 8f87dd83..b61fda89 100644 --- a/src/client/mac/handler/exception_handler.cc +++ b/src/client/mac/handler/exception_handler.cc @@ -32,6 +32,7 @@ #include "client/mac/handler/exception_handler.h" #include "client/mac/handler/minidump_generator.h" +#include "common/mac/mac_compat.h" namespace google_breakpad { @@ -290,7 +291,7 @@ kern_return_t ForwardException(mach_port_t task, mach_port_t failed_thread, thread_state_flavor_t target_flavor = current.flavors[found]; mach_msg_type_number_t thread_state_count = THREAD_STATE_MAX; - thread_state_data_t thread_state; + breakpad_thread_state_data_t thread_state; switch (target_behavior) { case EXCEPTION_DEFAULT: result = exception_raise(target_port, failed_thread, task, exception, diff --git a/src/client/mac/handler/minidump_generator.cc b/src/client/mac/handler/minidump_generator.cc index bdabc1f4..afdce0e5 100644 --- a/src/client/mac/handler/minidump_generator.cc +++ b/src/client/mac/handler/minidump_generator.cc @@ -34,6 +34,7 @@ #include <mach-o/dyld.h> #include <mach-o/loader.h> #include <sys/sysctl.h> +#include <sys/resource.h> #include <CoreFoundation/CoreFoundation.h> @@ -253,7 +254,7 @@ bool MinidumpGenerator::WriteStackFromStartAddress( } #if TARGET_CPU_PPC -bool MinidumpGenerator::WriteStack(thread_state_data_t state, +bool MinidumpGenerator::WriteStack(breakpad_thread_state_data_t state, MDMemoryDescriptor *stack_location) { ppc_thread_state_t *machine_state = reinterpret_cast<ppc_thread_state_t *>(state); @@ -261,14 +262,14 @@ bool MinidumpGenerator::WriteStack(thread_state_data_t state, return WriteStackFromStartAddress(start_addr, stack_location); } -u_int64_t MinidumpGenerator::CurrentPCForStack(thread_state_data_t state) { +u_int64_t MinidumpGenerator::CurrentPCForStack(breakpad_thread_state_data_t state) { ppc_thread_state_t *machine_state = reinterpret_cast<ppc_thread_state_t *>(state); return machine_state->srr0; } -bool MinidumpGenerator::WriteContext(thread_state_data_t state, +bool MinidumpGenerator::WriteContext(breakpad_thread_state_data_t state, MDLocationDescriptor *register_location) { TypedMDRVA<MDRawContextPPC> context(&writer_); ppc_thread_state_t *machine_state = @@ -327,7 +328,7 @@ bool MinidumpGenerator::WriteContext(thread_state_data_t state, } #elif TARGET_CPU_X86 -bool MinidumpGenerator::WriteStack(thread_state_data_t state, +bool MinidumpGenerator::WriteStack(breakpad_thread_state_data_t state, MDMemoryDescriptor *stack_location) { x86_thread_state_t *machine_state = reinterpret_cast<x86_thread_state_t *>(state); @@ -335,14 +336,14 @@ bool MinidumpGenerator::WriteStack(thread_state_data_t state, return WriteStackFromStartAddress(start_addr, stack_location); } -u_int64_t MinidumpGenerator::CurrentPCForStack(thread_state_data_t state) { +u_int64_t MinidumpGenerator::CurrentPCForStack(breakpad_thread_state_data_t state) { x86_thread_state_t *machine_state = reinterpret_cast<x86_thread_state_t *>(state); return machine_state->uts.ts32.eip; } -bool MinidumpGenerator::WriteContext(thread_state_data_t state, +bool MinidumpGenerator::WriteContext(breakpad_thread_state_data_t state, MDLocationDescriptor *register_location) { TypedMDRVA<MDRawContextX86> context(&writer_); x86_thread_state_t *machine_state = @@ -378,7 +379,7 @@ bool MinidumpGenerator::WriteContext(thread_state_data_t state, bool MinidumpGenerator::WriteThreadStream(mach_port_t thread_id, MDRawThread *thread) { - thread_state_data_t state; + breakpad_thread_state_data_t state; mach_msg_type_number_t state_count = sizeof(state); if (thread_get_state(thread_id, MACHINE_THREAD_STATE, state, &state_count) == @@ -451,7 +452,7 @@ bool MinidumpGenerator::WriteExceptionStream(MDRawDirectory *exception_stream) { exception_ptr->exception_record.exception_code = exception_type_; exception_ptr->exception_record.exception_flags = exception_code_; - thread_state_data_t state; + breakpad_thread_state_data_t state; mach_msg_type_number_t stateCount = sizeof(state); if (thread_get_state(exception_thread_, MACHINE_THREAD_STATE, state, diff --git a/src/client/mac/handler/minidump_generator.h b/src/client/mac/handler/minidump_generator.h index 9fee9e5a..2251897d 100644 --- a/src/client/mac/handler/minidump_generator.h +++ b/src/client/mac/handler/minidump_generator.h @@ -38,6 +38,7 @@ #include "client/minidump_file_writer.h" #include "google_breakpad/common/minidump_format.h" +#include "common/mac/mac_compat.h" #include "dynamic_images.h" @@ -91,12 +92,12 @@ class MinidumpGenerator { bool WriteBreakpadInfoStream(MDRawDirectory *breakpad_info_stream); // Helpers - u_int64_t CurrentPCForStack(thread_state_data_t state); + u_int64_t CurrentPCForStack(breakpad_thread_state_data_t state); bool WriteStackFromStartAddress(vm_address_t start_addr, MDMemoryDescriptor *stack_location); - bool WriteStack(thread_state_data_t state, + bool WriteStack(breakpad_thread_state_data_t state, MDMemoryDescriptor *stack_location); - bool WriteContext(thread_state_data_t state, + bool WriteContext(breakpad_thread_state_data_t state, MDLocationDescriptor *register_location); bool WriteThreadStream(mach_port_t thread_id, MDRawThread *thread); bool WriteCVRecord(MDRawModule *module, int cpu_type, |