Skip to content
Snippets Groups Projects
Commit 6407713f authored by Tom de Vries's avatar Tom de Vries
Browse files

[gdb/testsuite] Fix gdb.server/sysroot.exp for remote target

Fix test-case gdb.server/sysroot.exp with target board
remote-gdbserver-on-localhost, by:
- using gdb_remote_download, and
- disabling the "local" scenario for remote host.

Tested on x86_64-linux.
parent ed32754a
No related branches found
No related tags found
No related merge requests found
...@@ -27,9 +27,17 @@ if {[build_executable "failed to prepare" $testfile $srcfile "additional_flags=- ...@@ -27,9 +27,17 @@ if {[build_executable "failed to prepare" $testfile $srcfile "additional_flags=-
return -1 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 # Run once with sysroot set to the local filesystem and once set to the remote
# target. # 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 srcdir
global subdir global subdir
global binfile global binfile
...@@ -40,7 +48,7 @@ foreach_with_prefix sysroot { "local" "remote" } { ...@@ -40,7 +48,7 @@ foreach_with_prefix sysroot { "local" "remote" } {
set timeout_factor 1 set timeout_factor 1
} else { } else {
set sysroot_command "target:" 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 set timeout_factor 5
} }
...@@ -55,7 +63,7 @@ foreach_with_prefix sysroot { "local" "remote" } { ...@@ -55,7 +63,7 @@ foreach_with_prefix sysroot { "local" "remote" } {
gdb_test "disconnect" ".*" gdb_test "disconnect" ".*"
# Start GDBserver. # Start GDBserver.
set res [gdbserver_start "" $binfile] set res [gdbserver_start "" $target_binfile]
set gdbserver_protocol [lindex $res 0] set gdbserver_protocol [lindex $res 0]
set gdbserver_gdbport [lindex $res 1] set gdbserver_gdbport [lindex $res 1]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment