bug 379518 - sync to breakpad svn revision 162. r=bsmedberg

This commit is contained in:
ted.mielczarek@gmail.com 2007-07-24 18:06:10 -07:00
parent 342d18ce3b
commit e02d956d3b
4 changed files with 20 additions and 14 deletions

View File

@ -216,7 +216,7 @@ bool ExceptionHandler::WriteMinidumpWithException(int exception_type,
exception_code,
thread_name) ) {
if (exception_type && exception_code)
exit(exception_type);
_exit(exception_type);
}
} else {
string minidump_id;
@ -245,7 +245,7 @@ bool ExceptionHandler::WriteMinidumpWithException(int exception_type,
if (callback_(dump_path_c_, next_minidump_id_c_, callback_context_,
result)) {
if (exception_type && exception_code)
exit(exception_type);
_exit(exception_type);
}
}
}

View File

@ -330,24 +330,24 @@ bool MinidumpGenerator::WriteContext(breakpad_thread_state_data_t state,
#elif TARGET_CPU_X86
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);
vm_address_t start_addr = machine_state->uts.ts32.esp;
i386_thread_state_t *machine_state =
reinterpret_cast<i386_thread_state_t *>(state);
vm_address_t start_addr = machine_state->esp;
return WriteStackFromStartAddress(start_addr, stack_location);
}
u_int64_t MinidumpGenerator::CurrentPCForStack(breakpad_thread_state_data_t state) {
x86_thread_state_t *machine_state =
reinterpret_cast<x86_thread_state_t *>(state);
i386_thread_state_t *machine_state =
reinterpret_cast<i386_thread_state_t *>(state);
return machine_state->uts.ts32.eip;
return machine_state->eip;
}
bool MinidumpGenerator::WriteContext(breakpad_thread_state_data_t state,
MDLocationDescriptor *register_location) {
TypedMDRVA<MDRawContextX86> context(&writer_);
x86_thread_state_t *machine_state =
reinterpret_cast<x86_thread_state_t *>(state);
i386_thread_state_t *machine_state =
reinterpret_cast<i386_thread_state_t *>(state);
if (!context.Allocate())
return false;
@ -355,7 +355,7 @@ bool MinidumpGenerator::WriteContext(breakpad_thread_state_data_t state,
*register_location = context.location();
MDRawContextX86 *context_ptr = context.get();
context_ptr->context_flags = MD_CONTEXT_X86;
#define AddReg(a) context_ptr->a = machine_state->uts.ts32.a
#define AddReg(a) context_ptr->a = machine_state->a
AddReg(cs);
AddReg(ds);
AddReg(ss);
@ -382,7 +382,8 @@ bool MinidumpGenerator::WriteThreadStream(mach_port_t thread_id,
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) ==
if (thread_get_state(thread_id, BREAKPAD_MACHINE_THREAD_STATE,
state, &state_count) ==
KERN_SUCCESS) {
if (!WriteStack(state, &thread->stack))
return false;
@ -455,7 +456,7 @@ bool MinidumpGenerator::WriteExceptionStream(MDRawDirectory *exception_stream) {
breakpad_thread_state_data_t state;
mach_msg_type_number_t stateCount = sizeof(state);
if (thread_get_state(exception_thread_, MACHINE_THREAD_STATE, state,
if (thread_get_state(exception_thread_, BREAKPAD_MACHINE_THREAD_STATE, state,
&stateCount) != KERN_SUCCESS)
return false;

View File

@ -54,6 +54,11 @@
# define LC_UUID 0x1b /* the uuid */
#endif
#if TARGET_CPU_X86
# define BREAKPAD_MACHINE_THREAD_STATE i386_THREAD_STATE
#else
# define BREAKPAD_MACHINE_THREAD_STATE MACHINE_THREAD_STATE
#endif
// The uuid_command struct/swap routines were added during the 10.4 series.
// Their presence isn't guaranteed.

View File

@ -354,7 +354,7 @@ static void PrintProcessStateMachineReadable(const ProcessState& process_state)
StripSeparator(process_state.crash_reason()).c_str(),
kOutputSeparator, process_state.crash_address(), kOutputSeparator);
} else {
printf("No crash%c%c\n", kOutputSeparator, kOutputSeparator);
printf("No crash%c%c", kOutputSeparator, kOutputSeparator);
}
if (requesting_thread != -1) {