qemu-devel
[Top][All Lists]
Advanced

[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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]