[gdb/testsuite] Handle readnow in ensure_gdb_index
authorTom de Vries <tdevries@suse.de>
Mon, 11 Oct 2021 10:21:00 +0000 (12:21 +0200)
committerTom de Vries <tdevries@suse.de>
Mon, 11 Oct 2021 10:21:00 +0000 (12:21 +0200)
commitdbfc69bef9d6f211fa1b42ee38c2e678079def3a
treef8ec7de7681b3bf038dd23749e4208e41b8f7300
parent47265957ad9b1de1d6434baa0569d286d75eaf48
[gdb/testsuite] Handle readnow in ensure_gdb_index

When running test-case gdb.base/with-mf.exp with target board readnow, I run
into:
...
FAIL: gdb.base/with-mf.exp: check if index present
...
This is since commit 6010fb0c49e "[gdb/testsuite] Fix full buffer in
gdb.rust/dwindex.exp".

Before that commit, the proc ensure_gdb_index would treat the line:
...
.gdb_index: faked for "readnow"^M
...
as proof that an index is already present (which is incorrect).

Now, instead it generates aforementioned FAIL and continues to generate an
index.

Fix this by explicitly handling the readnow case in proc ensure_gdb_index,
such that we bail out instead.

Tested on x86_64-linux.
gdb/testsuite/lib/gdb.exp