scripts: Include all entries in collect_dwarf_info

Note this only affects the top-level entries. Dwarf-info contains a
heirarchical structure, but for some scripts we just don't care. Finding
DW_TAG_variables in nested DW_TAG_lexical_blocks for example.

This is useful for ongoing stack.py rework.
This commit is contained in:
Christopher Haster
2024-12-05 01:42:30 -06:00
parent bd7004a4f3
commit eb7fff8843
4 changed files with 8 additions and 16 deletions

View File

@@ -450,10 +450,8 @@ def collect_dwarf_info(obj_path, tags=None, *,
off=int(m.group('off'), 16),
tag=m.group('tag').strip(),
)
# keep track of top-level entries
if (entry.level == 1 and (
# unless this entry is filtered
tags is None or entry.tag in tags)):
# keep track of unfiltered entries
if tags is None or entry.tag in tags:
info[entry.off] = entry
# store entry in parent
levels[entry.level] = entry