return -1
}
+set target_binfile [gdb_remote_download target $binfile]
+
# Run once with sysroot set to the local filesystem and once set to the remote
# target.
-foreach_with_prefix sysroot { "local" "remote" } {
+set modes {}
+if { ![is_remote target] } {
+ lappend modes "local"
+}
+lappend modes "remote"
+
+foreach_with_prefix sysroot $modes {
global srcdir
global subdir
global binfile
set timeout_factor 1
} else {
set sysroot_command "target:"
- set reading_symbols "Reading $binfile from remote target..."
+ set reading_symbols "Reading .*$target_binfile from remote target..."
set timeout_factor 5
}
gdb_test "disconnect" ".*"
# Start GDBserver.
- set res [gdbserver_start "" $binfile]
+ set res [gdbserver_start "" $target_binfile]
set gdbserver_protocol [lindex $res 0]
set gdbserver_gdbport [lindex $res 1]