Remove unused import
[pyelftools.git] / examples / examine_dwarf_info.py
index 1aa28c60e204ce317547e34979d62fcc209bb89f..0e1619e9f7a65bba9f2a950489f6a3712342d65d 100644 (file)
@@ -13,7 +13,6 @@ import sys
 # examples/ dir of the source distribution.
 sys.path[0:0] = ['.', '..']
 
-from elftools.common.py3compat import bytes2str
 from elftools.elf.elffile import ELFFile
 
 
@@ -43,15 +42,8 @@ def process_file(filename):
             top_DIE = CU.get_top_DIE()
             print('    Top DIE with tag=%s' % top_DIE.tag)
 
-            # Each DIE holds an OrderedDict of attributes, mapping names to
-            # values. Values are represented by AttributeValue objects in
-            # elftools/dwarf/die.py
-            # We're interested in the DW_AT_name attribute. Note that its value
-            # is usually a string taken from the .debug_str section. This
-            # is done transparently by the library, and such a value will be
-            # simply given as a string.
-            name_attr = top_DIE.attributes['DW_AT_name']
-            print('    name=%s' % bytes2str(name_attr.value))
+            # We're interested in the filename...
+            print('    name=%s' % top_DIE.get_full_path())
 
 if __name__ == '__main__':
     for filename in sys.argv[1:]: