diff options
Diffstat (limited to 'gdb/testsuite/gdb.xml/tdesc-arch.exp')
-rw-r--r-- | gdb/testsuite/gdb.xml/tdesc-arch.exp | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/gdb/testsuite/gdb.xml/tdesc-arch.exp b/gdb/testsuite/gdb.xml/tdesc-arch.exp index 5fde2ff..241ad28 100644 --- a/gdb/testsuite/gdb.xml/tdesc-arch.exp +++ b/gdb/testsuite/gdb.xml/tdesc-arch.exp @@ -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 |