Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Aktemur, Baris" <TankutBaris.Aktemur@amd.com>
To: "Six, Lancelot" <Lancelot.Six@amd.com>,
	"gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: RE: [PATCH] gdb/amd-dbgapi-target: suppress a repeated stop request
Date: Wed, 20 May 2026 11:49:57 +0000	[thread overview]
Message-ID: <DM4PR12MB64701462521C5AF2624EA5C4F8012@DM4PR12MB6470.namprd12.prod.outlook.com> (raw)
In-Reply-To: <a67c5058-7254-4199-a30c-e80fbbd3245d@amd.com>

AMD General

On Wednesday, May 20, 2026 12:10 PM, Six, Lancelot wrote:
> Hi,
...
> > +
> > +    # Resume the thread in the background.  It will loop.  Then we
> > +    # interrupt twice.  To be able to run the "interrupt" command back
> > +    # to back, we define a user command.
> > +    gdb_test "continue &" "Continuing." "continue async"
> > +
> > +    gdb_test_multiple "define inttwice" "" {
> > +   -re "End with .*>$"  {
> > +       pass $gdb_test_name
> > +   }
> > +    }
> > +
> > +    gdb_test [multi_line_input \
> > +             {interrupt} \
> > +             {interrupt} \
> > +             {end}] \
> > +   "" \
> > +   "enter commands"
>
> Having 2 tests here seems odd. There should be just one PASS/FAIL for
> the entire command.
>
> There are 2 approaches to do this.
>
> First, gdb_test has all the machinery in place to do the "question -
> response" interaction:
>
>      gdb_test \
>        "define inttwice" \
>        "" \
>        "define inttwice" \
>        "Type commands for definition of \"inttwice\"\.\r\nEnd with a
> line saying just \"end\"\.\r\n>" \
>        [multi_line_input "interrupt" "interrupt" "end"]
>
> The second approach is to use gdb_test_multiple all the way, and use
> send_gdb to reply to the question
>
>      gdb_test_multiple "define inttwice" "" {
>       -re "Type commands for definition of \"inttwice\"\.\r\nEnd with a line
> saying just \"end\"\.\r\n>$" {
>               send_gdb [multi_line_input "interrupt" "interrupt" "end" ""]
>               exp_continue
>       }
>       -re "$::gdb_prompt $" {
>               pass $gdb_test_name
>       }
>      }

As usual, I had copied from an existing test, but I agree that changing this
part makes sense (and there are many existing tests using a nested
gdb_test_multiple/gdb_test approach, which I could've used).

I'll soon send v2.

Thank you.
-Baris




  reply	other threads:[~2026-05-20 11:50 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-20  8:58 Tankut Baris Aktemur
2026-05-20 10:09 ` Lancelot SIX
2026-05-20 11:49   ` Aktemur, Baris [this message]
2026-05-20 11:52 ` [PATCH v2] " Tankut Baris Aktemur
2026-05-20 20:31   ` Lancelot SIX
2026-05-21  6:45     ` Aktemur, Baris

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DM4PR12MB64701462521C5AF2624EA5C4F8012@DM4PR12MB6470.namprd12.prod.outlook.com \
    --to=tankutbaris.aktemur@amd.com \
    --cc=Lancelot.Six@amd.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox