From de2fd15db9a480c807ba337690669538a97756a4 Mon Sep 17 00:00:00 2001 From: ladderbreaker Date: Wed, 2 May 2007 21:05:49 +0000 Subject: Issue 159: reviewer Waylonis git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@151 4c0a9323-5329-0410-9bdc-e9ce6186880e --- src/client/mac/handler/exception_handler.h | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'src/client/mac/handler/exception_handler.h') diff --git a/src/client/mac/handler/exception_handler.h b/src/client/mac/handler/exception_handler.h index 11babb73..8d7755a6 100644 --- a/src/client/mac/handler/exception_handler.h +++ b/src/client/mac/handler/exception_handler.h @@ -71,6 +71,14 @@ class ExceptionHandler { const char *minidump_id, void *context, bool succeeded); + // A callback function which will be called directly if an exception occurs. + // This bypasses the minidump file writing and simply gives the client + // the exception information. + typedef bool (*DirectCallback)( void *context, + int exception_type, + int exception_code, + mach_port_t thread_name); + // Creates a new ExceptionHandler instance to handle writing minidumps. // Minidump files will be written to dump_path, and the optional callback // is called after writing the dump file, as described above. @@ -80,6 +88,13 @@ class ExceptionHandler { ExceptionHandler(const string &dump_path, FilterCallback filter, MinidumpCallback callback, void *callback_context, bool install_handler); + + // A special constructor if we want to bypass minidump writing and + // simply get a callback with the exception information. + ExceptionHandler(DirectCallback callback, + void *callback_context, + bool install_handler); + ~ExceptionHandler(); // Get and set the minidump path. @@ -104,7 +119,7 @@ class ExceptionHandler { bool InstallHandler(); // Uninstall the mach exception handler (if any) - bool UninstallHandler(); + bool UninstallHandler(bool in_exception); // Setup the handler thread, and if |install_handler| is true, install the // mach exception port handler @@ -159,6 +174,10 @@ class ExceptionHandler { MinidumpCallback callback_; void *callback_context_; + // The callback function to be passed back when we don't want a minidump + // file to be written + DirectCallback directCallback_; + // The thread that is created for the handler pthread_t handler_thread_; -- cgit v1.2.1