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 by dlang-bot — 2020-02-21T11:14:07Z
@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 by dlang-bot — 2020-02-22T00:26:32Z
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