debug-dump=info should print null DIEs to conform to the new readelf.
authorEli Bendersky <eliben@gmail.com>
Sat, 30 Mar 2013 23:39:30 +0000 (16:39 -0700)
committerEli Bendersky <eliben@gmail.com>
Sat, 30 Mar 2013 23:39:30 +0000 (16:39 -0700)
CHANGES
elftools/dwarf/die.py
pyelftools.sublime-project
scripts/readelf.py

diff --git a/CHANGES b/CHANGES
index 18612536e750df255550f2f75fcc260c543c0d6d..7fec9c75261a4fff3df05570f07d5e50dcdd1a2b 100644 (file)
--- 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)
 
index 846ba9d10a48adf039af47fc599f4a5b45c6a099..cb5d0505537ce1d32248ee1dfd07514efba9c9b4 100644 (file)
@@ -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).
 
index 45e4dcab3d600649a2e909e4b0cfb2e9d58d746f..a92140cdf398ea3f2d28523231b6cd212443cc3b 100644 (file)
@@ -1,9 +1,9 @@
 {
-       "folders":
-       [
-               {
-                       "path": ".",
-                       "folder_exclude_patterns": ["build", "dist", ".tox", ".hg"]
-               }
-       ]
+    "folders":
+    [
+        {
+            "path": ".",
+            "folder_exclude_patterns": ["build", "dist", ".tox", ".hg"]
+        }
+    ]
 }
index b9b07a3359c7ed5b403d05d0214d9f89b7703ae0..33fa9574d1f9e15c0fb9408f11550d63e56ad39d 100755 (executable)
@@ -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