[gdb/testsuite] Fix gdb.dwarf2/gdb-index-cxx.exp for remote host
authorTom de Vries <tdevries@suse.de>
Mon, 27 Mar 2023 11:58:10 +0000 (13:58 +0200)
committerTom de Vries <tdevries@suse.de>
Mon, 27 Mar 2023 11:58:10 +0000 (13:58 +0200)
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
gdb/testsuite/lib/gdb.exp

index 3c3d6cc463dd468dacfad5a0f03cd9d1d8013f3f..6fffc9827221b65163bc6f5a41e0a2aa6840121c 100644 (file)
@@ -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.*" {
index 39ed5ad761b606879064a7b7f0b3c4aa37f119c5..14ce39e8ed7288206e6797d9b730dae6e6eb8c5b 100644 (file)
@@ -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] "/"]