qemu-ppc
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [RFC PATCH 02/24] gdbstub: Introduce GDBFeature structure


From: Philippe Mathieu-Daudé
Subject: Re: [RFC PATCH 02/24] gdbstub: Introduce GDBFeature structure
Date: Mon, 31 Jul 2023 15:51:43 +0200
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.13.0

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.odaki@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

[Prev in Thread] Current Thread [Next in Thread]