From: Peter Maydell <peter.maydell@linaro.org>
To: Changbin Du <changbin.du@gmail.com>
Cc: "Philippe Mathieu-Daudé" <philmd@redhat.com>,
"Alex Bennée" <alex.bennee@linaro.org>,
"QEMU Developers" <qemu-devel@nongnu.org>
Subject: Re: [PATCH] tcg: gdbstub: Fix single-step issue on arm target
Date: Thu, 20 Feb 2020 17:58:34 +0000 [thread overview]
Message-ID: <CAFEAcA-hwr+0nXmUnCgW4U2dnn64-TWUM+4LE_bS12toR-RJBw@mail.gmail.com> (raw)
In-Reply-To: <20200220155834.21905-1-changbin.du@gmail.com>
On Thu, 20 Feb 2020 at 15:59, Changbin Du <changbin.du@gmail.com> wrote:
>
> Recently when debugging an arm32 system on qemu, I found sometimes the
> single-step command (stepi) is not working. This can be reproduced by
> below steps:
> 1) start qemu-system-arm -s -S .. and wait for gdb connection.
> 2) start gdb and connect to qemu. In my case, gdb gets a wrong value
> (0x60) for PC.
> 3) After connected, type 'stepi' and expect it will stop at next ins.
>
> But, it has never stopped. This because:
> 1) We doesn't report ‘vContSupported’ feature to gdb explicitly and gdb
> think we do not support it. In this case, gdb use a software breakpoint
> to emulate single-step.
> 2) Since gdb gets a wrong initial value of PC, then gdb inserts a
> breakpoint to wrong place (PC+4).
>
> Since we do support ‘vContSupported’ query command, so let's tell gdb that
> we support it.
>
> Before this change, gdb send below 'Z0' packet to implement single-step:
> gdb_handle_packet: Z0,4,4
>
> After this change, gdb send "vCont;s.." which is expected:
> gdb_handle_packet: vCont?
> put_packet: vCont;c;C;s;S
> gdb_handle_packet: vCont;s:p1.1;c:p1.-1
>
> Signed-off-by: Changbin Du <changbin.du@gmail.com>
Certainly if we support vCont we should advertise it. But why
does the fallback path not work? That is, why does gdb get a
wrong PC value initially?
thanks
-- PMM
next prev parent reply other threads:[~2020-02-20 17:59 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-20 15:58 [PATCH] tcg: gdbstub: Fix single-step issue on arm target Changbin Du
2020-02-20 17:47 ` Philippe Mathieu-Daudé
2020-02-20 18:06 ` Laurent Vivier
2020-02-20 18:55 ` Philippe Mathieu-Daudé
2020-02-21 0:08 ` Changbin Du
2020-02-20 17:58 ` Peter Maydell [this message]
2020-02-20 21:24 ` Luc Michel
2020-02-21 0:07 ` Changbin Du
2020-02-21 11:51 ` Changbin Du
2020-02-21 12:33 ` Philippe Mathieu-Daudé
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=CAFEAcA-hwr+0nXmUnCgW4U2dnn64-TWUM+4LE_bS12toR-RJBw@mail.gmail.com \
--to=peter.maydell@linaro.org \
--cc=alex.bennee@linaro.org \
--cc=changbin.du@gmail.com \
--cc=philmd@redhat.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).