public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [committed][gdb/testsuite] Fix gdb.dwarf2/per-bfd-sharing.exp with cc-with-gdb-index
@ 2021-08-02 13:33 Tom de Vries
  0 siblings, 0 replies; only message in thread
From: Tom de Vries @ 2021-08-02 13:33 UTC (permalink / raw)
  To: gdb-patches

Hi,

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.

Committed to trunk.

Thanks,
- Tom

[gdb/testsuite] Fix gdb.dwarf2/per-bfd-sharing.exp with cc-with-gdb-index

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.

---
 gdb/testsuite/gdb.dwarf2/per-bfd-sharing.exp | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/gdb/testsuite/gdb.dwarf2/per-bfd-sharing.exp b/gdb/testsuite/gdb.dwarf2/per-bfd-sharing.exp
index 48a30fa741c..6891cd77446 100644
--- a/gdb/testsuite/gdb.dwarf2/per-bfd-sharing.exp
+++ b/gdb/testsuite/gdb.dwarf2/per-bfd-sharing.exp
@@ -23,6 +23,10 @@ if { [build_executable "failed to prepare" $testfile $srcfile \
     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.
@@ -93,7 +97,7 @@ foreach_with_prefix first $methods {
 }
 
 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
 }

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-08-02 13:33 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-02 13:33 [committed][gdb/testsuite] Fix gdb.dwarf2/per-bfd-sharing.exp with cc-with-gdb-index Tom de Vries

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).