Akihiko Odaki <akihiko.od...@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.od...@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.ben...@linaro.org>

-- 
Alex Bennée
Virtualisation Tech Lead @ Linaro

Reply via email to