From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: Sven Schnelle <svens@stackframe.org>,
Richard Henderson <richard.henderson@linaro.org>,
Helge Deller <deller@gmx.de>
Cc: qemu-devel@nongnu.org
Subject: Re: [PATCH 1/1] target/hppa: add 64 bit support to gdbstub
Date: Wed, 12 Nov 2025 08:07:22 +0100 [thread overview]
Message-ID: <41f24ea4-787f-4e79-bff2-5ae66c4c2a6e@linaro.org> (raw)
In-Reply-To: <20251110222646.180265-2-svens@stackframe.org>
Hi Sven!
On 10/11/25 23:26, Sven Schnelle wrote:
> Signed-off-by: Sven Schnelle <svens@stackframe.org>
> ---
> target/hppa/gdbstub.c | 66 +++++++++++++++++++++++++++++--------------
> 1 file changed, 45 insertions(+), 21 deletions(-)
> +static int hppa_reg_size(CPUHPPAState *env)
> +{
> + return hppa_is_pa20(env) ? 8 : 4;
> +}
> int hppa_cpu_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n)
> {
> - CPUHPPAState *env = cpu_env(cs);
> - uint32_t val = ldl_p(mem_buf);
> + HPPACPU *cpu = HPPA_CPU(cs);
> + CPUHPPAState *env = &cpu->env;
> + target_ulong val;
> +
> + if (n >= hppa_num_regs(env)) {
> + return 0;
> + }
> +
> + if (hppa_is_pa20(env)) {
> + val = ldq_p(mem_buf);
> + } else {
> + val = ldl_p(mem_buf);
> + }
Alternatively:
val = ldn_p(mem_buf, hppa_reg_size(env));
>
> switch (n) {
> case 0:
> @@ -267,16 +291,16 @@ int hppa_cpu_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n)
> cpu_hppa_loaded_fr0(env);
> break;
> case 65 ... 127:
> - {
> + if (hppa_is_pa20(env)) {
> + env->fr[n - 64] = val;
> + } else {
> uint64_t *fr = &env->fr[(n - 64) / 2];
> *fr = deposit64(*fr, (n & 1 ? 0 : 32), 32, val);
> }
> break;
> default:
> - if (n >= 128) {
> - return 0;
> - }
> break;
> }
> - return 4;
> +
> + return hppa_reg_size(env);
> }
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
prev parent reply other threads:[~2025-11-12 7:07 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-10 22:26 [PATCH 0/1] 64 Bit support for hppa gdbstub Sven Schnelle
2025-11-10 22:26 ` [PATCH 1/1] target/hppa: add 64 bit support to gdbstub Sven Schnelle
2025-11-12 7:07 ` Philippe Mathieu-Daudé [this message]
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=41f24ea4-787f-4e79-bff2-5ae66c4c2a6e@linaro.org \
--to=philmd@linaro.org \
--cc=deller@gmx.de \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.org \
--cc=svens@stackframe.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).