[gdb/testsuite] Fix gdb.base/jit-reader-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)
With test-case gdb.base/jit-reader-exec.exp and target board
remote-gdbserver-on-localhost (using REMOTE_TARGET_USERNAME) we run into some
failures.

Fix this by adding the missing gdb_remote_download.

Tested on x86_64-linux.

Co-Authored-by: Ivan Tetyushkin <ivan.tetyushkin@syntacore.com>
gdb/testsuite/gdb.base/jit-reader-exec.exp

index c5ee8ef89a38079bee40af046782b5df632bc7bb..ad47c5a96103de4b657a31d7a1d2a10f032b2c90 100644 (file)
@@ -27,15 +27,19 @@ set testfile2 "jit-reader-execd"
 set srcfile2 ${testfile2}.c
 set binfile2 [standard_output_file ${testfile2}]
 
-set compile_options [list debug additional_flags=-DPROGRAM=\"$binfile2\"]
-
-if {[gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" \
-        executable $compile_options] != ""} {
+if {[gdb_compile "${srcdir}/${subdir}/${srcfile2}" "${binfile2}" \
+        executable {debug}] != ""} {
     untested "failed to compile"
     return -1
 }
 
-if {[gdb_compile "${srcdir}/${subdir}/${srcfile2}" "${binfile2}" \
+if { [is_remote target] } {
+    set binfile2 [gdb_remote_download target $binfile2]
+}
+
+set compile_options [list debug additional_flags=-DPROGRAM=\"$binfile2\"]
+
+if {[gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" \
         executable $compile_options] != ""} {
     untested "failed to compile"
     return -1