qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v9 06/23] gdbstub: Introduce GDBFeatureBuilder


From: Alex Bennée
Subject: Re: [PATCH v9 06/23] gdbstub: Introduce GDBFeatureBuilder
Date: Wed, 11 Oct 2023 16:39:12 +0100
User-agent: mu4e 1.11.22; emacs 29.1.50

Akihiko Odaki <akihiko.odaki@daynix.com> writes:

> GDBFeatureBuilder unifies the logic to generate dynamic GDBFeature.
>
> Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>  include/exec/gdbstub.h | 20 ++++++++++++++
>  gdbstub/gdbstub.c      | 59 ++++++++++++++++++++++++++++++++++++++++++
>  2 files changed, 79 insertions(+)
>
> diff --git a/include/exec/gdbstub.h b/include/exec/gdbstub.h
> index 071021415a..d9ef2ccbff 100644
> --- a/include/exec/gdbstub.h
> +++ b/include/exec/gdbstub.h
> @@ -16,6 +16,11 @@ typedef struct GDBFeature {
>      int num_regs;
>  } GDBFeature;
>  
> +typedef struct GDBFeatureBuilder {
> +    GDBFeature *feature;
> +    GPtrArray *xml;
> +} GDBFeatureBuilder;
> +
>  
>  /* Get or set a register.  Returns the size of the register.  */
>  typedef int (*gdb_get_reg_cb)(CPUArchState *env, GByteArray *buf, int reg);
> @@ -44,6 +49,21 @@ void gdb_register_coprocessor(CPUState *cpu,
>   */
>  int gdbserver_start(const char *port_or_device);
>  
> +void gdb_feature_builder_init(GDBFeatureBuilder *builder, GDBFeature 
> *feature,
> +                              const char *name, const char *xmlname);
> +
> +void gdb_feature_builder_append_tag(const GDBFeatureBuilder *builder,
> +                                    const char *format, ...)
> +    G_GNUC_PRINTF(2, 3);

minor nit: it might be cleaner to put this declaration before the name,
i.e.:

  void G_GNUC_PRINTF(2, 3)
  gdb_feature_builder_append_tag(const GDBFeatureBuilder *builder,
                                 const char *format, ...);

but the existing code base is pretty random in where it puts these
declarations so *shrug*.

<snip>

-- 
Alex Bennée
Virtualisation Tech Lead @ Linaro



reply via email to

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