[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
- [PATCH v9 00/23] plugins: Allow to read registers, Akihiko Odaki, 2023/10/11
- [PATCH v9 01/23] target/riscv: Move MISA limits to class, Akihiko Odaki, 2023/10/11
- [PATCH v9 02/23] target/riscv: Remove misa_mxl validation, Akihiko Odaki, 2023/10/11
- [PATCH v9 03/23] target/riscv: Validate misa_mxl_max only once, Akihiko Odaki, 2023/10/11
- [PATCH v9 04/23] gdbstub: Add num_regs member to GDBFeature, Akihiko Odaki, 2023/10/11
- [PATCH v9 05/23] gdbstub: Introduce gdb_find_static_feature(), Akihiko Odaki, 2023/10/11
- [PATCH v9 06/23] gdbstub: Introduce GDBFeatureBuilder, Akihiko Odaki, 2023/10/11
- Re: [PATCH v9 06/23] gdbstub: Introduce GDBFeatureBuilder,
Alex Bennée <=
- [PATCH v9 07/23] target/arm: Use GDBFeature for dynamic XML, Akihiko Odaki, 2023/10/11
- [PATCH v9 09/23] target/riscv: Use GDBFeature for dynamic XML, Akihiko Odaki, 2023/10/11
- [PATCH v9 08/23] target/ppc: Use GDBFeature for dynamic XML, Akihiko Odaki, 2023/10/11
- [PATCH v9 10/23] gdbstub: Use GDBFeature for gdb_register_coprocessor, Akihiko Odaki, 2023/10/11
- [PATCH v9 11/23] gdbstub: Use GDBFeature for GDBRegisterState, Akihiko Odaki, 2023/10/11
- [PATCH v9 13/23] gdbstub: Simplify XML lookup, Akihiko Odaki, 2023/10/11
- [PATCH v9 12/23] gdbstub: Change gdb_get_reg_cb and gdb_set_reg_cb, Akihiko Odaki, 2023/10/11
- [PATCH v9 14/23] gdbstub: Infer number of core registers from XML, Akihiko Odaki, 2023/10/11
- [PATCH v9 15/23] hw/core/cpu: Remove gdb_get_dynamic_xml member, Akihiko Odaki, 2023/10/11