From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43665) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WW4FV-00056j-DS for qemu-devel@nongnu.org; Fri, 04 Apr 2014 09:33:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WW4FM-0004U8-C0 for qemu-devel@nongnu.org; Fri, 04 Apr 2014 09:33:37 -0400 Message-ID: <533EB4A1.3020807@gmail.com> Date: Fri, 04 Apr 2014 08:33:21 -0500 From: Tom Musta MIME-Version: 1.0 References: <1396382633-6769-1-git-send-email-tlfalcon@linux.vnet.ibm.com> In-Reply-To: <1396382633-6769-1-git-send-email-tlfalcon@linux.vnet.ibm.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v7] target-ppc: gdbstub allow byte swapping for reading/writing registers List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Thomas Falcon , qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, agraf@suse.de 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 > 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 Tested-by: Tom Musta