diff options
author | Mark Wielaard <mark@klomp.org> | 2022-10-20 00:02:39 +0200 |
---|---|---|
committer | Mark Wielaard <mark@klomp.org> | 2022-10-27 15:28:32 +0200 |
commit | 85f4c22f60c87bd2f67b241974f1b5f0f355a29b (patch) | |
tree | 24002aaae9c05a35f877924515e7434d1a7911bc /src | |
parent | 8aa88041e0e33a5fd9ec6e7e04cc72a58f764d7f (diff) | |
download | elfutils-85f4c22f60c87bd2f67b241974f1b5f0f355a29b.tar.gz |
readelf: Handle DW_LLE_GNU_view_pair
DW_LLE_GNU_view_pair is used by gcc -gvariable-location-views=incompat5.
As described in http://www.fsfla.org/~lxoliva/papers/sfn/dwarf6-sfn-lvu.txt
and proposed for DWARF6 https://dwarfstd.org/ShowIssue.php?issue=170427.1
Signed-off-by: Mark Wielaard <mark@klomp.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/ChangeLog | 6 | ||||
-rw-r--r-- | src/readelf.c | 12 |
2 files changed, 18 insertions, 0 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 23c971d1..1f369ef6 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2022-10-19 Mark Wielaard <mark@klomp.org> + + * readelf.c (dwarf_loc_list_encoding_string): Handle + DW_LLE_GNU_view_pair. + (print_debug_loclists_section): Likewise. + 2022-09-20 Yonggang Luo <luoyonggang@gmail.com> * arlib.h: Use BYTE_ORDER, LITTLE_ENDIAN and BIG_ENDIAN. diff --git a/src/readelf.c b/src/readelf.c index a206e60e..7671a31d 100644 --- a/src/readelf.c +++ b/src/readelf.c @@ -4185,6 +4185,8 @@ dwarf_loc_list_encoding_string (unsigned int kind) #define DWARF_ONE_KNOWN_DW_LLE(NAME, CODE) case CODE: return #NAME; DWARF_ALL_KNOWN_DW_LLE #undef DWARF_ONE_KNOWN_DW_LLE + /* DW_LLE_GNU_view_pair is special/incompatible with default codes. */ + case DW_LLE_GNU_view_pair: return "GNU_view_pair"; default: return NULL; } @@ -9744,6 +9746,16 @@ print_debug_loclists_section (Dwfl_Module *dwflmod, readp += len; break; + case DW_LLE_GNU_view_pair: + if ((uint64_t) (nexthdr - readp) < 1) + goto invalid_entry; + get_uleb128 (op1, readp, nexthdr); + if ((uint64_t) (nexthdr - readp) < 1) + goto invalid_entry; + get_uleb128 (op2, readp, nexthdr); + printf (" %" PRIx64 ", %" PRIx64 "\n", op1, op2); + break; + default: goto invalid_entry; } |