Ddwarf #526

Merged
merged 4 commits into from Jan 19, 2012

Projects

None yet

5 participants

@MartinNowak
Member
  • emit debug infos for dynamic arrays as
    struct _Array_T { size_t length; T* ptr; }
  • emit debug infos for delegates as
    struct _Delegate{ void* ctxptr; Function* funcptr; }
  • emit debug infos for aarrays as
    struct _AArray_KeyT_ValueT { void* ptr; }
  • remove D DWARF extensions
  • remove dead code in toctype.c which changed the ctype to
    structs, the backend could not handle them
  • emit same debug infos for -gc as the info is common C

Specifically the _Array_T type will hook to gdb's D support.
That is with gdb >= 2010-04-29 this will add full dynamic
array printing support.

The function pointer in _Delegate is correctly typed and
will be resolved to the actual symbol name during debugging.

For AAs we can't really add debug infos as their implementation
is hidden in druntime.

Owner

I'd rather #ifdef the D Dwarf extensions out, rather than remove them.

I'd also rather leave in the struct generation stuff as #ifdef, as it is useful for Codeview symbolic debug info generation, though that needs to be looked at in more detail.

Member

Sounds reasonable.

Member

I've rewritten this in a more conservative way.
It now only alters the -g behavior for DWARF.
The old behavior can be enabled with defining
USE_DWARF_D_EXTENSIONS in dwarf.h.
Hopefully it will not rot as the struct code in toctype.c.

It would be great if we'd mangle the types.
Then the typenames could be
_Array_ElementMangle
_AArray_KeyMangle_ValueMangle
_Delegate_TypeFunctionMangle

GDB has a D demangler and can be made to display them accordingly.
I will see how to add this later, there is no D mangler around the backend, is it?

Marenz commented Dec 16, 2011

Do want!

Owner

By the way, would it be possible to add a switch to emit DWARF debug info on Windows? Some debuggers/profilers (e.g. Very Sleepy) understand DWARF but not CodeView.

Contributor
llucax commented Dec 19, 2011
Member

Yeah, but AA support won't work.
I think we're better of to add python scripts for them, but they require a specific binary to be associated with. So this will only get usable with a shared phobos2.

Contributor
llucax commented Dec 19, 2011

Martin Nowak, el 19 de diciembre a las 04:02 me escribiste:

Yeah, but AA support won't work.
I think we're better of to add python scripts for them, but they
require a specific binary to be associated with. So this will only get
usable with a shared phobos2.

Yeah, STL support is really great using python extensions... Would be
great having something like that for D.

Leandro Lucarella (AKA luca) http://llucax.com.ar/

@WalterBright WalterBright merged commit f37b755 into dlang:master Jan 19, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment