commit 05eb6742c169226ae09f1737aa8b9dc1dc12adb5
Author: Mark Wielaard <mark@klomp.org>
Date: Tue Nov 29 18:50:58 2022 +0100
Handle DWARF5 DW_OP_implicit_pointer and DW_OP_entry_value
These are the same as the GNU extensions for older DWARF,
DW_OP_GNU_implicit_pointer and DW_GNU_entry_value.
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
@@ -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"