Re:D 2.069.0 released, compiler automatically ported from C+...
by destructionator on Wednesday November 04, 2015 @01:48PM
(#10508603)
null deference in D doesn't throw exceptions by default on Unix so you won't see the backtrace there.
If you are working in a big codebase and have this come up, you can enable core dumps and run it in a debugger to get far more information than just a line number (and line numbers are there too at least if compiled in debug mode).
Re:D 2.069.0 released, compiler automatically ported from C+...
by thepumpkin1979 on Wednesday November 04, 2015 @02:31PM
(#10508978)
does this mean there is not a way to get stack trace on OSX?
Re:D 2.069.0 released, compiler automatically ported from C+...
by EvenThisAcronym on Wednesday November 04, 2015 @03:20PM
(#10509362)
I have not tried it myself but there seem to be ways to get a stack trace on Linux.
Re:D 2.069.0 released, compiler automatically ported from C+...
by destructionator on Wednesday November 04, 2015 @06:24PM
(#10510543)
I don't know about an automatic one, but running the debugger would still work there too. Or at least it should.
I know it's because I'm trying to call a method on "null", but If I'm working on a huge code base, how do I debug this kind of issues if I don't have stack trace with line and error number of the error?
I'd like to get at least the stack trace and the error number with the line of the source code that caused the problem, like in golang: