aboutsummaryrefslogtreecommitdiff
path: root/src/client/windows
diff options
context:
space:
mode:
authorwfh@chromium.org <wfh@chromium.org>2015-02-22 02:27:35 +0000
committerwfh@chromium.org <wfh@chromium.org>2015-02-22 02:27:35 +0000
commitb79454627e475c2f8c7da576e5a5ddaf2f0832f8 (patch)
treee651f19d96f4ee43efe426499b8019240032aa51 /src/client/windows
parentCleanup Linux debug link file handling code. (diff)
downloadbreakpad-b79454627e475c2f8c7da576e5a5ddaf2f0832f8.tar.xz
Add option to Breakpad to consume INVALID_HANDLE_VALUE exceptions.
BUG=chromium:452613 R=mark@chromium.org Review URL: https://breakpad.appspot.com/7794002 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1427 4c0a9323-5329-0410-9bdc-e9ce6186880e
Diffstat (limited to 'src/client/windows')
-rw-r--r--src/client/windows/handler/exception_handler.cc6
-rw-r--r--src/client/windows/handler/exception_handler.h13
2 files changed, 19 insertions, 0 deletions
diff --git a/src/client/windows/handler/exception_handler.cc b/src/client/windows/handler/exception_handler.cc
index b4ebbdac..b78075de 100644
--- a/src/client/windows/handler/exception_handler.cc
+++ b/src/client/windows/handler/exception_handler.cc
@@ -174,6 +174,7 @@ void ExceptionHandler::Initialize(
assertion_ = NULL;
handler_return_value_ = false;
handle_debug_exceptions_ = false;
+ consume_invalid_handle_exceptions_ = false;
// Attempt to use out-of-process if user has specified a pipe or a
// crash generation client.
@@ -481,6 +482,11 @@ LONG ExceptionHandler::HandleException(EXCEPTION_POINTERS* exinfo) {
bool is_debug_exception = (code == EXCEPTION_BREAKPOINT) ||
(code == EXCEPTION_SINGLE_STEP);
+ if (code == EXCEPTION_INVALID_HANDLE &&
+ current_handler->consume_invalid_handle_exceptions_) {
+ return EXCEPTION_CONTINUE_EXECUTION;
+ }
+
bool success = false;
if (!is_debug_exception ||
diff --git a/src/client/windows/handler/exception_handler.h b/src/client/windows/handler/exception_handler.h
index 3c935089..e3cd8146 100644
--- a/src/client/windows/handler/exception_handler.h
+++ b/src/client/windows/handler/exception_handler.h
@@ -263,6 +263,15 @@ class ExceptionHandler {
handle_debug_exceptions_ = handle_debug_exceptions;
}
+ // Controls behavior of EXCEPTION_INVALID_HANDLE.
+ bool get_consume_invalid_handle_exceptions() const {
+ return consume_invalid_handle_exceptions_;
+ }
+ void set_consume_invalid_handle_exceptions(
+ bool consume_invalid_handle_exceptions) {
+ consume_invalid_handle_exceptions_ = consume_invalid_handle_exceptions;
+ }
+
// Returns whether out-of-process dump generation is used or not.
bool IsOutOfProcess() const { return crash_generation_client_.get() != NULL; }
@@ -472,6 +481,10 @@ class ExceptionHandler {
// to not interfere with debuggers.
bool handle_debug_exceptions_;
+ // If true, the handler will consume any EXCEPTION_INVALID_HANDLE exceptions.
+ // Leave this false (the default) to handle these exceptions as normal.
+ bool consume_invalid_handle_exceptions_;
+
// Callers can request additional memory regions to be included in
// the dump.
AppMemoryList app_memory_info_;