HomePhabricator

DWARFContext: Return empty data extractors instead of null pointers
3d2405817e8bUnpublished

Authored by labath on May 16 2019, 4:19 AM.

Unpublished Commit ยท Learn More

Not On Permanent Ref: This commit is not an ancestor of any permanent ref.

Description

DWARFContext: Return empty data extractors instead of null pointers

Summary:
There are several reasons for doing this:

  • generally, there's no reason to differentiate between a section being absent and it being present, but empty
  • it matches more closely what llvm DWARF parser is doing (which also doesn't differentiate the two cases)
  • SymbolFileDWARF also doesn't differentiate the two cases, which makes porting the rest of sections easier
  • it fixes a bug in how the return-null-if-empty logic was implemented (it returned nullptr only the second time we tried to get the debug_aranges section), which meant that we hit an assert when trying to parse an empty-but-present section

Reviewers: JDevlieghere, clayborg, aprantl

Subscribers: zturner, lldb-commits

Differential Revision: https://reviews.llvm.org/D61942

llvm-svn: 360874

Details