D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 20591 - ldc doesn't print files' directories when printing stack trace
Summary: ldc doesn't print files' directories when printing stack trace
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: druntime (show other issues)
Version: D2
Hardware: All Linux
: P1 normal
Assignee: No Owner
URL:
Keywords: pull
Depends on:
Blocks:
 
Reported: 2020-02-21 11:13 UTC by yazan.dabain
Modified: 2020-02-22 00:26 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description yazan.dabain 2020-02-21 11:13:00 UTC
DMD's implementation of dwarf debug data puts the directory in the filename directly. A more correct implementation, like LDC's, uses the include_directories for that.
The current implementation only uses the filenames when printing the stacktrace. This means that stacktraces for programs compiled using LDC only contained the filename (not including the filepath).

    package.d:2577 [0x55605bed2022]
    stdio.d:3002 [0x55605bed8b53]
    primitives.d:276 [0x55605bed8b00]
    primitives.d:379 [0x55605bed88db]
    format.d:3284 [0x55605bed8320]
    format.d:4230 [0x55605bed81c9]
    format.d:1854 [0x55605bed3058]
    format.d:575 [0x55605bed2863]
    stdio.d:1596 [0x55605bed22c6]
    stdio.d:3927 [0x55605bed1652]

vs

    /home/yazan/repos/d-devel/ldc/runtime/phobos/std/range/primitives.d:2458 [0x56518645c434]
    /home/yazan/repos/d-devel/ldc/runtime/phobos/std/range/package.d:2619     [0x56518645cd32]
    /home/yazan/repos/d-devel/ldc/runtime/phobos/std/stdio.d:3041 [0x565186464690]
    /home/yazan/repos/d-devel/ldc/runtime/phobos/std/range/primitives.d:276 [0x565186464640]
    /home/yazan/repos/d-devel/ldc/runtime/phobos/std/range/primitives.d:379 [0x56518646442b]
    /home/yazan/repos/d-devel/ldc/runtime/phobos/std/format.d:3455 [0x565186463e8a]
    /home/yazan/repos/d-devel/ldc/runtime/phobos/std/format.d:4429 [0x565186463d39]
    /home/yazan/repos/d-devel/ldc/runtime/phobos/std/format.d:1875 [0x56518645dcb8]
    /home/yazan/repos/d-devel/ldc/runtime/phobos/std/format.d:576 [0x56518645d459]
    /home/yazan/repos/d-devel/ldc/runtime/phobos/std/stdio.d:1609 [0x56518645cee4]
    /home/yazan/repos/d-devel/ldc/runtime/phobos/std/stdio.d:3967 [0x56518645c372]
Comment 1 Dlang Bot 2020-02-21 11:14:07 UTC
@yazd updated dlang/druntime pull request #2945 "Print source file directory in stack traces" fixing this issue:

- Fix issue 20591 - Print source file directory in stack traces

https://github.com/dlang/druntime/pull/2945
Comment 2 Dlang Bot 2020-02-22 00:26:32 UTC
dlang/druntime pull request #2945 "Print source file directory in stack traces" was merged into master:

- f6534412ac65fb1f343d5a71ec8779faf1c69662 by Yazan Dabain:
  Fix issue 20591 - Print source file directory in stack traces

https://github.com/dlang/druntime/pull/2945