[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Is there any way to know from where the C++ exception originates ?
- Date: Tue, 21 Sep 2004 17:41:55 -0700
- From: strauman at slac.stanford.edu (Till Straumann)
- Subject: Is there any way to know from where the C++ exception originates ?
Valery Pykhtin wrote:
>may be this is an unappropriate place to ask, but may be someone knows the
>answer in the topic ?
That's why we were taught 'never user GOTO' in the old days. C++ people
will probably tell you that you don't _have_ to know and start singing about
If I need to know, I set a breakpoint to __throw or similar (depends on
in the debugger. If you don't have debugger support on your RTEMS target
you can usually either patch your binary or use the linker's --wrap
hook into 'throw'. Write a little routine that dumps a stack trace and then
branches to the real 'throw'. If your application throws and handles a lot
of exceptions but you need to catch a 'fatal' one, let the hook routine
the stack trace to memory and print it on 'exit', or from a global
That's the easiest that comes to my mind.