* exception.h (exception::handle_while_being_debugged): Declare.

(exception::exception): Install unhandled exception filter.
	* exceptions.cc (exception::handle_while_being_debugged): New method.
This commit is contained in:
Corinna Vinschen 2014-03-19 16:08:21 +00:00
parent bdd04d0a62
commit 2c1e724ba4
3 changed files with 17 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2014-03-19 Corinna Vinschen <corinna@vinschen.de>
* exception.h (exception::handle_while_being_debugged): Declare.
(exception::exception): Install unhandled exception filter.
* exceptions.cc (exception::handle_while_being_debugged): New method.
2014-03-19 Corinna Vinschen <corinna@vinschen.de> 2014-03-19 Corinna Vinschen <corinna@vinschen.de>
* passwd.cc (pg_ent::enumerate_ad): Ignore primary domain in list of * passwd.cc (pg_ent::enumerate_ad): Ignore primary domain in list of

View File

@ -111,6 +111,7 @@ class exception
#ifdef __x86_64__ #ifdef __x86_64__
static bool handler_installed; static bool handler_installed;
static int handle (LPEXCEPTION_POINTERS); static int handle (LPEXCEPTION_POINTERS);
static int handle_while_being_debugged (LPEXCEPTION_POINTERS);
#else #else
exception_list el; exception_list el;
exception_list *save; exception_list *save;
@ -123,7 +124,8 @@ public:
if (!handler_installed) if (!handler_installed)
{ {
handler_installed = true; handler_installed = true;
AddVectoredExceptionHandler (1, handle); SetUnhandledExceptionFilter (handle);
AddVectoredExceptionHandler (1, handle_while_being_debugged);
} }
#else #else
save = _except_list; save = _except_list;

View File

@ -555,6 +555,14 @@ rtl_unwind (exception_list *frame, PEXCEPTION_RECORD e)
bool exception::handler_installed NO_COPY; bool exception::handler_installed NO_COPY;
int
exception::handle_while_being_debugged (LPEXCEPTION_POINTERS ep)
{
if (being_debugged ())
return handle (ep);
return EXCEPTION_CONTINUE_SEARCH;
}
int int
exception::handle (LPEXCEPTION_POINTERS ep) exception::handle (LPEXCEPTION_POINTERS ep)
#else #else