mirror of
https://git.suyu.dev/suyu/breakpad.git
synced 2026-01-01 20:24:40 +01:00
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
This commit is contained in:
parent
de2fd15db9
commit
255bbe93ed
12 changed files with 220 additions and 20 deletions
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue