Debugging support for D - wiki

Iain Buclaw ibuclaw at ubuntu.com
Wed Sep 25 07:38:18 PDT 2013


On 25 September 2013 14:45, Bruno Medeiros
<brunodomedeiros+dng at gmail.com> wrote:
> On 23/09/2013 23:57, Iain Buclaw wrote:
>>
>> On 23 September 2013 20:50, Bruno Medeiros
>> <brunodomedeiros+dng at gmail.com> wrote:
>>>
>>> I'm looking to begin adding integrated debugger support for the DDT IDE
>>> pretty soon. With this in mind it would be desirable to have a view of
>>> what
>>> level of D language debugger support is there for the various
>>> combinations
>>> of platform+compiler+debugger.
>>>
>>> This information would be quite beneficial to regular D users as well, as
>>> Manu's recent thread on the importance of a debugger is any indication
>>> of.
>>> Yet there doesn't seem to be any info about this in the wiki. The
>>> debuggers
>>> wiki page ( http://wiki.dlang.org/Debuggers ) doesn't even list the main
>>> players in this scene (VisualD/Mago, GDB, WinDebugger?)
>>>
>>>
>>> I might get started with this, but I would need to enlist the help of
>>> other
>>> people for the other platforms/debuggers I don't have proper acess to.
>>>
>>> The only combinations I tried so far was DMD+Windows+GDB, which seems
>>> like
>>> it's not supported at all. And GDC+Windows32+GDB which does seem to be
>>> well
>>> supported (GDB understands D name mangling, breakpoints in source, D data
>>> structures layout, etc.). I'm guessing GDC+GDB on Linux works just as
>>> well.
>>> (what about Mac though?)
>>>
>>
>> GDB doesn't understand D mangling.  We currently leverage the use of
>> setting pretty-print names for debugging purposes, but you require to
>> put the names in 'quotation.marks' - I will fix this sometime this
>> year... maybe. :)
>>
>>
>
> Perhaps I described it incorrectly then. What I mean is that most references
> and displays of D symbols are made using proper D names, and not mangled
> names (as you might get if you run it through a pure C/C++ debugger). I've
> haven't yet seen something like "_D8func_mod5funczFZv" on GDB compiled with
> GDC.
>
>

This is what emitting pretty-print names to the debugger does!

Think of it this way, there is a distinction between a decl name, and
a decl assembler name.

decl name = func.func  (this is what is seen by the debugger)
decl assember name = _D8func_mod5funczFZv  (this is the name of the
function emitted in assembler)


Iain Buclaw

*(p < e ? p++ : p) = (c & 0x0f) + '0';


More information about the Digitalmars-d mailing list