aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2014-03-19 16:08:21 +0000
committerCorinna Vinschen <corinna@vinschen.de>2014-03-19 16:08:21 +0000
commit2c1e724ba46299696570c06440752d8729c60d2b (patch)
tree4c0373dcc167b2b307f6364a0b3b192247e0c05f
parentbdd04d0a6271e47584dd7ee8f350fa28951ed9d7 (diff)
downloadnewlib-2c1e724ba46299696570c06440752d8729c60d2b.zip
newlib-2c1e724ba46299696570c06440752d8729c60d2b.tar.gz
newlib-2c1e724ba46299696570c06440752d8729c60d2b.tar.bz2
* exception.h (exception::handle_while_being_debugged): Declare.
(exception::exception): Install unhandled exception filter. * exceptions.cc (exception::handle_while_being_debugged): New method.
-rw-r--r--winsup/cygwin/ChangeLog6
-rw-r--r--winsup/cygwin/exception.h4
-rw-r--r--winsup/cygwin/exceptions.cc8
3 files changed, 17 insertions, 1 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 66ab3f7..4565d1b 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,5 +1,11 @@
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>
+
* passwd.cc (pg_ent::enumerate_ad): Ignore primary domain in list of
trusted domains only if all trusted domains are enumerated anyway.
Explain why.
diff --git a/winsup/cygwin/exception.h b/winsup/cygwin/exception.h
index 6792536..673f3b3 100644
--- a/winsup/cygwin/exception.h
+++ b/winsup/cygwin/exception.h
@@ -111,6 +111,7 @@ class exception
#ifdef __x86_64__
static bool handler_installed;
static int handle (LPEXCEPTION_POINTERS);
+ static int handle_while_being_debugged (LPEXCEPTION_POINTERS);
#else
exception_list el;
exception_list *save;
@@ -123,7 +124,8 @@ public:
if (!handler_installed)
{
handler_installed = true;
- AddVectoredExceptionHandler (1, handle);
+ SetUnhandledExceptionFilter (handle);
+ AddVectoredExceptionHandler (1, handle_while_being_debugged);
}
#else
save = _except_list;
diff --git a/winsup/cygwin/exceptions.cc b/winsup/cygwin/exceptions.cc
index e9e8778..fac65bf 100644
--- a/winsup/cygwin/exceptions.cc
+++ b/winsup/cygwin/exceptions.cc
@@ -556,6 +556,14 @@ rtl_unwind (exception_list *frame, PEXCEPTION_RECORD e)
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
exception::handle (LPEXCEPTION_POINTERS ep)
#else
#define CYG_EXC_CONTINUE_EXECUTION ExceptionContinueExecution