* [PATCH] Fix latent bug in DWARF test case
@ 2021-10-30 21:00 Tom Tromey
2021-10-31 2:45 ` Simon Marchi
0 siblings, 1 reply; 2+ messages in thread
From: Tom Tromey @ 2021-10-30 21:00 UTC (permalink / raw)
To: gdb-patches; +Cc: Tom Tromey
On my branch that replaces the DWARF psymtab reader,
dw2-stack-boundary.exp started failing. However, when I look at the
output in gdb.log, it is correct:
file /home/tromey/gdb/build/gdb/testsuite/outputs/gdb.dwarf2/dw2-stack-boundary/dw2-stack-boundary
Reading symbols from /home/tromey/gdb/build/gdb/testsuite/outputs/gdb.dwarf2/dw2-stack-boundary/dw2-stack-boundary...
During symbol reading: location description stack overflow
During symbol reading: location description stack underflow
What happens to cause the failure is that the two branches in
gdb_test_multiple appear in this order:
-re "\r\nDuring symbol reading: location description stack underflow" {
[...]
-re "\r\nDuring symbol reading: location description stack overflow" {
The first one will match the above, without causing the second one to
ever match -- leading to a spurious failure.
Anchoring the regexps seems to fix the problem, and works for the
current gdb as well.
---
gdb/testsuite/gdb.dwarf2/dw2-stack-boundary.exp | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-stack-boundary.exp b/gdb/testsuite/gdb.dwarf2/dw2-stack-boundary.exp
index 8b81b5b2119..054d0c66e71 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-stack-boundary.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-stack-boundary.exp
@@ -44,11 +44,11 @@ gdb_test_multiple "file $binfile" "file command" {
-re "\r\nReading symbols from \[^\r\n\]*\\.\\.\\." {
exp_continue
}
- -re "\r\nDuring symbol reading: location description stack underflow" {
+ -re "^\r\nDuring symbol reading: location description stack underflow" {
set w1 1
exp_continue
}
- -re "\r\nDuring symbol reading: location description stack overflow" {
+ -re "^\r\nDuring symbol reading: location description stack overflow" {
set w2 1
exp_continue
}
--
2.31.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] Fix latent bug in DWARF test case
2021-10-30 21:00 [PATCH] Fix latent bug in DWARF test case Tom Tromey
@ 2021-10-31 2:45 ` Simon Marchi
0 siblings, 0 replies; 2+ messages in thread
From: Simon Marchi @ 2021-10-31 2:45 UTC (permalink / raw)
To: Tom Tromey, gdb-patches
On 2021-10-30 17:00, Tom Tromey wrote:
> On my branch that replaces the DWARF psymtab reader,
> dw2-stack-boundary.exp started failing. However, when I look at the
> output in gdb.log, it is correct:
>
> file /home/tromey/gdb/build/gdb/testsuite/outputs/gdb.dwarf2/dw2-stack-boundary/dw2-stack-boundary
> Reading symbols from /home/tromey/gdb/build/gdb/testsuite/outputs/gdb.dwarf2/dw2-stack-boundary/dw2-stack-boundary...
> During symbol reading: location description stack overflow
> During symbol reading: location description stack underflow
>
> What happens to cause the failure is that the two branches in
> gdb_test_multiple appear in this order:
>
> -re "\r\nDuring symbol reading: location description stack underflow" {
> [...]
> -re "\r\nDuring symbol reading: location description stack overflow" {
>
> The first one will match the above, without causing the second one to
> ever match -- leading to a spurious failure.
>
> Anchoring the regexps seems to fix the problem, and works for the
> current gdb as well.
> ---
> gdb/testsuite/gdb.dwarf2/dw2-stack-boundary.exp | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/gdb/testsuite/gdb.dwarf2/dw2-stack-boundary.exp b/gdb/testsuite/gdb.dwarf2/dw2-stack-boundary.exp
> index 8b81b5b2119..054d0c66e71 100644
> --- a/gdb/testsuite/gdb.dwarf2/dw2-stack-boundary.exp
> +++ b/gdb/testsuite/gdb.dwarf2/dw2-stack-boundary.exp
> @@ -44,11 +44,11 @@ gdb_test_multiple "file $binfile" "file command" {
> -re "\r\nReading symbols from \[^\r\n\]*\\.\\.\\." {
> exp_continue
> }
> - -re "\r\nDuring symbol reading: location description stack underflow" {
> + -re "^\r\nDuring symbol reading: location description stack underflow" {
> set w1 1
> exp_continue
> }
> - -re "\r\nDuring symbol reading: location description stack overflow" {
> + -re "^\r\nDuring symbol reading: location description stack overflow" {
> set w2 1
> exp_continue
> }
>
This LGTM. I'll try to remember this technique for when expecting
things that can be in different orders.
Simon
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-10-31 2:45 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-30 21:00 [PATCH] Fix latent bug in DWARF test case Tom Tromey
2021-10-31 2:45 ` Simon Marchi
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).