From: Changbin Du <changbin.du@gmail.com>
To: Luc Michel <luc.michel@greensocs.com>
Cc: Peter Maydell <peter.maydell@linaro.org>,
philmd@redhat.com, alex.bennee@linaro.org, qemu-devel@nongnu.org,
Changbin Du <changbin.du@gmail.com>
Subject: Re: [PATCH] tcg: gdbstub: Fix single-step issue on arm target
Date: Fri, 21 Feb 2020 19:51:04 +0800 [thread overview]
Message-ID: <20200221115104.x3af4cfjin553jun@mail.google.com> (raw)
In-Reply-To: <ddc8b36f-da30-faac-cab2-fad882841159@greensocs.com>
On Thu, Feb 20, 2020 at 10:24:37PM +0100, Luc Michel wrote:
> I'm curious, I never experienced this behaviour from GDB. What GDB and
> QEMU versions are you using?
>
> On my side (GDB 9.1), even without 'vContSupported+' in the 'qSupported'
> answer, GDB sends a 'vCont?' packet on the first stepi:
>
> 0x00000000 in ?? ()
> (gdb) si
> Sending packet: $m0,4#fd...Ack
> Packet received: 00000000
> Sending packet: $vCont?#49...Ack
> Packet received: vCont;c;C;s;S
> Packet vCont (verbose-resume) is supported
> Sending packet: $vCont;s:p1.1;c:p1.-1#f7...Ack
> Packet received: T05thread:p01.01;
>
> Your second issue (wrong PC value) should be investigated though. Does
> it happen on QEMU vanilla? Do you have a way to reproduce this bug?
>
Just confirmed this issue. This is an endianness problem for gdb. I was
debugging an big-endian elf and my host cpu is little-endian. QEMU gdbstub
always uses host cpu endian but gdb client treats it as big-endian by
inspecting elf info.
I can mannually set it to little-endian but it is painful. The gdb complains
abount invalid opcode error in debuginfo.
I also noticed that someoneelse has already tried to resolve this issue.
https://patchwork.kernel.org/patch/9528947/
> Anyway after re-reading the GDB remote protocol documentation, I think
> your patch is right, the feature should be advertised.
>
> However I think your commit message needs some modifications. This fix
> is not specific to ARM or TCG, but to the gdbstub itself. You also
> mention this bug you have with PC, which is not related to the bug you
> are fixing here. Could you rewrite it in a more generic way? You simply
> need to emphasis the effect of advertising the 'vContSupported+' feature
> on GDB.
>
> Thanks.
>
> --
> Luc
--
Cheers,
Changbin Du
next prev parent reply other threads:[~2020-02-21 11:51 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
2020-02-20 21:24 ` Luc Michel
2020-02-21 0:07 ` Changbin Du
2020-02-21 11:51 ` Changbin Du [this message]
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=20200221115104.x3af4cfjin553jun@mail.google.com \
--to=changbin.du@gmail.com \
--cc=alex.bennee@linaro.org \
--cc=luc.michel@greensocs.com \
--cc=peter.maydell@linaro.org \
--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).