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>
This commit is contained in:
Philippe Mathieu-Daudé
2026-03-11 00:20:39 +01:00
committed by Pierrick Bouvier
parent aa6a508795
commit e0930f667a
2 changed files with 2 additions and 0 deletions

View File

@@ -6,6 +6,7 @@ typedef struct GDBFeature {
const char *xml;
const char *name;
const char * const *regs;
int base_reg;
int num_regs;
} GDBFeature;

View File

@@ -102,6 +102,7 @@ for input in sys.argv[1:]:
sys.stdout.write(',\n')
sys.stdout.write( ' },\n')
sys.stdout.write(f' .base_reg = {base_reg},\n')
sys.stdout.write(f' .num_regs = {num_regs},\n')
sys.stdout.write( ' },\n')