From 2744c8fd054dde5c8c9ec3bc518af8f029d73e03 Mon Sep 17 00:00:00 2001
From: tracer-ics2018 <tracer@njuics.org>
Date: Sat, 14 Dec 2019 13:23:16 +0800
Subject: [PATCH] >  Manual commit:  Better info r U201614531 recolic Linux
 RECOLICPC 5.4.2-arch1-1 #1 SMP PREEMPT Thu, 05 Dec 2019 12:29:40 +0000 x86_64
 GNU/Linux  13:23:16 up 2 days, 20:41,  1 user,  load average: 1.50, 1.42,
 1.21 ae29316cbf5d91c7bd90bd912203e525524d324f

---
 nemu/src/monitor/debug/ui.cc | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/nemu/src/monitor/debug/ui.cc b/nemu/src/monitor/debug/ui.cc
index 32f7dad..2b97f28 100644
--- a/nemu/src/monitor/debug/ui.cc
+++ b/nemu/src/monitor/debug/ui.cc
@@ -131,9 +131,10 @@ using namespace rlib;
 using namespace rlib::literals;
 
 #include <sstream>
+#include <iomanip>
 
 auto dumpReg(uint32_t val) {
-  return string("[32b={}{}, L16b={}{}]").format(std::hex, val, (uint16_t)val, std::dec);
+  return string("{}{}[32b=0x{}{}, {}L16b=0x{}{}]").format(std::setfill('0'), std::setw(8), std::hex, val, std::setw(4), (uint16_t)val, std::dec);
 }
 
 static int cmd_info(char *args) {
-- 
GitLab