This is an archive of the discontinued LLVM Phabricator instance.

[lldb/DWARF] Simplify DWARFDebugInfoEntry::LookupAddress
ClosedPublic

Authored by labath on Jan 17 2020, 6:24 AM.

Details

Summary

This method was doing a lot more than it's only caller needed
(DWARFDIE::LookupDeepestBlock) needed, so I inline it into the caller,
and remove any code which is not actually used. This includes code for
searching for the deepest function, and the code for working around
incomplete DW_AT_low_pc/high_pc attributes on a compile unit DIE (modern
compiler get this right, and this method is called on function DIEs
anyway).

This also improves our llvm consistency, as llvm::DWARFDebugInfoEntry is
just a very simple struct with no nontrivial logic.

Diff Detail

Event Timeline

labath created this revision.Jan 17 2020, 6:24 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 17 2020, 6:24 AM
clayborg accepted this revision.Jan 17 2020, 2:14 PM
clayborg added a subscriber: clayborg.

LGTM. Much cleaner using the newer DWARFDIE code. Not sure if we can unit test this?

This revision is now accepted and ready to land.Jan 17 2020, 2:14 PM

LGTM. Much cleaner using the newer DWARFDIE code. Not sure if we can unit test this?

"image lookup --address" is sufficiently low level to be considered a unit test. We already have test using it (though we could always have more), and a lot of other integration tests fail if this goes wrong due to not being able to find local variables.

This revision was automatically updated to reflect the committed changes.