Index: trunk/src/VBox/VMM/VMMAll/CPUMAllRegs.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMAll/CPUMAllRegs.cpp	(revision 12578)
+++ trunk/src/VBox/VMM/VMMAll/CPUMAllRegs.cpp	(revision 12600)
@@ -182,5 +182,5 @@
 CPUMDECL(void) CPUMSetHyperDR0(PVM pVM, RTGCUINTREG uDr0)
 {
-    pVM->cpum.s.Hyper.dr0 = uDr0;
+    pVM->cpum.s.Hyper.dr[0] = uDr0;
     /** @todo in GC we must load it! */
 }
@@ -188,5 +188,5 @@
 CPUMDECL(void) CPUMSetHyperDR1(PVM pVM, RTGCUINTREG uDr1)
 {
-    pVM->cpum.s.Hyper.dr1 = uDr1;
+    pVM->cpum.s.Hyper.dr[1] = uDr1;
     /** @todo in GC we must load it! */
 }
@@ -194,5 +194,5 @@
 CPUMDECL(void) CPUMSetHyperDR2(PVM pVM, RTGCUINTREG uDr2)
 {
-    pVM->cpum.s.Hyper.dr2 = uDr2;
+    pVM->cpum.s.Hyper.dr[2] = uDr2;
     /** @todo in GC we must load it! */
 }
@@ -200,5 +200,5 @@
 CPUMDECL(void) CPUMSetHyperDR3(PVM pVM, RTGCUINTREG uDr3)
 {
-    pVM->cpum.s.Hyper.dr3 = uDr3;
+    pVM->cpum.s.Hyper.dr[3] = uDr3;
     /** @todo in GC we must load it! */
 }
@@ -206,5 +206,5 @@
 CPUMDECL(void) CPUMSetHyperDR6(PVM pVM, RTGCUINTREG uDr6)
 {
-    pVM->cpum.s.Hyper.dr6 = uDr6;
+    pVM->cpum.s.Hyper.dr[6] = uDr6;
     /** @todo in GC we must load it! */
 }
@@ -212,5 +212,5 @@
 CPUMDECL(void) CPUMSetHyperDR7(PVM pVM, RTGCUINTREG uDr7)
 {
-    pVM->cpum.s.Hyper.dr7 = uDr7;
+    pVM->cpum.s.Hyper.dr[7] = uDr7;
     /** @todo in GC we must load it! */
 }
@@ -347,30 +347,30 @@
 CPUMDECL(RTGCUINTREG) CPUMGetHyperDR0(PVM pVM)
 {
-    return pVM->cpum.s.Hyper.dr0;
+    return pVM->cpum.s.Hyper.dr[0];
 }
 
 CPUMDECL(RTGCUINTREG) CPUMGetHyperDR1(PVM pVM)
 {
-    return pVM->cpum.s.Hyper.dr1;
+    return pVM->cpum.s.Hyper.dr[1];
 }
 
 CPUMDECL(RTGCUINTREG) CPUMGetHyperDR2(PVM pVM)
 {
-    return pVM->cpum.s.Hyper.dr2;
+    return pVM->cpum.s.Hyper.dr[2];
 }
 
 CPUMDECL(RTGCUINTREG) CPUMGetHyperDR3(PVM pVM)
 {
-    return pVM->cpum.s.Hyper.dr3;
+    return pVM->cpum.s.Hyper.dr[3];
 }
 
 CPUMDECL(RTGCUINTREG) CPUMGetHyperDR6(PVM pVM)
 {
-    return pVM->cpum.s.Hyper.dr6;
+    return pVM->cpum.s.Hyper.dr[6];
 }
 
 CPUMDECL(RTGCUINTREG) CPUMGetHyperDR7(PVM pVM)
 {
-    return pVM->cpum.s.Hyper.dr7;
+    return pVM->cpum.s.Hyper.dr[7];
 }
 
@@ -888,61 +888,36 @@
 CPUMDECL(uint64_t) CPUMGetGuestDR0(PVM pVM)
 {
-    return pVM->cpum.s.Guest.dr0;
+    return pVM->cpum.s.Guest.dr[0];
 }
 
 CPUMDECL(uint64_t) CPUMGetGuestDR1(PVM pVM)
 {
-    return pVM->cpum.s.Guest.dr1;
+    return pVM->cpum.s.Guest.dr[1];
 }
 
 CPUMDECL(uint64_t) CPUMGetGuestDR2(PVM pVM)
 {
-    return pVM->cpum.s.Guest.dr2;
+    return pVM->cpum.s.Guest.dr[2];
 }
 
 CPUMDECL(uint64_t) CPUMGetGuestDR3(PVM pVM)
 {
-    return pVM->cpum.s.Guest.dr3;
+    return pVM->cpum.s.Guest.dr[3];
 }
 
 CPUMDECL(uint64_t) CPUMGetGuestDR6(PVM pVM)
 {
-    return pVM->cpum.s.Guest.dr6;
+    return pVM->cpum.s.Guest.dr[6];
 }
 
 CPUMDECL(uint64_t) CPUMGetGuestDR7(PVM pVM)
 {
-    return pVM->cpum.s.Guest.dr7;
-}
-
-/** @todo drx should be an array */
+    return pVM->cpum.s.Guest.dr[7];
+}
+
 CPUMDECL(int) CPUMGetGuestDRx(PVM pVM, uint32_t iReg, uint64_t *pValue)
 {
-    switch (iReg)
-    {
-        case USE_REG_DR0:
-            *pValue = pVM->cpum.s.Guest.dr0;
-            break;
-        case USE_REG_DR1:
-            *pValue = pVM->cpum.s.Guest.dr1;
-            break;
-        case USE_REG_DR2:
-            *pValue = pVM->cpum.s.Guest.dr2;
-            break;
-        case USE_REG_DR3:
-            *pValue = pVM->cpum.s.Guest.dr3;
-            break;
-        case USE_REG_DR4:
-        case USE_REG_DR6:
-            *pValue = pVM->cpum.s.Guest.dr6;
-            break;
-        case USE_REG_DR5:
-        case USE_REG_DR7:
-            *pValue = pVM->cpum.s.Guest.dr7;
-            break;
-
-        default:
-            return VERR_INVALID_PARAMETER;
-    }
+    AssertReturn(iReg <= USE_REG_DR7, VERR_INVALID_PARAMETER);
+    *pValue = pVM->cpum.s.Guest.dr[iReg];
     return VINF_SUCCESS;
 }
@@ -1311,5 +1286,5 @@
 CPUMDECL(int) CPUMSetGuestDR0(PVM pVM, uint64_t uDr0)
 {
-    pVM->cpum.s.Guest.dr0 = uDr0;
+    pVM->cpum.s.Guest.dr[0] = uDr0;
     return CPUMRecalcHyperDRx(pVM);
 }
@@ -1317,5 +1292,5 @@
 CPUMDECL(int) CPUMSetGuestDR1(PVM pVM, uint64_t uDr1)
 {
-    pVM->cpum.s.Guest.dr1 = uDr1;
+    pVM->cpum.s.Guest.dr[1] = uDr1;
     return CPUMRecalcHyperDRx(pVM);
 }
@@ -1323,5 +1298,5 @@
 CPUMDECL(int) CPUMSetGuestDR2(PVM pVM, uint64_t uDr2)
 {
-    pVM->cpum.s.Guest.dr2 = uDr2;
+    pVM->cpum.s.Guest.dr[2] = uDr2;
     return CPUMRecalcHyperDRx(pVM);
 }
@@ -1329,5 +1304,5 @@
 CPUMDECL(int) CPUMSetGuestDR3(PVM pVM, uint64_t uDr3)
 {
-    pVM->cpum.s.Guest.dr3 = uDr3;
+    pVM->cpum.s.Guest.dr[3] = uDr3;
     return CPUMRecalcHyperDRx(pVM);
 }
@@ -1335,5 +1310,5 @@
 CPUMDECL(int) CPUMSetGuestDR6(PVM pVM, uint64_t uDr6)
 {
-    pVM->cpum.s.Guest.dr6 = uDr6;
+    pVM->cpum.s.Guest.dr[6] = uDr6;
     return CPUMRecalcHyperDRx(pVM);
 }
@@ -1341,37 +1316,12 @@
 CPUMDECL(int) CPUMSetGuestDR7(PVM pVM, uint64_t uDr7)
 {
-    pVM->cpum.s.Guest.dr7 = uDr7;
+    pVM->cpum.s.Guest.dr[7] = uDr7;
     return CPUMRecalcHyperDRx(pVM);
 }
 
-/** @todo drx should be an array */
 CPUMDECL(int) CPUMSetGuestDRx(PVM pVM, uint32_t iReg, uint64_t Value)
 {
-    switch (iReg)
-    {
-        case USE_REG_DR0:
-            pVM->cpum.s.Guest.dr0 = Value;
-            break;
-        case USE_REG_DR1:
-            pVM->cpum.s.Guest.dr1 = Value;
-            break;
-        case USE_REG_DR2:
-            pVM->cpum.s.Guest.dr2 = Value;
-            break;
-        case USE_REG_DR3:
-            pVM->cpum.s.Guest.dr3 = Value;
-            break;
-        case USE_REG_DR4:
-        case USE_REG_DR6:
-            pVM->cpum.s.Guest.dr6 = Value;
-            break;
-        case USE_REG_DR5:
-        case USE_REG_DR7:
-            pVM->cpum.s.Guest.dr7 = Value;
-            break;
-
-        default:
-            return VERR_INVALID_PARAMETER;
-    }
+    AssertReturn(iReg <= USE_REG_DR7, VERR_INVALID_PARAMETER);
+    pVM->cpum.s.Guest.dr[iReg] = Value;
     return CPUMRecalcHyperDRx(pVM);
 }
@@ -1425,5 +1375,5 @@
         }
         else
-            uNewDr0 = pVM->cpum.s.Hyper.dr0;
+            uNewDr0 = pVM->cpum.s.Hyper.dr[0];
 
         /* bp 1 */
@@ -1440,5 +1390,5 @@
         }
         else
-            uNewDr1 = pVM->cpum.s.Hyper.dr1;
+            uNewDr1 = pVM->cpum.s.Hyper.dr[1];
 
         /* bp 2 */
@@ -1455,5 +1405,5 @@
         }
         else
-            uNewDr2 = pVM->cpum.s.Hyper.dr2;
+            uNewDr2 = pVM->cpum.s.Hyper.dr[2];
 
         /* bp 3 */
@@ -1470,5 +1420,5 @@
         }
         else
-            uNewDr3 = pVM->cpum.s.Hyper.dr3;
+            uNewDr3 = pVM->cpum.s.Hyper.dr[3];
 
         /*
@@ -1482,13 +1432,13 @@
 #endif
         pVM->cpum.s.fUseFlags |= CPUM_USE_DEBUG_REGS;
-        if (uNewDr3 != pVM->cpum.s.Hyper.dr3)
+        if (uNewDr3 != pVM->cpum.s.Hyper.dr[3])
             CPUMSetHyperDR3(pVM, uNewDr3);
-        if (uNewDr2 != pVM->cpum.s.Hyper.dr2)
+        if (uNewDr2 != pVM->cpum.s.Hyper.dr[2])
             CPUMSetHyperDR2(pVM, uNewDr2);
-        if (uNewDr1 != pVM->cpum.s.Hyper.dr1)
+        if (uNewDr1 != pVM->cpum.s.Hyper.dr[1])
             CPUMSetHyperDR1(pVM, uNewDr1);
-        if (uNewDr0 != pVM->cpum.s.Hyper.dr0)
+        if (uNewDr0 != pVM->cpum.s.Hyper.dr[0])
             CPUMSetHyperDR0(pVM, uNewDr0);
-        if (uNewDr7 != pVM->cpum.s.Hyper.dr7)
+        if (uNewDr7 != pVM->cpum.s.Hyper.dr[7])
             CPUMSetHyperDR7(pVM, uNewDr7);
     }
@@ -1504,7 +1454,7 @@
     }
     Log2(("CPUMRecalcHyperDRx: fUseFlags=%#x %RGr %RGr %RGr %RGr  %RGr %RGr\n",
-          pVM->cpum.s.fUseFlags, pVM->cpum.s.Hyper.dr0, pVM->cpum.s.Hyper.dr1,
-         pVM->cpum.s.Hyper.dr2, pVM->cpum.s.Hyper.dr3, pVM->cpum.s.Hyper.dr6,
-         pVM->cpum.s.Hyper.dr7));
+          pVM->cpum.s.fUseFlags, pVM->cpum.s.Hyper.dr[0], pVM->cpum.s.Hyper.dr[1],
+         pVM->cpum.s.Hyper.dr[2], pVM->cpum.s.Hyper.dr[3], pVM->cpum.s.Hyper.dr[6],
+         pVM->cpum.s.Hyper.dr[7]));
 
     return VINF_SUCCESS;
