qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: qemu-devel@nongnu.org
Cc: qemu-arm@nongnu.org,
	"Richard Henderson" <richard.henderson@linaro.org>,
	"Alex Bennée" <alex.bennee@linaro.org>
Subject: Re: [PATCH v2 02/10] gdbstub: Clarify no more than @gdb_num_core_regs can be accessed
Date: Wed, 22 Jan 2025 10:32:43 +0100	[thread overview]
Message-ID: <dda293ce-575c-45c8-ab36-93938a7c5bdc@linaro.org> (raw)
In-Reply-To: <20250122093028.52416-3-philmd@linaro.org>

On 22/1/25 10:30, Philippe Mathieu-Daudé wrote:
> Both CPUClass::gdb_read_register() and CPUClass::gdb_write_register()
> handlers are called from common gdbstub code, and won't be called with
> register index over CPUClass::gdb_num_core_regs:
> 
>    int gdb_read_register(CPUState *cpu, GByteArray *buf, int reg)
>    {
>        CPUClass *cc = CPU_GET_CLASS(cpu);
> 
>        if (reg < cc->gdb_num_core_regs) {
>            return cc->gdb_read_register(cpu, buf, reg);
>        }
>        ...
>    }
> 
>    static int gdb_write_register(CPUState *cpu, uint8_t *mem_buf, int reg)
>    {
>        CPUClass *cc = CPU_GET_CLASS(cpu);
> 
>        if (reg < cc->gdb_num_core_regs) {
>            return cc->gdb_write_register(cpu, mem_buf, reg);
>        }
>        ...
>    }
> 
> Clarify that in CPUClass docstring, and remove unreachable code on
> the microblaze and tricore implementations.

s/tricore/openrisc/ 🤦

> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>   include/hw/core/cpu.h       | 2 ++
>   target/microblaze/gdbstub.c | 5 -----
>   target/openrisc/gdbstub.c   | 5 -----
>   3 files changed, 2 insertions(+), 10 deletions(-)



  reply	other threads:[~2025-01-22  9:33 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-22  9:30 [PATCH v2 00/10] cpus: Prefer cached CpuClass over CPU_GET_CLASS() macro Philippe Mathieu-Daudé
2025-01-22  9:30 ` [PATCH v2 01/10] hw/core/generic-loader: Do not open-code cpu_set_pc() Philippe Mathieu-Daudé
2025-01-24 19:25   ` Richard Henderson
2025-01-22  9:30 ` [PATCH v2 02/10] gdbstub: Clarify no more than @gdb_num_core_regs can be accessed Philippe Mathieu-Daudé
2025-01-22  9:32   ` Philippe Mathieu-Daudé [this message]
2025-01-22 20:55   ` Alex Bennée
2025-01-22  9:30 ` [PATCH v2 03/10] cpus: Cache CPUClass early in instance_init() handler Philippe Mathieu-Daudé
2025-01-22  9:30 ` [PATCH v2 04/10] cpus: Prefer cached CpuClass over CPU_GET_CLASS() macro Philippe Mathieu-Daudé
2025-01-22  9:30 ` [PATCH v2 05/10] accel: " Philippe Mathieu-Daudé
2025-01-22  9:30 ` [PATCH v2 06/10] user: " Philippe Mathieu-Daudé
2025-01-22  9:30 ` [PATCH v2 07/10] disas: " Philippe Mathieu-Daudé
2025-01-22  9:30 ` [PATCH v2 08/10] gdbstub: " Philippe Mathieu-Daudé
2025-01-22 21:34   ` Alex Bennée
2025-01-22  9:30 ` [PATCH v2 09/10] hw/acpi: " Philippe Mathieu-Daudé
2025-01-22  9:30 ` [PATCH v2 10/10] target/arm: " Philippe Mathieu-Daudé
2025-02-10 21:56 ` [PATCH v2 00/10] cpus: " Philippe Mathieu-Daudé

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=dda293ce-575c-45c8-ab36-93938a7c5bdc@linaro.org \
    --to=philmd@linaro.org \
    --cc=alex.bennee@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.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).