diff options
author | Mark Wielaard <mark@klomp.org> | 2018-05-14 17:18:11 +0200 |
---|---|---|
committer | Mark Wielaard <mark@klomp.org> | 2018-05-19 12:46:19 +0200 |
commit | e9585375426b392cb887789fbf6068ab1f529d4a (patch) | |
tree | daafb011f7bdd45b59a2c9308a8678644cad677c /src | |
parent | a7bcf4322f5e23a638c3b5b6f3cf62855865cc4a (diff) | |
download | elfutils-e9585375426b392cb887789fbf6068ab1f529d4a.tar.gz |
libdw: Add GNU DebugFission attributes, tags, forms and operands.
Most are handled just like their DWARF5 counterparts.
Signed-off-by: Mark Wielaard <mark@klomp.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/ChangeLog | 9 | ||||
-rw-r--r-- | src/readelf.c | 20 |
2 files changed, 27 insertions, 2 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index bf07a79c..4f08312e 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,12 @@ +2018-05-14 Mark Wielaard <mark@klomp.org> + + * readelf.c (print_ops): Handle DW_OP_GNU_addr_index and + DW_OP_GNU_const_index. + (attr_callback): Handle DW_FORM_GNU_addr_index as DW_FORM_addrx. + Handle DW_FORM_GNU_str_index as DW_FORM_constx. Add as_hex_id. + Handle DW_AT_GNU_dwo_id as_hex_id. + (print_form_data): Handle DW_FORM_GNU_str_index as DW_FORM_strx. + 2018-05-12 Mark Wielaard <mark@klomp.org> * readelf.c (print_debug): Also recognize .dwo section name variants. diff --git a/src/readelf.c b/src/readelf.c index f34dd361..6d503c71 100644 --- a/src/readelf.c +++ b/src/readelf.c @@ -4341,7 +4341,9 @@ print_ops (Dwfl_Module *dwflmod, Dwarf *dbg, int indent, int indentrest, case DW_OP_plus_uconst: case DW_OP_constu: case DW_OP_addrx: - case DW_OP_constx:; + case DW_OP_GNU_addr_index: + case DW_OP_constx: + case DW_OP_GNU_const_index:; const unsigned char *start = data; uint64_t uleb; NEED (1); @@ -6115,6 +6117,7 @@ attr_callback (Dwarf_Attribute *attrp, void *arg) case DW_FORM_addrx2: case DW_FORM_addrx3: case DW_FORM_addrx4: + case DW_FORM_GNU_addr_index: if (!cbargs->silent) { Dwarf_Addr addr; @@ -6151,6 +6154,7 @@ attr_callback (Dwarf_Attribute *attrp, void *arg) case DW_FORM_strx4: case DW_FORM_string: case DW_FORM_GNU_strp_alt: + case DW_FORM_GNU_str_index: if (cbargs->silent) break; const char *str = dwarf_formstring (attrp); @@ -6203,6 +6207,7 @@ attr_callback (Dwarf_Attribute *attrp, void *arg) goto attrval_out; const char *valuestr = NULL; + bool as_hex_id = false; switch (attr) { /* This case can take either a constant or a loclistptr. */ @@ -6330,6 +6335,10 @@ attr_callback (Dwarf_Attribute *attrp, void *arg) valuestr = "???"; } break; + case DW_AT_GNU_dwo_id: + as_hex_id = true; + break; + default: /* Nothing. */ break; @@ -6357,7 +6366,13 @@ attr_callback (Dwarf_Attribute *attrp, void *arg) if (unlikely (dwarf_formsdata (attrp, &snum) != 0)) goto attrval_out; - if (valuestr == NULL) + if (as_hex_id) + { + printf (" %*s%-20s (%s) 0x%.16" PRIx64 "\n", + (int) (level * 2), "", dwarf_attr_name (attr), + dwarf_form_name (form), num); + } + else if (valuestr == NULL) { printf (" %*s%-20s (%s)", (int) (level * 2), "", dwarf_attr_name (attr), @@ -6940,6 +6955,7 @@ print_form_data (Dwarf *dbg, int form, const unsigned char *readp, break; case DW_FORM_strx: + case DW_FORM_GNU_str_index: if (readendp - readp < 1) goto invalid_data; get_uleb128 (val, readp, readendp); |