Forcing thrown exceptions to core dump without stack unwinding?
Mumit Khan
khan@xraylith.wisc.edu
Fri Dec 3 23:13:00 GMT 1999
In article < 829qlj$80e@spool.cs.wisc.edu >, Andy Glew <glew@cs.wisc.edu> wrote:
>I'm using GCC 2.95.
>Q: is there a way of forcing thrown exceptions to core dump
>at the site of the exception - so that I can get a useful core dump
>I can look at in a debugger?
This is IMO a real issue with current EH implementation in GCC. One way
to fix is to implement a dual pass: (1) "virtually" unwind the stack
looking for a handler, and (2) if found, call the handler; if not, call
terminate in the context of the current frame. Essentially, you get a
C-like assertion if you don't have a handler for that exception.
>My program may run for many days before the core dump (or not).
>It is impractical to run them in a debugger set to break at the first
>exception. Since the exceptions seem to be arising in library functions
>I have not written, it is impractical to change the code to optionally
>not throw.
I know the feeling. I have numercial codes that runs from days to weeks
at a time, and it's very frustrating when you can't pinpoint where things
went wrong. You can get around *some of it* by inserting "catch all"
blocks around library codes, but it's still messy.
>Please email to glew@cs.wisc.edu
And posted of course.
Regards,
Mumit
More information about the Gcc-help
mailing list