diff options
author | ted.mielczarek@gmail.com <ted.mielczarek@gmail.com@4c0a9323-5329-0410-9bdc-e9ce6186880e> | 2010-12-15 16:28:28 +0000 |
---|---|---|
committer | ted.mielczarek@gmail.com <ted.mielczarek@gmail.com@4c0a9323-5329-0410-9bdc-e9ce6186880e> | 2010-12-15 16:28:28 +0000 |
commit | 0d9bd40775211c223c75543890d862135f677d67 (patch) | |
tree | b5124e137fe2d99b7551d4b5d70f5d17cf8b130d /src/client/mac/handler/exception_handler.h | |
parent | issue 334 - Fix a race condition between ExceptionHandler::Teardown and Excep... (diff) | |
download | breakpad-0d9bd40775211c223c75543890d862135f677d67.tar.xz |
Allow writing on-request minidumps with an exception stream
R=mark at http://breakpad.appspot.com/172001/show
git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@745 4c0a9323-5329-0410-9bdc-e9ce6186880e
Diffstat (limited to 'src/client/mac/handler/exception_handler.h')
-rw-r--r-- | src/client/mac/handler/exception_handler.h | 37 |
1 files changed, 30 insertions, 7 deletions
diff --git a/src/client/mac/handler/exception_handler.h b/src/client/mac/handler/exception_handler.h index 182faa9d..172dc358 100644 --- a/src/client/mac/handler/exception_handler.h +++ b/src/client/mac/handler/exception_handler.h @@ -49,6 +49,16 @@ using std::string; struct ExceptionParameters; +enum HandlerThreadMessage { + // Message ID telling the handler thread to write a dump. + kWriteDumpMessage = 0, + // Message ID telling the handler thread to write a dump and include + // an exception stream. + kWriteDumpWithExceptionMessage = 1, + // Message ID telling the handler thread to quit. + kShutdownMessage = 2 +}; + class ExceptionHandler { public: // A callback function to run before Breakpad performs any substantial @@ -114,11 +124,22 @@ class ExceptionHandler { // Writes a minidump immediately. This can be used to capture the // execution state independently of a crash. Returns true on success. - bool WriteMinidump(); + bool WriteMinidump() { + return WriteMinidump(false); + } + + bool WriteMinidump(bool write_exception_stream); // Convenience form of WriteMinidump which does not require an // ExceptionHandler instance. static bool WriteMinidump(const string &dump_path, MinidumpCallback callback, + void *callback_context) { + return WriteMinidump(dump_path, false, callback, callback_context); + } + + static bool WriteMinidump(const string &dump_path, + bool write_exception_stream, + MinidumpCallback callback, void *callback_context); // Write a minidump of child immediately. This can be used to capture @@ -149,14 +170,16 @@ class ExceptionHandler { // thread bool Teardown(); - // Send an "empty" mach message to the exception handler. Return true on - // success, false otherwise. If quit is true, the handler thread should - // simply quit. - bool SendEmptyMachMessage(bool quit); + // Send a mach message to the exception handler. Return true on + // success, false otherwise. + bool SendMessageToHandlerThread(HandlerThreadMessage message_id); // All minidump writing goes through this one routine - bool WriteMinidumpWithException(int exception_type, int exception_code, - int exception_subcode, mach_port_t thread_name); + bool WriteMinidumpWithException(int exception_type, + int exception_code, + int exception_subcode, + mach_port_t thread_name, + bool exit_after_write); // When installed, this static function will be call from a newly created // pthread with |this| as the argument |