kvm: Fix dumping code for large registers
authorAndreas Sandberg <andreas.sandberg@arm.com>
Sat, 23 May 2015 12:37:22 +0000 (13:37 +0100)
committerAndreas Sandberg <andreas.sandberg@arm.com>
Sat, 23 May 2015 12:37:22 +0000 (13:37 +0100)
The register dumping code in kvm tries to print the bytes in large
registers (128 bits and larger) instead of printing them as hex. This
changeset fixes that.

src/cpu/kvm/base.cc

index e09c4b7f2c764f5dca30ef35fb8c49debeb140d2..abb3451f64bfc33305c59d65d26b849a2d454a77 100644 (file)
@@ -816,14 +816,14 @@ BaseKvmCPU::getAndFormatOneReg(uint64_t id) const
         ss << value;                             \
     }  break
 
-#define HANDLE_ARRAY(len)                       \
-    case KVM_REG_SIZE_U ## len: {               \
-        uint8_t value[len / 8];                 \
-        getOneReg(id, value);                   \
-        ss << "[" << value[0];                  \
-        for (int i = 1; i < len  / 8; ++i)      \
-            ss << ", " << value[i];             \
-        ss << "]";                              \
+#define HANDLE_ARRAY(len)                               \
+    case KVM_REG_SIZE_U ## len: {                       \
+        uint8_t value[len / 8];                         \
+        getOneReg(id, value);                           \
+        ccprintf(ss, "[0x%x", value[0]);                \
+        for (int i = 1; i < len  / 8; ++i)              \
+            ccprintf(ss, ", 0x%x", value[i]);           \
+        ccprintf(ss, "]");                              \
       } break
 
     switch (id & KVM_REG_SIZE_MASK) {