From: Mark Wielaard Date: Wed, 3 Apr 2019 14:54:15 +0000 (+0200) Subject: readelf: Print DW_AT_data_member_location as decimal offset, not hex number. X-Git-Tag: elfutils-0.177~34 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=384e54bc275941784b6b6756cd0d347caf24a062;p=thirdparty%2Felfutils.git readelf: Print DW_AT_data_member_location as decimal offset, not hex number. 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 --- diff --git a/src/ChangeLog b/src/ChangeLog index 99ca1b757..57db6cadb 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2019-04-03 Mark Wielaard + + * readelf.c (attr_callback): Print DW_AT_data_member_location as + decimal offset, not hex number. + 2019-03-29 Mark Wielaard * readelf.c (print_debug_macinfo_section): Check cus[0] is not the diff --git a/src/readelf.c b/src/readelf.c index 5654fd1e8..c346e1f8a 100644 --- a/src/readelf.c +++ b/src/readelf.c @@ -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;