Index: gdb/testsuite/gdb.xml/tdesc-arch.exp |
diff --git a/gdb/testsuite/gdb.xml/tdesc-arch.exp b/gdb/testsuite/gdb.xml/tdesc-arch.exp |
index 55c23b2c882d764d2e9fb7a03bbe104f18188051..241ad28f9c9d6cb3260fca43f963cd3bdb7ca0ad 100644 |
--- a/gdb/testsuite/gdb.xml/tdesc-arch.exp |
+++ b/gdb/testsuite/gdb.xml/tdesc-arch.exp |
@@ -1,4 +1,4 @@ |
-# Copyright 2007-2012 Free Software Foundation, Inc. |
+# Copyright 2007-2013 Free Software Foundation, Inc. |
# This program is free software; you can redistribute it and/or modify |
# it under the terms of the GNU General Public License as published by |
@@ -60,17 +60,20 @@ proc set_arch { arch which } { |
global gdb_prompt |
global subdir |
- set fd [open "$subdir/tdesc-arch.xml" w] |
+ set filename [standard_output_file tdesc-arch.xml] |
+ set fd [open $filename w] |
puts $fd \ |
"<target> |
<architecture>$arch</architecture> |
</target>" |
close $fd |
- remote_download host "${subdir}/tdesc-arch.xml" "tdesc-arch.xml" |
+ if {[is_remote host]} { |
+ set filename [remote_download host $filename tdesc-arch.xml] |
+ } |
# Anchor the test output, so that error messages are detected. |
- set cmd "set tdesc filename tdesc-arch.xml" |
- set msg "$cmd ($which architecture)" |
+ set cmd "set tdesc filename $filename" |
+ set msg "set tdesc filename tdesc-arch.xml ($which architecture)" |
set cmd_regex [string_to_regexp $cmd] |
gdb_test_multiple $cmd $msg { |
-re "^$cmd_regex\r\n$gdb_prompt $" { |
@@ -86,31 +89,32 @@ proc set_arch { arch which } { |
"The target architecture is set automatically \\(currently $arch\\)" \ |
"$cmd ($which architecture)" |
- file delete "${subdir}/tdesc-arch.xml" |
- remote_file host delete "tdesc-arch.xml" |
+ remote_file host delete $filename |
} |
set_arch $arch1 first |
set_arch $arch2 second |
# Check an invalid architecture setting. |
-set fd [open "${subdir}/tdesc-arch.xml" w] |
+set filename [standard_output_file tdesc-arch.xml] |
+set fd [open $filename w] |
puts $fd \ |
"<target> |
<architecture>invalid</architecture> |
</target>" |
close $fd |
-remote_download host "$subdir/tdesc-arch.xml" "tdesc-arch.xml" |
+if {[is_remote host]} { |
+ set filename [remote_download host $filename "tdesc-arch.xml"] |
+} |
-set cmd "set tdesc filename tdesc-arch.xml" |
+set cmd "set tdesc filename $filename" |
gdb_test $cmd \ |
"warning:.*Target description specified unknown architecture.*" \ |
- "$cmd (invalid architecture)" |
+ "set tdesc filename tdesc-arch.xml (invalid architecture)" |
set cmd "show architecture" |
gdb_test $cmd \ |
"The target architecture is set automatically \\(currently $default_arch\\)" \ |
"$cmd (invalid architecture)" |
-file delete "${subdir}/tdesc-arch.xml" |
-remote_file host delete "tdesc-arch.xml" |
+remote_file host delete $filename |