From: Ilya Leoshkevich <iii@linux.ibm.com>
To: Matheus Tavares Bernardino <quic_mathbern@quicinc.com>,
qemu-devel@nongnu.org
Cc: alex.bennee@linaro.org, bcain@quicinc.com,
"Philippe Mathieu-Daudé" <philmd@linaro.org>
Subject: Re: [PATCH] gdbstub: use 0 ("any process") on packets with no PID
Date: Tue, 01 Aug 2023 23:11:38 +0200 [thread overview]
Message-ID: <922a658a278cf241e7ca0f49b2249c7d5a6871b6.camel@linux.ibm.com> (raw)
In-Reply-To: <78a3b06f6ab90a7ff8e73ae14a996eb27ec76c85.1690904195.git.quic_mathbern@quicinc.com>
On Tue, 2023-08-01 at 12:37 -0300, Matheus Tavares Bernardino wrote:
> Previously, qemu-user would always report PID 1 to GDB. This was
> changed
> at dc14a7a6e9 (gdbstub: Report the actual qemu-user pid, 2023-06-30),
> but read_thread_id() still considers GDB packets with "no PID" as
> "PID
> 1", which is not the qemu-user PID. Fix that by parsing "no PID" as
> "0",
> which the GDB Remote Protocol defines as "any process".
>
> Note that this should have no effect for system emulation as, in this
> case, gdb_create_default_process() will assign PID 1 for the first
> process and that is what the gdbstub uses for GDB requests with no
> PID,
> or PID 0.
>
> This issue was found with hexagon-lldb, which sends a "Hq" packet
> with
> only the thread-id, but no process-id, leading to the invalid usage
> of
> "PID 1" by qemu-hexagon and a subsequent "E22" reply.
Did you mean "Hg"?
> Signed-off-by: Matheus Tavares Bernardino <quic_mathbern@quicinc.com>
> ---
> gdbstub/gdbstub.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
The change looks good to me.
Thanks for looking into this and sorry for the breakage.
Acked-by: Ilya Leoshkevich <iii@linux.ibm.com>
next prev parent reply other threads:[~2023-08-01 21:12 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-01 15:37 [PATCH] gdbstub: use 0 ("any process") on packets with no PID Matheus Tavares Bernardino
2023-08-01 21:11 ` Ilya Leoshkevich [this message]
2023-08-02 11:04 ` Matheus Tavares Bernardino
2023-08-02 16:19 ` Richard Henderson
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=922a658a278cf241e7ca0f49b2249c7d5a6871b6.camel@linux.ibm.com \
--to=iii@linux.ibm.com \
--cc=alex.bennee@linaro.org \
--cc=bcain@quicinc.com \
--cc=philmd@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=quic_mathbern@quicinc.com \
/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).