-
Notifications
You must be signed in to change notification settings - Fork 348
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
Request for new "declfile" source type #339
Comments
Thanks for the detailed report! I think there are two key questions in here:
Both are good questions. Debugging the bug
Unfortunately this debug entry is missing the two attributes Bloaty generally depends on to attribute this to a section of the binary:
Without one of these two, Bloaty doesn't know which part of the binary When I look in the symbol table (binary compiled with Clang), I see an address of
But when I dump the debug info, unfortunately there is no DIE that references this address:
Looking at verbose Bloaty output, it looks like the only way Bloaty was able to attribute
The address was referenced from two different functions, and it was a matter of luck which one Bloaty found first. Looking at the symbol table, the two addresses
So why did it reference
But when I dump the debug info looking for this
So this looks like a bug in Bloaty. It should have been attributed to On the
|
I’m trying to use bloaty to divide up memory usage of a project by directory structure. The compileunits source type seemed to be the closest fit to what I was looking for, so I used it as the base type for my custom directory structure data type. However, I noticed that constants inlined within header files weren’t placed into a compileunit named with the path to file, which was the case for most symbols. These were instead rolled up in a generic [section .rodata] compileunit. I’ve tried to reproduce a simple version of this behavior using the source code at the bottom and compiling using gcc and clang.
The symbol, sample_array, should be 40 bytes in size, defined in array.h, and used in translation_unit1.cc and translation_unit2.cc. However, bloaty analysis of the clang executable puts it under both main.cc with strange size attribution because of additional inclusion in the .eh_frame_hdr section.
For gcc, the compileunit name is not intuitive and therefore it is difficult to attribute symbols defined in header inlines to the appropriate source code.
Looking at the dwarfdump of both executables, it looks like the information I want is present under the DW_AT_decl_file tag.
Is it possible to create a different source type which is primarily based on the decl file (as this is essentially what I want and compileunits was just as close as I could get)?
``
main.h
main.cc
array.h
translation_unit1.h
translation_unit1.cc
translation_unit2.h
translation_unit2.cc
The text was updated successfully, but these errors were encountered: