Page MenuHomePhabricator

DebugInfo: Remove DWARFv5 TUs from CUs list by sorting the finalized list

Authored by dblaikie on Sep 18 2020, 1:19 PM.



Since DWARFv5 places TUs in debug_info, some of DWARFContext's APIs have
become a bit erroneous, including TUs in the CU list by accident.

Implementation: Once we finish parsing debug_info[.dwo], stable sort the list by whether they are a TU or CU (CUs first, then TUs).
Then, when querying for debug_info units, provide the whole range of both

Drawback: We have to then resort the units when dumping debug_info[.dwo] to print them in the order they are in the input file.

Trying to pick between this solution and D87935

One slight variation on this would be that we could avoid sorting after finalizing, if we kept an extra member to save the boundary point between CUs and TUs - or, always insert CUs at the start and TUs at the end.

Diff Detail

Event Timeline

dblaikie created this revision.Sep 18 2020, 1:19 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 18 2020, 1:19 PM
dblaikie requested review of this revision.Sep 18 2020, 1:19 PM
dblaikie abandoned this revision.Wed, Sep 23, 10:19 PM

Went with D87935 instead.