[pushed,08/10,gdb/testsuite] Fix gdb.dwarf2/gdb-index-cxx.exp for remote host
Commit Message
Fix test-case gdb.dwarf2/gdb-index-cxx.exp for remote host using
host_standard_output_file.
Tested on x86_64-linux.
---
gdb/testsuite/gdb.dwarf2/gdb-index-cxx.exp | 2 +-
gdb/testsuite/lib/gdb.exp | 3 +++
2 files changed, 4 insertions(+), 1 deletion(-)
@@ -23,7 +23,7 @@ if {[prepare_for_testing "failed to prepare" "${testfile}" \
}
# The bug was that gdb would crash when saving.
-set output_dir [standard_output_file ""]
+set output_dir [host_standard_output_file ""]
set cmd "save gdb-index"
gdb_test_multiple "$cmd $output_dir" $cmd {
-re -wrap "Cannot use an index to create the index.*" {
@@ -6414,6 +6414,9 @@ proc host_standard_output_file { basename } {
if { [is_remote host] } {
set remotedir [board_info host remotedir]
if { $remotedir == "" } {
+ if { $basename == "" } {
+ return "."
+ }
return $basename
} else {
return [join [list $remotedir $basename] "/"]