public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [pushed 0/5] [gdb/testsuite] Fix remote host issues in gdb.arch tests
@ 2023-03-15 15:38 Tom de Vries
  2023-03-15 15:38 ` [pushed 1/5] [gdb/testsuite] Fix gdb.arch/amd64*.exp with local-remote-host-native.exp Tom de Vries
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Tom de Vries @ 2023-03-15 15:38 UTC (permalink / raw)
  To: gdb-patches

I ran the gdb.arch test-cases on x86_64-linux with various
host/target boards from gdb/testsuite/boards and fixed issues, most of which
had to do with remote host testing.

Results after the fixes:
...
$ ./test-all.sh
 HOST/TARGET: local
 # of expected failures          2
 # of expected passes            913
 # of unsupported tests          118
 HOST: local, TARGET: native-gdbserver
 # of expected failures          1
 # of expected passes            926
 # of unsupported tests          117
 HOST: local, TARGET: native-extended-gdbserver
 # of expected failures          1
 # of expected passes            926
 # of unsupported tests          117
 HOST: local, TARGET: native-stdio-gdbserver
 # of expected failures          1
 # of expected passes            926
 # of unsupported tests          117
 HOST: local, TARGET: remote-gdbserver-on-localhost
 # of expected failures          1
 # of expected passes            780
 # of unsupported tests          119
 HOST: local, TARGET: remote-stdio-gdbserver
 # of expected failures          1
 # of expected passes            927
 # of unsupported tests          117
 HOST: local, TARGET: remote-stdio-gdbserver-remotedir
 # of expected failures          1
 # of expected passes            927
 # of unsupported tests          117
 HOST: local-remote-host-notty, TARGET: native-gdbserver
 FAIL: gdb.arch/ftrace-insn-reloc.exp: IPA loaded
 # of expected failures          1
 # of expected passes            777
 # of unexpected failures        1
 # of unsupported tests          119
 # of untested testcases         1
 HOST: local-remote-host-notty, TARGET: native-extended-gdbserver
 FAIL: gdb.arch/ftrace-insn-reloc.exp: IPA loaded
 # of expected failures          1
 # of expected passes            777
 # of unexpected failures        1
 # of unsupported tests          119
 # of untested testcases         1
 HOST: local-remote-host-notty, TARGET: native-stdio-gdbserver
 FAIL: gdb.arch/ftrace-insn-reloc.exp: IPA loaded
 # of expected failures          1
 # of expected passes            777
 # of unexpected failures        1
 # of unsupported tests          119
 # of untested testcases         1
 HOST: local-remote-host-notty, TARGET: remote-gdbserver-on-localhost
 # of expected failures          1
 # of expected passes            711
 # of unsupported tests          120
 HOST: local-remote-host-notty, TARGET: remote-stdio-gdbserver
 # of expected failures          1
 # of expected passes            788
 # of unsupported tests          119
 HOST: local-remote-host-notty, TARGET: remote-stdio-gdbserver-remotedir
 FAIL: gdb.arch/ftrace-insn-reloc.exp: IPA loaded
 # of expected failures          1
 # of expected passes            778
 # of unexpected failures        1
 # of unsupported tests          119
 # of untested testcases         1
 HOST: local-remote-host, TARGET: native-gdbserver
 FAIL: gdb.arch/ftrace-insn-reloc.exp: IPA loaded
 # of expected failures          1
 # of expected passes            777
 # of unexpected failures        1
 # of unsupported tests          119
 # of untested testcases         1
 HOST: local-remote-host, TARGET: native-extended-gdbserver
 FAIL: gdb.arch/ftrace-insn-reloc.exp: IPA loaded
 # of expected failures          1
 # of expected passes            777
 # of unexpected failures        1
 # of unsupported tests          119
 # of untested testcases         1
 HOST: local-remote-host, TARGET: native-stdio-gdbserver
 FAIL: gdb.arch/ftrace-insn-reloc.exp: IPA loaded
 # of expected failures          1
 # of expected passes            777
 # of unexpected failures        1
 # of unsupported tests          119
 # of untested testcases         1
 HOST: local-remote-host, TARGET: remote-gdbserver-on-localhost
 # of expected failures          1
 # of expected passes            711
 # of unsupported tests          120
 HOST: local-remote-host, TARGET: remote-stdio-gdbserver
 # of expected failures          1
 # of expected passes            788
 # of unsupported tests          119
 HOST: local-remote-host, TARGET: remote-stdio-gdbserver-remotedir
 FAIL: gdb.arch/ftrace-insn-reloc.exp: IPA loaded
 # of expected failures          1
 # of expected passes            778
 # of unexpected failures        1
 # of unsupported tests          119
 # of untested testcases         1
 HOST/TARGET: local-remote-host-native
 # of expected failures          2
 # of expected passes            776
 # of unsupported tests          120
...

The remaining failure is in test-case gdb.arch/ftrace-insn-reloc.exp, due to
RUNPATH not being set to $ORIGIN due to quoting issues, this WIP patch fixes
that:
...
@@ -4864,7 +4864,11 @@ proc gdb_compile {source dest type options} {
 	    if { $shlib_load } {
 		lappend new_options "libs=-ldl"
 	    }
-	    lappend new_options "ldflags=-Wl,-rpath,\\\$ORIGIN"
+	    if { [is_remote host] } {
+		lappend new_options "ldflags=-Wl,-rpath,\\\\\$ORIGIN"
+	    } else {
+		lappend new_options "ldflags=-Wl,-rpath,\\\$ORIGIN"
+	    }
 	}
     }
     set options $new_options
...

Tested on x86_64-linux.

Tom de Vries (5):
  [gdb/testsuite] Fix gdb.arch/amd64*.exp with
    local-remote-host-native.exp
  [gdb/testsuite] Unset DEBUGINFOD_URLS on remote host
  [gdb/testsuite] Fix gdb.arch/i386-pkru.exp for native-gdbserver
  [gdb/testsuite] Fix gdb.arch/amd64-stap-special-operands.exp for
    remote host
  [gdb/testsuite] Fix re-used exec in gdb.arch/ftrace-insn-reloc.exp

 .../gdb.arch/amd64-entry-value-inline.exp     | 12 +++++++----
 .../amd64-entry-value-param-dwarf5.exp        | 10 +++++++---
 .../gdb.arch/amd64-entry-value-param.exp      | 10 +++++++---
 .../gdb.arch/amd64-entry-value-paramref.exp   |  8 ++++++--
 .../gdb.arch/amd64-stap-special-operands.exp  |  5 +++--
 gdb/testsuite/gdb.arch/amd64-tailcall-ret.exp |  9 +++++++--
 gdb/testsuite/gdb.arch/ftrace-insn-reloc.exp  |  6 ++----
 gdb/testsuite/gdb.arch/i386-pkru.exp          | 15 +++++++++++---
 gdb/testsuite/lib/gdb.exp                     | 20 ++++++++++++++++++-
 9 files changed, 71 insertions(+), 24 deletions(-)


base-commit: 2d5783fad77c2cb9cdcb396d65fe0a60e3d8938b
-- 
2.35.3


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [pushed 1/5] [gdb/testsuite] Fix gdb.arch/amd64*.exp with local-remote-host-native.exp
  2023-03-15 15:38 [pushed 0/5] [gdb/testsuite] Fix remote host issues in gdb.arch tests Tom de Vries
@ 2023-03-15 15:38 ` Tom de Vries
  2023-03-15 15:38 ` [pushed 2/5] [gdb/testsuite] Unset DEBUGINFOD_URLS on remote host Tom de Vries
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Tom de Vries @ 2023-03-15 15:38 UTC (permalink / raw)
  To: 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 <http://www.gnu.org/licenses/>.
 
 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]+: <optimized out>\) 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 <http://www.gnu.org/licenses/>.
 
 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
 }
-- 
2.35.3


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [pushed 2/5] [gdb/testsuite] Unset DEBUGINFOD_URLS on remote host
  2023-03-15 15:38 [pushed 0/5] [gdb/testsuite] Fix remote host issues in gdb.arch tests Tom de Vries
  2023-03-15 15:38 ` [pushed 1/5] [gdb/testsuite] Fix gdb.arch/amd64*.exp with local-remote-host-native.exp Tom de Vries
@ 2023-03-15 15:38 ` Tom de Vries
  2023-03-15 15:38 ` [pushed 3/5] [gdb/testsuite] Fix gdb.arch/i386-pkru.exp for native-gdbserver Tom de Vries
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Tom de Vries @ 2023-03-15 15:38 UTC (permalink / raw)
  To: 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
  <https://debuginfod.opensuse.org/>^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
-- 
2.35.3


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [pushed 3/5] [gdb/testsuite] Fix gdb.arch/i386-pkru.exp for native-gdbserver
  2023-03-15 15:38 [pushed 0/5] [gdb/testsuite] Fix remote host issues in gdb.arch tests Tom de Vries
  2023-03-15 15:38 ` [pushed 1/5] [gdb/testsuite] Fix gdb.arch/amd64*.exp with local-remote-host-native.exp Tom de Vries
  2023-03-15 15:38 ` [pushed 2/5] [gdb/testsuite] Unset DEBUGINFOD_URLS on remote host Tom de Vries
@ 2023-03-15 15:38 ` Tom de Vries
  2023-03-15 15:38 ` [pushed 4/5] [gdb/testsuite] Fix gdb.arch/amd64-stap-special-operands.exp for remote host Tom de Vries
  2023-03-15 15:38 ` [pushed 5/5] [gdb/testsuite] Fix re-used exec in gdb.arch/ftrace-insn-reloc.exp Tom de Vries
  4 siblings, 0 replies; 6+ messages in thread
From: Tom de Vries @ 2023-03-15 15:38 UTC (permalink / raw)
  To: 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
+	}
+    }
+}
-- 
2.35.3


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [pushed 4/5] [gdb/testsuite] Fix gdb.arch/amd64-stap-special-operands.exp for remote host
  2023-03-15 15:38 [pushed 0/5] [gdb/testsuite] Fix remote host issues in gdb.arch tests Tom de Vries
                   ` (2 preceding siblings ...)
  2023-03-15 15:38 ` [pushed 3/5] [gdb/testsuite] Fix gdb.arch/i386-pkru.exp for native-gdbserver Tom de Vries
@ 2023-03-15 15:38 ` Tom de Vries
  2023-03-15 15:38 ` [pushed 5/5] [gdb/testsuite] Fix re-used exec in gdb.arch/ftrace-insn-reloc.exp Tom de Vries
  4 siblings, 0 replies; 6+ messages in thread
From: Tom de Vries @ 2023-03-15 15:38 UTC (permalink / raw)
  To: 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=`<any>', provider=`<any>', 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
 }
 
-- 
2.35.3


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [pushed 5/5] [gdb/testsuite] Fix re-used exec in gdb.arch/ftrace-insn-reloc.exp
  2023-03-15 15:38 [pushed 0/5] [gdb/testsuite] Fix remote host issues in gdb.arch tests Tom de Vries
                   ` (3 preceding siblings ...)
  2023-03-15 15:38 ` [pushed 4/5] [gdb/testsuite] Fix gdb.arch/amd64-stap-special-operands.exp for remote host Tom de Vries
@ 2023-03-15 15:38 ` Tom de Vries
  4 siblings, 0 replies; 6+ messages in thread
From: Tom de Vries @ 2023-03-15 15:38 UTC (permalink / raw)
  To: 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
-- 
2.35.3


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-03-15 15:38 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-15 15:38 [pushed 0/5] [gdb/testsuite] Fix remote host issues in gdb.arch tests Tom de Vries
2023-03-15 15:38 ` [pushed 1/5] [gdb/testsuite] Fix gdb.arch/amd64*.exp with local-remote-host-native.exp Tom de Vries
2023-03-15 15:38 ` [pushed 2/5] [gdb/testsuite] Unset DEBUGINFOD_URLS on remote host Tom de Vries
2023-03-15 15:38 ` [pushed 3/5] [gdb/testsuite] Fix gdb.arch/i386-pkru.exp for native-gdbserver Tom de Vries
2023-03-15 15:38 ` [pushed 4/5] [gdb/testsuite] Fix gdb.arch/amd64-stap-special-operands.exp for remote host Tom de Vries
2023-03-15 15:38 ` [pushed 5/5] [gdb/testsuite] Fix re-used exec in gdb.arch/ftrace-insn-reloc.exp Tom de Vries

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).