This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] ppc64le/gdbserver: Fix ppc_collect/supply_ptrace_register() routines
- From: Sergio Durigan Junior <sergiodj at redhat dot com>
- To: "Ulrich Weigand" <uweigand at de dot ibm dot com>
- Cc: emachado at linux dot vnet dot ibm dot com (Edjunior Barbosa Machado), gdb-patches at sourceware dot org
- Date: Mon, 08 Sep 2014 11:20:19 -0400
- Subject: Re: [PATCH] ppc64le/gdbserver: Fix ppc_collect/supply_ptrace_register() routines
- Authentication-results: sourceware.org; auth=none
- References: <201409081151 dot s88BpOJX015412 at d06av02 dot portsmouth dot uk dot ibm dot com>
On Monday, September 08 2014, Ulrich Weigand wrote:
>> 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.
Ouch, missed that, sorry.
> 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.
This part seemed "strange" to me as well, but then I figured you guys
know more about PPC than I do :-).
Anyway, thanks for the corrections, Ulrich.
--
Sergio
GPG key ID: 0x65FC5E36
Please send encrypted e-mail if possible
http://sergiodj.net/