On 4/1/2014 3:03 PM, Thomas Falcon 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>
<snip> > index 1c91090..92649ed 100644 > --- a/target-ppc/gdbstub.c > +++ b/target-ppc/gdbstub.c > @@ -21,6 +21,82 @@ > #include "qemu-common.h" > #include "exec/gdbstub.h" > > +static int ppc_cpu_gdb_register_len(int n) > +{ > + switch (n) { > + case 0 ... 31: > + /* gprs */ > + return sizeof(target_ulong); > + case 32 ... 63: > + /* fprs */ > + if (gdb_has_xml) { > + return 0; > + } > + return 8; The magic numbers in the case statement are not ideal but there is precedent in the code already for this. Reviewed-by: Tom Musta <tommu...@gmail.com> Tested-by: Tom Musta <tommu...@gmail.com>