On 31/7/23 10:43, Akihiko Odaki wrote:
Before this change, the information from a XML file was stored in an
array that is not descriptive. Introduce a dedicated structure type to
make it easier to understand and to extend with more fields.

Signed-off-by: Akihiko Odaki <akihiko.od...@daynix.com>
---
  MAINTAINERS             |  2 +-
  meson.build             |  2 +-
  include/exec/gdbstub.h  |  9 ++++--
  gdbstub/gdbstub.c       |  4 +--
  stubs/gdbstub.c         |  6 ++--
  scripts/feature_to_c.py | 44 ++++++++++++++++++++++++++
  scripts/feature_to_c.sh | 69 -----------------------------------------
  7 files changed, 58 insertions(+), 78 deletions(-)
  create mode 100755 scripts/feature_to_c.py
  delete mode 100644 scripts/feature_to_c.sh


diff --git a/include/exec/gdbstub.h b/include/exec/gdbstub.h
index 7d743fe1e9..bd5bc91dda 100644
--- a/include/exec/gdbstub.h
+++ b/include/exec/gdbstub.h
@@ -10,6 +10,11 @@
  #define GDB_WATCHPOINT_READ      3
  #define GDB_WATCHPOINT_ACCESS    4
+typedef struct GDBFeature {
+    const char *xmlname;
+    const char *xml;
+} GDBFeature;
+
/* Get or set a register. Returns the size of the register. */
  typedef int (*gdb_get_reg_cb)(CPUArchState *env, GByteArray *buf, int reg);
@@ -38,7 +43,7 @@ void gdb_set_stop_cpu(CPUState *cpu);
   */
  extern bool gdb_has_xml;
-/* in gdbstub-xml.c, generated by scripts/feature_to_c.sh */
-extern const char *const xml_builtin[][2];
+/* in gdbstub-xml.c, generated by scripts/feature_to_c.py */
+extern const GDBFeature gdb_features[];
Maybe clearer named gdb_static_features[].

Reply via email to