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

Initial support for parsing vtables out of DWARF information #1174

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mplegendre
Copy link
Contributor

@mplegendre mplegendre commented Dec 18, 2021

I took a stab at adding vtable support to SymtabAPI via the DW_AT_vtable_elem_location attribute in DWARF for #1173 .

This is only a prototype. It parses the attribute and adds vtable information to SymtabAPI internal data structures. I haven't finalized a public interface, nor added tests or documentation.

BUT, I don't think the DW_AT_vtable_elem_location fields are accurate. With GCC compilers, I'm missing information about destructors. With clang compilers, the info is all over the place, with different functions occupying the same slots in the same class's vtable. Based on inspection with dwarfdump, I think this code is reading DW_AT_vtable_elem_location information correctly and it's the compilers that are wrong.
Or, I've got a bug/misunderstanding.

So I'm not immediately sure how to proceed. @woodard , any insight?

@mplegendre mplegendre added ABI-BREAKER This change alters the Dyninst public ABI DWARF Item is related to DWARF parsing labels Dec 18, 2021
@vsoch
Copy link
Contributor

vsoch commented Dec 20, 2021

@woodard @mplegendre do you have a simple script (or library example in spack) that will generate dwarf with this attribute? I'm testing in Go so I can look at how it works and the standard libs that I use (tcl and libtest) don't have it.

@vsoch
Copy link
Contributor

vsoch commented Dec 20, 2021

I'm using these as examples - will try different compilers next in case that's the issue. https://www.geeksforgeeks.org/virtual-function-cpp/

@vsoch
Copy link
Contributor

vsoch commented Dec 20, 2021

Also one thing I think could be an extra check - DW_AT_virtuality (here in Go) and here for docs should be set if it's virtual.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ABI-BREAKER This change alters the Dyninst public ABI DWARF Item is related to DWARF parsing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants