-
Notifications
You must be signed in to change notification settings - Fork 55
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
Split DWARF support #23
Comments
⬢[acme@toolbox c]$ eu-readelf -winfo foo.o DWARF section [ 6] '.debug_info' at offset 0x67: Humm, DW_TAG_skeleton_unit First time I see this.... Researching... |
The skeleton unit was when I built with g++ (GCC) 11.2.1 20210728 (Red Hat 11.2.1-1), if I do it with clang version 14.0.0 (https://github.com/llvm/llvm-project f7e82e4fa849376ea9226220847a098dc92d74a0) I get: ⬢[acme@toolbox c]$ clang++ -g -gsplit-dwarf -c foo.cpp -o foo.o DWARF section [ 4] '.debug_info' at offset 0x71: a DW_TAG_compile_unit of type "skeleton", and: ⬢[acme@toolbox c]$ pahole foo.o No output, but then, there are no children on this DW_TAG_compile_unit, or at least eu-readelf can't see it |
ok, there is an extra file, extension .dwo: ⬢[acme@toolbox c]$ ls -la foo.*
}; So there must be a link in foo.o to foo.dwo, lemme see... |
yeah, we have: GNU_dwo_name (strp) "foo.dwo" So its a matter of looking for this attribute inside DW_TAG_compile_unit and open that file instead. |
Furthermore, with g++ we also get an extra file, the only difference is that unknown to pahole DW_TAG_skeleton_unit: ⬢[acme@toolbox split]$ g++ -g -gsplit-dwarf -c foo.cpp -o foo.o
}; |
…_process() So that we can get it from user reports, i.e. instead of: die__process: DW_TAG_compile_unit, DW_TAG_type_unit or DW_TAG_partial_unit expected got INVALID We now get: die__process: DW_TAG_compile_unit, DW_TAG_type_unit or DW_TAG_partial_unit expected got INVALID (0x4a) That we can then look in dwarf.h and notice that there is this new: DW_TAG_skeleton_unit = 0x4a, Now lets go support it... Reported-by: https://twitter.com/trass3r Link: #23 Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
$ pahole ~/c/split/foo.o WARNING: DW_TAG_skeleton_unit used, please look for a .dwo file and use it instead. A future version of pahole will support do this automagically. $ Reported-by: https://twitter.com/trass3r Link: #23 Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
The alt_dwarf branch should address this, I'll revisit the examples above and check if it works with them. |
Looks like there's no support atm.
pahole -E
does not output anything on an executable built withclang -Og -g -gsplit-dwarf
,and with
-gsplit-dwarf -gdwarf-5
it printsdwarves/dwarf_loader.c
Line 2414 in e38e89e
on a real application.
Here it seems to print nothing:
https://godbolt.org/z/v78azerGT
The text was updated successfully, but these errors were encountered: