* 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.
This commit is contained in:
Corinna Vinschen 2014-03-04 11:56:42 +00:00
parent 17ff765184
commit 4e3c8d9425
3 changed files with 25 additions and 14 deletions

View File

@ -1,3 +1,11 @@
2014-03-04 Corinna Vinschen <corinna@vinschen.de>
* 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.
2014-03-03 Corinna Vinschen <corinna@vinschen.de>
* exception.h (exception::exception): Install vectored exception

View File

@ -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__ */
};

View File

@ -553,8 +553,6 @@ rtl_unwind (exception_list *frame, PEXCEPTION_RECORD e)
#define CYG_EXC_CONTINUE_EXECUTION EXCEPTION_CONTINUE_EXECUTION
#define CYG_EXC_CONTINUE_SEARCH EXCEPTION_CONTINUE_SEARCH
bool exception::handler_installed NO_COPY;
int
exception::handle (LPEXCEPTION_POINTERS ep)
#else