From: "Alex Bennée" <alex.bennee@linaro.org>
To: Matheus Branco Borella <dark.ryu.550@gmail.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [PATCH v2] gdbstub: fixes cases where wrong threads were reported to GDB on SIGINT
Date: Thu, 10 Aug 2023 18:30:10 +0100 [thread overview]
Message-ID: <87a5uy3hjh.fsf@linaro.org> (raw)
In-Reply-To: <20230804182633.47300-2-dark.ryu.550@gmail.com>
Matheus Branco Borella <dark.ryu.550@gmail.com> writes:
> Alex Bennée <alex.bennee@linaro.org> writes:
>> Can gdb switch which packet sequence it uses to halt and restart
>> threads?
>
> Yes, but the way it does it does not trigger the behavior I was concerned
> about. GDB falls back to the old sequence when either (1) the target does not
> support the vCont command it's trying to send or (2) you step backwards. In both
> cases, though, whenever it does fall back, it will first send an Hc packet
> before continuing or stepping, which means we won't ever see a sequence such as
> ["Hc", "vCont;c:*", "c"]. This means, in short, that, while the shortcoming does
> exist in the code, GDB never actually triggers it.
>
>> The test I would like see is pretty much your test case
>>
>> - load a multi-threaded program
>> - wait until threads running
>> - pause
>> - resume thread
>> - check resumed thread was the right one
>
> What I have here should be pretty much that.
>
> Is there something else you think I'm missing?
>
> ---
> Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1725
>
> This fix is implemented by having the vCont handler set the value of
> `gdbserver_state.c_cpu` if any threads are to be resumed. The specific CPU
> picked is arbitrarily from the ones to be resumed, but it should be okay, as all
> GDB cares about is that it is a resumed thread.
>
> Signed-off-by: Matheus Branco Borella <dark.ryu.550@gmail.com>
Arg the commit message is in the --- discard section.
Queued to for-8.1/misc-fixes, thanks.
--
Alex Bennée
Virtualisation Tech Lead @ Linaro
prev parent reply other threads:[~2023-08-10 17:59 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-23 18:12 [PATCH] gdbstub: fixes cases where wrong threads were reported to GDB on SIGINT Matheus Branco Borella
2023-06-27 10:39 ` Alex Bennée
2023-07-06 23:50 ` Matheus Branco Borella
2023-08-04 18:26 ` [PATCH v2] " Matheus Branco Borella
2023-08-10 17:30 ` Alex Bennée [this message]
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=87a5uy3hjh.fsf@linaro.org \
--to=alex.bennee@linaro.org \
--cc=dark.ryu.550@gmail.com \
--cc=qemu-devel@nongnu.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;
as well as URLs for NNTP newsgroup(s).