From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2205) id E00313858D39; Wed, 15 Mar 2023 15:38:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E00313858D39 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1678894688; bh=UVrKHScGQcHUCu8ZZBBdecHtCfTP8BveDoYDR5EBe9k=; h=From:To:Subject:Date:From; b=hqPMtJbPq4oFEu2MZGionCjFzEgxTjHmpFBceU9P1uS2Q94lajvSKiFQq8xctrCdP idED/nD6kOLm3kNyZXIfvEOhpninO5Vj1McDDgYMyeKgM4MexoK8hXzWtE0TiE1z3M 9UBnVrsowlg4r77Hzr94U97LbTYY/2sXU6O0phL8= 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] Fix gdb.arch/amd64*.exp with local-remote-host-native.exp X-Act-Checkin: binutils-gdb X-Git-Author: Tom de Vries X-Git-Refname: refs/heads/master X-Git-Oldrev: 2d5783fad77c2cb9cdcb396d65fe0a60e3d8938b X-Git-Newrev: 81a7a72f67a318be7e1a4755ee83bafb40dcead2 Message-Id: <20230315153808.E00313858D39@sourceware.org> Date: Wed, 15 Mar 2023 15:38:08 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D81a7a72f67a3= 18be7e1a4755ee83bafb40dcead2 commit 81a7a72f67a318be7e1a4755ee83bafb40dcead2 Author: Tom de Vries Date: Wed Mar 15 16:38:03 2023 +0100 [gdb/testsuite] Fix gdb.arch/amd64*.exp with local-remote-host-native.e= xp =20 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, generate= d from a .c file. =20 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 availa= ble for the compiler. =20 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=3Dy@entry=3D25, x=3Dx@entry=3D6) at amd64-entry-va= lue-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 breakpoi= nt: \ break-here ... =20 Fix this by using "gdb_remote_download host <.c file>". =20 Tested on x86_64-linux, with host+target board local-remote-host-native. Diff: --- gdb/testsuite/gdb.arch/amd64-entry-value-inline.exp | 12 ++++++++---- gdb/testsuite/gdb.arch/amd64-entry-value-param-dwarf5.exp | 10 +++++++--- gdb/testsuite/gdb.arch/amd64-entry-value-param.exp | 10 +++++++--- gdb/testsuite/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/test= suite/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 . =20 set opts {} -standard_testfile .S +standard_testfile .S .c =20 if [info exists COMPILE] { # make check RUNTESTFLAGS=3D"gdb.arch/amd64-entry-value-inline.exp COM= PILE=3D1" - standard_testfile + standard_testfile .c .c lappend opts debug optimize=3D-O2 } else { require is_x86_64_m64_target } =20 +# 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 } =20 -set srcfile $testfile.c -gdb_breakpoint [gdb_get_line_number "break-here"] +gdb_breakpoint [gdb_get_line_number "break-here" $srcfile2] =20 gdb_continue_to_breakpoint "break-here" ".* break-here .*" gdb_test "p y" " =3D 25" diff --git a/gdb/testsuite/gdb.arch/amd64-entry-value-param-dwarf5.exp b/gd= b/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 {} =20 if [info exists COMPILE] { # make check RUNTESTFLAGS=3D"gdb.arch/amd64-entry-value-param-dwarf5.e= xp COMPILE=3D1" - set srcfile ${srcfile2} + standard_testfile .c .c lappend opts optimize=3D-O2 additional_flags=3D-gdwarf-5 } else { require is_x86_64_m64_target } =20 +# 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 } =20 -set srcfile $srcfile2 -gdb_breakpoint [gdb_get_line_number "break-here"] +gdb_breakpoint [gdb_get_line_number "break-here" $srcfile2] =20 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/tests= uite/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 {} =20 if [info exists COMPILE] { # make check RUNTESTFLAGS=3D"gdb.arch/amd64-entry-value-param.exp COMP= ILE=3D1" - set srcfile ${srcfile2} + standard_testfile .c .c lappend opts debug optimize=3D-O2 } else { require is_x86_64_m64_target } =20 +# 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 } =20 -set srcfile $srcfile2 -gdb_breakpoint [gdb_get_line_number "break-here"] +gdb_breakpoint [gdb_get_line_number "break-here" $srcfile2] =20 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/te= stsuite/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 =20 require is_x86_64_m64_target =20 +# 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 } =20 -set srcfile $srcfile2 -gdb_breakpoint [gdb_get_line_number "break-here"] +gdb_breakpoint [gdb_get_line_number "break-here" $srcfile2] =20 gdb_continue_to_breakpoint "break-here" ".* break-here .*" gdb_test "frame" {bar \(ref=3D@0x[0-9a-f]+: 10, ref@entry=3D@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 . =20 set opts {} -standard_testfile .S +standard_testfile .S .c =20 if [info exists COMPILE] { # make check RUNTESTFLAGS=3D"gdb.arch/amd64-tailcall-ret.exp COMPILE= =3D1" - standard_testfile + standard_testfile .c .c lappend opts debug optimize=3D-O2 } else { require is_x86_64_m64_target } =20 +# 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 }