From bcdb82925d893caf44a82d61c080a9ba807ad239 Mon Sep 17 00:00:00 2001 From: Seva Alekseyev Date: Mon, 15 Apr 2024 21:51:42 -0400 Subject: [PATCH] Comment --- scripts/readelf.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/scripts/readelf.py b/scripts/readelf.py index fca91bf3..32496eb9 100755 --- a/scripts/readelf.py +++ b/scripts/readelf.py @@ -1553,6 +1553,13 @@ def _dump_debug_locsection(self, di, loc_lists_sec): self._emitline("\nSection '%s' has no debugging data." % (section_name,)) return + # The v5 loclists section consists of CUs - small header, and + # an optional loclist offset table. Readelf prints out the header data dump + # on top of every CU, so we should too. But we don't scroll through + # the loclists section, we are effectively scrolling through the info + # section (as to not stumble upon gaps in the secion, and not miss the + # GNU locviews, so we have to keep track which loclists-CU we are in. + # Same logic in v5 rnglists section dump. lcus = list(loc_lists_sec.iter_CUs()) if ver5 else None lcu_index = 0 next_lcu_offset = 0 @@ -1562,7 +1569,7 @@ def _dump_debug_locsection(self, di, loc_lists_sec): self._emitline(' Offset Begin End Expression') for loc_list in loc_lists: - # Emit CU headers before the curernt loclist + # Emit CU headers before the current loclist, if we've moved to the next CU if ver5 and loc_list[0].entry_offset > next_lcu_offset: while loc_list[0].entry_offset > next_lcu_offset: lcu = lcus[lcu_index]