All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Alex Bennée" <alex.bennee@linaro.org>
To: Peter Xu <peterx@redhat.com>
Cc: "Philippe Mathieu-Daudé" <philmd@redhat.com>, qemu-devel@nongnu.org
Subject: Re: [PATCH 2/2] gdbstub: i386: Fix gdb_get_reg16() parameter to unbreak gdb
Date: Thu, 09 Apr 2020 21:36:02 +0100	[thread overview]
Message-ID: <87o8s09z2l.fsf@linaro.org> (raw)
In-Reply-To: <20200409164954.36902-3-peterx@redhat.com>


Peter Xu <peterx@redhat.com> writes:

> We should only pass in gdb_get_reg16() with the GByteArray* object
> itself, no need to shift.  Without this patch, gdb remote attach will
> crash QEMU.
>
> Cc: Alex Bennée <alex.bennee@linaro.org>
> Cc: Philippe Mathieu-Daudé <philmd@redhat.com>
> Signed-off-by: Peter Xu <peterx@redhat.com>

Queued to for-5.0/more-random-fixes, thanks.

> ---
>  target/i386/gdbstub.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/target/i386/gdbstub.c b/target/i386/gdbstub.c
> index f3d23b614e..b98a99500a 100644
> --- a/target/i386/gdbstub.c
> +++ b/target/i386/gdbstub.c
> @@ -106,7 +106,7 @@ int x86_cpu_gdb_read_register(CPUState *cs, GByteArray *mem_buf, int n)
>      } else if (n >= IDX_FP_REGS && n < IDX_FP_REGS + 8) {
>          floatx80 *fp = (floatx80 *) &env->fpregs[n - IDX_FP_REGS];
>          int len = gdb_get_reg64(mem_buf, cpu_to_le64(fp->low));
> -        len += gdb_get_reg16(mem_buf + len, cpu_to_le16(fp->high));
> +        len += gdb_get_reg16(mem_buf, cpu_to_le16(fp->high));
>          return len;
>      } else if (n >= IDX_XMM_REGS && n < IDX_XMM_REGS + CPU_NB_REGS) {
>          n -= IDX_XMM_REGS;


-- 
Alex Bennée


      parent reply	other threads:[~2020-04-09 20:36 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-09 16:49 [PATCH 0/2] gdbstub: Unbreak i386 with gdb remote Peter Xu
2020-04-09 16:49 ` [PATCH 1/2] gdbstub: Assert len read from each register Peter Xu
2020-04-09 17:51   ` Philippe Mathieu-Daudé
2020-04-09 18:12     ` Peter Xu
2020-04-09 16:49 ` [PATCH 2/2] gdbstub: i386: Fix gdb_get_reg16() parameter to unbreak gdb Peter Xu
2020-04-09 17:21   ` Philippe Mathieu-Daudé
2020-04-09 18:01     ` Peter Xu
2020-04-09 19:29       ` Philippe Mathieu-Daudé
2020-04-09 20:36   ` 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=87o8s09z2l.fsf@linaro.org \
    --to=alex.bennee@linaro.org \
    --cc=peterx@redhat.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.