Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2014-03-04 15:56:42 +0400
committerCorinna Vinschen <corinna@vinschen.de>2014-03-04 15:56:42 +0400
commit4e3c8d94251bb8a010e1656e824a46d4c2a14119 (patch)
tree620786b19e695b3ae2fb05a438c2dcafc5ba00ae /winsup/cygwin/exception.h
parent17ff765184829731ca171ddcbcba19bf92b84202 (diff)
* exception.h (exception::handler_installed): Remove.
(exception::exception): Remove old code. Manually install SEH handler instead. (exception::~exception): For x86_64, define frame end label. * exceptions.cc (exception::handler_installed): Remove.
Diffstat (limited to 'winsup/cygwin/exception.h')
-rw-r--r--winsup/cygwin/exception.h29
1 files changed, 17 insertions, 12 deletions
diff --git a/winsup/cygwin/exception.h b/winsup/cygwin/exception.h
index 95d8311fc..5b8b6da77 100644
--- a/winsup/cygwin/exception.h
+++ b/winsup/cygwin/exception.h
@@ -109,7 +109,6 @@ extern exception_list *_except_list asm ("%fs:0");
class exception
{
#ifdef __x86_64__
- static bool handler_installed;
static int handle (LPEXCEPTION_POINTERS);
#else
exception_list el;
@@ -120,16 +119,16 @@ public:
exception () __attribute__ ((always_inline))
{
#ifdef __x86_64__
- if (!handler_installed)
- {
- handler_installed = true;
- /* The unhandled exception filter goes first. It won't work if the
- executable is debugged, but then the vectored continue handler
- kicks in. For some reason the vectored continue handler doesn't
- get called if no unhandled exception filter is installed. */
- SetUnhandledExceptionFilter (handle);
- AddVectoredExceptionHandler (1, handle);
- }
+ /* Manually install SEH handler. */
+ asm (".l_startframe: \n\
+ .seh_handler __C_specific_handler, @except \n\
+ .seh_handlerdata \n\
+ .long 1 \n\
+ .rva .l_startframe, \
+ .l_endframe, \
+ _ZN9exception6handleEP19_EXCEPTION_POINTERS, \
+ .l_endframe \n\
+ .text \n");
#else
save = _except_list;
el.handler = handle;
@@ -137,7 +136,13 @@ public:
_except_list = &el;
#endif /* __x86_64__ */
};
-#ifndef __x86_64__
+#ifdef __x86_64__
+ ~exception () __attribute__ ((always_inline)) {
+ asm (" nop \n\
+ .l_endframe: \n\
+ nop \n");
+ }
+#else
~exception () __attribute__ ((always_inline)) { _except_list = save; }
#endif /* !__x86_64__ */
};