From: Alexander Graf <agraf@suse.de>
To: Fabien Chouteau <chouteau@adacore.com>
Cc: qemu-ppc@nongnu.org, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] PPC/GDB: handle read and write of fpscr
Date: Tue, 19 Mar 2013 13:10:30 +0100 [thread overview]
Message-ID: <1F098328-BA3A-40BC-955B-9CDFF470D257@suse.de> (raw)
In-Reply-To: <1363694598-19799-1-git-send-email-chouteau@adacore.com>
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.
>
> Signed-off-by: Fabien Chouteau <chouteau@adacore.com>
> ---
> gdbstub.c | 3 ++-
> target-ppc/translate_init.c | 2 +-
> 2 files changed, 3 insertions(+), 2 deletions(-)
>
> 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 = 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 == 32) {
> - /* FPSCR not implemented */
> + env->fpscr = ldl_p(mem_buf);
> return 4;
> }
> return 0;
> --
> 1.7.9.5
>
next prev parent reply other threads:[~2013-03-19 12:10 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-19 12:03 [Qemu-devel] [PATCH] PPC/GDB: handle read and write of fpscr Fabien Chouteau
2013-03-19 12:10 ` Alexander Graf [this message]
2013-03-19 12:13 ` Peter Maydell
2013-03-19 12:16 ` Alexander Graf
2013-03-19 15:14 ` Fabien Chouteau
2013-03-19 15:23 ` Peter Maydell
2013-03-19 17:20 ` Fabien Chouteau
2013-03-19 17:21 ` Peter Maydell
2013-03-19 18:32 ` Richard Henderson
2013-03-19 19:48 ` Alexander Graf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1F098328-BA3A-40BC-955B-9CDFF470D257@suse.de \
--to=agraf@suse.de \
--cc=chouteau@adacore.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).