From 9aec9d8a8e6ac82fbd92205e6a11f24a74631cca Mon Sep 17 00:00:00 2001 From: Eli Bendersky Date: Sat, 30 Mar 2013 16:39:30 -0700 Subject: [PATCH] debug-dump=info should print null DIEs to conform to the new readelf. --- CHANGES | 6 ++++-- elftools/dwarf/die.py | 2 +- pyelftools.sublime-project | 14 +++++++------- scripts/readelf.py | 10 +++++----- 4 files changed, 17 insertions(+), 15 deletions(-) diff --git a/CHANGES b/CHANGES index 1861253..7fec9c7 100644 --- a/CHANGES +++ b/CHANGES @@ -7,8 +7,10 @@ Changelog file & line information from an address. - Issue #7: parsing incorrect DWARF was made a bit more forgiving for cases where serialized DIE trees have extra NULLs at the end. - - Pull request 6: very initial support for ARM ELF files (Matthew Fernandez). - - Pull request 7: support for dumping the dynamic section (Mike Frysinger). + - Very initial support for ARM ELF files (Matthew Fernandez - pull + request #6). + - Support support for dumping the dynamic section (Mike Frysinger - pull + request #7). + Version 0.20 (27.01.2012) diff --git a/elftools/dwarf/die.py b/elftools/dwarf/die.py index 846ba9d..cb5d050 100644 --- a/elftools/dwarf/die.py +++ b/elftools/dwarf/die.py @@ -59,7 +59,7 @@ class DIE(object): Specifies whether this DIE has children abbrev_code: - The abbreviation code pointing to an abbreviation entry (not + The abbreviation code pointing to an abbreviation entry (note that this is for informational pusposes only - this object interacts with its abbreviation table transparently). diff --git a/pyelftools.sublime-project b/pyelftools.sublime-project index 45e4dca..a92140c 100644 --- a/pyelftools.sublime-project +++ b/pyelftools.sublime-project @@ -1,9 +1,9 @@ { - "folders": - [ - { - "path": ".", - "folder_exclude_patterns": ["build", "dist", ".tox", ".hg"] - } - ] + "folders": + [ + { + "path": ".", + "folder_exclude_patterns": ["build", "dist", ".tox", ".hg"] + } + ] } diff --git a/scripts/readelf.py b/scripts/readelf.py index b9b07a3..33fa957 100755 --- a/scripts/readelf.py +++ b/scripts/readelf.py @@ -577,14 +577,14 @@ class ReadElf(object): # die_depth = 0 for die in cu.iter_DIEs(): - if die.is_null(): - die_depth -= 1 - continue - self._emitline(' <%s><%x>: Abbrev Number: %s (%s)' % ( + self._emitline(' <%s><%x>: Abbrev Number: %s%s' % ( die_depth, die.offset, die.abbrev_code, - die.tag)) + (' (%s)' % die.tag) if not die.is_null() else '')) + if die.is_null(): + die_depth -= 1 + continue for attr in itervalues(die.attributes): name = attr.name -- 2.30.2