On 16/2/26 23:52, Philippe Mathieu-Daudé wrote:
Implement the gdb_get_register() helper and call it before the
regular get_monitor_def() one. Registers is exposed via the
GDB XML files will be directly handled, possibily allowing new
registers added to XML files to be automatically accessible in
QEMU monitor. All targets having GDB XML files can now be used
within the monitor.

For example with Loongarch, before:

  $ qemu-system-loongarch64 -M virt -S -monitor stdio
  QEMU 10.2.0 monitor - type 'help' for more information

  (qemu) info registers

  CPU#0
   PC=000000001c000000  FCSR0 0x00000000
   ...

  (qemu) p/x $pc
  unknown register
  Try "help p" for more information
  (qemu)

and after:

  $ ./qemu-system-loongarch64 -M virt -S -monitor stdio
  QEMU 10.2.50 monitor - type 'help' for more information
  (qemu) p/x $pc
  0x1c000000
  (qemu)

Similarly RISC-V:

  QEMU 10.2.0 monitor - type 'help' for more information
  (qemu) p/x $pc
  unknown register
  Try "help p" for more information

VS

  QEMU 10.2.50 monitor - type 'help' for more information
  (qemu) p/x $pc
  0x1000
  (qemu)


Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
---
  monitor/hmp.c | 49 ++++++++++++++++++++++++++++++++++++++++++++++---
  1 file changed, 46 insertions(+), 3 deletions(-)


Reply via email to