All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Alex Bennée" <alex.bennee@linaro.org>
To: Changbin Du <changbin.du@gmail.com>
Cc: philmd@redhat.com, qemu-devel@nongnu.org
Subject: Re: [PATCH v2] gdbstub: Fix single-step issue by confirming 'vContSupported+' feature to gdb
Date: Mon, 09 Mar 2020 14:48:47 +0000	[thread overview]
Message-ID: <874kuxk2i8.fsf@linaro.org> (raw)
In-Reply-To: <20200309104322.u6ktpdl5yjdfcvqa@mail.google.com>


Changbin Du <changbin.du@gmail.com> writes:

> hello, is this patch ready to merge now? Thanks!
>
> On Fri, Feb 21, 2020 at 08:25:59AM +0800, Changbin Du 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, which is an another bug.
>>  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).

OK I was initially confused because I couldn't replicate the failure
with the aarch64 tests. With or without the vContSupported reply I saw
the exact same set of messages go between gdbstub and gdb.

However I did replicate with:

  ./arm-softmmu/qemu-system-arm -monitor none -display none \
     -chardev file,path=test-armv6m-undef.out,id=output \
     -semihosting -M microbit \
     -kernel tests/tcg/arm-softmmu/test-armv6m-undef \
     -s -S -d trace:gdbstub\* -D gdbstub.dump

So I have applied it to me tree.

-- 
Alex Bennée


      reply	other threads:[~2020-03-09 14:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-21  0:25 [PATCH v2] gdbstub: Fix single-step issue by confirming 'vContSupported+' feature to gdb Changbin Du
2020-02-21 12:40 ` Luc Michel
2020-03-09 10:43 ` Changbin Du
2020-03-09 14:48   ` 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=874kuxk2i8.fsf@linaro.org \
    --to=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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.