aboutsummaryrefslogtreecommitdiff
path: root/src/client/mac/handler/exception_handler.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/mac/handler/exception_handler.h')
-rw-r--r--src/client/mac/handler/exception_handler.h37
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