On 01/20/2014 08:33 AM, Alexander Graf wrote:
On 17.01.2014, at 22:02, Thomas Falcon <tlfal...@linux.vnet.ibm.com> wrote:
This patch allows registers to be properly read from and written to
when using the gdbstub to debug a ppc guest running in little
endian mode. It accomplishes this goal by byte swapping the values of
any registers if the MSR:LE value is set.
Signed-off-by: Thomas Falcon <tlfal...@linux.vnet.ibm.com>
---
Differences from v2:
Fixed formatting issues
Added logic to ensure only FP registers have a guaranteed size of 8 bytes
I don't really like how the write case has to know about the size of a register
(maybe we could factor this out into a single function for all reads and
writes?), but this is good enough for now :). However, I can't apply the patch
as your email client seems to have broken the patch formatting.
Alex
I'm not sure of a way to swap the value without knowing its size. In both read
and write, the size needs to be known and is hardcoded in some cases. The
write case cannot know the size without a conditional since we need to swap in
mem_buf before we call ppc_cpu_gdb_write_register. Maybe we could get around
this by hanging ppc_cpu_gdb_write_register so that it returns a pointer to the
register being overwritten, and then we could swap that instead of mem_buf?
But even then I guess we would still need to check the size of the register
before we called bswap32/64.
Anyway, sorry about the formatting issues again. Should I just resubmit the
patch as is?
Thanks,
Tom