This is an archive of the discontinued LLVM Phabricator instance.

[DebugInfo/DWARF] generate aranges for CU even if it has .debug_aranges entry
Needs ReviewPublic

Authored by sugak on Dec 21 2017, 4:33 PM.

Details

Summary

Not all of the functions have entries in .debug_aranges, but there are always .debug_info entries for them. Currently, this generates aranges for all of the compilation unit if there are no .debug_arange entries (see how ParsedCUOffsets is used). But this is not completely correct, in practice, a compilation unit might have an entry in .debug_arange which doesn't cover all of the functions and it's .debug_infos still, have to be considered.
To solve the problem remove ParsedCUOffsets which is used to determine if a CU has a .debug_arages.

With this change I was able to get full locations in ASAN stack traces with llvm-symbolizer that previously were not decoded:
Before:

#2 0x7f9a8807b2bb in foo(bar<void ()>) (.../libfoo.so+0xff2bb)

After:

#2 0x7f1a85c8f2bb in fin foo(bar<void ()>) foo/foo.cpp:589

Diff Detail

Event Timeline

sugak created this revision.Dec 21 2017, 4:33 PM
grimar edited reviewers, added: dblaikie, aprantl; removed: grimar.Dec 21 2017, 10:11 PM
grimar added a subscriber: grimar.Dec 23 2017, 1:17 AM
aprantl added inline comments.Jan 2 2018, 9:36 AM
tools/llvm-dwarfdump/Statistics.cpp
2

This seems odd, did something go wrong with uploading this patch?