mirror of
https://github.com/yuzu-emu/breakpad.git
synced 2025-03-01 10:47:06 +00:00
Issue203 : reviewed by Waylonis
git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@206 4c0a9323-5329-0410-9bdc-e9ce6186880e
This commit is contained in:
parent
69d242245a
commit
d792274003
|
@ -375,10 +375,6 @@ void *ExceptionHandler::WaitForMessage(void *exception_handler_class) {
|
||||||
sizeof(receive), self->handler_port_,
|
sizeof(receive), self->handler_port_,
|
||||||
MACH_MSG_TIMEOUT_NONE, MACH_PORT_NULL);
|
MACH_MSG_TIMEOUT_NONE, MACH_PORT_NULL);
|
||||||
|
|
||||||
#if USE_PROTECTED_ALLOCATIONS
|
|
||||||
if(gBreakpadAllocator)
|
|
||||||
gBreakpadAllocator->Unprotect();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (result == KERN_SUCCESS) {
|
if (result == KERN_SUCCESS) {
|
||||||
// Uninstall our handler so that we don't get in a loop if the process of
|
// Uninstall our handler so that we don't get in a loop if the process of
|
||||||
|
@ -393,23 +389,32 @@ void *ExceptionHandler::WaitForMessage(void *exception_handler_class) {
|
||||||
// to avoid misleading stacks. If appropriate they will be resumed
|
// to avoid misleading stacks. If appropriate they will be resumed
|
||||||
// afterwards.
|
// afterwards.
|
||||||
if (!receive.exception) {
|
if (!receive.exception) {
|
||||||
self->UninstallHandler(false);
|
|
||||||
|
|
||||||
if (self->is_in_teardown_)
|
if (self->is_in_teardown_)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
self->SuspendThreads();
|
self->SuspendThreads();
|
||||||
|
|
||||||
|
#if USE_PROTECTED_ALLOCATIONS
|
||||||
|
if(gBreakpadAllocator)
|
||||||
|
gBreakpadAllocator->Unprotect();
|
||||||
|
#endif
|
||||||
|
|
||||||
// Write out the dump and save the result for later retrieval
|
// Write out the dump and save the result for later retrieval
|
||||||
self->last_minidump_write_result_ =
|
self->last_minidump_write_result_ =
|
||||||
self->WriteMinidumpWithException(0, 0, 0);
|
self->WriteMinidumpWithException(0, 0, 0);
|
||||||
|
|
||||||
|
self->UninstallHandler(false);
|
||||||
|
|
||||||
|
#if USE_PROTECTED_ALLOCATIONS
|
||||||
|
if(gBreakpadAllocator)
|
||||||
|
gBreakpadAllocator->Protect();
|
||||||
|
#endif
|
||||||
|
|
||||||
self->ResumeThreads();
|
self->ResumeThreads();
|
||||||
|
|
||||||
if (self->use_minidump_write_mutex_)
|
if (self->use_minidump_write_mutex_)
|
||||||
pthread_mutex_unlock(&self->minidump_write_mutex_);
|
pthread_mutex_unlock(&self->minidump_write_mutex_);
|
||||||
} else {
|
} else {
|
||||||
self->UninstallHandler(true);
|
|
||||||
|
|
||||||
// When forking a child process with the exception handler installed,
|
// When forking a child process with the exception handler installed,
|
||||||
// if the child crashes, it will send the exception back to the parent
|
// if the child crashes, it will send the exception back to the parent
|
||||||
|
@ -419,10 +424,22 @@ void *ExceptionHandler::WaitForMessage(void *exception_handler_class) {
|
||||||
if (receive.task.name == mach_task_self()) {
|
if (receive.task.name == mach_task_self()) {
|
||||||
self->SuspendThreads();
|
self->SuspendThreads();
|
||||||
|
|
||||||
|
#if USE_PROTECTED_ALLOCATIONS
|
||||||
|
if(gBreakpadAllocator)
|
||||||
|
gBreakpadAllocator->Unprotect();
|
||||||
|
#endif
|
||||||
|
|
||||||
// Generate the minidump with the exception data.
|
// Generate the minidump with the exception data.
|
||||||
self->WriteMinidumpWithException(receive.exception, receive.code[0],
|
self->WriteMinidumpWithException(receive.exception, receive.code[0],
|
||||||
receive.thread.name);
|
receive.thread.name);
|
||||||
|
|
||||||
|
self->UninstallHandler(true);
|
||||||
|
|
||||||
|
#if USE_PROTECTED_ALLOCATIONS
|
||||||
|
if(gBreakpadAllocator)
|
||||||
|
gBreakpadAllocator->Protect();
|
||||||
|
#endif
|
||||||
|
|
||||||
// Pass along the exception to the server, which will setup the
|
// Pass along the exception to the server, which will setup the
|
||||||
// message and call catch_exception_raise() and put the KERN_SUCCESS
|
// message and call catch_exception_raise() and put the KERN_SUCCESS
|
||||||
// into the reply.
|
// into the reply.
|
||||||
|
|
Loading…
Reference in a new issue