[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v14 10/18] gdbstub: Simplify XML lookup
|
From: |
Alex Bennée |
|
Subject: |
Re: [PATCH v14 10/18] gdbstub: Simplify XML lookup |
|
Date: |
Tue, 24 Oct 2023 15:25:05 +0100 |
|
User-agent: |
mu4e 1.11.22; emacs 29.1.90 |
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
- [PATCH v14 00/18] plugins: Allow to read registers, Akihiko Odaki, 2023/10/19
- [PATCH v14 01/18] gdbstub: Add num_regs member to GDBFeature, Akihiko Odaki, 2023/10/19
- [PATCH v14 02/18] gdbstub: Introduce gdb_find_static_feature(), Akihiko Odaki, 2023/10/19
- [PATCH v14 03/18] gdbstub: Introduce GDBFeatureBuilder, Akihiko Odaki, 2023/10/19
- [PATCH v14 04/18] target/arm: Use GDBFeature for dynamic XML, Akihiko Odaki, 2023/10/19
- [PATCH v14 06/18] target/riscv: Use GDBFeature for dynamic XML, Akihiko Odaki, 2023/10/19
- [PATCH v14 05/18] target/ppc: Use GDBFeature for dynamic XML, Akihiko Odaki, 2023/10/19
- [PATCH v14 07/18] gdbstub: Use GDBFeature for gdb_register_coprocessor, Akihiko Odaki, 2023/10/19
- [PATCH v14 08/18] gdbstub: Use GDBFeature for GDBRegisterState, Akihiko Odaki, 2023/10/19
- [PATCH v14 10/18] gdbstub: Simplify XML lookup, Akihiko Odaki, 2023/10/19
- Re: [PATCH v14 10/18] gdbstub: Simplify XML lookup,
Alex Bennée <=
- [PATCH v14 09/18] gdbstub: Change gdb_get_reg_cb and gdb_set_reg_cb, Akihiko Odaki, 2023/10/19
- [PATCH v14 12/18] hw/core/cpu: Remove gdb_get_dynamic_xml member, Akihiko Odaki, 2023/10/19
- [PATCH v14 11/18] gdbstub: Infer number of core registers from XML, Akihiko Odaki, 2023/10/19
- [PATCH v14 16/18] plugins: Use different helpers when reading registers, Akihiko Odaki, 2023/10/19
- [PATCH v14 17/18] plugins: Allow to read registers, Akihiko Odaki, 2023/10/19