Message ID | 20250403162645.438432-2-thiago.bauermann@linaro.org |
---|---|
State | New |
Headers | show |
Series | [1/2] gdb/testsuite: Fix flakiness in gdb.base/default.exp | expand |
On 4/3/25 9:26 AM, Thiago Jung Bauermann wrote: > I was a bit confused about the -lbl option in gdb_test_multiple, and needed > to read its implementation to determine that it would be useful for my > needs. Explicitly mention what the option does and why it's useful to > hopefully help other developers. > --- > gdb/testsuite/lib/gdb.exp | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp > index 59967c70cda9..0ff6b69421cb 100644 > --- a/gdb/testsuite/lib/gdb.exp > +++ b/gdb/testsuite/lib/gdb.exp > @@ -1026,7 +1026,10 @@ proc command_to_message { command } { > # should not be anchored at the end of the buffer. This means that the > # pattern can match even if there is stuff output after the prompt. Does not > # have any effect if -prompt is specified. > -# -lbl specifies that line-by-line matching will be used. > +# -lbl specifies that line-by-line matching will be used. This means > +# that lines from GDB not matched by any pattern will be consumed from > +# the output buffer. This helps avoid buffer overflows and timeouts > +# when testing verbose commands. > # EXPECT_ARGUMENTS will be fed to expect in addition to the standard > # patterns. Pattern elements will be evaluated in the caller's > # context; action elements will be executed in the caller's context. > Thank you for that explanation/clarification. LGTM. Reviewed-By: Keith Seitz <keiths@redhat.com> Keith
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index 59967c70cda9..0ff6b69421cb 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -1026,7 +1026,10 @@ proc command_to_message { command } { # should not be anchored at the end of the buffer. This means that the # pattern can match even if there is stuff output after the prompt. Does not # have any effect if -prompt is specified. -# -lbl specifies that line-by-line matching will be used. +# -lbl specifies that line-by-line matching will be used. This means +# that lines from GDB not matched by any pattern will be consumed from +# the output buffer. This helps avoid buffer overflows and timeouts +# when testing verbose commands. # EXPECT_ARGUMENTS will be fed to expect in addition to the standard # patterns. Pattern elements will be evaluated in the caller's # context; action elements will be executed in the caller's context.