aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/lib/gdb.exp
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/testsuite/lib/gdb.exp')
-rw-r--r--gdb/testsuite/lib/gdb.exp9
1 files changed, 7 insertions, 2 deletions
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index 1ef6a96..0d8a3b0 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -4211,8 +4211,13 @@ proc gdb_remote_download {dest fromfile {tofile {}}} {
return $destname
} else {
- # When the DEST is local, we copy the file to the test directory
- # (where the executable is), except if that's already where it is.
+ # When the DEST is local, we copy the file to the test directory (where
+ # the executable is).
+ #
+ # Note that we pass TOFILE through standard_output_file, regardless of
+ # whether it is absolute or relative, because we don't want the tests
+ # to be able to write outside their standard output directory.
+
set tofile [standard_output_file $tofile]
file copy -force $fromfile $tofile