Exception Handling

Robert Fraser fraserofthenight at gmail.com
Wed Aug 27 18:13:07 PDT 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-use-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).


More information about the Digitalmars-d-learn mailing list