Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(71)

Unified Diff: chrome_frame/exception_barrier.cc

Issue 1748016: Avoid reporting crashes for exceptions that hit our SEH from calls to the ori... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome_frame/exception_barrier.h ('k') | chrome_frame/exception_barrier_lowlevel.asm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome_frame/exception_barrier.cc
===================================================================
--- chrome_frame/exception_barrier.cc (revision 45859)
+++ chrome_frame/exception_barrier.cc (working copy)
@@ -6,13 +6,19 @@
// get crash reports of exceptions that pass over same.
#include "chrome_frame/exception_barrier.h"
+#include "chrome_frame/crash_reporting/vectored_handler-impl.h"
+#include "chrome_frame/crash_reporting/crash_report.h"
+
enum {
// Flag set by exception handling machinery when unwinding
EH_UNWINDING = 0x00000002
};
-ExceptionBarrier::ExceptionHandler ExceptionBarrier::s_handler_ = NULL;
+bool ExceptionBarrierConfig::s_enabled_ = false;
+ExceptionBarrierCustomHandler::CustomExceptionHandler
+ExceptionBarrierCustomHandler::s_custom_handler_ = NULL;
+
// This function must be extern "C" to match up with the SAFESEH
// declaration in our corresponding ASM file
extern "C" EXCEPTION_DISPOSITION __cdecl
@@ -20,19 +26,53 @@
void* establisher_frame,
struct _CONTEXT* context,
void* reserved) {
- establisher_frame; // unreferenced formal parameter
- reserved;
- if (!(exception_record->ExceptionFlags & EH_UNWINDING)) {
- // When the exception is really propagating through us, we'd like to be
- // called before the state of the program has been modified by the stack
- // unwinding. In the absence of an exception handler, the unhandled
- // exception filter gets called between the first chance and the second
- // chance exceptions, so Windows pops either the JIT debugger or WER UI.
- // This is not desirable in most of the cases.
- ExceptionBarrier::ExceptionHandler handler = ExceptionBarrier::handler();
+ // When the exception is really propagating through us, we'd like to be
+ // called before the state of the program has been modified by the stack
+ // unwinding. In the absence of an exception handler, the unhandled
+ // exception filter gets called between the first chance and the second
+ // chance exceptions, so Windows pops either the JIT debugger or WER UI.
+ // This is not desirable in most of the cases.
+ EXCEPTION_POINTERS ptrs = { exception_record, context };
+
+ if (ExceptionBarrierConfig::enabled() &&
+ IS_DISPATCHING(exception_record->ExceptionFlags)) {
+ WriteMinidumpForException(&ptrs);
+ }
+
+ return ExceptionContinueSearch;
+}
+
+extern "C" EXCEPTION_DISPOSITION __cdecl
+ExceptionBarrierReportOnlyModuleHandler(
+ struct _EXCEPTION_RECORD* exception_record,
+ void* establisher_frame,
+ struct _CONTEXT* context,
+ void* reserved) {
+ EXCEPTION_POINTERS ptrs = { exception_record, context };
+
+ if (ExceptionBarrierConfig::enabled() &&
+ IS_DISPATCHING(exception_record->ExceptionFlags)) {
+ CrashHandlerTraits traits;
stoyan 2010/04/30 22:44:00 you know I really don't like this. :)
+ traits.Init(0, 0, &WriteMinidumpForException);
+ if (traits.IsOurModule(exception_record->ExceptionAddress)) {
+ traits.WriteDump(&ptrs);
+ }
+ }
+
+ return ExceptionContinueSearch;
+}
+
+extern "C" EXCEPTION_DISPOSITION __cdecl
+ExceptionBarrierCallCustomHandler(struct _EXCEPTION_RECORD* exception_record,
+ void* establisher_frame,
+ struct _CONTEXT* context,
+ void* reserved) {
+ if (ExceptionBarrierConfig::enabled() &&
+ IS_DISPATCHING(exception_record->ExceptionFlags)) {
+ ExceptionBarrierCustomHandler::CustomExceptionHandler handler =
+ ExceptionBarrierCustomHandler::custom_handler();
if (handler) {
EXCEPTION_POINTERS ptrs = { exception_record, context };
-
handler(&ptrs);
}
}
« no previous file with comments | « chrome_frame/exception_barrier.h ('k') | chrome_frame/exception_barrier_lowlevel.asm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698