digitalmars.D.learn - Line numbers in backtraces (2017)
- Tobias Pankrath (16/35) Oct 31 2017 Hi,
- Moritz Maxeiner (5/18) Oct 31 2017 Does using dmd's `-g` option (compile with debug symbols) not
- Tobias Pankrath (3/25) Oct 31 2017 Of course I've tried this.
- Moritz Maxeiner (5/33) Nov 01 2017 Including Phobos? Your posted backtrace looks to me like
- Tobias Pankrath (8/14) Nov 02 2017 ---
- Moritz Maxeiner (7/21) Nov 02 2017 That Error is thrown from within druntime. If you want to see
Hi, I'm using ArchLinux and the recent DMD from the Arch repositories and my backtraces show no line numbers. I now that is an old issue, but I'm back to D after a long pause and I thought that this used to work out of the box. My backtraces look likes this:??:? pure safe void std.exception.bailOut!(Exception).bailOut(immutable(char)[], ulong, const(char[])) [0xab5c9566] ??:? pure safe bool std.exception.enforce!(Exception, bool).enforce(bool, lazy const(char)[], immutable(char)[], ulong) [0xab5c94e2]I've found this StackOverflow Question from 2011 [1] and if I remember correctly this could be fixed by adding -L--export-dynamic which already is part of my dmd.conf cat /etc/dmd.conf[Environment32] DFLAGS=-I/usr/include/dlang/dmd -L-L/usr/lib32 -L--export-dynamic -fPIC [Environment64] DFLAGS=-I/usr/include/dlang/dmd -L-L/usr/lib -L--export-dynamic -fPICwhich is in fact read by dmd:% dmd -v DMD64 D Compiler v2.076.1 Copyright (c) 1999-2017 by Digital Mars written by Walter Bright Documentation: http://dlang.org/ Config file: /etc/dmd.confHow do I get useful back traces back? Thanks, Tobias [1] https://stackoverflow.com/questions/8209494/how-to-show-line-numbers-in-d-backtraces
Oct 31 2017
On Tuesday, 31 October 2017 at 11:04:57 UTC, Tobias Pankrath wrote:[...]Does using dmd's `-g` option (compile with debug symbols) not work[1]? [1] This is also what the answer in your linked SO post suggest???:? pure safe void std.exception.bailOut!(Exception).bailOut(immutable(char)[], ulong, const(char[])) [0xab5c9566] ??:? pure safe bool std.exception.enforce!(Exception, bool).enforce(bool, lazy const(char)[], immutable(char)[], ulong) [0xab5c94e2]I've found this StackOverflow Question from 2011 [1] and if I remember correctly this could be fixed by adding -L--export-dynamic which already is part of my dmd.conf [...] [1] https://stackoverflow.com/questions/8209494/how-to-show-line-numbers-in-d-backtraces
Oct 31 2017
On Tuesday, 31 October 2017 at 11:21:30 UTC, Moritz Maxeiner wrote:On Tuesday, 31 October 2017 at 11:04:57 UTC, Tobias Pankrath wrote:Of course I've tried this.[...]Does using dmd's `-g` option (compile with debug symbols) not work[1]? [1] This is also what the answer in your linked SO post suggest???:? pure safe void std.exception.bailOut!(Exception).bailOut(immutable(char)[], ulong, const(char[])) [0xab5c9566] ??:? pure safe bool std.exception.enforce!(Exception, bool).enforce(bool, lazy const(char)[], immutable(char)[], ulong) [0xab5c94e2]I've found this StackOverflow Question from 2011 [1] and if I remember correctly this could be fixed by adding -L--export-dynamic which already is part of my dmd.conf [...] [1] https://stackoverflow.com/questions/8209494/how-to-show-line-numbers-in-d-backtraces
Oct 31 2017
On Wednesday, 1 November 2017 at 06:44:44 UTC, Tobias Pankrath wrote:On Tuesday, 31 October 2017 at 11:21:30 UTC, Moritz Maxeiner wrote:Including Phobos? Your posted backtrace looks to me like templates instantiated within Phobos, so I think you'd need Phobos with debug symbols for those lines.On Tuesday, 31 October 2017 at 11:04:57 UTC, Tobias Pankrath wrote:Of course I've tried this.[...]Does using dmd's `-g` option (compile with debug symbols) not work[1]? [1] This is also what the answer in your linked SO post suggest???:? pure safe void std.exception.bailOut!(Exception).bailOut(immutable(char)[], ulong, const(char[])) [0xab5c9566] ??:? pure safe bool std.exception.enforce!(Exception, bool).enforce(bool, lazy const(char)[], immutable(char)[], ulong) [0xab5c94e2]I've found this StackOverflow Question from 2011 [1] and if I remember correctly this could be fixed by adding -L--export-dynamic which already is part of my dmd.conf [...] [1] https://stackoverflow.com/questions/8209494/how-to-show-line-numbers-in-d-backtraces
Nov 01 2017
Including Phobos? Your posted backtrace looks to me like templates instantiated within Phobos, so I think you'd need Phobos with debug symbols for those lines.--- int main(string[] argv) { return argv[1].length > 0; } ---~ [i] % rdmd -g -debug test.d core.exception.RangeError test.d(3): Range violation ----------------No difference when I compile with 'dmd -g -debug' and run in manually.
Nov 02 2017
On Thursday, 2 November 2017 at 19:05:46 UTC, Tobias Pankrath wrote:That Error is thrown from within druntime. If you want to see line numbers for backtraces locations within druntime, you need to compile druntime with debug symbols. Also `-debug` only changes conditional compilation behaviour[1]. [1] https://dlang.org/spec/version.html#DebugConditionIncluding Phobos? Your posted backtrace looks to me like templates instantiated within Phobos, so I think you'd need Phobos with debug symbols for those lines.--- int main(string[] argv) { return argv[1].length > 0; } ---~ [i] % rdmd -g -debug test.d core.exception.RangeError test.d(3): Range violation ----------------No difference when I compile with 'dmd -g -debug' and run in manually.
Nov 02 2017