]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
readelf: Print DW_AT_data_member_location as decimal offset, not hex number.
authorMark Wielaard <mark@klomp.org>
Wed, 3 Apr 2019 14:54:15 +0000 (16:54 +0200)
committerMark Wielaard <mark@klomp.org>
Wed, 10 Apr 2019 21:31:23 +0000 (23:31 +0200)
The data_member_location attribute was printed as a hex number, but other
constant attributes like bit_offset, byte_size or alignment were printed
as decimal numbers. This is confusing.

The reason that data_member_location was printed as hex seemed to have
been because it could also have been a location description, in which
case it might have been of DW_FORM_loclist, for which it makes sense
to print as hex offset (between square brackets).

Signed-off-by: Mark Wielaard <mark@klomp.org>
src/ChangeLog
src/readelf.c

index 99ca1b757ccf7cc62b08c365dac884104bcdbef7..57db6cadb6ffb6e1ae6d17044900758ca4c3632f 100644 (file)
@@ -1,3 +1,8 @@
+2019-04-03  Mark Wielaard  <mark@klomp.org>
+
+       * readelf.c (attr_callback): Print DW_AT_data_member_location as
+       decimal offset, not hex number.
+
 2019-03-29  Mark Wielaard  <mark@klomp.org>
 
        * readelf.c (print_debug_macinfo_section): Check cus[0] is not the
index 5654fd1e8139ecc0027a3ff540233fa7704f84e4..c346e1f8a494596b10369b084093a3731f1adc40 100644 (file)
@@ -7092,7 +7092,7 @@ attr_callback (Dwarf_Attribute *attrp, void *arg)
                  || (form != DW_FORM_data4 && form != DW_FORM_data8)))
            {
              if (!cbargs->silent)
-               printf ("           %*s%-20s (%s) %" PRIxMAX "\n",
+               printf ("           %*s%-20s (%s) %" PRIuMAX "\n",
                        (int) (level * 2), "", dwarf_attr_name (attr),
                        dwarf_form_name (form), (uintmax_t) num);
              return DWARF_CB_OK;