Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: Andrew Burgess <andrew.burgess@embecosm.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH] gdb/x86: Handle kernels using compact xsave format
Date: Mon, 26 Mar 2018 15:42:00 -0000	[thread overview]
Message-ID: <785bd5ce-1e3e-228c-663f-87a3555adaee@redhat.com> (raw)
In-Reply-To: <20180314005707.9009-1-andrew.burgess@embecosm.com>

On 03/14/2018 12:57 AM, Andrew Burgess wrote:

> 
>

[snip excellent description]

> 
> gdb/ChangeLog:
> 
> 	* i387-tdep.c (i387_supply_xsave): Supply initial values when
> 	registers have not been initialised by the kernel yet.
> 	(i387_collect_xsave): Update xstate_bv after check if any control
> 	registers have changed.  Updating the control registers should
> 	result in xstate_bv being updated.

> -	    memcpy (FXSAVE_ADDR (tdep, regs, i), buf, 2);
> +	    p = FXSAVE_ADDR (tdep, regs, i);
> +	    if (memcmp (p, buf, 2) == 0)
> +	      {
> +		xstate_bv |= X86_XSTATE_X87;
> +		memcpy (p, buf, 2);
> +	      }

I don't understand this though -- if memcmp returns 0, then
p and buf hold the same bytes, so the memcpy is useless.
I think you meant to do "memcmp ... != 0" ?

Curious no test catches that.

Thanks,
Pedro Alves


  reply	other threads:[~2018-03-26 15:42 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-14  0:57 Andrew Burgess
2018-03-26 15:42 ` Pedro Alves [this message]
2018-03-26 15:58   ` Pedro Alves

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=785bd5ce-1e3e-228c-663f-87a3555adaee@redhat.com \
    --to=palves@redhat.com \
    --cc=andrew.burgess@embecosm.com \
    --cc=gdb-patches@sourceware.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