From: Kevin Buettner <kevinb@redhat.com>
To: Pedro Alves <pedro@palves.net>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH] gdb.multi/attach-no-multi-process.exp: Detect no remote non-stop
Date: Fri, 6 Jun 2025 10:15:21 -0700 [thread overview]
Message-ID: <20250606101521.6c70c0e1@f41-zbm-amd> (raw)
In-Reply-To: <20250606162932.960463-1-pedro@palves.net>
On Fri, 6 Jun 2025 17:29:31 +0100
Pedro Alves <pedro@palves.net> wrote:
> Running gdb.multi/attach-no-multi-process.exp on Cygwin, where
> GDBserver does not support non-stop mode, I see:
>
> FAIL: gdb.multi/attach-no-multi-process.exp: target_non_stop=off: info
> threads FAIL: gdb.multi/attach-no-multi-process.exp: target_non_stop=on:
> attach to the program via remote (timeout) FAIL:
> gdb.multi/attach-no-multi-process.exp: target_non_stop=on: info threads
> (timeout)
>
> Let's ignore the first "info threads" fail. The timeouts look like
> this:
>
> builtin_spawn /home/alves/gdb-cache-cygwin/gdb/../gdbserver/gdbserver
> --once --multi localhost:2346 Listening on port 2346
> target extended-remote localhost:2346
> Remote debugging using localhost:2346
> Non-stop mode requested, but remote does not support non-stop
> (gdb) gdb_do_cache: can_spawn_for_attach ( )
> builtin_spawn
> /home/alves/gdb/build-cygwin-testsuite/outputs/gdb.multi/attach-no-multi-process/attach-no-multi-process
> attach 14540 FAIL: gdb.multi/attach-no-multi-process.exp:
> target_non_stop=on: attach to the program via remote (timeout) info
> threads FAIL: gdb.multi/attach-no-multi-process.exp: target_non_stop=on:
> info threads (timeout)
>
> Note the "Non-stop mode requested, but remote does not support
> non-stop" line.
>
> The intro to gdb_target_cmd_ext says:
>
> # gdb_target_cmd_ext
> # Send gdb the "target" command. Returns 0 on success, 1 on failure, 2
> on # unsupported.
>
> That's perfect here, we can just use gdb_target_cmd_ext instead of
> gdb_target_cmd, and check for 2 (unsupported). That's what this patch
> does.
>
> However gdb_target_cmd_ext incorrectly returns 1 instead of 2 for the
> case where the remote target says it does not support non-stop. That
> is also fixed by this patch.
>
> With this, we no longer get those timeout fails. We get instead:
>
> target extended-remote localhost:2346
> Remote debugging using localhost:2346
> Non-stop mode requested, but remote does not support non-stop
> (gdb) UNSUPPORTED: gdb.multi/attach-no-multi-process.exp:
> target_non_stop=on: non-stop RSP
LGTM.
Approved-by: Kevin Buettner <kevinb@redhat.com>
next prev parent reply other threads:[~2025-06-06 17:16 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-06 16:29 Pedro Alves
2025-06-06 17:15 ` Kevin Buettner [this message]
2025-06-11 14:01 ` Pedro Alves
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=20250606101521.6c70c0e1@f41-zbm-amd \
--to=kevinb@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=pedro@palves.net \
/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