Skip to content

Ddwarf #526

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jan 19, 2012
Merged

Ddwarf #526

merged 4 commits into from
Jan 19, 2012

Conversation

MartinNowak
Copy link
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.

@MartinNowak
Copy link
Member Author

@WalterBright
Copy link
Member

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.

@MartinNowak
Copy link
Member Author

Sounds reasonable.

@MartinNowak
Copy link
Member Author

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
Copy link

Marenz commented Dec 16, 2011

Do want!

@CyberShadow
Copy link
Member

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.

@llucax
Copy link
Contributor

llucax commented Dec 19, 2011

It almost fixes http://d.puremagic.com/issues/show_bug.cgi?id=3391 also

@MartinNowak
Copy link
Member Author

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.

@llucax
Copy link
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 added a commit that referenced this pull request Jan 19, 2012
@WalterBright WalterBright merged commit f37b755 into dlang:master Jan 19, 2012
braddr pushed a commit to braddr/dmd that referenced this pull request Oct 22, 2012
Capitalize `pointerTarget`'s first letter
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants