[fpc-devel] unwinding stack from within ExceptProc?

Lukas Zeller luz_info at synthesis.ch
Fri Sep 25 18:09:36 CEST 2009


Hello,

I have the following situation: A FPC shared library called from a C  
main program should catch otherwise unhandled exceptions.

I set up a exception handling routine and assign it to ExceptProc.  
This works fine so far, the handler is called as expected.

Now the handler routine calls back into a C world routine which does a  
longjmp (out of my control) that unwinds the stack to before the call  
into the FPC sharedlib.

The longjmp itself works, but after this has happened once, further  
exceptions crash the program. I wonder if there is some (FPC) cleanup  
routine I could or should call before the longjmp that would make the  
scenario work, or if there is technical evidence that it can't work at  
all.

Lukas

(luz_info at synthesis.ch)





More information about the fpc-devel mailing list