diff options
author | Alex Bennée <alex.bennee@linaro.org> | 2024-02-27 14:43:27 +0000 |
---|---|---|
committer | Alex Bennée <alex.bennee@linaro.org> | 2024-02-28 09:11:42 +0000 |
commit | c3d0b46645d4b95b1fa24f4911738cb59d26173e (patch) | |
tree | 579bd7ad5bae7046e4e6cd2454747a2ce5047cd8 /include | |
parent | 33a277fec03a61e470bc279b03b1a3759505f3e0 (diff) | |
download | qemu-c3d0b46645d4b95b1fa24f4911738cb59d26173e.zip qemu-c3d0b46645d4b95b1fa24f4911738cb59d26173e.tar.gz qemu-c3d0b46645d4b95b1fa24f4911738cb59d26173e.tar.bz2 |
gdbstub: expose api to find registers
Expose an internal API to QEMU to return all the registers for a vCPU.
The list containing the details required to called gdb_read_register().
Based-on: <20231025093128.33116-15-akihiko.odaki@daynix.com>
Cc: Akihiko Odaki <akihiko.odaki@daynix.com>
Reviewed-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20240227144335.1196131-22-alex.bennee@linaro.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/exec/gdbstub.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/include/exec/gdbstub.h b/include/exec/gdbstub.h index da9ddfe..eb14b91 100644 --- a/include/exec/gdbstub.h +++ b/include/exec/gdbstub.h @@ -111,6 +111,34 @@ void gdb_feature_builder_end(const GDBFeatureBuilder *builder); */ const GDBFeature *gdb_find_static_feature(const char *xmlname); +/** + * gdb_read_register() - Read a register associated with a CPU. + * @cpu: The CPU associated with the register. + * @buf: The buffer that the read register will be appended to. + * @reg: The register's number returned by gdb_find_feature_register(). + * + * Return: The number of read bytes. + */ +int gdb_read_register(CPUState *cpu, GByteArray *buf, int reg); + +/** + * typedef GDBRegDesc - a register description from gdbstub + */ +typedef struct { + int gdb_reg; + const char *name; + const char *feature_name; +} GDBRegDesc; + +/** + * gdb_get_register_list() - Return list of all registers for CPU + * @cpu: The CPU being searched + * + * Returns a GArray of GDBRegDesc, caller frees array but not the + * const strings. + */ +GArray *gdb_get_register_list(CPUState *cpu); + void gdb_set_stop_cpu(CPUState *cpu); /* in gdbstub-xml.c, generated by scripts/feature_to_c.py */ |