]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
[gdb/testsuite] Fix gdb.ada/tagged-lookup.exp with read1+readnow
authorTom de Vries <tdevries@suse.de>
Tue, 8 Oct 2024 11:45:21 +0000 (13:45 +0200)
committerTom de Vries <tdevries@suse.de>
Tue, 8 Oct 2024 11:45:21 +0000 (13:45 +0200)
commite232c98332313323d0228440a14f0a7fd1fed655
tree7c79811604ad795279446117b66bafc120bed6f9
parent5ad960fcdb6732c805d2a235efc8a40df644e03e
[gdb/testsuite] Fix gdb.ada/tagged-lookup.exp with read1+readnow

When running test-case gdb.ada/tagged-lookup.exp with target board readnow and
make target check-read1:
...
$ ( cd build/gdb; \
    make check-read1 \
      RUNTESTFLAGS="--target_board=readnow gdb.ada/tagged-lookup.exp" )
...
I run into:
...
(gdb) PASS: gdb.ada/tagged-lookup.exp: set debug symtab-create 1
print *the_local_var^M
$1 = (n => 2)^M
(gdb) FAIL: gdb.ada/tagged-lookup.exp: only one CU expanded
...

The problem is that the corresponding gdb_test_multiple uses line-by-line
matching (using -lbl) which doesn't work well with the multiline pattern
matching both the prompt and the line before it:
...
    -re -wrap ".* = \\\(n => $decimal\\\)" {
...

Fix this by making it a one-line pattern:
...
    -re -wrap "" {
...

While we're at it, replace an if-then-pass-else-fail with a gdb_assert.

Tested on aarch64-linux.
gdb/testsuite/gdb.ada/tagged-lookup.exp