All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 00/10] monitor/hmp: replace MonitorDef with GDB registers
@ 2026-10-12 20:34 Marc-André Lureau
  2026-10-12 20:34 ` [PATCH v2 01/10] hmp: don't crash on invalid register Marc-André Lureau
                   ` (9 more replies)
  0 siblings, 10 replies; 16+ messages in thread
From: Marc-André Lureau @ 2026-10-12 20:34 UTC (permalink / raw)
  To: qemu-devel
  Cc: Dr. David Alan Gilbert, Alex Bennée,
	Philippe Mathieu-Daudé, Zhao Liu, Peter Maydell,
	Chinmay Rath, Nicholas Piggin, Glenn Miles, Harsh Prateek Bora,
	Palmer Dabbelt, Alistair Francis, Weiwei Li,
	Daniel Henrique Barboza, Liu Zhiwei, Chao Liu, Max Filippov,
	qemu-arm, qemu-ppc, qemu-riscv, Paolo Bonzini, Laurent Vivier,
	Mark Cave-Ayland, Artyom Tarasenko, Helge Deller,
	Pierrick Bouvier, Warner Losh, Kyle Evans, Marc-André Lureau

Hi,

HMP monitor supports printing $register expression. The lookup
was done via GDB stub registers, and supplementary MonitorDef
HMP-specific tables.

Migrate HMP registers to use the GDB infrastructure and remove the
legacy HMP MonitorDef. Internal registers aren't exposed to GDB.
This also drops HMP $pc x86 fallback (use $eip/$rip instead).

Known behavioural changes on RISC-V: CSR lookup is now case-sensitive
and vector registers now report "unkown register" instead of a
target-specific message ("Unable to print the value of vector vreg 'v0'
from this API")

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
Changes in v2:
- dropped v1 patch 5 (CPUClass::get_pc fallback for $pc)
- new patch gdb_register_internal_coprocessor() to hide registers from GDB
- SPARC64, m68k, RISC-V aliases now use internal registration
- pickup trailer tags
- Link to v1: https://lore.kernel.org/qemu-devel/20260911-query-reg-v1-0-0c04f0c02cf3@redhat.com

---
Marc-André Lureau (10):
      hmp: don't crash on invalid register
      gdbstub: fix next register base after register gaps
      gdbstub: set feature->base_reg for dynamic features
      gdbstub: add gdb_register_internal_coprocessor()
      target/i386: expose segment limits via GDB
      target/m68k: expose system registers via GDB
      target/sparc64: expose system registers via GDB
      target/riscv: bypass smstateen check in debugger mode
      target/riscv: expose register aliases via GDB
      monitor/hmp: remove legacy MonitorDef infrastructure

 configs/targets/i386-softmmu.mak          |   2 +-
 configs/targets/m68k-softmmu.mak          |   2 +-
 configs/targets/riscv32-linux-user.mak    |   2 +-
 configs/targets/riscv32-softmmu.mak       |   2 +-
 configs/targets/riscv64-bsd-user.mak      |   2 +-
 configs/targets/riscv64-linux-user.mak    |   2 +-
 configs/targets/riscv64-softmmu.mak       |   2 +-
 configs/targets/sparc64-softmmu.mak       |   2 +-
 configs/targets/x86_64-softmmu.mak        |   2 +-
 gdbstub/gdb-xml/i386-segments.xml         |  14 +++
 gdbstub/gdb-xml/m68k-system.xml           |  32 +++++++
 gdbstub/gdb-xml/riscv-32bit-alias.xml     | 105 ++++++++++++++++++++++
 gdbstub/gdb-xml/riscv-32bit-fpu-alias.xml |  40 +++++++++
 gdbstub/gdb-xml/riscv-64bit-alias.xml     | 105 ++++++++++++++++++++++
 gdbstub/gdb-xml/riscv-64bit-fpu-alias.xml |  46 ++++++++++
 gdbstub/gdb-xml/sparc64-system.xml        |  22 +++++
 gdbstub/gdbstub.c                         |  85 ++++++++++++++----
 include/exec/gdbstub.h                    |  21 +++++
 include/hw/core/cpu.h                     |   2 +-
 include/hw/core/sysemu-cpu-ops.h          |  16 ----
 include/monitor/hmp.h                     |   6 --
 include/qemu/typedefs.h                   |   1 -
 monitor/hmp.c                             |  46 +---------
 target/arm/gdbstub.c                      |   8 +-
 target/arm/gdbstub64.c                    |  10 ++-
 target/i386/cpu.c                         |  32 -------
 target/i386/gdbstub.c                     |  24 +++++
 target/m68k/cpu.c                         |  22 -----
 target/m68k/helper.c                      |  47 ++++++++++
 target/ppc/gdbstub.c                      |   2 +-
 target/riscv/cpu.c                        |   1 -
 target/riscv/gdbstub.c                    |  56 +++++++++++-
 target/riscv/internals.h                  |   3 -
 target/riscv/monitor.c                    | 140 ------------------------------
 target/riscv/tcg/csr.c                    |   3 +-
 target/sparc/cpu.c                        |  19 ----
 target/sparc/gdbstub.c                    |  38 ++++++++
 target/xtensa/cpu.c                       |   2 +-
 38 files changed, 645 insertions(+), 321 deletions(-)
---
base-commit: 615ece3c406b262996e569f29ea6eed0d81c4d8d
change-id: 20260910-query-reg-80cd59cf4707

Best regards,
--  
Marc-André Lureau <marcandre.lureau@redhat.com>



^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2026-10-13 14:35 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-12 20:34 [PATCH v2 00/10] monitor/hmp: replace MonitorDef with GDB registers Marc-André Lureau
2026-10-12 20:34 ` [PATCH v2 01/10] hmp: don't crash on invalid register Marc-André Lureau
2026-10-12 20:34 ` [PATCH v2 02/10] gdbstub: fix next register base after register gaps Marc-André Lureau
2026-10-12 20:34 ` [PATCH v2 03/10] gdbstub: set feature->base_reg for dynamic features Marc-André Lureau
2026-10-12 20:34 ` [PATCH v2 04/10] gdbstub: add gdb_register_internal_coprocessor() Marc-André Lureau
2026-10-13  8:42   ` Alex Bennée
2026-10-13 13:00     ` Marc-André Lureau
2026-10-13 13:26       ` Peter Maydell
2026-10-13 14:34         ` Dr. David Alan Gilbert
2026-10-12 20:34 ` [PATCH v2 05/10] target/i386: expose segment limits via GDB Marc-André Lureau
2026-10-12 20:34 ` [PATCH v2 06/10] target/m68k: expose system registers " Marc-André Lureau
2026-10-12 20:34 ` [PATCH v2 07/10] target/sparc64: " Marc-André Lureau
2026-10-13  6:57   ` Philippe Mathieu-Daudé
2026-10-12 20:34 ` [PATCH v2 08/10] target/riscv: bypass smstateen check in debugger mode Marc-André Lureau
2026-10-12 20:34 ` [PATCH v2 09/10] target/riscv: expose register aliases via GDB Marc-André Lureau
2026-10-12 20:34 ` [PATCH v2 10/10] monitor/hmp: remove legacy MonitorDef infrastructure Marc-André Lureau

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.