public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] readelf: Handle DW_LLE_GNU_view_pair
@ 2022-10-19 22:02 Mark Wielaard
  2022-10-27 13:30 ` Mark Wielaard
  0 siblings, 1 reply; 2+ messages in thread
From: Mark Wielaard @ 2022-10-19 22:02 UTC (permalink / raw)
  To: elfutils-devel; +Cc: Mark Wielaard

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>
---
 libdw/ChangeLog |  4 ++++
 libdw/dwarf.h   |  6 +++++-
 src/ChangeLog   |  6 ++++++
 src/readelf.c   | 12 ++++++++++++
 4 files changed, 27 insertions(+), 1 deletion(-)

diff --git a/libdw/ChangeLog b/libdw/ChangeLog
index b14b5383..2efcaeb9 100644
--- a/libdw/ChangeLog
+++ b/libdw/ChangeLog
@@ -1,3 +1,7 @@
+2022-10-19  Mark Wielaard  <mark@klomp.org>
+
+	* dwarf.h (DW_LLE_GNU_view_pair): New constant.
+
 2022-09-20  Yonggang Luo  <luoyonggang@gmail.com>
 
 	* memory-access.h: Use BYTE_ORDER, LITTLE_ENDIAN and BIG_ENDIAN.
diff --git a/libdw/dwarf.h b/libdw/dwarf.h
index c961bc36..b2e49db2 100644
--- a/libdw/dwarf.h
+++ b/libdw/dwarf.h
@@ -931,7 +931,11 @@ enum
     DW_LLE_GNU_end_of_list_entry = 0x0,
     DW_LLE_GNU_base_address_selection_entry = 0x1,
     DW_LLE_GNU_start_end_entry = 0x2,
-    DW_LLE_GNU_start_length_entry = 0x3
+    DW_LLE_GNU_start_length_entry = 0x3,
+
+    // http://www.fsfla.org/~lxoliva/papers/sfn/dwarf6-sfn-lvu.txt
+    // https://dwarfstd.org/ShowIssue.php?issue=170427.1
+    DW_LLE_GNU_view_pair = 0x9
   };
 
 /* DWARF5 package file section identifiers.  */
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;
 	    }
-- 
2.30.2


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] readelf: Handle DW_LLE_GNU_view_pair
  2022-10-19 22:02 [PATCH] readelf: Handle DW_LLE_GNU_view_pair Mark Wielaard
@ 2022-10-27 13:30 ` Mark Wielaard
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Wielaard @ 2022-10-27 13:30 UTC (permalink / raw)
  To: elfutils-devel

Hi,

On Thu, 2022-10-20 at 00:02 +0200, Mark Wielaard wrote:
> 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

Pushed,

Mark

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-10-27 13:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-19 22:02 [PATCH] readelf: Handle DW_LLE_GNU_view_pair Mark Wielaard
2022-10-27 13:30 ` Mark Wielaard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).