D 2.0 Stacktrace
    Sean Kelly 
    sean at invisibleduck.org
       
    Fri Oct  8 14:34:41 PDT 2010
    
    
  
Denis Koroskin Wrote:
> 
> I modified druntime to support stack-tracing for all kind of exceptions.  
> It's very simple:
> 
> 1) In object_.d, change traceContext() function linkage to C:
> extern(C) Throwable.TraceInfo traceContext(void* ptr = null) { ... }
> 
> 2) In rt\deh.c, declare
> Interface* traceContext(void* ptr);
> 
> and add the following line to _d_create_exception_object (rt\deh.c)
> exc->info = traceContext(NULL);
> 
> that's it. Works like a charm!
Pretty slick.  I've been thinking about generating traces when the throw occurs instead of when the exception is constructed, and this change allows that as well.  I'll add it to the queue.
    
    
More information about the Digitalmars-d-announce
mailing list