diff options
author | Tom de Vries <tdevries@suse.de> | 2024-10-08 13:45:21 +0200 |
---|---|---|
committer | Tom de Vries <tdevries@suse.de> | 2024-10-08 13:45:21 +0200 |
commit | e232c98332313323d0228440a14f0a7fd1fed655 (patch) | |
tree | 7c79811604ad795279446117b66bafc120bed6f9 /gdb/testsuite | |
parent | 5ad960fcdb6732c805d2a235efc8a40df644e03e (diff) | |
download | gdb-e232c98332313323d0228440a14f0a7fd1fed655.zip gdb-e232c98332313323d0228440a14f0a7fd1fed655.tar.gz gdb-e232c98332313323d0228440a14f0a7fd1fed655.tar.bz2 |
[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.
Diffstat (limited to 'gdb/testsuite')
-rw-r--r-- | gdb/testsuite/gdb.ada/tagged-lookup.exp | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/gdb/testsuite/gdb.ada/tagged-lookup.exp b/gdb/testsuite/gdb.ada/tagged-lookup.exp index 3803319..f1473aa 100644 --- a/gdb/testsuite/gdb.ada/tagged-lookup.exp +++ b/gdb/testsuite/gdb.ada/tagged-lookup.exp @@ -51,11 +51,7 @@ gdb_test_multiple "print *the_local_var" "only one CU expanded" -lbl { -re ".symtab-create. start_subfile: name = \[^,\]*, name_for_id = \[^\r\n\]*\r\n" { exp_continue } - -re -wrap ".* = \\\(n => $decimal\\\)" { - if {$found_pck + $found_pck2 <= 1} { - pass $gdb_test_name - } else { - fail $gdb_test_name - } + -re -wrap "" { + gdb_assert {$found_pck + $found_pck2 <= 1} $gdb_test_name } } |