From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gnu.wildebeest.org (gnu.wildebeest.org [45.83.234.184]) by sourceware.org (Postfix) with ESMTPS id 934EB3858D35 for ; Tue, 29 Nov 2022 17:51:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 934EB3858D35 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=klomp.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=klomp.org Received: from tarox.wildebeest.org (83-87-18-245.cable.dynamic.v4.ziggo.nl [83.87.18.245]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by gnu.wildebeest.org (Postfix) with ESMTPSA id 4FC3A300B351; Tue, 29 Nov 2022 18:51:03 +0100 (CET) Received: by tarox.wildebeest.org (Postfix, from userid 1000) id D83434000C75; Tue, 29 Nov 2022 18:51:02 +0100 (CET) From: Mark Wielaard To: systemtap@sourceware.org Cc: Mark Wielaard Subject: [PATCH] Handle DWARF5 DW_OP_implicit_pointer and DW_OP_entry_value Date: Tue, 29 Nov 2022 18:50:58 +0100 Message-Id: <20221129175058.32728-1-mark@klomp.org> X-Mailer: git-send-email 2.18.4 X-Spam-Status: No, score=-3038.8 required=5.0 tests=BAYES_00,GIT_PATCH_0,JMQ_SPF_NEUTRAL,KAM_DMARC_STATUS,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: 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 @@ -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