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:
authorChristopher Faylor <me@cgf.cx>2008-03-01 16:18:22 +0300
committerChristopher Faylor <me@cgf.cx>2008-03-01 16:18:22 +0300
commit813767de3db47bae178d815e32770787bbb2cfed (patch)
tree5fcc4009db05acb7e2cdc40140117e4ae2b43962 /winsup/cygwin/exceptions.cc
parent76ff710cfaa54aa7a85b15d2d2b0303a53afe83d (diff)
* exceptions.cc (_cygtls::handle_exceptions): Only call rtl_unwind when
exiting. Just return, don't set thread context. * gendef (_setjmp): Store %fs:0 in jmp_buf. (_sjfault): Ditto. (_ljfault): Restore %fs:0 from jmp_buf. (_longjmp): Ditto.
Diffstat (limited to 'winsup/cygwin/exceptions.cc')
-rw-r--r--winsup/cygwin/exceptions.cc18
1 files changed, 2 insertions, 16 deletions
diff --git a/winsup/cygwin/exceptions.cc b/winsup/cygwin/exceptions.cc
index 3b4184db0..56f191851 100644
--- a/winsup/cygwin/exceptions.cc
+++ b/winsup/cygwin/exceptions.cc
@@ -599,8 +599,6 @@ _cygtls::handle_exceptions (EXCEPTION_RECORD *e, exception_list *frame, CONTEXT
return 1;
}
- rtl_unwind (frame, e);
-
debug_printf ("In cygwin_except_handler exc %p at %p sp %p", e->ExceptionCode, in->Eip, in->Esp);
debug_printf ("In cygwin_except_handler sig %d at %p", si.si_signo, in->Eip);
@@ -650,6 +648,7 @@ _cygtls::handle_exceptions (EXCEPTION_RECORD *e, exception_list *frame, CONTEXT
goto out;
}
+ rtl_unwind (frame, e);
open_stackdumpfile ();
exception (e, in);
stackdump ((DWORD) ebp, 0, 1);
@@ -680,21 +679,8 @@ _cygtls::handle_exceptions (EXCEPTION_RECORD *e, exception_list *frame, CONTEXT
sig_send (NULL, si, &me); // Signal myself
me.incyg--;
e->ExceptionFlags = 0;
- /* The OS adds an exception list frame to the stack. It expects to be
- able to remove this entry after the exception handler returned.
- However, when unwinding to our frame, our frame becomes the uppermost
- frame on the stack (%fs:0 points to frame). This way, our frame
- is removed from the exception stack and just disappears. So, we can't
- just return here or things will be screwed up by the helpful function
- in (presumably) ntdll.dll.
-
- So, instead, we will do the equivalent of a longjmp here and return
- to the caller without visiting any of the helpful code installed prior
- to this function. This should work ok, since a longjmp() out of here has
- to work if linux signal semantics are to be maintained. */
out:
- SetThreadContext (GetCurrentThread (), in);
- return 0; /* Never actually returns. This is just to keep gcc happy. */
+ return 0;
}
/* Utilities to call a user supplied exception handler. */