[5/7,gdb/testsuite] fix test gdb.base/infcall-exec.exp for remote execution

Message ID 20221025162946.727169-6-ivan.tetyushkin@syntacore.com
State New
Headers
Series introduce get_runtime_path |

Commit Message

Ivan Tetyushkin Oct. 25, 2022, 4:29 p.m. UTC
  ---
 gdb/testsuite/gdb.base/infcall-exec.exp | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
  

Patch

diff --git a/gdb/testsuite/gdb.base/infcall-exec.exp b/gdb/testsuite/gdb.base/infcall-exec.exp
index e8f6a218c36..514dc70a4d9 100644
--- a/gdb/testsuite/gdb.base/infcall-exec.exp
+++ b/gdb/testsuite/gdb.base/infcall-exec.exp
@@ -21,6 +21,7 @@  standard_testfile
 set testfile2 "infcall-exec2"
 set srcfile2 "${testfile2}.c"
 set binfile2 [standard_output_file $testfile2]
+set runtimebinfile2 [get_runtime_file $binfile2]
 
 # Build the two executables for the test.
 if {[gdb_compile $srcdir/$subdir/$srcfile $binfile executable debug] != ""} {
@@ -33,15 +34,17 @@  if {[gdb_compile $srcdir/$subdir/$srcfile2 $binfile2 executable debug] != ""} {
 }
 
 clean_restart $binfile
+gdb_remote_download target $binfile
+gdb_remote_download target $binfile2
 
 if {![runto_main]} {
     return -1
 }
 
-set expected_result "process $decimal is executing new program: $binfile2"
+set expected_result "process $decimal is executing new program: $runtimebinfile2"
 append expected_result "\[\r\n\]+.*"
 append expected_result "Breakpoint 1, main .*at .*$srcfile2:$decimal"
 append expected_result ".*"
 
-gdb_test "call (int) execlp \(\"$binfile2\", \"$binfile2\", \(char \*\)0\)" \
+gdb_test "call (int) execlp \(\"$runtimebinfile2\", \"$runtimebinfile2\", \(char \*\)0\)" \
     $expected_result "call execlp"