Hi, I see that Tango now has stacktrace built in. That's great addition! What is the status of that? Is it usable already and if so - how? Maybe a little example?
With DMD 1.041 and later, you only need to import tango.core.stacktrace.TraceExceptions?. Here's what I do to be able to use older compilers too:
// Workaround for a bug in dmd < 1.041.
// http://d.puremagic.com/issues/show_bug.cgi?id=2673
static if (__VERSION__ < 1041) {
debug import tango.core.stacktrace.StackTrace;
debug version = bug2673;
}
debug import tango.core.stacktrace.TraceExceptions;
/* ... */
// in main()
version (bug2673)
rt_setTraceHandler(&basicTracer);
Like the old stacktrace, it still won't show the call where the exception actually originated. To get that you need a debug build of the base tango lib. But linking to tango-base-dmd-d.lib won't work due to issue #1574, but might work on other platforms than Windows.
dsss_objs/D/tango.core.stacktrace.StackTrace?.o: In function `_D5tango4core10stacktrace10StackTrace24dladdrSymbolizeFrameInfoFKS9Exception9FrameInfoPS5tango4core10stacktrace10StackTrace12TraceContextAaZb':
/usr/local/dmd/bin/../import/tango/core/stacktrace/StackTrace.d:231: undefined reference to `dladdr'
collect2: ld returned 1 exit status