From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:46606) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UHvNE-00072F-Nl for qemu-devel@nongnu.org; Tue, 19 Mar 2013 08:10:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UHvND-0005hI-FF for qemu-devel@nongnu.org; Tue, 19 Mar 2013 08:10:36 -0400 Mime-Version: 1.0 (Apple Message framework v1278) Content-Type: text/plain; charset=us-ascii From: Alexander Graf In-Reply-To: <1363694598-19799-1-git-send-email-chouteau@adacore.com> Date: Tue, 19 Mar 2013 13:10:30 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: <1F098328-BA3A-40BC-955B-9CDFF470D257@suse.de> References: <1363694598-19799-1-git-send-email-chouteau@adacore.com> Subject: Re: [Qemu-devel] [PATCH] PPC/GDB: handle read and write of fpscr List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fabien Chouteau Cc: qemu-ppc@nongnu.org, qemu-devel@nongnu.org On 19.03.2013, at 13:03, Fabien Chouteau wrote: > Although the support of this register may be uncomplete, there are no > reason to prevent the debugger from reading or writing it. >=20 > Signed-off-by: Fabien Chouteau > --- > gdbstub.c | 3 ++- > target-ppc/translate_init.c | 2 +- > 2 files changed, 3 insertions(+), 2 deletions(-) >=20 > diff --git a/gdbstub.c b/gdbstub.c > index e414ad9..d23d9c5 100644 > --- a/gdbstub.c > +++ b/gdbstub.c > @@ -781,7 +781,8 @@ static int cpu_gdb_write_register(CPUPPCState = *env, uint8_t *mem_buf, int n) > /* fpscr */ > if (gdb_has_xml) > return 0; > - return 4; > + env->fpscr =3D ldtul_p(mem_buf); Check out helper_store_fpscr() in target-ppc/fpu_helper.c. Storing fpscr = has a bunch of side effects that won't happen when you just set the env = variable. I'd prefer not to enable users to set fpscr when we can't = guarantee that the updated values are actually used. Can't you just call the helper function here? Alex > + return sizeof(target_ulong); > } > } > return 0; > diff --git a/target-ppc/translate_init.c b/target-ppc/translate_init.c > index 09ad4ba..a5d2cc3 100644 > --- a/target-ppc/translate_init.c > +++ b/target-ppc/translate_init.c > @@ -7693,7 +7693,7 @@ static int gdb_set_float_reg(CPUPPCState *env, = uint8_t *mem_buf, int n) > return 8; > } > if (n =3D=3D 32) { > - /* FPSCR not implemented */ > + env->fpscr =3D ldl_p(mem_buf); > return 4; > } > return 0; > --=20 > 1.7.9.5 >=20