Add high level API for breakpad on iOS.

The new API allows to automatically upload repports to the crash server when the application restarts.

 This change also:
 - Correct a bug on the test for correct alignment of the abrt signal handler
 - Add user friendly information on crashes for SIGABRT and NSException
Review URL: https://breakpad.appspot.com/361001

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@935 4c0a9323-5329-0410-9bdc-e9ce6186880e
This commit is contained in:
qsr@chromium.org 2012-03-13 20:02:40 +00:00
parent 7facb6a6fb
commit 1e8d2d5a4c
7 changed files with 402 additions and 11 deletions

View file

@ -38,6 +38,7 @@
#include "client/mac/handler/minidump_generator.h"
#include "common/mac/macho_utilities.h"
#include "common/mac/scoped_task_suspend-inl.h"
#include "google_breakpad/common/minidump_exception_mac.h"
#ifndef USE_PROTECTED_ALLOCATIONS
#if TARGET_OS_IPHONE
@ -580,12 +581,13 @@ void *ExceptionHandler::WaitForMessage(void *exception_handler_class) {
//static
void ExceptionHandler::SignalHandler(int sig, siginfo_t* info, void* uc) {
gProtectedData.handler->WriteMinidumpWithException(EXC_CRASH,
0xDEADBEEF,
0,
mach_thread_self(),
true,
true);
gProtectedData.handler->WriteMinidumpWithException(
EXC_SOFTWARE,
MD_EXCEPTION_CODE_MAC_ABORT,
0,
mach_thread_self(),
true,
true);
}
bool ExceptionHandler::InstallHandler() {
@ -609,7 +611,7 @@ bool ExceptionHandler::InstallHandler() {
old_handler_.swap(old);
gProtectedData.handler = this;
#if USE_PROTECTED_ALLOCATIONS
assert(((size_t)(*gProtectedData.protected_buffer) & PAGE_MASK) == 0);
assert(((size_t)(gProtectedData.protected_buffer) & PAGE_MASK) == 0);
mprotect(gProtectedData.protected_buffer, PAGE_SIZE, PROT_READ);
#endif
}