[PATCH] ppc64le/gdbserver: Fix ppc_collect/supply_ptrace_register() routines
Sergio Durigan Junior
sergiodj@redhat.com
Mon Sep 8 15:20:00 GMT 2014
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/
More information about the Gdb-patches
mailing list