Backtrace in exceptions

BCS BCS at pathlink.com
Mon Aug 7 09:33:09 PDT 2006


Sean Kelly wrote:
> Serg Kovrov wrote:
> 
>> Some time ago Shinichiro.h has posted Phobos modification implementing
>> backtrace in exceptions. Shinichiro.h intended this to be part of Phobos
>> and Walter seems was pleased with it.
>>
>> And then discussion thread just stopped... Is this changes got to
>> Phobos?
> 
> 
> I don't think it's been added yet.
> 
>> If yes, how to use exception tracing?
> 
> 
> Just run a debug build.
> 
> I'll admit the way the stack trace is generated for this mod is a bit 
> weird, though it may be a necessary part of how Win32 support works.  To 
> generate the trace, the try/catch block in dmain2 is not used.  Instead, 
> the exception is thrown all the way out of the application, and the 
> trace is generated by some special handler as the app exits.  I'd like 
> to believe it would be possible to generate the trace at the throw point 
> or as the exception propagates instead.
> 
> 
> Sean


I have some projects with one of these in each function.

debug scope( failure ) writef("Backtrace@"__FILE__"(",__LINE__,")\n");



More information about the Digitalmars-d mailing list