From eb7fff8843d9fedfe30e00ddafb1d37e3fb2fe34 Mon Sep 17 00:00:00 2001 From: Christopher Haster Date: Thu, 5 Dec 2024 01:42:30 -0600 Subject: [PATCH] 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. --- scripts/code.py | 6 ++---- scripts/ctx.py | 6 ++---- scripts/data.py | 6 ++---- scripts/structs.py | 6 ++---- 4 files changed, 8 insertions(+), 16 deletions(-) diff --git a/scripts/code.py b/scripts/code.py index 8d0d69ac..aa93b8b3 100755 --- a/scripts/code.py +++ b/scripts/code.py @@ -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 diff --git a/scripts/ctx.py b/scripts/ctx.py index 6bbc0ea3..b18d4d0e 100755 --- a/scripts/ctx.py +++ b/scripts/ctx.py @@ -459,10 +459,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 diff --git a/scripts/data.py b/scripts/data.py index e394ac95..54f9d65b 100755 --- a/scripts/data.py +++ b/scripts/data.py @@ -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 diff --git a/scripts/structs.py b/scripts/structs.py index d03299f0..c4429b3a 100755 --- a/scripts/structs.py +++ b/scripts/structs.py @@ -347,10 +347,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