[pushed,3/3,gdb/testsuite] Fix gdb.cp/cp-relocate.exp for remote host

Message ID 20230322083819.14320-4-tdevries@suse.de
State Committed
Headers
Series Fix gdb.cp/*.exp for remote host/target |

Commit Message

Tom de Vries March 22, 2023, 8:38 a.m. UTC
  Fix test-case gdb.cp/cp-relocate.exp for remote host using
gdb_remote_download.

Tested on x86_64-linux.
---
 gdb/testsuite/gdb.cp/cp-relocate.exp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
  

Patch

diff --git a/gdb/testsuite/gdb.cp/cp-relocate.exp b/gdb/testsuite/gdb.cp/cp-relocate.exp
index d400bb14e46..25ed15a9aa1 100644
--- a/gdb/testsuite/gdb.cp/cp-relocate.exp
+++ b/gdb/testsuite/gdb.cp/cp-relocate.exp
@@ -118,7 +118,9 @@  if { $func1_sec == $func2_sec } {
 # Now start a clean GDB, for add-symbol-file tests.
 clean_restart
 
-gdb_test "add-symbol-file ${binfile} 0 -s ${func1_sec} 0x10000 -s ${func2_sec} 0x20000" \
+set host_binfile [gdb_remote_download host $binfile]
+
+gdb_test "add-symbol-file $host_binfile 0 -s ${func1_sec} 0x10000 -s ${func2_sec} 0x20000" \
 	"Reading symbols from .*${testfile}\\.o\\.\\.\\.(|\r\nUsing host libthread_db library .*libthread_db.so.*\\.)" \
 	"add-symbol-file ${testfile}.o" \
 	"add symbol table from file \".*${testfile}\\.o\" at.*\\(y or n\\) " \