Getting line number where error occured?
Sergey Gromov
snake.scaly at gmail.com
Thu Jan 15 17:50:20 PST 2009
Thu, 15 Jan 2009 13:08:35 -0500, Kagamin wrote:
> Bill Baxter Wrote:
>
>> Nothing built-in for this,
>> but there are the backtrace hacks: http://team0xf.com/index.php?n=Site.Download
>> Never tried those myself though.
>>
>> I use a debugger when I need a stack trace.
>> http://ddbg.mainia.de/releases.html (Windows - on Linux I think you
>> can use GDB).
>
> Weren't stack traces added to druntime some time ago?
You're correct, I missed that. Exception is derived from Throwable in
druntime, and Throwable has a field 'info' of type TraceInfo with
opApply in its interface.
But it doesn't work, at least with DMD 2.023 on Windows. Attempts to
access this field cause object.Error: Access Violation. I didn't try to
investigate further though.
More information about the Digitalmars-d-learn
mailing list