qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] gdbstub/ppc: handle read and write of fpscr


From: Peter Maydell
Subject: Re: [Qemu-devel] [PATCH] gdbstub/ppc: handle read and write of fpscr
Date: Tue, 15 Feb 2011 10:22:27 +0000

On 15 February 2011 08:59, Tristan Gingold <address@hidden> wrote:
> @@ -770,7 +770,8 @@ static int cpu_gdb_write_register(CPUState *env, uint8_t 
> *mem_buf, int n)
>             /* fpscr */
>             if (gdb_has_xml)
>                 return 0;
> -            return 4;
> +            env->fpscr = ldtul_p(mem_buf);
> +            return sizeof(target_ulong);
>         }
>     }
>     return 0;

Not a PPC expert, but this doesn't look right; for instance if you change
the rounding mode by fiddling with the FPSCR in the debugger this
won't update the softfloat rounding mode settings. (that is, it lets the
visible state in env->fpscr get out of sync with the hidden state of the
model). Also we probably shouldn't be letting the debugger change
reserved fpscr bits.

(Side note: linux-user/signal.c:restore_user_regs() appears to have
a similar fpscr-related bug.)

-- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]