On 9/1/2013 5:14 PM, H. S. Teoh wrote:
But I will say that debugging can and must be improved. Currently, about
the only thing usable for dmd -g is to get a stacktrace of a program
crash. Nothing else seems to be properly supported (I use gdb). Stepping
through statements and setting breakpoints more-or-less works, but I
can't get at most variables (keeps complains about being unable to
reference 'this' or something similar), sometimes variable values are
outright wrong or completely unrelated to the actual value, sometimes
variables shown right on the source line being debugged don't exist in
the debugger ('no such symbol'). Unable to look into nested structs
without hitting odd behaviour. Doesn't understand D naming conventions
(or does so poorly).

I've tried to figure this out many times, and have found the Dwarf format to be completely impenetrable. As far as I can tell, dmd generates correct Dwarf symbolic debug info according to the Dwarf spec.

gdb relies on very undocumented idiosyncratic combinations of things to work. It appears to be wrapped tightly around exactly what gcc generates.

I suppose the only way to figure it out is to read the gdb source code. Sigh.

BTW,

    dumpobj -p

on linux will pretty-print the Dwarf symbolic debug info. If anyone wants to take a stab at it, please do so!

Reply via email to