Skip to content
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

Remove template arguments from drgn.Type.tag #80

Open
Tracked by #328
osandov opened this issue Jan 9, 2021 · 0 comments
Open
Tracked by #328

Remove template arguments from drgn.Type.tag #80

osandov opened this issue Jan 9, 2021 · 0 comments
Labels
bug Something isn't working C++ Support for C++ debugging

Comments

@osandov
Copy link
Owner

osandov commented Jan 9, 2021

As noted by 352c31e, drgn.Type.tag includes the template arguments because the DW_AT_name attribute in DWARF includes them. tag should just be what the C standard calls tag and what the C++ standard calls class-head-name: the identifier after the struct, union, or class keyword.

To do this, we need to strip everything starting at the < character when parsing DWARF for a structure, union, or class. But this means that we can't use the string directly in the mmap'd DWARF anymore; we'll have to allocate it and track it to deallocate it (maybe interning it in a set, maybe just keeping them all in a vector). Or, we can edit the mmap, but that might get awkward with the DWARF index.

Then, when formatting a type with template parameters, we need to include those after the tag.

@osandov osandov added bug Something isn't working C++ Support for C++ debugging labels Jan 9, 2021
@osandov osandov changed the title Remove template arguments from drgn.Type.tag Remove template arguments from drgn.Type.tag Jan 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working C++ Support for C++ debugging
Projects
None yet
Development

No branches or pull requests

1 participant