]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
gdbstub: Emit base_register index in GDBFeature entries
authorPhilippe Mathieu-Daudé <philmd@linaro.org>
Tue, 10 Mar 2026 23:20:39 +0000 (00:20 +0100)
committerPierrick Bouvier <pierrick.bouvier@linaro.org>
Wed, 11 Mar 2026 00:12:18 +0000 (17:12 -0700)
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>
include/exec/gdbstub.h
scripts/feature_to_c.py

index 79e47a024ece88a1ede34fa54f125349cabc373a..75eb4d9c365ee62c2ed0c182bc72a58f6c18d3d0 100644 (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;
 
index 1329695ad0422d512441949dc85cb8b42b74f33e..a52cd2e9ec6df2f79a9f3e135da2b43aeaa3a0b9 100644 (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')