diff options
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/testsuite/gdb.testsuite/board-sanity.exp | 4 | ||||
-rw-r--r-- | gdb/testsuite/lib/gdb.exp | 15 |
2 files changed, 16 insertions, 3 deletions
diff --git a/gdb/testsuite/gdb.testsuite/board-sanity.exp b/gdb/testsuite/gdb.testsuite/board-sanity.exp index d640226..eb19db8 100644 --- a/gdb/testsuite/gdb.testsuite/board-sanity.exp +++ b/gdb/testsuite/gdb.testsuite/board-sanity.exp @@ -77,9 +77,7 @@ proc test_remote { remote host_is_target } { } with_test_prefix copy-from-remote { - # Note: we're using $remote_file here instead of $file, otherwise - # this breaks with board_info remotedir. - set build_file [remote_upload $remote $remote_file] + set build_file [remote_upload $remote $file] gdb_assert { [string equal [file tail $build_file] $file] == 1 } \ "remote_upload returns valid value" diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index 86a0515..111a158 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -5917,6 +5917,21 @@ proc gdb_touch_execfile { binfile } { } } +# Override of dejagnu's remote_upload, which doesn't handle remotedir. + +rename remote_upload dejagnu_remote_upload +proc remote_upload { dest srcfile args } { + if { [is_remote $dest] && [board_info $dest exists remotedir] } { + set remotedir [board_info $dest remotedir] + if { ![string match "$remotedir*" $srcfile] } { + # Use hardcoded '/' as separator, as in dejagnu's remote_download. + set srcfile $remotedir/$srcfile + } + } + + return [dejagnu_remote_upload $dest $srcfile {*}$args] +} + # Like remote_download but provides a gdb-specific behavior. # # If the destination board is remote, the local file FROMFILE is transferred as |