From patchwork Wed Mar 15 15:38:33 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: 66418 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 8AA4F385087B for ; Wed, 15 Mar 2023 15:39:22 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8AA4F385087B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1678894762; bh=568n4RHv0vEA0Va0ZZhx2192T01FsrgMaYJXVrUyVMw=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=osesZmYq6eSyhpq5YgX/XYFoXP1QAmsDk3mCLbBGh9WiXHWwWx6fySB4QsxUf8UGI sYMVvbl/jwklW0pvXpyaPyrcjlqj17/DZ+8HSYbmzkPvrzDZvNhHLen3tbFbTa/OVu vByVk1FoTcHP8V+BR0398JRQLGQRDgiLCaZ5srpY= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) by sourceware.org (Postfix) with ESMTPS id 7592B3858C78 for ; Wed, 15 Mar 2023 15:38:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7592B3858C78 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 5C4531FD7C for ; Wed, 15 Mar 2023 15:38:38 +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 4B3C113A2F for ; Wed, 15 Mar 2023 15:38:38 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id iAlsEX7mEWS9bwAAMHmgww (envelope-from ) for ; Wed, 15 Mar 2023 15:38:38 +0000 To: gdb-patches@sourceware.org Subject: [pushed 1/5] [gdb/testsuite] Fix gdb.arch/amd64*.exp with local-remote-host-native.exp Date: Wed, 15 Mar 2023 16:38:33 +0100 Message-Id: <20230315153837.21440-2-tdevries@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20230315153837.21440-1-tdevries@suse.de> References: <20230315153837.21440-1-tdevries@suse.de> MIME-Version: 1.0 X-Spam-Status: No, score=-12.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, 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" There's a number of gdb.arch/amd64*.exp test-cases that fail with host+target board local-remote-host-native.exp because of using a .S file, generated from a .c file. If a test-case compiles the .S file when executing on remote host, the .S file is already copied from build to host, such that it's available for the compiler. But that's not the case for the .c file, which is needed by gdb to show a source line: ... (gdb) continue^M Continuing.^M ^M Breakpoint 2, fn2 (y=y@entry=25, x=x@entry=6) at amd64-entry-value-inline.c:32^M 32 in gdb.arch/amd64-entry-value-inline.c^M (gdb) FAIL: gdb.arch/amd64-entry-value-inline.exp: continue to breakpoint: \ break-here ... Fix this by using "gdb_remote_download host <.c file>". Tested on x86_64-linux, with host+target board local-remote-host-native. --- gdb/testsuite/gdb.arch/amd64-entry-value-inline.exp | 12 ++++++++---- .../gdb.arch/amd64-entry-value-param-dwarf5.exp | 10 +++++++--- gdb/testsuite/gdb.arch/amd64-entry-value-param.exp | 10 +++++++--- .../gdb.arch/amd64-entry-value-paramref.exp | 8 ++++++-- gdb/testsuite/gdb.arch/amd64-tailcall-ret.exp | 9 +++++++-- 5 files changed, 35 insertions(+), 14 deletions(-) diff --git a/gdb/testsuite/gdb.arch/amd64-entry-value-inline.exp b/gdb/testsuite/gdb.arch/amd64-entry-value-inline.exp index 774b90bcdb0..d9920146fa4 100644 --- a/gdb/testsuite/gdb.arch/amd64-entry-value-inline.exp +++ b/gdb/testsuite/gdb.arch/amd64-entry-value-inline.exp @@ -14,16 +14,21 @@ # along with this program. If not, see . set opts {} -standard_testfile .S +standard_testfile .S .c if [info exists COMPILE] { # make check RUNTESTFLAGS="gdb.arch/amd64-entry-value-inline.exp COMPILE=1" - standard_testfile + standard_testfile .c .c lappend opts debug optimize=-O2 } else { require is_x86_64_m64_target } +# Make .c available on the host. +if [is_remote host] { + gdb_remote_download host $srcdir/$subdir/$srcfile2 +} + if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} $opts] } { return -1 } @@ -32,8 +37,7 @@ if ![runto_main] { return -1 } -set srcfile $testfile.c -gdb_breakpoint [gdb_get_line_number "break-here"] +gdb_breakpoint [gdb_get_line_number "break-here" $srcfile2] gdb_continue_to_breakpoint "break-here" ".* break-here .*" gdb_test "p y" " = 25" diff --git a/gdb/testsuite/gdb.arch/amd64-entry-value-param-dwarf5.exp b/gdb/testsuite/gdb.arch/amd64-entry-value-param-dwarf5.exp index f6d11b26cc7..17a92bdcbf5 100644 --- a/gdb/testsuite/gdb.arch/amd64-entry-value-param-dwarf5.exp +++ b/gdb/testsuite/gdb.arch/amd64-entry-value-param-dwarf5.exp @@ -18,12 +18,17 @@ set opts {} if [info exists COMPILE] { # make check RUNTESTFLAGS="gdb.arch/amd64-entry-value-param-dwarf5.exp COMPILE=1" - set srcfile ${srcfile2} + standard_testfile .c .c lappend opts optimize=-O2 additional_flags=-gdwarf-5 } else { require is_x86_64_m64_target } +# Make .c available on the host. +if [is_remote host] { + gdb_remote_download host $srcdir/$subdir/$srcfile2 +} + if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} $opts] } { return -1 } @@ -32,8 +37,7 @@ if ![runto_main] { return -1 } -set srcfile $srcfile2 -gdb_breakpoint [gdb_get_line_number "break-here"] +gdb_breakpoint [gdb_get_line_number "break-here" $srcfile2] with_test_prefix "call 1" { gdb_continue_to_breakpoint "break-here" ".* break-here .*" diff --git a/gdb/testsuite/gdb.arch/amd64-entry-value-param.exp b/gdb/testsuite/gdb.arch/amd64-entry-value-param.exp index da1445f51c2..504c534d654 100644 --- a/gdb/testsuite/gdb.arch/amd64-entry-value-param.exp +++ b/gdb/testsuite/gdb.arch/amd64-entry-value-param.exp @@ -18,12 +18,17 @@ set opts {} if [info exists COMPILE] { # make check RUNTESTFLAGS="gdb.arch/amd64-entry-value-param.exp COMPILE=1" - set srcfile ${srcfile2} + standard_testfile .c .c lappend opts debug optimize=-O2 } else { require is_x86_64_m64_target } +# Make .c available on the host. +if [is_remote host] { + remote_download host $srcdir/$subdir/$srcfile2 +} + if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} $opts] } { return -1 } @@ -32,8 +37,7 @@ if ![runto_main] { return -1 } -set srcfile $srcfile2 -gdb_breakpoint [gdb_get_line_number "break-here"] +gdb_breakpoint [gdb_get_line_number "break-here" $srcfile2] with_test_prefix "call 1" { gdb_continue_to_breakpoint "break-here" ".* break-here .*" diff --git a/gdb/testsuite/gdb.arch/amd64-entry-value-paramref.exp b/gdb/testsuite/gdb.arch/amd64-entry-value-paramref.exp index ff3e0242e9a..4b4f507dd82 100644 --- a/gdb/testsuite/gdb.arch/amd64-entry-value-paramref.exp +++ b/gdb/testsuite/gdb.arch/amd64-entry-value-paramref.exp @@ -17,6 +17,11 @@ standard_testfile .S .cc require is_x86_64_m64_target +# Make .cc available on the host. +if [is_remote host] { + gdb_remote_download host $srcdir/$subdir/$srcfile2 +} + if { [prepare_for_testing_full "failed to prepare" \ [list $testfile "c++" $srcfile {}]] } { return -1 @@ -26,8 +31,7 @@ if ![runto_main] { return -1 } -set srcfile $srcfile2 -gdb_breakpoint [gdb_get_line_number "break-here"] +gdb_breakpoint [gdb_get_line_number "break-here" $srcfile2] gdb_continue_to_breakpoint "break-here" ".* break-here .*" gdb_test "frame" {bar \(ref=@0x[0-9a-f]+: 10, ref@entry=@0x[0-9a-f]+: \) at .*} diff --git a/gdb/testsuite/gdb.arch/amd64-tailcall-ret.exp b/gdb/testsuite/gdb.arch/amd64-tailcall-ret.exp index 1602aff5dc5..5ba435e5e72 100644 --- a/gdb/testsuite/gdb.arch/amd64-tailcall-ret.exp +++ b/gdb/testsuite/gdb.arch/amd64-tailcall-ret.exp @@ -14,16 +14,21 @@ # along with this program. If not, see . set opts {} -standard_testfile .S +standard_testfile .S .c if [info exists COMPILE] { # make check RUNTESTFLAGS="gdb.arch/amd64-tailcall-ret.exp COMPILE=1" - standard_testfile + standard_testfile .c .c lappend opts debug optimize=-O2 } else { require is_x86_64_m64_target } +# Make .c available on the host. +if [is_remote host] { + gdb_remote_download host $srcdir/$subdir/$srcfile2 +} + if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} $opts] } { return -1 } From patchwork Wed Mar 15 15:38:34 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: 66417 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 419903858C1F for ; Wed, 15 Mar 2023 15:39:14 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 419903858C1F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1678894754; bh=ZLyzjrLVHGY8XY13H4B7ilTIiyzvLDF7oQh7IIAs7YA=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=qgllUq9455ZspnaQyTvxAbruI1Gf9v8fXde0xL4VgPrCzh1JxjbVIeHXA1CkfwG5f kQervqwSLnAjrNLhNiHbE3fNGAXU3bH3Xcm9Lx4p0UTkOuArMnynyooxSH803a1Zqs 5ah8ceRkUT69USFwqtLmhGH/PBCHpG/sIdfzjCGY= 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 72EA73858C5F for ; Wed, 15 Mar 2023 15:38:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 72EA73858C5F 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 71ADF1FD84 for ; Wed, 15 Mar 2023 15:38:38 +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 60E1713A2F for ; Wed, 15 Mar 2023 15:38:38 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id wNe1Fn7mEWS9bwAAMHmgww (envelope-from ) for ; Wed, 15 Mar 2023 15:38:38 +0000 To: gdb-patches@sourceware.org Subject: [pushed 2/5] [gdb/testsuite] Unset DEBUGINFOD_URLS on remote host Date: Wed, 15 Mar 2023 16:38:34 +0100 Message-Id: <20230315153837.21440-3-tdevries@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20230315153837.21440-1-tdevries@suse.de> References: <20230315153837.21440-1-tdevries@suse.de> MIME-Version: 1.0 X-Spam-Status: No, score=-12.5 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" When running test-case gdb.arch/i386-pkru.exp with host board local-remote-host-notty and target board native-gdbserver on openSUSE Tumbleweed (with DEBUGINFOD_URLS set), I run into: ... This GDB supports auto-downloading debuginfo from the following URLs:^M ^M Enable debuginfod for this session? (y or [n]) ^CQuit^M (gdb) FAIL: gdb.arch/i386-pkru.exp: runto: run to main ... The problem is that the unsetenv for DEBUGINFOD_URLS in default_gdb_init: ... # If DEBUGINFOD_URLS is set, gdb will try to download sources and # debug info for f.i. system libraries. Prevent this. unset -nocomplain ::env(DEBUGINFOD_URLS) ... doesn't work on remote host. Fix this by using "set debuginfod enabled off" for remote host. Tested on x86_64-linux. --- gdb/testsuite/lib/gdb.exp | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index 23277c4ab79..8b3a594e6a4 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -219,6 +219,17 @@ if ![info exists INTERNAL_GDBFLAGS] { {-iex "set height 0"} \ {-iex "set width 0"}]] + # If DEBUGINFOD_URLS is set, gdb will try to download sources and + # debug info for f.i. system libraries. Prevent this. + if { [is_remote host] } { + # Setting environment variables on build has no effect on remote host, + # so handle this using "set debuginfod enabled off" instead. + set INTERNAL_GDBFLAGS \ + "$INTERNAL_GDBFLAGS -iex \"set debuginfod enabled off\"" + } else { + # See default_gdb_init. + } + set INTERNAL_GDBFLAGS [append_gdb_data_directory_option $INTERNAL_GDBFLAGS] } @@ -6173,7 +6184,14 @@ proc default_gdb_init { test_file_name } { # If DEBUGINFOD_URLS is set, gdb will try to download sources and # debug info for f.i. system libraries. Prevent this. - unset -nocomplain ::env(DEBUGINFOD_URLS) + if { [is_remote host] } { + # See initialization of INTERNAL_GDBFLAGS. + } else { + # Using "set debuginfod enabled off" in INTERNAL_GDBFLAGS interferes + # with the gdb.debuginfod test-cases, so use the unsetenv method for + # non-remote host. + unset -nocomplain ::env(DEBUGINFOD_URLS) + } # Ensure that GDBHISTFILE and GDBHISTSIZE are removed from the # environment, we don't want these modifications to the history From patchwork Wed Mar 15 15:38:35 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: 66415 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 6C8F93854837 for ; Wed, 15 Mar 2023 15:39:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6C8F93854837 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1678894743; bh=JHp/ABLKHtL5E8hN9YfgFTDRgWekarOX9gzYpju4Ars=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=o7AI7nMNZy0j+1cDbbCVK5EFufADHHAJj0I0UOCEQgtsRe09UTxtrq5h9aSFbsyXp eICEjO/NYTZ7BZyKtarwecrmtH8s7QjHIQwQu2Bt9hXGi6Oze+BMlyzL2IIP5kLvrt B2Dq54yPSUN6p0qxIal7slyJ4ylLHtnCYcJ0A05w= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by sourceware.org (Postfix) with ESMTPS id A76883858D39 for ; Wed, 15 Mar 2023 15:38:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A76883858D39 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-out1.suse.de (Postfix) with ESMTPS id 8882C219CF for ; Wed, 15 Mar 2023 15:38:38 +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 76AD213A2F for ; Wed, 15 Mar 2023 15:38:38 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 0NbxG37mEWS9bwAAMHmgww (envelope-from ) for ; Wed, 15 Mar 2023 15:38:38 +0000 To: gdb-patches@sourceware.org Subject: [pushed 3/5] [gdb/testsuite] Fix gdb.arch/i386-pkru.exp for native-gdbserver Date: Wed, 15 Mar 2023 16:38:35 +0100 Message-Id: <20230315153837.21440-4-tdevries@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20230315153837.21440-1-tdevries@suse.de> References: <20230315153837.21440-1-tdevries@suse.de> MIME-Version: 1.0 X-Spam-Status: No, score=-12.4 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" With test-case gdb.arch/i386-pkru.exp and target board native-gdbserver we run into: ... FAIL: gdb.arch/i386-pkru.exp: variable after reading pkru ... This looks similar to the the problem for which there's already an xfail, so fix this by extending the xfail matching. Tested on x86_64-linux. Also tested on openSUSE Tumbleweed, where all tests in the test-case pass. --- gdb/testsuite/gdb.arch/i386-pkru.exp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/gdb/testsuite/gdb.arch/i386-pkru.exp b/gdb/testsuite/gdb.arch/i386-pkru.exp index 1f047df68ef..223a8aa95f0 100644 --- a/gdb/testsuite/gdb.arch/i386-pkru.exp +++ b/gdb/testsuite/gdb.arch/i386-pkru.exp @@ -80,7 +80,6 @@ gdb_test "info register pkru" ".*pkru.*$val1.*" "read pkru register" set val2 0x44444444 gdb_test "print /x \$pkru = $val2" "= $val2" "set pkru value" -set xval $val2 gdb_test_multiple "info register pkru" "read value after setting value" { -re -wrap ".*pkru.*$val2.*" { pass $gdb_test_name @@ -91,11 +90,21 @@ gdb_test_multiple "info register pkru" "read value after setting value" { } else { fail $gdb_test_name } - set xval $val1 } } gdb_breakpoint [ gdb_get_line_number "break here 2" ] gdb_continue_to_breakpoint "break here 2" ".*break here 2.*" -gdb_test "print /x rd_value" "= $xval" "variable after reading pkru" +gdb_test_multiple "print /x rd_value" "variable after reading pkru" { + -re -wrap "= $val2" { + pass $gdb_test_name + } + -re -wrap "= $val1" { + if { $have_xfail } { + xfail $gdb_test_name + } else { + fail $gdb_test_name + } + } +} From patchwork Wed Mar 15 15:38:36 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: 66416 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 3F0873851C20 for ; Wed, 15 Mar 2023 15:39:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3F0873851C20 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1678894744; bh=7zMRI/89ixZiCP6XqivwhpiqdqStWtSRI0nlaBXMcl8=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=wosltXZPSWhCg4sVKAAZCnlDK65HWYaX69s8P01VaQ81kxKAS62Me8wCoK3c0xuvV jLtF0Z6BkfxiukwJXYJM60IDU+fpIUcA4cF5cEc9jKvVbBoHtwjLdDv0LQqBN3eESV HMwJbbhjRQr4bs/cmGeguJge+drsmvnHe1w9j4p0= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by sourceware.org (Postfix) with ESMTPS id 3AFDE3858C83 for ; Wed, 15 Mar 2023 15:38:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3AFDE3858C83 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-out1.suse.de (Postfix) with ESMTPS id 9F1DD219D0 for ; Wed, 15 Mar 2023 15:38:38 +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 8D8D813A2F for ; Wed, 15 Mar 2023 15:38:38 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id aGGXIX7mEWS9bwAAMHmgww (envelope-from ) for ; Wed, 15 Mar 2023 15:38:38 +0000 To: gdb-patches@sourceware.org Subject: [pushed 4/5] [gdb/testsuite] Fix gdb.arch/amd64-stap-special-operands.exp for remote host Date: Wed, 15 Mar 2023 16:38:36 +0100 Message-Id: <20230315153837.21440-5-tdevries@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20230315153837.21440-1-tdevries@suse.de> References: <20230315153837.21440-1-tdevries@suse.de> MIME-Version: 1.0 X-Spam-Status: No, score=-12.4 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" With test-case gdb.arch/amd64-stap-special-operands.exp and host board local-remote-host-notty and target board native-gdbserver I run into: ... (gdb) break -pstap three_arg^M No probe matching objfile=`', provider=`', name=`three_arg'^M Make breakpoint pending on future shared library load? (y or [n]) n^M (gdb) FAIL: gdb.arch/amd64-stap-special-operands.exp: probe: three_arg: \ gdb_breakpoint: set breakpoint at -pstap three_arg ... due to compiling two executables with the same name, and when uploading the second one from host to build, we run into: ... Upload from 127.0.0.1 failed, \ $outputs/gdb.arch/amd64-stap-special-operands/amd64-stap-special-operands: \ Text file busy. ... Fix this by making the executable names unique. Tested on x86_64-linux. --- gdb/testsuite/gdb.arch/amd64-stap-special-operands.exp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gdb/testsuite/gdb.arch/amd64-stap-special-operands.exp b/gdb/testsuite/gdb.arch/amd64-stap-special-operands.exp index 147d0ff40b2..4773074ce3c 100644 --- a/gdb/testsuite/gdb.arch/amd64-stap-special-operands.exp +++ b/gdb/testsuite/gdb.arch/amd64-stap-special-operands.exp @@ -28,7 +28,7 @@ proc test_probe { probe_name } { standard_testfile amd64-stap-triplet.S -if { [prepare_for_testing "failed to prepare" $testfile $srcfile] } { +if { [prepare_for_testing "failed to prepare" $testfile-triplet $srcfile] } { return -1 } @@ -36,7 +36,8 @@ test_probe "triplet" standard_testfile amd64-stap-three-arg-disp.S -if { [prepare_for_testing "failed to prepare" $testfile $srcfile] } { +if { [prepare_for_testing "failed to prepare" $testfile-three-arg-displ \ + $srcfile] } { return -1 } From patchwork Wed Mar 15 15:38:37 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: 66419 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 501FE385084D for ; Wed, 15 Mar 2023 15:39:31 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 501FE385084D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1678894771; bh=UaHV0vvwMd+sQvOUFLcsHJUL37eApmWZmN6vBJhPaCM=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=n/1UnewvCKbZjv6LuC3Garw08ALaXTG1PNmEFjMTOyiClxSj5tCtj5Q5ssh4FtSjm m43wcf/j02BJOyZl/effx9MSQHmiXQ8ggcYaSRo+0/YY5JbOUmHMYib6bn/dD1MgVg zI5b/GXDpI9kPJXKrDfCXalcA4vhug+dVaaD05II= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by sourceware.org (Postfix) with ESMTPS id 523033858C66 for ; Wed, 15 Mar 2023 15:38:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 523033858C66 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-out1.suse.de (Postfix) with ESMTPS id B5E93219D1 for ; Wed, 15 Mar 2023 15:38:38 +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 A397D13A2F for ; Wed, 15 Mar 2023 15:38:38 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 4HHwJn7mEWS9bwAAMHmgww (envelope-from ) for ; Wed, 15 Mar 2023 15:38:38 +0000 To: gdb-patches@sourceware.org Subject: [pushed 5/5] [gdb/testsuite] Fix re-used exec in gdb.arch/ftrace-insn-reloc.exp Date: Wed, 15 Mar 2023 16:38:37 +0100 Message-Id: <20230315153837.21440-6-tdevries@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20230315153837.21440-1-tdevries@suse.de> References: <20230315153837.21440-1-tdevries@suse.de> MIME-Version: 1.0 X-Spam-Status: No, score=-12.5 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" In test-case gdb.arch/ftrace-insn-reloc.exp we generate two executables with the same name, which is confusing and known to cause trouble. Fix this by making the executable names unique. Tested on x86_64-linux. --- gdb/testsuite/gdb.arch/ftrace-insn-reloc.exp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/gdb/testsuite/gdb.arch/ftrace-insn-reloc.exp b/gdb/testsuite/gdb.arch/ftrace-insn-reloc.exp index a353f386ec0..a00c4dbe2ff 100644 --- a/gdb/testsuite/gdb.arch/ftrace-insn-reloc.exp +++ b/gdb/testsuite/gdb.arch/ftrace-insn-reloc.exp @@ -15,13 +15,11 @@ load_lib "trace-support.exp" standard_testfile insn-reloc.c -set executable $testfile -set expfile $testfile.exp # Some targets have leading underscores on assembly symbols. set additional_flags [gdb_target_symbol_prefix_flags] -if [prepare_for_testing "failed to prepare" $executable $srcfile \ +if [prepare_for_testing "failed to prepare" $testfile-no-ipa $srcfile \ [list debug $additional_flags]] { return -1 } @@ -47,7 +45,7 @@ if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \ untested "failed to compile" return -1 } -clean_restart ${executable} +clean_restart $testfile if ![runto_main] { return 0