When running with target board cc-with-gdb-index, we run into:
...
rm: cannot remove '/tmp/tmp.JmYTeiuFjj/*.gdb-index': \
No such file or directory^M
FAIL: gdb.dwarf2/per-bfd-sharing.exp: \
couldn't remove files in temporary cache dir
...
Fix this, as in gdb.base/index-cache.exp, by only FAILing when
$expecting_index_cache_use.
Tested on x86_64-linux.
gdb/testsuite/ChangeLog:
2021-08-02 Tom de Vries <tdevries@suse.de>
* gdb.dwarf2/per-bfd-sharing.exp: Only expect index-cache files
when $expecting_index_cache_use.
return
}
+set has_index_section [exec_has_index_section $binfile]
+set uses_readnow [expr [string first "-readnow" $GDBFLAGS] != -1]
+set expecting_index_cache_use [expr !$has_index_section && !$uses_readnow]
+
lassign [remote_exec host mktemp -d] ret cache_dir
# The output of mktemp contains an end of line, remove it.
}
lassign [remote_exec host sh "-c \"rm $cache_dir/*.gdb-index\""] ret
-if { $ret != 0 } {
+if { $ret != 0 && $expecting_index_cache_use } {
fail "couldn't remove files in temporary cache dir"
return
}