digitalmars.D.learn - Exception Handling
- sleek (1/1) Aug 27 2008 Is there an easy way to get a stack trace when an exception is caught?
- Jesse Phillips (2/3) Aug 27 2008 I believe that is currently a no.
- Robert Fraser (15/16) Aug 27 2008 The only way I know of currently is
- Christopher Wright (9/10) Aug 27 2008 On Linux, there's a library called jive floating around. It may be
- Frank Benoit (3/15) Aug 28 2008 I use Jive a lot on linux. I put a copy on the DWT project page:
- Jarrett Billingsley (10/11) Aug 27 2008 On Windows, you can run your program in ddbg, and it will print out a st...
- Jarrett Billingsley (5/17) Aug 27 2008 The downside here of course being that it's an external program and not ...
- Christopher Wright (4/28) Aug 28 2008 Conversely, when do you explicitly want a lacok of debug information on
- sleek (5/18) Aug 28 2008 After considering this for a few hours, I think ddbg is my best bet here...
Is there an easy way to get a stack trace when an exception is caught?
Aug 27 2008
On Wed, 27 Aug 2008 20:18:30 -0400, sleek wrote:Is there an easy way to get a stack trace when an exception is caught?I believe that is currently a no.
Aug 27 2008
sleek wrote:Is there an easy way to get a stack trace when an exception is caught?The only way I know of currently is http://petermodzelewski.blogspot.com/2008/01/development-in-d-with-u e-of-backtrace.html . It's Windows-only. However, my most recent test of the binary tango libs ( http://petermodzelewski.blogspot.com/2008/08/tango-patched-libs-for-0997.html ) had some linking issue, and I was too lazy to follow up on it. There's a Phobos hack there as well as the Tango one, I haven't tried that. Flectioned ( flectioned.kuehne.cn ) used to be able to do it, but it hasn't been updated for over a year. I know the Tango one no longer compiles (though it shouldn't be _too_ much work to get it to do so). Phobos might still work. To trace non-user-defined exceptions with it you need to call TracedException.traceAllExceptions(true); Flectioned works better on Linux (on Windows, it won't trace segfaults/access violations).
Aug 27 2008
sleek wrote:Is there an easy way to get a stack trace when an exception is caught?On Linux, there's a library called jive floating around. It may be tango-only, and the official version is defunct, but you can find versions of it updated to more recent versions of D and tango. I know for a fact that it doesn't help when you segfault due to stack overflow (debugging a circular dependency verifier in dconstructor; it only takes a couple seconds to overflow your stack, but it takes ages if you're printing to stdout in the meantime). I don't know whether it catches other segmentation faults, though.
Aug 27 2008
Christopher Wright schrieb:sleek wrote:I use Jive a lot on linux. I put a copy on the DWT project page: http://downloads.dsource.org/projects/dwt/jive.zipIs there an easy way to get a stack trace when an exception is caught?On Linux, there's a library called jive floating around. It may be tango-only, and the official version is defunct, but you can find versions of it updated to more recent versions of D and tango. I know for a fact that it doesn't help when you segfault due to stack overflow (debugging a circular dependency verifier in dconstructor; it only takes a couple seconds to overflow your stack, but it takes ages if you're printing to stdout in the meantime). I don't know whether it catches other segmentation faults, though.
Aug 28 2008
"sleek" <cslush gmail.com> wrote in message news:g94qsm$t5$1 digitalmars.com...Is there an easy way to get a stack trace when an exception is caught?On Windows, you can run your program in ddbg, and it will print out a stack trace when you get an exception (segfaults/stack overflows included) as long as you compiled your program with debug symbols (-g). You can get it here: http://ddbg.mainia.de/releases.html You just use ddbg -cmd="r" myprog.exe on the commandline to load your program and immediately start running it. On linux... yeah I don't know.
Aug 27 2008
"Jarrett Billingsley" <kb3ctd2 yahoo.com> wrote in message news:g95d2h$1ojq$1 digitalmars.com..."sleek" <cslush gmail.com> wrote in message news:g94qsm$t5$1 digitalmars.com...The downside here of course being that it's an external program and not a library/part of the language, but hey, how often do you need a stack trace unless you're debugging?Is there an easy way to get a stack trace when an exception is caught?On Windows, you can run your program in ddbg, and it will print out a stack trace when you get an exception (segfaults/stack overflows included) as long as you compiled your program with debug symbols (-g). You can get it here: http://ddbg.mainia.de/releases.html You just use ddbg -cmd="r" myprog.exe on the commandline to load your program and immediately start running it. On linux... yeah I don't know.
Aug 27 2008
Jarrett Billingsley wrote:"Jarrett Billingsley" <kb3ctd2 yahoo.com> wrote in message news:g95d2h$1ojq$1 digitalmars.com...Conversely, when do you explicitly want a lacok of debug information on a crash? Maybe if you're distributing a super-secret closed source application, but that's the only situation I can think of."sleek" <cslush gmail.com> wrote in message news:g94qsm$t5$1 digitalmars.com...The downside here of course being that it's an external program and not a library/part of the language, but hey, how often do you need a stack trace unless you're debugging?Is there an easy way to get a stack trace when an exception is caught?On Windows, you can run your program in ddbg, and it will print out a stack trace when you get an exception (segfaults/stack overflows included) as long as you compiled your program with debug symbols (-g). You can get it here: http://ddbg.mainia.de/releases.html You just use ddbg -cmd="r" myprog.exe on the commandline to load your program and immediately start running it. On linux... yeah I don't know.
Aug 28 2008
After considering this for a few hours, I think ddbg is my best bet here. Quite honestly, I should only be catching known exceptions. Anything else that occurs that is unexpected should absolutely bubble up and out. "Jarrett Billingsley" <kb3ctd2 yahoo.com> wrote in message news:g95d2h$1ojq$1 digitalmars.com..."sleek" <cslush gmail.com> wrote in message news:g94qsm$t5$1 digitalmars.com...Is there an easy way to get a stack trace when an exception is caught?On Windows, you can run your program in ddbg, and it will print out a stack trace when you get an exception (segfaults/stack overflows included) as long as you compiled your program with debug symbols (-g). You can get it here: http://ddbg.mainia.de/releases.html You just use ddbg -cmd="r" myprog.exe on the commandline to load your program and immediately start running it. On linux... yeah I don't know.
Aug 28 2008