aboutsummaryrefslogtreecommitdiff
path: root/src/client/windows/handler/exception_handler.h
diff options
context:
space:
mode:
authormmentovai <mmentovai@4c0a9323-5329-0410-9bdc-e9ce6186880e>2007-07-02 19:41:05 +0000
committermmentovai <mmentovai@4c0a9323-5329-0410-9bdc-e9ce6186880e>2007-07-02 19:41:05 +0000
commit6a844b1d85be2804e1cbf6771f4249f5172b08c7 (patch)
tree035f7b2a349eaf2b3ce1c9ac3f41871c195bc060 /src/client/windows/handler/exception_handler.h
parentIssue 190 - 32 bit build fails on a 64 bit Linux system. Patch by wgianopoul... (diff)
downloadbreakpad-6a844b1d85be2804e1cbf6771f4249f5172b08c7.tar.xz
Allow finer control over installed handler types (#193). r=ted.mielczarek
http://groups.google.com/group/google-breakpad-dev/browse_thread/thread/992a1bb09dc58a32 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@193 4c0a9323-5329-0410-9bdc-e9ce6186880e
Diffstat (limited to 'src/client/windows/handler/exception_handler.h')
-rw-r--r--src/client/windows/handler/exception_handler.h38
1 files changed, 27 insertions, 11 deletions
diff --git a/src/client/windows/handler/exception_handler.h b/src/client/windows/handler/exception_handler.h
index a9eccd6b..c2d55609 100644
--- a/src/client/windows/handler/exception_handler.h
+++ b/src/client/windows/handler/exception_handler.h
@@ -119,17 +119,33 @@ class ExceptionHandler {
MDRawAssertionInfo *assertion,
bool succeeded);
+ // HandlerType specifies which types of handlers should be installed, if
+ // any. Use HANDLER_NONE for an ExceptionHandler that remains idle,
+ // without catching any failures on its own. This type of handler may
+ // still be triggered by calling WriteMinidump. Otherwise, use a
+ // combination of the other HANDLER_ values, or HANDLER_ALL to install
+ // all handlers.
+ enum HandlerType {
+ HANDLER_NONE = 0,
+ HANDLER_EXCEPTION = 1 << 0, // SetUnhandledExceptionFilter
+ HANDLER_INVALID_PARAMETER = 1 << 1, // _set_invalid_parameter_handler
+ HANDLER_PURECALL = 1 << 2, // _set_purecall_handler
+ HANDLER_ALL = HANDLER_EXCEPTION |
+ HANDLER_INVALID_PARAMETER |
+ HANDLER_PURECALL
+ };
+
// Creates a new ExceptionHandler instance to handle writing minidumps.
// Before writing a minidump, the optional filter callback will be called.
- // Its return value determines whether or not Breakpad should write a minidump.
- // Minidump files will be written to dump_path, and the optional callback
- // is called after writing the dump file, as described above.
- // If install_handler is true, then a minidump will be written whenever
- // an unhandled exception occurs. If it is false, minidumps will only
- // be written when WriteMinidump is called.
+ // Its return value determines whether or not Breakpad should write a
+ // minidump. Minidump files will be written to dump_path, and the optional
+ // callback is called after writing the dump file, as described above.
+ // handler_types specifies the types of handlers that should be installed.
ExceptionHandler(const wstring &dump_path,
- FilterCallback filter, MinidumpCallback callback,
- void *callback_context, bool install_handler);
+ FilterCallback filter,
+ MinidumpCallback callback,
+ void *callback_context,
+ HandlerType handler_types);
~ExceptionHandler();
// Get and set the minidump path.
@@ -244,9 +260,9 @@ class ExceptionHandler {
HMODULE dbghelp_module_;
MiniDumpWriteDump_type minidump_write_dump_;
- // True if the ExceptionHandler installed an unhandled exception filter
- // when created (with an install_handler parameter set to true).
- bool installed_handler_;
+ // Tracks the handler types that were installed according to the
+ // handler_types constructor argument.
+ HandlerType handler_types_;
// When installed_handler_ is true, previous_filter_ is the unhandled
// exception filter that was set prior to installing ExceptionHandler as