]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
[gdb/testsuite] Fix gdb.base/reggroups.exp with check-read1
authorTom de Vries <tdevries@suse.de>
Wed, 9 Oct 2024 09:17:41 +0000 (11:17 +0200)
committerTom de Vries <tdevries@suse.de>
Wed, 9 Oct 2024 09:17:41 +0000 (11:17 +0200)
commit2ae9b1b2d7e5feb0fd734f91250fc5dd187767a5
tree073bd7fe933072371687ff1df06283c85728562c
parent967dc35c78adb85ee1e2e596047d9dc69107a9db
[gdb/testsuite] Fix gdb.base/reggroups.exp with check-read1

On aarch64-linux, with make target check-read1, I run into:
...
(gdb) info reg vector^M
  ...
d19            {f = 0x0, u = 0x0, s = 0x0} {f =FAIL: gdb.base/reggroups.exp: fetch reggroup regs vector (timeout)
 0, u = 0, s = 0}^M
...

The problem is that while (as documented) the corresponding gdb_test_multiple
doesn't work for vector registers, it doesn't skip them either.  This causes
the timeout, and it also causes the registers after a vector register not to
be found.

Fix this by using -lbl style matching.

Make which reggroups and registers are found more explicit using verbose -log,
which makes us notice that regnames with underscores are skipped, so fix that
as well.

While we're at it, this:
...
set invalid_register_re "Invalid register .*"
...
and this:
...
       -re $invalid_register_re {
           fail "$test (unexpected invalid register response)"
       }
...
means that the prompt may or may not be consumed.  Fix this by limiting the
regexp to one line, and using exp_continue.

While we're at it, improve readability of the complex regexp matching a single
register by factoring out regexps.

Tested on aarch64-linux and x86_64-linux.
gdb/testsuite/gdb.base/reggroups.exp