Getting line number where error occured?

Bill Baxter wbaxter at gmail.com
Thu Jan 15 17:59:36 PST 2009


On Fri, Jan 16, 2009 at 10:50 AM, Sergey Gromov <snake.scaly at gmail.com> wrote:
> 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.

And also, D1 will not be moved to the new common druntime, so if
you're using D1 then backtrace hacks or a debugger are still your only
options I think.

--bb


More information about the Digitalmars-d-learn mailing list