From: "Alex Bennée" <alex.bennee@linaro.org>
To: Akihiko Odaki <akihiko.odaki@daynix.com>
Cc: "Mikhail Tyutin" <m.tyutin@yadro.com>,
"Aleksandr Anenkov" <a.anenkov@yadro.com>,
qemu-devel@nongnu.org,
"Philippe Mathieu-Daudé" <philmd@linaro.org>
Subject: Re: [PATCH v14 10/18] gdbstub: Simplify XML lookup
Date: Tue, 24 Oct 2023 15:25:05 +0100 [thread overview]
Message-ID: <87o7go2itz.fsf@linaro.org> (raw)
In-Reply-To: <20231019102657.129512-11-akihiko.odaki@daynix.com>
Akihiko Odaki <akihiko.odaki@daynix.com> writes:
> Now we know all instances of GDBFeature that is used in CPU so we can
> traverse them to find XML. This removes the need for a CPU-specific
> lookup function for dynamic XMLs.
>
> Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
<snip>
> }
>
> +static void gdb_register_feature(CPUState *cpu, int base_reg,
> + gdb_get_reg_cb get_reg, gdb_set_reg_cb set_reg,
> + const GDBFeature *feature)
> +{
> + guint i = cpu->gdb_regs->len;
> + GDBRegisterState *s;
> +
> + g_array_set_size(cpu->gdb_regs, i + 1);
> + s = &g_array_index(cpu->gdb_regs, GDBRegisterState, i);
> + s->base_reg = base_reg;
> + s->get_reg = get_reg;
> + s->set_reg = set_reg;
> + s->feature = feature;
Why not just:
GDBRegisterState s = { base_reg, get_reg, set_reg, feature };
g_array_append_val(cpu->gdb_regs, s);
?
Otherwise:
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
--
Alex Bennée
Virtualisation Tech Lead @ Linaro
next prev parent reply other threads:[~2023-10-24 14:32 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-19 10:26 [PATCH v14 00/18] plugins: Allow to read registers Akihiko Odaki
2023-10-19 10:26 ` [PATCH v14 01/18] gdbstub: Add num_regs member to GDBFeature Akihiko Odaki
2023-10-19 10:26 ` [PATCH v14 02/18] gdbstub: Introduce gdb_find_static_feature() Akihiko Odaki
2023-10-19 10:26 ` [PATCH v14 03/18] gdbstub: Introduce GDBFeatureBuilder Akihiko Odaki
2023-10-19 10:26 ` [PATCH v14 04/18] target/arm: Use GDBFeature for dynamic XML Akihiko Odaki
2023-10-19 10:26 ` [PATCH v14 05/18] target/ppc: " Akihiko Odaki
2023-10-19 10:26 ` [PATCH v14 06/18] target/riscv: " Akihiko Odaki
2023-10-19 10:26 ` [PATCH v14 07/18] gdbstub: Use GDBFeature for gdb_register_coprocessor Akihiko Odaki
2023-10-19 10:26 ` [PATCH v14 08/18] gdbstub: Use GDBFeature for GDBRegisterState Akihiko Odaki
2023-10-19 10:26 ` [PATCH v14 09/18] gdbstub: Change gdb_get_reg_cb and gdb_set_reg_cb Akihiko Odaki
2023-10-24 14:20 ` Alex Bennée
2023-10-19 10:26 ` [PATCH v14 10/18] gdbstub: Simplify XML lookup Akihiko Odaki
2023-10-24 14:25 ` Alex Bennée [this message]
2023-10-19 10:26 ` [PATCH v14 11/18] gdbstub: Infer number of core registers from XML Akihiko Odaki
2023-10-19 10:26 ` [PATCH v14 12/18] hw/core/cpu: Remove gdb_get_dynamic_xml member Akihiko Odaki
2023-10-24 15:38 ` Alex Bennée
2023-10-19 10:26 ` [PATCH v14 13/18] gdbstub: Add members to identify registers to GDBFeature Akihiko Odaki
2023-10-19 10:26 ` [PATCH v14 14/18] gdbstub: Expose functions to read registers Akihiko Odaki
2023-10-24 15:41 ` Alex Bennée
2023-10-19 10:26 ` [PATCH v14 15/18] cpu: Call plugin hooks only when ready Akihiko Odaki
2023-10-24 15:58 ` Alex Bennée
2023-10-24 16:41 ` Alex Bennée
2023-10-19 10:26 ` [PATCH v14 16/18] plugins: Use different helpers when reading registers Akihiko Odaki
2023-10-24 16:48 ` Alex Bennée
2023-10-25 5:39 ` Akihiko Odaki
2023-10-25 9:34 ` Akihiko Odaki
2023-10-19 10:26 ` [PATCH v14 17/18] plugins: Allow to read registers Akihiko Odaki
2023-10-19 10:26 ` [PATCH v14 18/18] contrib/plugins: Allow to log registers Akihiko Odaki
2023-10-24 17:08 ` [PATCH v14 00/18] plugins: Allow to read registers Alex Bennée
2023-10-25 5:51 ` Akihiko Odaki
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=87o7go2itz.fsf@linaro.org \
--to=alex.bennee@linaro.org \
--cc=a.anenkov@yadro.com \
--cc=akihiko.odaki@daynix.com \
--cc=m.tyutin@yadro.com \
--cc=philmd@linaro.org \
--cc=qemu-devel@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).