summary refs log tree commit diff stats
path: root/monitor.c
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2017-06-29 17:37:11 +0100
committerPeter Maydell <peter.maydell@linaro.org>2017-06-29 17:37:11 +0100
commitc5eb5846d2d207bbde7f4b665d9ff90b92c8adff (patch)
tree0c6c05f44eae0cca3dae76962669e524a3d5125f /monitor.c
parent454d7dc9bc13e46084e0612076e6952c40f4afeb (diff)
parentbd1d5ad9f9a1347d6f4338f294253617c565c89a (diff)
downloadfocaccia-qemu-c5eb5846d2d207bbde7f4b665d9ff90b92c8adff.tar.gz
focaccia-qemu-c5eb5846d2d207bbde7f4b665d9ff90b92c8adff.zip
Merge remote-tracking branch 'remotes/dgilbert/tags/pull-hmp-20170629' into staging
HMP pull 2017-06-29

# gpg: Signature made Thu 29 Jun 2017 17:27:55 BST
# gpg:                using RSA key 0x0516331EBC5BFDE7
# gpg: Good signature from "Dr. David Alan Gilbert (RH2) <dgilbert@redhat.com>"
# gpg: WARNING: This key is not certified with a trusted signature!
# gpg:          There is no indication that the signature belongs to the owner.
# Primary key fingerprint: 45F5 C71B 4A0C B7FB 977A  9FA9 0516 331E BC5B FDE7

* remotes/dgilbert/tags/pull-hmp-20170629:
  Add chardev-send-break monitor command
  monitor: Add -a (all) option to info registers

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'monitor.c')
-rw-r--r--monitor.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/monitor.c b/monitor.c
index 3c369f4dd5..4031876411 100644
--- a/monitor.c
+++ b/monitor.c
@@ -1078,13 +1078,24 @@ int monitor_get_cpu_index(void)
 
 static void hmp_info_registers(Monitor *mon, const QDict *qdict)
 {
-    CPUState *cs = mon_get_cpu();
+    bool all_cpus = qdict_get_try_bool(qdict, "cpustate_all", false);
+    CPUState *cs;
 
-    if (!cs) {
-        monitor_printf(mon, "No CPU available\n");
-        return;
+    if (all_cpus) {
+        CPU_FOREACH(cs) {
+            monitor_printf(mon, "\nCPU#%d\n", cs->cpu_index);
+            cpu_dump_state(cs, (FILE *)mon, monitor_fprintf, CPU_DUMP_FPU);
+        }
+    } else {
+        cs = mon_get_cpu();
+
+        if (!cs) {
+            monitor_printf(mon, "No CPU available\n");
+            return;
+        }
+
+        cpu_dump_state(cs, (FILE *)mon, monitor_fprintf, CPU_DUMP_FPU);
     }
-    cpu_dump_state(cs, (FILE *)mon, monitor_fprintf, CPU_DUMP_FPU);
 }
 
 static void hmp_info_jit(Monitor *mon, const QDict *qdict)