Skip to content

Commit 6a07f1e

Browse files
committed
debug_rnglists/symbolizing: reduce memory usage by not caching rnglists
This matches the debug_ranges behavior - though is currently implemented differently. (the debug_ranges parsing was handled by creating a new ranges parser during DIE address querying, and just destroying it after the query - whereas the rnglists parser is a member of the DWARFUnit currently - so the API doesn't cache anymore) I think this could/should be improved by not parsing debug_rnglists headers at all when dumping debug_info or symbolizing - do it the way DWARF (roughly) intended: take the rnglists_base, add addr*index to it, read the offset, parse the list at rnglists_base+offset. This would have no error checking for valid index (because the number of valid indexes is stored in the header, which has a negative offset from rnglists_base - and is sort of only intended for use by dumpers, not by parsers going from debug_info to a rnglist) or out of contribution bounds access (since it wouldn't know the length of the contribution, also in the header) - nor any error-checking that the rnglist contribution was using the same properties as the debug_info (version, DWARF32/64, address size, etc).
1 parent c140322 commit 6a07f1e

File tree

1 file changed

+0
-6
lines changed

1 file changed

+0
-6
lines changed

llvm/include/llvm/DebugInfo/DWARF/DWARFListTable.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -270,19 +270,13 @@ template <typename DWARFListType>
270270
Expected<DWARFListType>
271271
DWARFListTableBase<DWARFListType>::findList(DWARFDataExtractor Data,
272272
uint64_t Offset) {
273-
auto Entry = ListMap.find(Offset);
274-
if (Entry != ListMap.end())
275-
return Entry->second;
276-
277273
// Extract the list from the section and enter it into the list map.
278274
DWARFListType List;
279275
uint64_t End = getHeaderOffset() + Header.length();
280-
uint64_t StartingOffset = Offset;
281276
if (Error E =
282277
List.extract(Data, getHeaderOffset(), End, &Offset,
283278
Header.getSectionName(), Header.getListTypeString()))
284279
return std::move(E);
285-
ListMap[StartingOffset] = List;
286280
return List;
287281
}
288282

0 commit comments

Comments
 (0)