using RepeatUntilExcluding for the Dwarf_abbrev_declaration struct - so now no accoun...
authorEli Bendersky <eliben@gmail.com>
Wed, 7 Dec 2011 07:44:06 +0000 (09:44 +0200)
committerEli Bendersky <eliben@gmail.com>
Wed, 7 Dec 2011 07:44:06 +0000 (09:44 +0200)
elftools/dwarf/abbrevtable.py
elftools/dwarf/structs.py

index ad25aebfaaa2536655cb54cc1242fe64a81a0f07..44ccdd5e5a277c43dda1df75ac8eb5324463b6d1 100644 (file)
@@ -73,9 +73,6 @@ class AbbrevDecl(object):
             (name, form) pairs.
         """
         for attr_spec in self['attr_spec']:
-            # Ignore the terminating 'null' spec
-            if attr_spec.name == 'DW_AT_null':
-                break
             yield attr_spec.name, attr_spec.form
             
     def __getitem__(self, entry):
index ebf34c668f9a90260a9770a238652077d0cf032b..2c003258b9c66445d3969c24f08821ea31363d70 100644 (file)
@@ -150,7 +150,7 @@ class DWARFStructs(object):
         self.Dwarf_abbrev_declaration = Struct('Dwarf_abbrev_entry',
             Enum(self.Dwarf_uleb128('tag'), **ENUM_DW_TAG),
             Enum(self.Dwarf_uint8('children_flag'), **ENUM_DW_CHILDREN),
-            RepeatUntil(
+            RepeatUntilExcluding(
                 lambda obj, ctx: 
                     obj.name == 'DW_AT_null' and obj.form == 'DW_FORM_null',
                 Struct('attr_spec',