aboutsummaryrefslogtreecommitdiff
path: root/gdbstub
diff options
context:
space:
mode:
authorAkihiko Odaki <akihiko.odaki@daynix.com>2023-11-06 18:50:59 +0000
committerAlex Bennée <alex.bennee@linaro.org>2023-11-08 15:15:23 +0000
commit1218b68ea673076632fff99e4e46a32a6cc190a1 (patch)
tree0c44ba670b2cc9b09013590dec84dc79091ad7c8 /gdbstub
parent6c2313e83d4ecdc036f86f20758d00ac3b898f4d (diff)
downloadqemu-1218b68ea673076632fff99e4e46a32a6cc190a1.zip
qemu-1218b68ea673076632fff99e4e46a32a6cc190a1.tar.gz
qemu-1218b68ea673076632fff99e4e46a32a6cc190a1.tar.bz2
gdbstub: Introduce gdb_find_static_feature()
This function is useful to determine the number of registers exposed to GDB from the XML name. Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20231025093128.33116-3-akihiko.odaki@daynix.com> Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20231106185112.2755262-10-alex.bennee@linaro.org>
Diffstat (limited to 'gdbstub')
-rw-r--r--gdbstub/gdbstub.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/gdbstub/gdbstub.c b/gdbstub/gdbstub.c
index 29540a0..ae24c48 100644
--- a/gdbstub/gdbstub.c
+++ b/gdbstub/gdbstub.c
@@ -422,6 +422,19 @@ static const char *get_feature_xml(const char *p, const char **newp,
return NULL;
}
+const GDBFeature *gdb_find_static_feature(const char *xmlname)
+{
+ const GDBFeature *feature;
+
+ for (feature = gdb_static_features; feature->xmlname; feature++) {
+ if (!strcmp(feature->xmlname, xmlname)) {
+ return feature;
+ }
+ }
+
+ g_assert_not_reached();
+}
+
static int gdb_read_register(CPUState *cpu, GByteArray *buf, int reg)
{
CPUClass *cc = CPU_GET_CLASS(cpu);