Fix some other differences from the output of readelf in binutils 2.23
authorEli Bendersky <eliben@gmail.com>
Sun, 31 Mar 2013 00:47:32 +0000 (17:47 -0700)
committerEli Bendersky <eliben@gmail.com>
Sun, 31 Mar 2013 00:47:32 +0000 (17:47 -0700)
.hgignore
elftools/dwarf/descriptions.py
test/run_readelf_tests.py

index b5fbddea2f82adb245f1aad25b79753a4d2b2be9..4e7e9206ab012238387cc8e8a43f2d1c18e30632 100644 (file)
--- a/.hgignore
+++ b/.hgignore
@@ -8,5 +8,6 @@ tags
 build
 dist
 MANIFEST
+*.sublime-workspace
 
 
index 28b4678905e3ee3c5291bba05bc9a0b80a39e4aa..987e0d0c36418af09ed3255ee92df1d477eb3d18 100644 (file)
@@ -199,7 +199,7 @@ def _describe_attr_debool(attr, die, section_offset):
 
 def _describe_attr_block(attr, die, section_offset):
     s = '%s byte block: ' % len(attr.value)
-    s += ' '.join('%x' % item for item in attr.value)
+    s += ' '.join('%x' % item for item in attr.value) + ' '
     return s
 
 
@@ -213,7 +213,7 @@ _ATTR_DESCRIPTION_MAP = defaultdict(
     DW_FORM_ref_udata=_describe_attr_ref,
     DW_FORM_ref_addr=_describe_attr_hex_addr,
     DW_FORM_data4=_describe_attr_hex,
-    DW_FORM_data8=_describe_attr_split_64bit,
+    DW_FORM_data8=_describe_attr_hex,
     DW_FORM_addr=_describe_attr_hex,
     DW_FORM_sec_offset=_describe_attr_hex,
     DW_FORM_flag=_describe_attr_debool,
index 6c822cc1c4194195c54f2a4c8efbc46cb9113e86..933788bb65ec7f33778c30540f2b71f6776c8ef2 100755 (executable)
@@ -134,7 +134,8 @@ def compare_output(s1, s2):
             elif 'at_const_value' in lines1[i]:
                 # On 32-bit machines, readelf doesn't correctly represent
                 # some boundary LEB128 numbers
-                num2 = int(lines2_parts[-1])
+                val = lines2_parts[-1]
+                num2 = int(val, 16 if val.startswith('0x') else 10)
                 if num2 <= -2**31 and '32' in platform.architecture()[0]:
                     ok = True
             elif 'os/abi' in lines1[i]: