[gdb/testsuite] Fix gdb.base/foll-exec.exp for remote target
authorTom de Vries <tdevries@suse.de>
Tue, 15 Nov 2022 14:24:54 +0000 (15:24 +0100)
committerTom de Vries <tdevries@suse.de>
Tue, 15 Nov 2022 14:24:54 +0000 (15:24 +0100)
When running test-case gdb.base/foll-exec.exp with target board
remote-gdbserver-on-localhost.exp, I run into:
...
(gdb) PASS: gdb.base/foll-exec.exp: insert first exec catchpoint
continue^M
Continuing.^M
[Inferior 1 (process 4476) exited normally]^M
(gdb) FAIL: gdb.base/foll-exec.exp: continue to first exec catchpoint (the program e\
xited)
...

The problem is that the foll-exec executable expects the exec-ed executable
execd-prog alongside it, but it's missing.

Fix this by adding the missing gdb_remote_download.

Likewise in a few other test-cases.

Tested on x86_64-linux.

gdb/testsuite/gdb.base/exec-invalid-sysroot.exp
gdb/testsuite/gdb.base/foll-exec.exp
gdb/testsuite/gdb.base/foll-vfork.exp

index cacd5a092a2afa272adeb9e327178601ac38eb0d..7f7599cbf86d07452fa2c000efcdd48866dfbe77 100644 (file)
@@ -33,6 +33,10 @@ if  { [gdb_compile "${srcdir}/${subdir}/${srcfile2}" "${binfile2}" executable $c
     return -1
 }
 
+if { [is_remote target] } {
+    gdb_remote_download target $binfile2
+}
+
 if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable $compile_options] != "" } {
     untested "failed to compile main testcase"
     return -1
index 8cddfa52c3b36fc6d4eaa752aea2e4abd9b6f95a..a3d1a8781e9ea831c29af1c89b6f44f4d9beb9f6 100644 (file)
@@ -36,6 +36,10 @@ if  { [gdb_compile "${srcdir}/${subdir}/${srcfile2}" "${binfile2}" executable $c
      return -1
 }
 
+if { [is_remote target] } {
+    gdb_remote_download target $binfile2
+}
+
 if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable $compile_options] != "" } {
      untested "failed to compile"
      return -1
index e4f757286008869ae9abc15397c5e5633b643359..9627a177896c39fb5f79e0d149886c8cfc9a2cd1 100644 (file)
@@ -42,6 +42,10 @@ if {[build_executable $testfile.exp $testfile2 $srcfile2 $compile_options] == -1
     return -1
 }
 
+if { [is_remote target] } {
+    gdb_remote_download target [standard_output_file $testfile2]
+}
+
 # A few of these tests require a little more time than the standard
 # timeout allows.
 set oldtimeout $timeout