[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-ppc] [Qemu-devel] [PATCH v7] target-ppc: gdbstub allow byte sw
From: |
Tom Musta |
Subject: |
Re: [Qemu-ppc] [Qemu-devel] [PATCH v7] target-ppc: gdbstub allow byte swapping for reading/writing registers |
Date: |
Fri, 04 Apr 2014 08:33:21 -0500 |
User-agent: |
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 |
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 <address@hidden>
<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 <address@hidden>
Tested-by: Tom Musta <address@hidden>