public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
From: Mark Wielaard <mark@klomp.org>
To: systemtap@sourceware.org
Cc: Mark Wielaard <mark@klomp.org>
Subject: [PATCH] Handle DWARF5 DW_OP_implicit_pointer and DW_OP_entry_value
Date: Tue, 29 Nov 2022 18:50:58 +0100	[thread overview]
Message-ID: <20221129175058.32728-1-mark@klomp.org> (raw)

These are the same as the GNU extensions for older DWARF,
DW_OP_GNU_implicit_pointer and DW_GNU_entry_value.
---
 loc2stap.cxx                                | 14 +++++++++++---
 testsuite/systemtap.base/dw_entry_value.exp |  2 +-
 2 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/loc2stap.cxx b/loc2stap.cxx
index efc78cc57..53316a480 100644
--- a/loc2stap.cxx
+++ b/loc2stap.cxx
@@ -23,6 +23,11 @@
 #define DW_OP_GNU_entry_value 0xf3
 #endif
 
+#if ! _ELFUTILS_PREREQ(0, 171)
+#define DW_OP_entry_value 0xa3
+#define DW_OP_implicit_pointer 0xa0
+#endif
+
 #define N_(x) x
 
 \f
@@ -372,7 +377,7 @@ location_context::translate (const Dwarf_Op *expr, const size_t len,
 	      DIE ("operations follow DW_OP_implicit_value");
 
 	    if (implicit_pointer != NULL)
-	      DIE ("operations follow DW_OP_GNU_implicit_pointer");
+	      DIE ("operations follow DW_OP implicit_pointer");
 	  }
 
 	switch (expr[i].atom)
@@ -662,6 +667,7 @@ location_context::translate (const Dwarf_Op *expr, const size_t len,
 
 #if _ELFUTILS_PREREQ (0, 149)
 	  case DW_OP_GNU_implicit_pointer:
+	  case DW_OP_implicit_pointer:
 	    implicit_pointer = &expr[i];
 	    /* Fake top of stack: implicit_pointer being set marks it.  */
 	    PUSH(NULL);
@@ -684,10 +690,11 @@ location_context::translate (const Dwarf_Op *expr, const size_t len,
 	    break;
 
 	  case DW_OP_GNU_entry_value:
+	  case DW_OP_entry_value:
 	    {
 	      expression *result = handle_GNU_entry_value (expr[i]);
 	      if (result == NULL)
-	        DIE("DW_OP_GNU_entry_value unable to resolve value");
+	        DIE("DW_OP entry_value unable to resolve value");
 	      PUSH(result);
 	    }
 	    break;
@@ -1248,7 +1255,8 @@ location_context::location_relative (const Dwarf_Op *expr, size_t len,
 	  break;
 
 	case DW_OP_GNU_entry_value:
-	  DIE ("unhandled DW_OP_GNU_entry_value");
+	case DW_OP_entry_value:
+	  DIE ("unhandled DW_OP entry_value");
 	  break;
 
 	default:
diff --git a/testsuite/systemtap.base/dw_entry_value.exp b/testsuite/systemtap.base/dw_entry_value.exp
index 7339fc5fa..b728fa7ff 100644
--- a/testsuite/systemtap.base/dw_entry_value.exp
+++ b/testsuite/systemtap.base/dw_entry_value.exp
@@ -10,7 +10,7 @@ if { $res != "" } {
     pass "$test: compiled $test.c"
 }
 
-if { ![catch { exec eu-readelf -w $test | grep GNU_entry_value }] } {
+if { ![catch { exec eu-readelf -w $test | grep entry_value: }] } {
     stap_run $test no_load $all_pass_string $srcdir/$subdir/$test.stp -c ./${test} -w
 } else {
     untested "$test: no DW_OP_GNU_entry_value found"
-- 
2.18.4


                 reply	other threads:[~2022-11-29 17:51 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221129175058.32728-1-mark@klomp.org \
    --to=mark@klomp.org \
    --cc=systemtap@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).