This is an archive of the discontinued LLVM Phabricator instance.

Cleanup fixed form sizes.
ClosedPublic

Authored by clayborg on May 24 2019, 11:55 AM.

Details

Summary

The fix form sizes use to have two arrays: one for 4 byte addresses and in for 8 byte addresses. The table had an issue where DW_FORM_flag_present wasn't being represented as a fixed size form because its actual size _is_ zero and zero was used to indicate the form isn't fixed in size. Any code that needed to quickly access the DWARF had to get a FixedFormSizes instance using the address byte size.

This fix cleans things up by adding a DWARFFormValue::GetFixedSize() both as a static method and as a member function on DWARFFormValue. It correctly can indicate if a form size is zero. This cleanup is a precursor to a follow up patch where I hope to speed up DWARF parsing.

I verified performance doesn't regress by loading hundreds of DWARF files and setting a breakpoint by file and line and by name in files that do not have DWARF indexes. Performance remained consistent between the two approaches.

Diff Detail

Event Timeline

clayborg created this revision.May 24 2019, 11:55 AM
clayborg updated this revision to Diff 201302.May 24 2019, 12:00 PM

Removed unused function added to DWARFFormValue

JDevlieghere accepted this revision.May 24 2019, 12:45 PM

Looks like a good change. Small comment inline but otherwise LGTM.

source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
3170–3174
if (auto data_length = form_value.GetFixedSize()) 
    ...
3188

Same as previous comment.

This revision is now accepted and ready to land.May 24 2019, 12:45 PM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptMay 24 2019, 3:07 PM