Re: [PATCH] gdb: use gdb_test_multiple in gdb_breakpoint

Lancelot SIX via Gdb-patches
2023-01-04T19:12:32Z

On Wed, Jan 04, 2023 at 02:05:23PM -0500, Simon Marchi wrote:
>
>
> On 1/4/23 13:02, Lancelot SIX wrote:
> > Something like this should fix the issue:.
> >
> > From 25585cc98812c90f819d78742243299a933ac879 Mon Sep 17 00:00:00 2001
> > From: Lancelot SIX <lancelot.six@amd.com>
> > Date: Wed, 4 Jan 2023 17:58:08 +0000
> > Subject: [PATCH] gdb: ensure test_name is initialized in gdb_breakpoint
> >
> > A refactoring in 4b9728bec15 (gdb: use gdb_test_multiple in
> > gdb_breakpoint) left the $test_name variable initialized.
>
> Woops, thanks for noticing and for the patch.
>
> initialized -> uninitialized (or undefined)?

I went for undefined which is more appropriate.

Pushed with this modification.

Best,
Lancelot.

>
> >
> > This patch fixes this.
> > ---
> > gdb/testsuite/lib/gdb.exp | 3 ++-
> > 1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
> > index ba16b2ab315..e17eace4cb1 100644
> > --- a/gdb/testsuite/lib/gdb.exp
> > +++ b/gdb/testsuite/lib/gdb.exp
> > @@ -639,8 +639,9 @@ proc gdb_breakpoint { linespec args } {
> > set print_pass 1
> > }
> >
> > + set test_name "gdb_breakpoint: set breakpoint at $linespec"
> > # The first two regexps are what we get with -g, the third is without -g.
> > - gdb_test_multiple "$break_command $linespec" "gdb_breakpoint: set breakpoint at $linespec" {
> > + gdb_test_multiple "$break_command $linespec" $test_name {
> > -re "$break_message \[0-9\]* at .*: file .*, line $decimal.\r\n$gdb_prompt $" {}
> > -re "$break_message \[0-9\]*: file .*, line $decimal.\r\n$gdb_prompt $" {}
> > -re "$break_message \[0-9\]* at .*$gdb_prompt $" {}
> > --
> > 2.34.1
>
> This LGTM, thanks:
>
> Approved-By: Simon Marchi <simon.marchi@efficios.com>
>
> Simon