From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2205) id 4A8B23858D32; Mon, 23 Jan 2023 10:54:46 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4A8B23858D32 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1674471286; bh=V+xnXIpFrkQAF11fF5Aupr6lYd/M5rz7iAFbl71TcAg=; h=From:To:Subject:Date:From; b=s4oMdqhQgAhy2Cfdzcv0m6/p2e6nyDR8/Tw97FoWCIQamzUKneUQLEj67xDXG2w0L UbCtBz8X5UHxY3bYz87NBYLtzfYltov3yy/SCY+I8IxpuAipR9INytWtPuywgM4ehD oO28FW43w3xEBQ/yx42spcupVr6i1zQSQ9KEKJeY= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Tom de Vries To: gdb-cvs@sourceware.org Subject: [binutils-gdb] [gdb/testsuite] Avoid using .eh_frame in gdb.base/unwind-on-each-insn.exp X-Act-Checkin: binutils-gdb X-Git-Author: Tom de Vries X-Git-Refname: refs/heads/master X-Git-Oldrev: b960c86c1e60ff9f8baf23bbc567f6d21344c370 X-Git-Newrev: eb015bf86b6c6764f8acfea01a25a63e9b492dc5 Message-Id: <20230123105446.4A8B23858D32@sourceware.org> Date: Mon, 23 Jan 2023 10:54:46 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3Deb015bf86b6c= 6764f8acfea01a25a63e9b492dc5 commit eb015bf86b6c6764f8acfea01a25a63e9b492dc5 Author: Tom de Vries Date: Mon Jan 23 11:54:43 2023 +0100 [gdb/testsuite] Avoid using .eh_frame in gdb.base/unwind-on-each-insn.e= xp =20 One purpose of the gdb.base/unwind-on-each-insn.exp test-case is to tes= t the architecture-specific unwinders on foo, so unwind-on-each-insn-foo.c is compiled with nodebug, to prevent the dwarf unwinders from taking effec= t. =20 For for instance gcc x86_64 though, -fasynchronous-unwind-tables is ena= bled by default, generating an .eh_frame section contribution which might enabl= e the dwarf unwinders and bypass the architecture-specific unwinders. =20 Currently, that happens to be not the case due to the current implement= ation of epilogue_unwind_valid, which assumes that in absence of debug info p= roving that the compiler is gcc >=3D 4.5.0, the .eh_frame contribution is inva= lid. =20 That may change though, see PR30028, in which case gdb.base/unwind-on-each-insn.exp stops being a regression test for comm= it 49d7cd733a7 ("Change calculation of frame_id by amd64 epilogue unwinder= "). =20 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. =20 Tested on x86_64-linux, target boards unix/{-m64,-m32}, using compilers gcc 7.5.0 and clang 13.0.1. Diff: --- gdb/testsuite/gdb.base/unwind-on-each-insn.exp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) 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 @@ =20 standard_testfile .c -foo.c =20 +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=3D-fno-asynchronous-unwind-tabl= es +} + 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 }