From patchwork Mon Jan 23 10:55:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom de Vries X-Patchwork-Id: 63586 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 95D683858C2F for ; Mon, 23 Jan 2023 10:55:30 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 95D683858C2F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1674471330; bh=yEGi4JVbetMNuLsLORg0z10amVrKfPZpaaY1n+7S06g=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=FnxAqLZJsqeOqHgcCPLnCZix40Ugq6GrQjYC/c8Di6JVvx/2fiJLtZw5xzg3yu8Uj UfqF7jf9h4UXK4ChIrqGYcPUzlEpZgrX1auxMyj+3N8wO/CBpsONdVVS2vj4eIw7wX M0cWwi89yTdriyJQ5aZWbf+5sFVlMpkuDtYXyr+o= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by sourceware.org (Postfix) with ESMTPS id 2CD693858D32 for ; Mon, 23 Jan 2023 10:55:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2CD693858D32 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 642F71F891 for ; Mon, 23 Jan 2023 10:55:06 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 4FD121357F for ; Mon, 23 Jan 2023 10:55:06 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id NR0+EopnzmOQLQAAMHmgww (envelope-from ) for ; Mon, 23 Jan 2023 10:55:06 +0000 To: gdb-patches@sourceware.org Subject: [pushed] [gdb/testsuite] Avoid using .eh_frame in gdb.base/unwind-on-each-insn.exp Date: Mon, 23 Jan 2023 11:55:05 +0100 Message-Id: <20230123105505.17839-1-tdevries@suse.de> X-Mailer: git-send-email 2.35.3 MIME-Version: 1.0 X-Spam-Status: No, score=-12.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, 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 X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Tom de Vries via Gdb-patches From: Tom de Vries Reply-To: Tom de Vries Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" One purpose of the gdb.base/unwind-on-each-insn.exp test-case is to test the architecture-specific unwinders on foo, so unwind-on-each-insn-foo.c is compiled with nodebug, to prevent the dwarf unwinders from taking effect. For for instance gcc x86_64 though, -fasynchronous-unwind-tables is enabled by default, generating an .eh_frame section contribution which might enable the dwarf unwinders and bypass the architecture-specific unwinders. Currently, that happens to be not the case due to the current implementation of epilogue_unwind_valid, which assumes that in absence of debug info proving that the compiler is gcc >= 4.5.0, the .eh_frame contribution is invalid. That may change though, see PR30028, in which case gdb.base/unwind-on-each-insn.exp stops being a regression test for commit 49d7cd733a7 ("Change calculation of frame_id by amd64 epilogue unwinder"). Fix this by making sure that we don't use .eh_frame info regardless of epilogue_unwind_valid, simply by not generating it using -fno-asynchronous-unwind-tables. Tested on x86_64-linux, target boards unix/{-m64,-m32}, using compilers gcc 7.5.0 and clang 13.0.1. --- gdb/testsuite/gdb.base/unwind-on-each-insn.exp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) base-commit: 36025e8f484a9d1a6ecc5f436344b1d7a09f470b diff --git a/gdb/testsuite/gdb.base/unwind-on-each-insn.exp b/gdb/testsuite/gdb.base/unwind-on-each-insn.exp index 5e822effaf1..fc48bf5c061 100644 --- a/gdb/testsuite/gdb.base/unwind-on-each-insn.exp +++ b/gdb/testsuite/gdb.base/unwind-on-each-insn.exp @@ -25,9 +25,19 @@ standard_testfile .c -foo.c +set debug_flags {debug} +set nodebug_flags {nodebug} + +# Make sure that we don't use .eh_frame info, by not generating it, +# using -fno-asynchronous-unwind-tables, if supported. +if { [gdb_can_simple_compile fno-asynchronous-unwind-tables \ + { void foo () { } } object -fno-asynchronous-unwind-tables] } { + lappend nodebug_flags additional_flags=-fno-asynchronous-unwind-tables +} + if {[prepare_for_testing_full "failed to prepare" \ - [list ${testfile} debug \ - $srcfile {debug} $srcfile2 {nodebug}]]} { + [list ${testfile} $debug_flags \ + $srcfile $debug_flags $srcfile2 $nodebug_flags]]} { return -1 }