Add EGPRs in monitor_defs[] to allow HMP to access EGPRs.

For example,

(qemu) print $r16

Since monitor_defs[] is used for read-only case, no need to consider
xstate synchronization issues that might be caused by modifying EGPRs
(like what gdbstub did).

Suggested-by: Paolo Bonzini <[email protected]>
Tested-by: Xudong Hao <[email protected]>
Signed-off-by: Zhao Liu <[email protected]>
---
Changes since v1:
 * New patch.
---
 target/i386/monitor.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/target/i386/monitor.c b/target/i386/monitor.c
index d2bb873d4947..99b32cb7b0f3 100644
--- a/target/i386/monitor.c
+++ b/target/i386/monitor.c
@@ -623,6 +623,22 @@ const MonitorDef monitor_defs[] = {
     { "r13", offsetof(CPUX86State, regs[13]) },
     { "r14", offsetof(CPUX86State, regs[14]) },
     { "r15", offsetof(CPUX86State, regs[15]) },
+    { "r16", offsetof(CPUX86State, regs[16]) },
+    { "r17", offsetof(CPUX86State, regs[17]) },
+    { "r18", offsetof(CPUX86State, regs[18]) },
+    { "r19", offsetof(CPUX86State, regs[19]) },
+    { "r20", offsetof(CPUX86State, regs[20]) },
+    { "r21", offsetof(CPUX86State, regs[21]) },
+    { "r22", offsetof(CPUX86State, regs[22]) },
+    { "r23", offsetof(CPUX86State, regs[23]) },
+    { "r24", offsetof(CPUX86State, regs[24]) },
+    { "r25", offsetof(CPUX86State, regs[25]) },
+    { "r26", offsetof(CPUX86State, regs[26]) },
+    { "r27", offsetof(CPUX86State, regs[27]) },
+    { "r28", offsetof(CPUX86State, regs[28]) },
+    { "r29", offsetof(CPUX86State, regs[29]) },
+    { "r30", offsetof(CPUX86State, regs[30]) },
+    { "r31", offsetof(CPUX86State, regs[31]) },
 #endif
     { "eflags", offsetof(CPUX86State, eflags) },
     { "eip", offsetof(CPUX86State, eip) },
-- 
2.34.1


Reply via email to