@samitouri / QOSamiQemu / commits / e0930f667a

gdbstub: Emit base_register index in GDBFeature entries

Record the base register index in the generated C file. Check at runtime that either @g_pos argument of gdb_register_coprocessor() is zero, or it the base register index. This change pass 'make check-tcg' test suite, which runs the tests/tcg/multiarch/gdbstub/registers.py test, itself calling gdb_register_coprocessor() for each target tested. Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> Tested-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> Link: https://lore.kernel.org/qemu-devel/20260310232045.58440-12-philmd@linaro.org Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>

Philippe Mathieu-Daudé committed Mar 11, 2026 at 00:20 UTC e0930f667a44aad84a9bd01738bd5eaaa29b658d
2 files changed +2
include/exec/gdbstub.h
+1
@@ -6,6 +6,7 @@ typedef struct GDBFeature {
6 const char *xml;
7 const char *name;
8 const char * const *regs;
9 + int base_reg;
10 int num_regs;
11 } GDBFeature;
12
scripts/feature_to_c.py
+1
@@ -102,6 +102,7 @@ for input in sys.argv[1:]:
102 sys.stdout.write(',\n')
103
104 sys.stdout.write( ' },\n')
105 + sys.stdout.write(f' .base_reg = {base_reg},\n')
106 sys.stdout.write(f' .num_regs = {num_regs},\n')
107 sys.stdout.write( ' },\n')
108