

Runtime Debug Information
This bounty was seeded by BPF Korea.
Bounty: 1/3 of total for OSX
2/3 of total for OSX + Linux
Full amount of OSX + Linux + Windows
Category: Enhancement
Description
The runtime library that is shipped with DMD does not include debug information. Example:
import std.stdio; struct Foo { string toString() { assert(0); } } void main () { writeln(Foo.init); }
This will result in the following stack trace:
[email protected](5): Assertion failure ---------------- ??:? _d_assertp [0x1073781c9] ??:? immutable(char)[] test.Foo.toString() [0x10735cd5c] ??:? void std.format.formatObject!(std.stdio.File.LockingTextWriter, test.Foo, char).formatObject(ref std.stdio.File.LockingTextWriter, ref test.Foo, scope ref const(std.format.FormatSpec!(char).FormatSpec)) [0x1073637d3] ??:? void std.format.formatValueImpl!(std.stdio.File.LockingTextWriter, test.Foo, char).formatValueImpl(ref std.stdio.File.LockingTextWriter, ref test.Foo, scope ref const(std.format.FormatSpec!(char).FormatSpec)) [0x107363769] ??:? void std.format.formatValue!(std.stdio.File.LockingTextWriter, test.Foo, char).formatValue(ref std.stdio.File.LockingTextWriter, ref test.Foo, scope ref const(std.format.FormatSpec!(char).FormatSpec)) [0x107363738] ??:? uint std.format.formattedWrite!(std.stdio.File.LockingTextWriter, char, test.Foo).formattedWrite(ref std.stdio.File.LockingTextWriter, scope const(char[]), test.Foo) [0x10735d1ac] ??:? void std.stdio.File.write!(test.Foo, char).write(test.Foo, char) [0x10735ce23] ??:? void std.stdio.writeln!(test.Foo).writeln(test.Foo) [0x10735cd9e] ??:? _Dmain [0x10735cd26]~
Notice how the file name and line number are absent from the stack trace. We’d like them to be present and to point to installed files.
Definition of Done
The above test case (plus a few others we’ll perform) includes file name and line number information. The debug information can be provided as a separate file on OSX and as a debug build (see -debuglib
) on Linux and Windows.