diff options
author | Tom de Vries <tdevries@suse.de> | 2023-03-09 10:45:03 +0100 |
---|---|---|
committer | Tom de Vries <tdevries@suse.de> | 2023-03-09 10:45:03 +0100 |
commit | 6407713fab73abcfcf1893451bfc6ac6c91e609c (patch) | |
tree | c170b09c980fab846006c3256e46ad0fda7e97d2 /gdb/testsuite/gdb.server/sysroot.exp | |
parent | ed32754a8c7919feffc6ddb66ff1c532e4a4d1cd (diff) | |
download | binutils-6407713fab73abcfcf1893451bfc6ac6c91e609c.zip binutils-6407713fab73abcfcf1893451bfc6ac6c91e609c.tar.gz binutils-6407713fab73abcfcf1893451bfc6ac6c91e609c.tar.bz2 |
[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.
Diffstat (limited to 'gdb/testsuite/gdb.server/sysroot.exp')
-rw-r--r-- | gdb/testsuite/gdb.server/sysroot.exp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/gdb/testsuite/gdb.server/sysroot.exp b/gdb/testsuite/gdb.server/sysroot.exp index 715d600..ac2a03d 100644 --- a/gdb/testsuite/gdb.server/sysroot.exp +++ b/gdb/testsuite/gdb.server/sysroot.exp @@ -27,9 +27,17 @@ if {[build_executable "failed to prepare" $testfile $srcfile "additional_flags=- 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 @@ -40,7 +48,7 @@ foreach_with_prefix sysroot { "local" "remote" } { 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 } @@ -55,7 +63,7 @@ foreach_with_prefix sysroot { "local" "remote" } { 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] |