Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Ulrich Weigand" <uweigand@de.ibm.com>
To: sergiodj@redhat.com (Sergio Durigan Junior)
Cc: emachado@linux.vnet.ibm.com (Edjunior Barbosa Machado),
	       gdb-patches@sourceware.org
Subject: Re: [PATCH] ppc64le/gdbserver: Fix ppc_collect/supply_ptrace_register() routines
Date: Mon, 08 Sep 2014 11:51:00 -0000	[thread overview]
Message-ID: <201409081151.s88BpOJX015412@d06av02.portsmouth.uk.ibm.com> (raw)
In-Reply-To: <87oaut4r0u.fsf@redhat.com> from "Sergio Durigan Junior" at Sep 05, 2014 06:54:41 PM

Sergio Durigan Junior wrote:
> On Friday, September 05 2014, Edjunior Barbosa Machado wrote:
> > gdb/gdbserver/
> > 2014-09-05  Edjunior Barbosa Machado  <emachado@linux.vnet.ibm.com>
> >
> > 	* linux-ppc-low.c (ppc_collect_ptrace_register): Adjust routine to take
> > 	endianness into account.
> > 	(ppc_supply_ptrace_register): Likewise.

> > +  if (__BYTE_ORDER == __LITTLE_ENDIAN)
> 
> Why not use gdbarch_byte_order here?  We don't use __BYTE_ORDER anywhere
> in the code.

Well, this is gdbserver code, so there is no gdbarch ...

In gdbserver, we usually check for host properties, so the above check
seems fine to me.

> Same applies for this chunk.
> 
> Otherwise, looks good (it's not an approval).

I agree with the rest of Sergio's comments.

However, there is one additional problem:

>+      /* Big-endian values sit at the right end of the buffer. In case of
>+         registers whose size is smaller than sizeof (long), we must use a
>+         padding to access it correctly.  */
>+      int padding = (sizeof (long) - register_size (regcache->tdesc, regno));
>+      collect_register (regcache, regno, buf + padding);

This will be wrong for registers larger than "long", e.g. vector registers.
The old code handled them correctly, but this new code does not.


Thanks,
Ulrich

-- 
  Dr. Ulrich Weigand
  GNU/Linux compilers and toolchain
  Ulrich.Weigand@de.ibm.com


  reply	other threads:[~2014-09-08 11:51 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-05 20:00 Edjunior Barbosa Machado
2014-09-05 22:54 ` Sergio Durigan Junior
2014-09-08 11:51   ` Ulrich Weigand [this message]
2014-09-08 14:40     ` Edjunior Barbosa Machado
2014-09-08 14:43       ` Ulrich Weigand
2014-09-08 16:51         ` Edjunior Barbosa Machado
2014-09-08 15:20     ` Sergio Durigan Junior

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=201409081151.s88BpOJX015412@d06av02.portsmouth.uk.ibm.com \
    --to=uweigand@de.ibm.com \
    --cc=emachado@linux.vnet.ibm.com \
    --cc=gdb-patches@sourceware.org \
    --cc=sergiodj@redhat.com \
    /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