Index: trunk/include/VBox/dbg.h
===================================================================
--- trunk/include/VBox/dbg.h	(revision 44398)
+++ trunk/include/VBox/dbg.h	(revision 44399)
@@ -8,5 +8,5 @@
 
 /*
- * Copyright (C) 2006-2007 Oracle Corporation
+ * Copyright (C) 2006-2013 Oracle Corporation
  *
  * This file is part of VirtualBox Open Source Edition (OSE), as
@@ -478,5 +478,4 @@
      * @returns VBox status code appropriate to return from a command.
      * @param   pCmdHlp     Pointer to the command callback structure.
-     * @param   pVM         VM handle if GC or physical HC address.
      * @param   pvBuffer    Where to store the read data.
      * @param   cbRead      Number of bytes to read.
@@ -488,5 +487,5 @@
      *                      will cause failure.
      */
-    DECLCALLBACKMEMBER(int, pfnMemRead)(PDBGCCMDHLP pCmdHlp, PVM pVM, void *pvBuffer, size_t cbRead, PCDBGCVAR pVarPointer, size_t *pcbRead);
+    DECLCALLBACKMEMBER(int, pfnMemRead)(PDBGCCMDHLP pCmdHlp, void *pvBuffer, size_t cbRead, PCDBGCVAR pVarPointer, size_t *pcbRead);
 
     /**
@@ -495,5 +494,4 @@
      * @returns VBox status code appropriate to return from a command.
      * @param   pCmdHlp     Pointer to the command callback structure.
-     * @param   pVM         VM handle if GC or physical HC address.
      * @param   pvBuffer    What to write.
      * @param   cbWrite     Number of bytes to write.
@@ -503,5 +501,5 @@
      *                      might have been written to the specified address.
      */
-    DECLCALLBACKMEMBER(int, pfnMemWrite)(PDBGCCMDHLP pCmdHlp, PVM pVM, const void *pvBuffer, size_t cbWrite, PCDBGCVAR pVarPointer, size_t *pcbWritten);
+    DECLCALLBACKMEMBER(int, pfnMemWrite)(PDBGCCMDHLP pCmdHlp, const void *pvBuffer, size_t cbWrite, PCDBGCVAR pVarPointer, size_t *pcbWritten);
 
     /**
@@ -721,7 +719,7 @@
  * @copydoc FNDBGCHLPMEMREAD
  */
-DECLINLINE(int) DBGCCmdHlpMemRead(PDBGCCMDHLP pCmdHlp, PVM pVM, void *pvBuffer, size_t cbRead, PCDBGCVAR pVarPointer, size_t *pcbRead)
-{
-    return pCmdHlp->pfnMemRead(pCmdHlp, pVM, pvBuffer, cbRead, pVarPointer, pcbRead);
+DECLINLINE(int) DBGCCmdHlpMemRead(PDBGCCMDHLP pCmdHlp, void *pvBuffer, size_t cbRead, PCDBGCVAR pVarPointer, size_t *pcbRead)
+{
+    return pCmdHlp->pfnMemRead(pCmdHlp, pvBuffer, cbRead, pVarPointer, pcbRead);
 }
 
@@ -818,7 +816,7 @@
 /** Assert+return like macro that the VM handle is present.
  * Returns with failure if the VM handle is NIL.  */
-#define DBGC_CMDHLP_REQ_VM_RET(pCmdHlp, pCmd, pVM) \
+#define DBGC_CMDHLP_REQ_UVM_RET(pCmdHlp, pCmd, pUVM) \
     do { \
-        if (!(pVM)) \
+        if (!(pUVM)) \
             return DBGCCmdHlpFail(pCmdHlp, pCmd, "No VM selected"); \
     } while (0)
@@ -927,9 +925,9 @@
  * @param   pCmd        Pointer to the command descriptor (as registered).
  * @param   pCmdHlp     Pointer to command helper functions.
- * @param   pVM         Pointer to the current VM (if any).
+ * @param   pUVM        The user mode VM handle, can in theory be NULL.
  * @param   paArgs      Pointer to (readonly) array of arguments.
  * @param   cArgs       Number of arguments in the array.
  */
-typedef DECLCALLBACK(int) FNDBGCCMD(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
+typedef DECLCALLBACK(int) FNDBGCCMD(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs);
 /** Pointer to a FNDBGCCMD() function. */
 typedef FNDBGCCMD *PFNDBGCCMD;
@@ -976,10 +974,10 @@
  * @param   pCmd        Pointer to the command descriptor (as registered).
  * @param   pCmdHlp     Pointer to command helper functions.
- * @param   pVM         Pointer to the current VM (if any).
+ * @param   pUVM        The user mode VM handle, can in theory be NULL.
  * @param   paArgs      Pointer to (readonly) array of arguments.
  * @param   cArgs       Number of arguments in the array.
  * @param   pResult     Where to return the result.
  */
-typedef DECLCALLBACK(int) FNDBGCFUNC(PCDBGCFUNC pFunc, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs,
+typedef DECLCALLBACK(int) FNDBGCFUNC(PCDBGCFUNC pFunc, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs,
                                      PDBGCVAR pResult);
 /** Pointer to a FNDBGCFUNC() function. */
@@ -1092,65 +1090,9 @@
 } DBGCBACK;
 
-
-/**
- * Make a console instance.
- *
- * This will not return until either an 'exit' command is issued or a error code
- * indicating connection loss is encountered.
- *
- * @returns VINF_SUCCESS if console termination caused by the 'exit' command.
- * @returns The VBox status code causing the console termination.
- *
- * @param   pVM         VM Handle.
- * @param   pBack       Pointer to the backend structure. This must contain
- *                      a full set of function pointers to service the console.
- * @param   fFlags      Reserved, must be zero.
- * @remark  A forced termination of the console is easiest done by forcing the
- *          callbacks to return fatal failures.
- */
-DBGDECL(int)    DBGCCreate(PVM pVM, PDBGCBACK pBack, unsigned fFlags);
-
-
-/**
- * Register one or more external commands.
- *
- * @returns VBox status.
- * @param   paCommands      Pointer to an array of command descriptors.
- *                          The commands must be unique. It's not possible
- *                          to register the same commands more than once.
- * @param   cCommands       Number of commands.
- */
+DBGDECL(int)    DBGCCreate(PUVM pUVM, PDBGCBACK pBack, unsigned fFlags);
 DBGDECL(int)    DBGCRegisterCommands(PCDBGCCMD paCommands, unsigned cCommands);
-
-
-/**
- * Deregister one or more external commands previously registered by
- * DBGCRegisterCommands().
- *
- * @returns VBox status.
- * @param   paCommands      Pointer to an array of command descriptors
- *                          as given to DBGCRegisterCommands().
- * @param   cCommands       Number of commands.
- */
 DBGDECL(int)    DBGCDeregisterCommands(PCDBGCCMD paCommands, unsigned cCommands);
-
-
-/**
- * Spawns a new thread with a TCP based debugging console service.
- *
- * @returns VBox status.
- * @param   pVM         VM handle.
- * @param   ppvData     Where to store the pointer to instance data.
- */
-DBGDECL(int)    DBGCTcpCreate(PVM pVM, void **ppvUser);
-
-/**
- * Terminates any running TCP base debugger console service.
- *
- * @returns VBox status.
- * @param   pVM         VM handle.
- * @param   pvData      Instance data set by DBGCTcpCreate().
- */
-DBGDECL(int)    DBGCTcpTerminate(PVM pVM, void *pvData);
+DBGDECL(int)    DBGCTcpCreate(PUVM pUVM, void **ppvUser);
+DBGDECL(int)    DBGCTcpTerminate(PUVM pUVM, void *pvData);
 
 
@@ -1190,13 +1132,13 @@
  *
  * @param   enmOperation    The operation.
- * @param   pVM             The VM handle. This may be NULL.
+ * @param   pUVM            The user mode VM handle. This may be NULL.
  * @param   uArg            Extra argument.
  */
-typedef DECLCALLBACK(int) FNDBGCPLUGIN(DBGCPLUGINOP enmOperation, PVM pVM, uintptr_t uArg);
+typedef DECLCALLBACK(int) FNDBGCPLUGIN(DBGCPLUGINOP enmOperation, PUVM pUVM, uintptr_t uArg);
 /** Pointer to a FNDBGCPLUGIN. */
 typedef FNDBGCPLUGIN *PFNDBGCPLUGIN;
 
 /** @copydoc FNDBGCPLUGIN */
-DECLEXPORT(int) DBGCPlugInEntry(DBGCPLUGINOP enmOperation, PVM pVM, uintptr_t uArg);
+DECLEXPORT(int) DBGCPlugInEntry(DBGCPLUGINOP enmOperation, PUVM pUVM, uintptr_t uArg);
 
 #endif /* IN_RING3 */
Index: trunk/include/VBox/vmm/dbgf.h
===================================================================
--- trunk/include/VBox/vmm/dbgf.h	(revision 44398)
+++ trunk/include/VBox/vmm/dbgf.h	(revision 44399)
@@ -47,6 +47,6 @@
  * @{
  */
-VMMRZDECL(int) DBGFRZTrap01Handler(PVM pVM, PVMCPU pVCpu, PCPUMCTXCORE pRegFrame, RTGCUINTREG uDr6);
-VMMRZDECL(int) DBGFRZTrap03Handler(PVM pVM, PVMCPU pVCpu, PCPUMCTXCORE pRegFrame);
+VMMRZ_INT_DECL(int) DBGFRZTrap01Handler(PVM pVM, PVMCPU pVCpu, PCPUMCTXCORE pRegFrame, RTGCUINTREG uDr6);
+VMMRZ_INT_DECL(int) DBGFRZTrap03Handler(PVM pVM, PVMCPU pVCpu, PCPUMCTXCORE pRegFrame);
 /** @} */
 #endif
@@ -115,12 +115,12 @@
 /** @} */
 
-VMMR3DECL(int)          DBGFR3AddrFromSelOff(PVM pVM, VMCPUID idCpu, PDBGFADDRESS pAddress, RTSEL Sel, RTUINTPTR off);
-VMMR3DECL(int)          DBGFR3AddrFromSelInfoOff(PVM pVM, PDBGFADDRESS pAddress, PCDBGFSELINFO pSelInfo, RTUINTPTR off);
-VMMR3DECL(PDBGFADDRESS) DBGFR3AddrFromFlat(PVM pVM, PDBGFADDRESS pAddress, RTGCUINTPTR FlatPtr);
-VMMR3DECL(PDBGFADDRESS) DBGFR3AddrFromPhys(PVM pVM, PDBGFADDRESS pAddress, RTGCPHYS PhysAddr);
-VMMR3DECL(bool)         DBGFR3AddrIsValid(PVM pVM, PCDBGFADDRESS pAddress);
-VMMR3DECL(int)          DBGFR3AddrToPhys(PVM pVM, VMCPUID idCpu, PDBGFADDRESS pAddress, PRTGCPHYS pGCPhys);
-VMMR3DECL(int)          DBGFR3AddrToHostPhys(PVM pVM, VMCPUID idCpu, PDBGFADDRESS pAddress, PRTHCPHYS pHCPhys);
-VMMR3DECL(int)          DBGFR3AddrToVolatileR3Ptr(PVM pVM, VMCPUID idCpu, PDBGFADDRESS pAddress, bool fReadOnly, void **ppvR3Ptr);
+VMMR3DECL(int)          DBGFR3AddrFromSelOff(PUVM pUVM, VMCPUID idCpu, PDBGFADDRESS pAddress, RTSEL Sel, RTUINTPTR off);
+VMMR3DECL(int)          DBGFR3AddrFromSelInfoOff(PUVM pUVM, PDBGFADDRESS pAddress, PCDBGFSELINFO pSelInfo, RTUINTPTR off);
+VMMR3DECL(PDBGFADDRESS) DBGFR3AddrFromFlat(PUVM pUVM, PDBGFADDRESS pAddress, RTGCUINTPTR FlatPtr);
+VMMR3DECL(PDBGFADDRESS) DBGFR3AddrFromPhys(PUVM pUVM, PDBGFADDRESS pAddress, RTGCPHYS PhysAddr);
+VMMR3DECL(bool)         DBGFR3AddrIsValid(PUVM pUVM, PCDBGFADDRESS pAddress);
+VMMR3DECL(int)          DBGFR3AddrToPhys(PUVM pUVM, VMCPUID idCpu, PDBGFADDRESS pAddress, PRTGCPHYS pGCPhys);
+VMMR3DECL(int)          DBGFR3AddrToHostPhys(PUVM pUVM, VMCPUID idCpu, PDBGFADDRESS pAddress, PRTHCPHYS pHCPhys);
+VMMR3DECL(int)          DBGFR3AddrToVolatileR3Ptr(PUVM pUVM, VMCPUID idCpu, PDBGFADDRESS pAddress, bool fReadOnly, void **ppvR3Ptr);
 VMMR3DECL(PDBGFADDRESS) DBGFR3AddrAdd(PDBGFADDRESS pAddress, RTGCUINTPTR uAddend);
 VMMR3DECL(PDBGFADDRESS) DBGFR3AddrSub(PDBGFADDRESS pAddress, RTGCUINTPTR uSubtrahend);
@@ -282,23 +282,26 @@
 # endif
 
-VMMR3DECL(int)  DBGFR3Init(PVM pVM);
-VMMR3DECL(int)  DBGFR3Term(PVM pVM);
-VMMR3DECL(void) DBGFR3Relocate(PVM pVM, RTGCINTPTR offDelta);
-VMMR3DECL(int)  DBGFR3VMMForcedAction(PVM pVM);
-VMMR3DECL(int)  DBGFR3Event(PVM pVM, DBGFEVENTTYPE enmEvent);
-VMMR3DECL(int)  DBGFR3EventSrc(PVM pVM, DBGFEVENTTYPE enmEvent, const char *pszFile, unsigned uLine, const char *pszFunction, const char *pszFormat, ...);
-VMMR3DECL(int)  DBGFR3EventSrcV(PVM pVM, DBGFEVENTTYPE enmEvent, const char *pszFile, unsigned uLine, const char *pszFunction, const char *pszFormat, va_list args);
-VMMR3DECL(int)  DBGFR3EventAssertion(PVM pVM, DBGFEVENTTYPE enmEvent, const char *pszMsg1, const char *pszMsg2);
-VMMR3DECL(int)  DBGFR3EventBreakpoint(PVM pVM, DBGFEVENTTYPE enmEvent);
-VMMR3DECL(int)  DBGFR3Attach(PVM pVM);
-VMMR3DECL(int)  DBGFR3Detach(PVM pVM);
-VMMR3DECL(int)  DBGFR3EventWait(PVM pVM, RTMSINTERVAL cMillies, PCDBGFEVENT *ppEvent);
-VMMR3DECL(int)  DBGFR3Halt(PVM pVM);
-VMMR3DECL(bool) DBGFR3IsHalted(PVM pVM);
-VMMR3DECL(bool) DBGFR3CanWait(PVM pVM);
-VMMR3DECL(int)  DBGFR3Resume(PVM pVM);
-VMMR3DECL(int)  DBGFR3Step(PVM pVM, VMCPUID idCpu);
-VMMR3DECL(int)  DBGFR3PrgStep(PVMCPU pVCpu);
-VMMR3DECL(int)  DBGFR3InjectNMI(PUVM pUVM, VMCPUID idCpu);
+VMMR3_INT_DECL(int)     DBGFR3Init(PVM pVM);
+VMMR3_INT_DECL(int)     DBGFR3Term(PVM pVM);
+VMMR3_INT_DECL(void)    DBGFR3Relocate(PVM pVM, RTGCINTPTR offDelta);
+VMMR3_INT_DECL(int)     DBGFR3VMMForcedAction(PVM pVM);
+VMMR3DECL(int)          DBGFR3Event(PVM pVM, DBGFEVENTTYPE enmEvent);
+VMMR3DECL(int)          DBGFR3EventSrc(PVM pVM, DBGFEVENTTYPE enmEvent, const char *pszFile, unsigned uLine,
+                                       const char *pszFunction, const char *pszFormat, ...);
+VMMR3DECL(int)          DBGFR3EventSrcV(PVM pVM, DBGFEVENTTYPE enmEvent, const char *pszFile, unsigned uLine,
+                                        const char *pszFunction, const char *pszFormat, va_list args);
+VMMR3_INT_DECL(int)     DBGFR3EventAssertion(PVM pVM, DBGFEVENTTYPE enmEvent, const char *pszMsg1, const char *pszMsg2);
+VMMR3_INT_DECL(int)     DBGFR3EventBreakpoint(PVM pVM, DBGFEVENTTYPE enmEvent);
+VMMR3_INT_DECL(int)     DBGFR3PrgStep(PVMCPU pVCpu);
+
+VMMR3DECL(int)          DBGFR3Attach(PUVM pUVM);
+VMMR3DECL(int)          DBGFR3Detach(PUVM pUVM);
+VMMR3DECL(int)          DBGFR3EventWait(PUVM pUVM, RTMSINTERVAL cMillies, PCDBGFEVENT *ppEvent);
+VMMR3DECL(int)          DBGFR3Halt(PUVM pUVM);
+VMMR3DECL(bool)         DBGFR3IsHalted(PUVM pUVM);
+VMMR3DECL(bool)         DBGFR3CanWait(PUVM pUVM);
+VMMR3DECL(int)          DBGFR3Resume(PUVM pUVM);
+VMMR3DECL(int)          DBGFR3Step(PUVM pUVM, VMCPUID idCpu);
+VMMR3DECL(int)          DBGFR3InjectNMI(PUVM pUVM, VMCPUID idCpu);
 
 #endif /* IN_RING3 */
@@ -386,11 +389,11 @@
 
 #ifdef IN_RING3 /* The breakpoint management API is only available in ring-3. */
-VMMR3DECL(int)  DBGFR3BpSet(PVM pVM, PCDBGFADDRESS pAddress, uint64_t iHitTrigger, uint64_t iHitDisable, uint32_t *piBp);
-VMMR3DECL(int)  DBGFR3BpSetReg(PVM pVM, PCDBGFADDRESS pAddress, uint64_t iHitTrigger, uint64_t iHitDisable,
+VMMR3DECL(int)  DBGFR3BpSet(PUVM pUVM, PCDBGFADDRESS pAddress, uint64_t iHitTrigger, uint64_t iHitDisable, uint32_t *piBp);
+VMMR3DECL(int)  DBGFR3BpSetReg(PUVM pUVM, PCDBGFADDRESS pAddress, uint64_t iHitTrigger, uint64_t iHitDisable,
                                uint8_t fType, uint8_t cb, uint32_t *piBp);
-VMMR3DECL(int)  DBGFR3BpSetREM(PVM pVM, PCDBGFADDRESS pAddress, uint64_t iHitTrigger, uint64_t iHitDisable, uint32_t *piBp);
-VMMR3DECL(int)  DBGFR3BpClear(PVM pVM, uint32_t iBp);
-VMMR3DECL(int)  DBGFR3BpEnable(PVM pVM, uint32_t iBp);
-VMMR3DECL(int)  DBGFR3BpDisable(PVM pVM, uint32_t iBp);
+VMMR3DECL(int)  DBGFR3BpSetREM(PUVM pUVM, PCDBGFADDRESS pAddress, uint64_t iHitTrigger, uint64_t iHitDisable, uint32_t *piBp);
+VMMR3DECL(int)  DBGFR3BpClear(PUVM pUVM, uint32_t iBp);
+VMMR3DECL(int)  DBGFR3BpEnable(PUVM pUVM, uint32_t iBp);
+VMMR3DECL(int)  DBGFR3BpDisable(PUVM pUVM, uint32_t iBp);
 
 /**
@@ -398,25 +401,26 @@
  *
  * @returns VBox status code. Any failure will stop the enumeration.
- * @param   pVM         The VM handle.
+ * @param   pUVM        The user mode VM handle.
  * @param   pvUser      The user argument.
  * @param   pBp         Pointer to the breakpoint information. (readonly)
  */
-typedef DECLCALLBACK(int) FNDBGFBPENUM(PVM pVM, void *pvUser, PCDBGFBP pBp);
+typedef DECLCALLBACK(int) FNDBGFBPENUM(PUVM pUVM, void *pvUser, PCDBGFBP pBp);
 /** Pointer to a breakpoint enumeration callback function. */
 typedef FNDBGFBPENUM *PFNDBGFBPENUM;
 
-VMMR3DECL(int)          DBGFR3BpEnum(PVM pVM, PFNDBGFBPENUM pfnCallback, void *pvUser);
+VMMR3DECL(int)              DBGFR3BpEnum(PUVM pUVM, PFNDBGFBPENUM pfnCallback, void *pvUser);
 #endif /* IN_RING3 */
 
-VMMDECL(RTGCUINTREG)    DBGFBpGetDR7(PVM pVM);
-VMMDECL(RTGCUINTREG)    DBGFBpGetDR0(PVM pVM);
-VMMDECL(RTGCUINTREG)    DBGFBpGetDR1(PVM pVM);
-VMMDECL(RTGCUINTREG)    DBGFBpGetDR2(PVM pVM);
-VMMDECL(RTGCUINTREG)    DBGFBpGetDR3(PVM pVM);
-VMMDECL(bool)           DBGFIsStepping(PVMCPU pVCpu);
+VMM_INT_DECL(RTGCUINTREG)   DBGFBpGetDR7(PVM pVM);
+VMM_INT_DECL(RTGCUINTREG)   DBGFBpGetDR0(PVM pVM);
+VMM_INT_DECL(RTGCUINTREG)   DBGFBpGetDR1(PVM pVM);
+VMM_INT_DECL(RTGCUINTREG)   DBGFBpGetDR2(PVM pVM);
+VMM_INT_DECL(RTGCUINTREG)   DBGFBpGetDR3(PVM pVM);
+VMM_INT_DECL(bool)          DBGFIsStepping(PVMCPU pVCpu);
 
 
 #ifdef IN_RING3 /* The CPU mode API only works in ring-3. */
-VMMR3DECL(CPUMMODE)     DBGFR3CpuGetMode(PVM pVM, VMCPUID idCpu);
+VMMR3DECL(CPUMMODE)         DBGFR3CpuGetMode(PUVM pUVM, VMCPUID idCpu);
+VMMR3DECL(VMCPUID)          DBGFR3CpuGetCount(PUVM pUVM);
 #endif
 
@@ -512,35 +516,35 @@
 /** @} */
 
-VMMR3DECL(int) DBGFR3InfoRegisterDevice(PVM pVM, const char *pszName, const char *pszDesc, PFNDBGFHANDLERDEV pfnHandler, PPDMDEVINS pDevIns);
-VMMR3DECL(int) DBGFR3InfoRegisterDriver(PVM pVM, const char *pszName, const char *pszDesc, PFNDBGFHANDLERDRV pfnHandler, PPDMDRVINS pDrvIns);
-VMMR3DECL(int) DBGFR3InfoRegisterInternal(PVM pVM, const char *pszName, const char *pszDesc, PFNDBGFHANDLERINT pfnHandler);
-VMMR3DECL(int) DBGFR3InfoRegisterInternalEx(PVM pVM, const char *pszName, const char *pszDesc, PFNDBGFHANDLERINT pfnHandler, uint32_t fFlags);
-VMMR3DECL(int) DBGFR3InfoRegisterExternal(PVM pVM, const char *pszName, const char *pszDesc, PFNDBGFHANDLEREXT pfnHandler, void *pvUser);
-VMMR3DECL(int) DBGFR3InfoDeregisterDevice(PVM pVM, PPDMDEVINS pDevIns, const char *pszName);
-VMMR3DECL(int) DBGFR3InfoDeregisterDriver(PVM pVM, PPDMDRVINS pDrvIns, const char *pszName);
-VMMR3DECL(int) DBGFR3InfoDeregisterInternal(PVM pVM, const char *pszName);
-VMMR3DECL(int) DBGFR3InfoDeregisterExternal(PVM pVM, const char *pszName);
-VMMR3DECL(int) DBGFR3Info(PVM pVM, const char *pszName, const char *pszArgs, PCDBGFINFOHLP pHlp);
-VMMR3DECL(int) DBGFR3InfoEx(PVM pVM, VMCPUID idCpu, const char *pszName, const char *pszArgs, PCDBGFINFOHLP pHlp);
-VMMR3DECL(int) DBGFR3InfoLogRel(PVM pVM, const char *pszName, const char *pszArgs);
-VMMR3DECL(int) DBGFR3InfoStdErr(PVM pVM, const char *pszName, const char *pszArgs);
-VMMR3DECL(int) DBGFR3InfoMulti(PVM pVM, const char *pszIncludePat, const char *pszExcludePat,
-                               const char *pszSepFmt, PCDBGFINFOHLP pHlp);
+VMMR3_INT_DECL(int) DBGFR3InfoRegisterDevice(PVM pVM, const char *pszName, const char *pszDesc, PFNDBGFHANDLERDEV pfnHandler, PPDMDEVINS pDevIns);
+VMMR3_INT_DECL(int) DBGFR3InfoRegisterDriver(PVM pVM, const char *pszName, const char *pszDesc, PFNDBGFHANDLERDRV pfnHandler, PPDMDRVINS pDrvIns);
+VMMR3_INT_DECL(int) DBGFR3InfoRegisterInternal(PVM pVM, const char *pszName, const char *pszDesc, PFNDBGFHANDLERINT pfnHandler);
+VMMR3_INT_DECL(int) DBGFR3InfoRegisterInternalEx(PVM pVM, const char *pszName, const char *pszDesc, PFNDBGFHANDLERINT pfnHandler, uint32_t fFlags);
+VMMR3DECL(int)      DBGFR3InfoRegisterExternal(PUVM pUVM, const char *pszName, const char *pszDesc, PFNDBGFHANDLEREXT pfnHandler, void *pvUser);
+VMMR3_INT_DECL(int) DBGFR3InfoDeregisterDevice(PVM pVM, PPDMDEVINS pDevIns, const char *pszName);
+VMMR3_INT_DECL(int) DBGFR3InfoDeregisterDriver(PVM pVM, PPDMDRVINS pDrvIns, const char *pszName);
+VMMR3_INT_DECL(int) DBGFR3InfoDeregisterInternal(PVM pVM, const char *pszName);
+VMMR3DECL(int)      DBGFR3InfoDeregisterExternal(PUVM pUVM, const char *pszName);
+VMMR3DECL(int)      DBGFR3Info(PUVM pUVM, const char *pszName, const char *pszArgs, PCDBGFINFOHLP pHlp);
+VMMR3DECL(int)      DBGFR3InfoEx(PUVM pUVM, VMCPUID idCpu, const char *pszName, const char *pszArgs, PCDBGFINFOHLP pHlp);
+VMMR3DECL(int)      DBGFR3InfoLogRel(PUVM pUVM, const char *pszName, const char *pszArgs);
+VMMR3DECL(int)      DBGFR3InfoStdErr(PUVM pUVM, const char *pszName, const char *pszArgs);
+VMMR3_INT_DECL(int) DBGFR3InfoMulti(PVM pVM, const char *pszIncludePat, const char *pszExcludePat,
+                                    const char *pszSepFmt, PCDBGFINFOHLP pHlp);
 
 /** @def DBGFR3InfoLog
  * Display a piece of info writing to the log if enabled.
  *
- * @param   pVM         VM handle.
- * @param   pszName     The identifier of the info to display.
- * @param   pszArgs     Arguments to the info handler.
+ * @param   a_pVM       The shared VM handle.
+ * @param   a_pszName   The identifier of the info to display.
+ * @param   a_pszArgs   Arguments to the info handler.
  */
 #ifdef LOG_ENABLED
-#define DBGFR3InfoLog(pVM, pszName, pszArgs) \
+# define DBGFR3_INFO_LOG(a_pVM, a_pszName, a_pszArgs) \
     do { \
         if (LogIsEnabled()) \
-            DBGFR3Info(pVM, pszName, pszArgs, NULL); \
+            DBGFR3Info((a_pVM)->pUVM, a_pszName, a_pszArgs, NULL); \
     } while (0)
 #else
-#define DBGFR3InfoLog(pVM, pszName, pszArgs) do { } while (0)
+# define DBGFR3_INFO_LOG(a_pVM, a_pszName, a_pszArgs) do { } while (0)
 #endif
 
@@ -551,13 +555,13 @@
  *          A status code indicating failure will end the enumeration
  *          and DBGFR3InfoEnum will return with that status code.
- * @param   pVM         VM handle.
+ * @param   pUVM        The user mode VM handle.
  * @param   pszName     Info identifier name.
  * @param   pszDesc     The description.
  */
-typedef DECLCALLBACK(int) FNDBGFINFOENUM(PVM pVM, const char *pszName, const char *pszDesc, void *pvUser);
+typedef DECLCALLBACK(int) FNDBGFINFOENUM(PUVM pUVM, const char *pszName, const char *pszDesc, void *pvUser);
 /** Pointer to a FNDBGFINFOENUM function. */
 typedef FNDBGFINFOENUM *PFNDBGFINFOENUM;
 
-VMMR3DECL(int)              DBGFR3InfoEnum(PVM pVM, PFNDBGFINFOENUM pfnCallback, void *pvUser);
+VMMR3DECL(int)              DBGFR3InfoEnum(PUVM pUVM, PFNDBGFINFOENUM pfnCallback, void *pvUser);
 VMMR3DECL(PCDBGFINFOHLP)    DBGFR3InfoLogHlp(void);
 VMMR3DECL(PCDBGFINFOHLP)    DBGFR3InfoLogRelHlp(void);
@@ -567,7 +571,7 @@
 
 #ifdef IN_RING3 /* The log contrl API only works in ring-3. */
-VMMR3DECL(int) DBGFR3LogModifyGroups(PVM pVM, const char *pszGroupSettings);
-VMMR3DECL(int) DBGFR3LogModifyFlags(PVM pVM, const char *pszFlagSettings);
-VMMR3DECL(int) DBGFR3LogModifyDestinations(PVM pVM, const char *pszDestSettings);
+VMMR3DECL(int) DBGFR3LogModifyGroups(PUVM pUVM, const char *pszGroupSettings);
+VMMR3DECL(int) DBGFR3LogModifyFlags(PUVM pUVM, const char *pszFlagSettings);
+VMMR3DECL(int) DBGFR3LogModifyDestinations(PUVM pUVM, const char *pszDestSettings);
 #endif /* IN_RING3 */
 
@@ -652,31 +656,31 @@
 /** @} */
 
-VMMR3DECL(int)          DBGFR3AsAdd(PVM pVM, RTDBGAS hDbgAs, RTPROCESS ProcId);
-VMMR3DECL(int)          DBGFR3AsDelete(PVM pVM, RTDBGAS hDbgAs);
-VMMR3DECL(int)          DBGFR3AsSetAlias(PVM pVM, RTDBGAS hAlias, RTDBGAS hAliasFor);
-VMMR3DECL(RTDBGAS)      DBGFR3AsResolve(PVM pVM, RTDBGAS hAlias);
-VMMR3DECL(RTDBGAS)      DBGFR3AsResolveAndRetain(PVM pVM, RTDBGAS hAlias);
-VMMR3DECL(RTDBGAS)      DBGFR3AsQueryByName(PVM pVM, const char *pszName);
-VMMR3DECL(RTDBGAS)      DBGFR3AsQueryByPid(PVM pVM, RTPROCESS ProcId);
-
-VMMR3DECL(int)          DBGFR3AsLoadImage(PVM pVM, RTDBGAS hDbgAs, const char *pszFilename, const char *pszModName, PCDBGFADDRESS pModAddress, RTDBGSEGIDX iModSeg, uint32_t fFlags);
-VMMR3DECL(int)          DBGFR3AsLoadMap(PVM pVM, RTDBGAS hDbgAs, const char *pszFilename, const char *pszModName, PCDBGFADDRESS pModAddress, RTDBGSEGIDX iModSeg, RTGCUINTPTR uSubtrahend, uint32_t fFlags);
-VMMR3DECL(int)          DBGFR3AsLinkModule(PVM pVM, RTDBGAS hDbgAs, RTDBGMOD hMod, PCDBGFADDRESS pModAddress, RTDBGSEGIDX iModSeg, uint32_t fFlags);
-
-VMMR3DECL(int)          DBGFR3AsSymbolByAddr(PVM pVM, RTDBGAS hDbgAs, PCDBGFADDRESS pAddress, PRTGCINTPTR poffDisp, PRTDBGSYMBOL pSymbol, PRTDBGMOD phMod);
-VMMR3DECL(PRTDBGSYMBOL) DBGFR3AsSymbolByAddrA(PVM pVM, RTDBGAS hDbgAs, PCDBGFADDRESS pAddress, PRTGCINTPTR poffDisp, PRTDBGMOD phMod);
-VMMR3DECL(int)          DBGFR3AsSymbolByName(PVM pVM, RTDBGAS hDbgAs, const char *pszSymbol, PRTDBGSYMBOL pSymbol, PRTDBGMOD phMod);
+VMMR3DECL(int)          DBGFR3AsAdd(PUVM pUVM, RTDBGAS hDbgAs, RTPROCESS ProcId);
+VMMR3DECL(int)          DBGFR3AsDelete(PUVM pUVM, RTDBGAS hDbgAs);
+VMMR3DECL(int)          DBGFR3AsSetAlias(PUVM pUVM, RTDBGAS hAlias, RTDBGAS hAliasFor);
+VMMR3DECL(RTDBGAS)      DBGFR3AsResolve(PUVM pUVM, RTDBGAS hAlias);
+VMMR3DECL(RTDBGAS)      DBGFR3AsResolveAndRetain(PUVM pUVM, RTDBGAS hAlias);
+VMMR3DECL(RTDBGAS)      DBGFR3AsQueryByName(PUVM pUVM, const char *pszName);
+VMMR3DECL(RTDBGAS)      DBGFR3AsQueryByPid(PUVM pUVM, RTPROCESS ProcId);
+
+VMMR3DECL(int)          DBGFR3AsLoadImage(PUVM pUVM, RTDBGAS hDbgAs, const char *pszFilename, const char *pszModName, PCDBGFADDRESS pModAddress, RTDBGSEGIDX iModSeg, uint32_t fFlags);
+VMMR3DECL(int)          DBGFR3AsLoadMap(PUVM pUVM, RTDBGAS hDbgAs, const char *pszFilename, const char *pszModName, PCDBGFADDRESS pModAddress, RTDBGSEGIDX iModSeg, RTGCUINTPTR uSubtrahend, uint32_t fFlags);
+VMMR3DECL(int)          DBGFR3AsLinkModule(PUVM pUVM, RTDBGAS hDbgAs, RTDBGMOD hMod, PCDBGFADDRESS pModAddress, RTDBGSEGIDX iModSeg, uint32_t fFlags);
+
+VMMR3DECL(int)          DBGFR3AsSymbolByAddr(PUVM pUVM, RTDBGAS hDbgAs, PCDBGFADDRESS pAddress, PRTGCINTPTR poffDisp, PRTDBGSYMBOL pSymbol, PRTDBGMOD phMod);
+VMMR3DECL(PRTDBGSYMBOL) DBGFR3AsSymbolByAddrA(PUVM pUVM, RTDBGAS hDbgAs, PCDBGFADDRESS pAddress, PRTGCINTPTR poffDisp, PRTDBGMOD phMod);
+VMMR3DECL(int)          DBGFR3AsSymbolByName(PUVM pUVM, RTDBGAS hDbgAs, const char *pszSymbol, PRTDBGSYMBOL pSymbol, PRTDBGMOD phMod);
 
 /* The following are soon to be obsoleted: */
-VMMR3DECL(int)          DBGFR3ModuleLoad(PVM pVM, const char *pszFilename, RTGCUINTPTR AddressDelta, const char *pszName, RTGCUINTPTR ModuleAddress, unsigned cbImage);
-VMMR3DECL(void)         DBGFR3ModuleRelocate(PVM pVM, RTGCUINTPTR OldImageBase, RTGCUINTPTR NewImageBase, RTGCUINTPTR cbImage,
+VMMR3DECL(int)          DBGFR3ModuleLoad(PUVM pUVM, const char *pszFilename, RTGCUINTPTR AddressDelta, const char *pszName, RTGCUINTPTR ModuleAddress, unsigned cbImage);
+VMMR3_INT_DECL(void)    DBGFR3ModuleRelocate(PVM pVM, RTGCUINTPTR OldImageBase, RTGCUINTPTR NewImageBase, RTGCUINTPTR cbImage,
                                              const char *pszFilename, const char *pszName);
-VMMR3DECL(int)          DBGFR3SymbolAdd(PVM pVM, RTGCUINTPTR ModuleAddress, RTGCUINTPTR SymbolAddress, RTUINT cbSymbol, const char *pszSymbol);
-VMMR3DECL(int)          DBGFR3SymbolByAddr(PVM pVM, RTGCUINTPTR Address, PRTGCINTPTR poffDisplacement, PDBGFSYMBOL pSymbol);
-VMMR3DECL(int)          DBGFR3SymbolByName(PVM pVM, const char *pszSymbol, PDBGFSYMBOL pSymbol);
-
-VMMR3DECL(int)          DBGFR3LineByAddr(PVM pVM, RTGCUINTPTR Address, PRTGCINTPTR poffDisplacement, PDBGFLINE pLine);
-VMMR3DECL(PDBGFLINE)    DBGFR3LineByAddrAlloc(PVM pVM, RTGCUINTPTR Address, PRTGCINTPTR poffDisplacement);
-VMMR3DECL(void)         DBGFR3LineFree(PDBGFLINE pLine);
+VMMR3_INT_DECL(int)     DBGFR3SymbolAdd(PVM pVM, RTGCUINTPTR ModuleAddress, RTGCUINTPTR SymbolAddress, RTUINT cbSymbol, const char *pszSymbol);
+VMMR3_INT_DECL(int)     DBGFR3SymbolByAddr(PVM pVM, RTGCUINTPTR Address, PRTGCINTPTR poffDisplacement, PDBGFSYMBOL pSymbol);
+VMMR3_INT_DECL(int)     DBGFR3SymbolByName(PVM pVM, const char *pszSymbol, PDBGFSYMBOL pSymbol);
+
+VMMR3DECL(int)          DBGFR3LineByAddr(PUVM pUVM, RTGCUINTPTR Address, PRTGCINTPTR poffDisplacement, PDBGFLINE pLine);
+VMMR3DECL(PDBGFLINE)    DBGFR3LineByAddrAlloc(PUVM pUVM, RTGCUINTPTR Address, PRTGCINTPTR poffDisplacement);
+VMMR3_INT_DECL(void)    DBGFR3LineFree(PDBGFLINE pLine);
 
 #endif /* IN_RING3 */
@@ -848,6 +852,7 @@
 /** @} */
 
-VMMR3DECL(int)              DBGFR3StackWalkBegin(PVM pVM, VMCPUID idCpu, DBGFCODETYPE enmCodeType, PCDBGFSTACKFRAME *ppFirstFrame);
-VMMR3DECL(int)              DBGFR3StackWalkBeginEx(PVM pVM, VMCPUID idCpu, DBGFCODETYPE enmCodeType, PCDBGFADDRESS pAddrFrame,
+VMMR3DECL(int)              DBGFR3StackWalkBegin(PUVM pUVM, VMCPUID idCpu, DBGFCODETYPE enmCodeType,
+                                                 PCDBGFSTACKFRAME *ppFirstFrame);
+VMMR3DECL(int)              DBGFR3StackWalkBeginEx(PUVM pUVM, VMCPUID idCpu, DBGFCODETYPE enmCodeType, PCDBGFADDRESS pAddrFrame,
                                                    PCDBGFADDRESS pAddrStack,PCDBGFADDRESS pAddrPC,
                                                    DBGFRETURNTYPE enmReturnType, PCDBGFSTACKFRAME *ppFirstFrame);
@@ -893,8 +898,8 @@
 #define DBGF_SEL_FLAT                       1
 
-VMMR3DECL(int) DBGFR3DisasInstrEx(PVM pVM, VMCPUID idCpu, RTSEL Sel, RTGCPTR GCPtr, uint32_t fFlags,
-                                  char *pszOutput, uint32_t cbOutput, uint32_t *pcbInstr);
-VMMR3DECL(int) DBGFR3DisasInstrCurrent(PVMCPU pVCpu, char *pszOutput, uint32_t cbOutput);
-VMMR3DECL(int) DBGFR3DisasInstrCurrentLogInternal(PVMCPU pVCpu, const char *pszPrefix);
+VMMR3DECL(int)      DBGFR3DisasInstrEx(PUVM pUVM, VMCPUID idCpu, RTSEL Sel, RTGCPTR GCPtr, uint32_t fFlags,
+                                       char *pszOutput, uint32_t cbOutput, uint32_t *pcbInstr);
+VMMR3_INT_DECL(int) DBGFR3DisasInstrCurrent(PVMCPU pVCpu, char *pszOutput, uint32_t cbOutput);
+VMMR3DECL(int)      DBGFR3DisasInstrCurrentLogInternal(PVMCPU pVCpu, const char *pszPrefix);
 
 /** @def DBGFR3DisasInstrCurrentLog
@@ -903,5 +908,5 @@
  */
 #ifdef LOG_ENABLED
-# define DBGFR3DisasInstrCurrentLog(pVCpu, pszPrefix) \
+# define DBGFR3_DISAS_INSTR_CUR_LOG(pVCpu, pszPrefix) \
     do { \
         if (LogIsEnabled()) \
@@ -909,5 +914,5 @@
     } while (0)
 #else
-# define DBGFR3DisasInstrCurrentLog(pVCpu, pszPrefix) do { } while (0)
+# define DBGFR3_DISAS_INSTR_CUR_LOG(pVCpu, pszPrefix) do { } while (0)
 #endif
 
@@ -920,5 +925,5 @@
  */
 # ifdef LOG_ENABLED
-#  define DBGFR3DisasInstrLog(pVCpu, Sel, GCPtr, pszPrefix) \
+#  define DBGFR3_DISAS_INSTR_LOG(pVCpu, Sel, GCPtr, pszPrefix) \
     do { \
         if (LogIsEnabled()) \
@@ -926,5 +931,5 @@
     } while (0)
 # else
-#  define DBGFR3DisasInstrLog(pVCpu, Sel, GCPtr, pszPrefix) do { } while (0)
+#  define DBGFR3_DISAS_INSTR_LOG(pVCpu, Sel, GCPtr, pszPrefix) do { } while (0)
 # endif
 #endif
@@ -932,9 +937,9 @@
 
 #ifdef IN_RING3
-VMMR3DECL(int) DBGFR3MemScan(PVM pVM, VMCPUID idCpu, PCDBGFADDRESS pAddress, RTGCUINTPTR cbRange, RTGCUINTPTR uAlign,
+VMMR3DECL(int) DBGFR3MemScan(PUVM pUVM, VMCPUID idCpu, PCDBGFADDRESS pAddress, RTGCUINTPTR cbRange, RTGCUINTPTR uAlign,
                              const void *pvNeedle, size_t cbNeedle, PDBGFADDRESS pHitAddress);
-VMMR3DECL(int) DBGFR3MemRead(PVM pVM, VMCPUID idCpu, PCDBGFADDRESS pAddress, void *pvBuf, size_t cbRead);
-VMMR3DECL(int) DBGFR3MemReadString(PVM pVM, VMCPUID idCpu, PCDBGFADDRESS pAddress, char *pszBuf, size_t cbBuf);
-VMMR3DECL(int) DBGFR3MemWrite(PVM pVM, VMCPUID idCpu, PCDBGFADDRESS pAddress, void const *pvBuf, size_t cbRead);
+VMMR3DECL(int) DBGFR3MemRead(PUVM pUVM, VMCPUID idCpu, PCDBGFADDRESS pAddress, void *pvBuf, size_t cbRead);
+VMMR3DECL(int) DBGFR3MemReadString(PUVM pUVM, VMCPUID idCpu, PCDBGFADDRESS pAddress, char *pszBuf, size_t cbBuf);
+VMMR3DECL(int) DBGFR3MemWrite(PUVM pUVM, VMCPUID idCpu, PCDBGFADDRESS pAddress, void const *pvBuf, size_t cbRead);
 #endif
 
@@ -981,5 +986,5 @@
 #define DBGFPGDMP_FLAGS_MODE_MASK       UINT32_C(0x00000f32)
 /** @}  */
-VMMDECL(int) DBGFR3PagingDumpEx(PVM pVM, VMCPUID idCpu, uint32_t fFlags, uint64_t cr3, uint64_t u64FirstAddr,
+VMMDECL(int) DBGFR3PagingDumpEx(PUVM pUVM, VMCPUID idCpu, uint32_t fFlags, uint64_t cr3, uint64_t u64FirstAddr,
                                 uint64_t u64LastAddr, uint32_t cMaxDepth, PCDBGFINFOHLP pHlp);
 
@@ -995,5 +1000,5 @@
 #define DBGFSELQI_FLAGS_DT_ADJ_64BIT_MODE   UINT32_C(2)
 /** @} */
-VMMR3DECL(int) DBGFR3SelQueryInfo(PVM pVM, VMCPUID idCpu, RTSEL Sel, uint32_t fFlags, PDBGFSELINFO pSelInfo);
+VMMR3DECL(int) DBGFR3SelQueryInfo(PUVM pUVM, VMCPUID idCpu, RTSEL Sel, uint32_t fFlags, PDBGFSELINFO pSelInfo);
 
 
@@ -1432,28 +1437,28 @@
 #define DBGFREG_HYPER_VMCPUID       UINT32_C(0x01000000)
 
-VMMR3DECL(int) DBGFR3RegCpuQueryU8(  PVM pVM, VMCPUID idCpu, DBGFREG enmReg, uint8_t     *pu8);
-VMMR3DECL(int) DBGFR3RegCpuQueryU16( PVM pVM, VMCPUID idCpu, DBGFREG enmReg, uint16_t    *pu16);
-VMMR3DECL(int) DBGFR3RegCpuQueryU32( PVM pVM, VMCPUID idCpu, DBGFREG enmReg, uint32_t    *pu32);
-VMMR3DECL(int) DBGFR3RegCpuQueryU64( PVM pVM, VMCPUID idCpu, DBGFREG enmReg, uint64_t    *pu64);
-VMMR3DECL(int) DBGFR3RegCpuQueryU128(PVM pVM, VMCPUID idCpu, DBGFREG enmReg, uint128_t   *pu128);
-VMMR3DECL(int) DBGFR3RegCpuQueryLrd( PVM pVM, VMCPUID idCpu, DBGFREG enmReg, long double *plrd);
-VMMR3DECL(int) DBGFR3RegCpuQueryXdtr(PVM pVM, VMCPUID idCpu, DBGFREG enmReg, uint64_t *pu64Base, uint16_t *pu16Limit);
+VMMR3DECL(int) DBGFR3RegCpuQueryU8(  PUVM pUVM, VMCPUID idCpu, DBGFREG enmReg, uint8_t     *pu8);
+VMMR3DECL(int) DBGFR3RegCpuQueryU16( PUVM pUVM, VMCPUID idCpu, DBGFREG enmReg, uint16_t    *pu16);
+VMMR3DECL(int) DBGFR3RegCpuQueryU32( PUVM pUVM, VMCPUID idCpu, DBGFREG enmReg, uint32_t    *pu32);
+VMMR3DECL(int) DBGFR3RegCpuQueryU64( PUVM pUVM, VMCPUID idCpu, DBGFREG enmReg, uint64_t    *pu64);
+VMMR3DECL(int) DBGFR3RegCpuQueryU128(PUVM pUVM, VMCPUID idCpu, DBGFREG enmReg, uint128_t   *pu128);
+VMMR3DECL(int) DBGFR3RegCpuQueryLrd( PUVM pUVM, VMCPUID idCpu, DBGFREG enmReg, long double *plrd);
+VMMR3DECL(int) DBGFR3RegCpuQueryXdtr(PUVM pUVM, VMCPUID idCpu, DBGFREG enmReg, uint64_t *pu64Base, uint16_t *pu16Limit);
 #if 0
-VMMR3DECL(int) DBGFR3RegCpuQueryBatch(PVM pVM,VMCPUID idCpu, PDBGFREGENTRY paRegs, size_t cRegs);
-VMMR3DECL(int) DBGFR3RegCpuQueryAll( PVM pVM, VMCPUID idCpu, PDBGFREGENTRY paRegs, size_t cRegs);
-
-VMMR3DECL(int) DBGFR3RegCpuSetU8(    PVM pVM, VMCPUID idCpu, DBGFREG enmReg, uint8_t     u8);
-VMMR3DECL(int) DBGFR3RegCpuSetU16(   PVM pVM, VMCPUID idCpu, DBGFREG enmReg, uint16_t    u16);
-VMMR3DECL(int) DBGFR3RegCpuSetU32(   PVM pVM, VMCPUID idCpu, DBGFREG enmReg, uint32_t    u32);
-VMMR3DECL(int) DBGFR3RegCpuSetU64(   PVM pVM, VMCPUID idCpu, DBGFREG enmReg, uint64_t    u64);
-VMMR3DECL(int) DBGFR3RegCpuSetU128(  PVM pVM, VMCPUID idCpu, DBGFREG enmReg, uint128_t   u128);
-VMMR3DECL(int) DBGFR3RegCpuSetLrd(   PVM pVM, VMCPUID idCpu, DBGFREG enmReg, long double lrd);
-VMMR3DECL(int) DBGFR3RegCpuSetBatch( PVM pVM, VMCPUID idCpu, PCDBGFREGENTRY paRegs, size_t cRegs);
+VMMR3DECL(int) DBGFR3RegCpuQueryBatch(PUVM pUVM,VMCPUID idCpu, PDBGFREGENTRY paRegs, size_t cRegs);
+VMMR3DECL(int) DBGFR3RegCpuQueryAll( PUVM pUVM, VMCPUID idCpu, PDBGFREGENTRY paRegs, size_t cRegs);
+
+VMMR3DECL(int) DBGFR3RegCpuSetU8(    PUVM pUVM, VMCPUID idCpu, DBGFREG enmReg, uint8_t     u8);
+VMMR3DECL(int) DBGFR3RegCpuSetU16(   PUVM pUVM, VMCPUID idCpu, DBGFREG enmReg, uint16_t    u16);
+VMMR3DECL(int) DBGFR3RegCpuSetU32(   PUVM pUVM, VMCPUID idCpu, DBGFREG enmReg, uint32_t    u32);
+VMMR3DECL(int) DBGFR3RegCpuSetU64(   PUVM pUVM, VMCPUID idCpu, DBGFREG enmReg, uint64_t    u64);
+VMMR3DECL(int) DBGFR3RegCpuSetU128(  PUVM pUVM, VMCPUID idCpu, DBGFREG enmReg, uint128_t   u128);
+VMMR3DECL(int) DBGFR3RegCpuSetLrd(   PUVM pUVM, VMCPUID idCpu, DBGFREG enmReg, long double lrd);
+VMMR3DECL(int) DBGFR3RegCpuSetBatch( PUVM pUVM, VMCPUID idCpu, PCDBGFREGENTRY paRegs, size_t cRegs);
 #endif
 
-VMMR3DECL(const char *) DBGFR3RegCpuName(PVM pVM, DBGFREG enmReg, DBGFREGVALTYPE enmType);
+VMMR3DECL(const char *) DBGFR3RegCpuName(PUVM pUVM, DBGFREG enmReg, DBGFREGVALTYPE enmType);
 
 VMMR3_INT_DECL(int) DBGFR3RegRegisterCpu(PVM pVM, PVMCPU pVCpu, PCDBGFREGDESC paRegisters, bool fGuestRegs);
-VMMR3DECL(int)      DBGFR3RegRegisterDevice(PVM pVM, PCDBGFREGDESC paRegisters, PPDMDEVINS pDevIns, const char *pszPrefix, uint32_t iInstance);
+VMMR3_INT_DECL(int) DBGFR3RegRegisterDevice(PVM pVM, PCDBGFREGDESC paRegisters, PPDMDEVINS pDevIns, const char *pszPrefix, uint32_t iInstance);
 
 /**
@@ -1474,31 +1479,31 @@
 typedef DBGFREGENTRYNM const *PCDBGFREGENTRYNM;
 
-VMMR3DECL(int) DBGFR3RegNmValidate( PVM pVM, VMCPUID idDefCpu, const char *pszReg);
-
-VMMR3DECL(int) DBGFR3RegNmQuery(    PVM pVM, VMCPUID idDefCpu, const char *pszReg, PDBGFREGVAL pValue, PDBGFREGVALTYPE penmType);
-VMMR3DECL(int) DBGFR3RegNmQueryU8(  PVM pVM, VMCPUID idDefCpu, const char *pszReg, uint8_t     *pu8);
-VMMR3DECL(int) DBGFR3RegNmQueryU16( PVM pVM, VMCPUID idDefCpu, const char *pszReg, uint16_t    *pu16);
-VMMR3DECL(int) DBGFR3RegNmQueryU32( PVM pVM, VMCPUID idDefCpu, const char *pszReg, uint32_t    *pu32);
-VMMR3DECL(int) DBGFR3RegNmQueryU64( PVM pVM, VMCPUID idDefCpu, const char *pszReg, uint64_t    *pu64);
-VMMR3DECL(int) DBGFR3RegNmQueryU128(PVM pVM, VMCPUID idDefCpu, const char *pszReg, PRTUINT128U  pu128);
-/*VMMR3DECL(int) DBGFR3RegNmQueryLrd( PVM pVM, VMCPUID idDefCpu, const char *pszReg, long double *plrd);*/
-VMMR3DECL(int) DBGFR3RegNmQueryXdtr(PVM pVM, VMCPUID idDefCpu, const char *pszReg, uint64_t *pu64Base, uint16_t *pu16Limit);
-VMMR3DECL(int) DBGFR3RegNmQueryBatch(PVM pVM,VMCPUID idDefCpu, PDBGFREGENTRYNM paRegs, size_t cRegs);
-VMMR3DECL(int) DBGFR3RegNmQueryAllCount(PVM pVM, size_t *pcRegs);
-VMMR3DECL(int) DBGFR3RegNmQueryAll( PVM pVM,                   PDBGFREGENTRYNM paRegs, size_t cRegs);
-
-VMMR3DECL(int) DBGFR3RegNmSet(      PVM pVM, VMCPUID idDefCpu, const char *pszReg, PCDBGFREGVAL pValue, DBGFREGVALTYPE enmType);
-VMMR3DECL(int) DBGFR3RegNmSetU8(    PVM pVM, VMCPUID idDefCpu, const char *pszReg, uint8_t     u8);
-VMMR3DECL(int) DBGFR3RegNmSetU16(   PVM pVM, VMCPUID idDefCpu, const char *pszReg, uint16_t    u16);
-VMMR3DECL(int) DBGFR3RegNmSetU32(   PVM pVM, VMCPUID idDefCpu, const char *pszReg, uint32_t    u32);
-VMMR3DECL(int) DBGFR3RegNmSetU64(   PVM pVM, VMCPUID idDefCpu, const char *pszReg, uint64_t    u64);
-VMMR3DECL(int) DBGFR3RegNmSetU128(  PVM pVM, VMCPUID idDefCpu, const char *pszReg, RTUINT128U  u128);
-VMMR3DECL(int) DBGFR3RegNmSetLrd(   PVM pVM, VMCPUID idDefCpu, const char *pszReg, long double lrd);
-VMMR3DECL(int) DBGFR3RegNmSetBatch( PVM pVM, VMCPUID idDefCpu, PCDBGFREGENTRYNM paRegs, size_t cRegs);
+VMMR3DECL(int) DBGFR3RegNmValidate( PUVM pUVM, VMCPUID idDefCpu, const char *pszReg);
+
+VMMR3DECL(int) DBGFR3RegNmQuery(    PUVM pUVM, VMCPUID idDefCpu, const char *pszReg, PDBGFREGVAL pValue, PDBGFREGVALTYPE penmType);
+VMMR3DECL(int) DBGFR3RegNmQueryU8(  PUVM pUVM, VMCPUID idDefCpu, const char *pszReg, uint8_t     *pu8);
+VMMR3DECL(int) DBGFR3RegNmQueryU16( PUVM pUVM, VMCPUID idDefCpu, const char *pszReg, uint16_t    *pu16);
+VMMR3DECL(int) DBGFR3RegNmQueryU32( PUVM pUVM, VMCPUID idDefCpu, const char *pszReg, uint32_t    *pu32);
+VMMR3DECL(int) DBGFR3RegNmQueryU64( PUVM pUVM, VMCPUID idDefCpu, const char *pszReg, uint64_t    *pu64);
+VMMR3DECL(int) DBGFR3RegNmQueryU128(PUVM pUVM, VMCPUID idDefCpu, const char *pszReg, PRTUINT128U  pu128);
+/*VMMR3DECL(int) DBGFR3RegNmQueryLrd( PUVM pUVM, VMCPUID idDefCpu, const char *pszReg, long double *plrd);*/
+VMMR3DECL(int) DBGFR3RegNmQueryXdtr(PUVM pUVM, VMCPUID idDefCpu, const char *pszReg, uint64_t *pu64Base, uint16_t *pu16Limit);
+VMMR3DECL(int) DBGFR3RegNmQueryBatch(PUVM pUVM,VMCPUID idDefCpu, PDBGFREGENTRYNM paRegs, size_t cRegs);
+VMMR3DECL(int) DBGFR3RegNmQueryAllCount(PUVM pUVM, size_t *pcRegs);
+VMMR3DECL(int) DBGFR3RegNmQueryAll( PUVM pUVM,                   PDBGFREGENTRYNM paRegs, size_t cRegs);
+
+VMMR3DECL(int) DBGFR3RegNmSet(      PUVM pUVM, VMCPUID idDefCpu, const char *pszReg, PCDBGFREGVAL pValue, DBGFREGVALTYPE enmType);
+VMMR3DECL(int) DBGFR3RegNmSetU8(    PUVM pUVM, VMCPUID idDefCpu, const char *pszReg, uint8_t     u8);
+VMMR3DECL(int) DBGFR3RegNmSetU16(   PUVM pUVM, VMCPUID idDefCpu, const char *pszReg, uint16_t    u16);
+VMMR3DECL(int) DBGFR3RegNmSetU32(   PUVM pUVM, VMCPUID idDefCpu, const char *pszReg, uint32_t    u32);
+VMMR3DECL(int) DBGFR3RegNmSetU64(   PUVM pUVM, VMCPUID idDefCpu, const char *pszReg, uint64_t    u64);
+VMMR3DECL(int) DBGFR3RegNmSetU128(  PUVM pUVM, VMCPUID idDefCpu, const char *pszReg, RTUINT128U  u128);
+VMMR3DECL(int) DBGFR3RegNmSetLrd(   PUVM pUVM, VMCPUID idDefCpu, const char *pszReg, long double lrd);
+VMMR3DECL(int) DBGFR3RegNmSetBatch( PUVM pUVM, VMCPUID idDefCpu, PCDBGFREGENTRYNM paRegs, size_t cRegs);
 
 /** @todo add enumeration methods.  */
 
-VMMR3DECL(int) DBGFR3RegPrintf( PVM pVM, VMCPUID idDefCpu, char *pszBuf, size_t cbBuf, const char *pszFormat, ...);
-VMMR3DECL(int) DBGFR3RegPrintfV(PVM pVM, VMCPUID idDefCpu, char *pszBuf, size_t cbBuf, const char *pszFormat, va_list va);
+VMMR3DECL(int) DBGFR3RegPrintf( PUVM pUVM, VMCPUID idDefCpu, char *pszBuf, size_t cbBuf, const char *pszFormat, ...);
+VMMR3DECL(int) DBGFR3RegPrintfV(PUVM pUVM, VMCPUID idDefCpu, char *pszBuf, size_t cbBuf, const char *pszFormat, va_list va);
 
 
@@ -1548,16 +1553,16 @@
      *
      * @returns VBox status code.
-     * @param   pVM     Pointer to the shared VM structure.
+     * @param   pUVM    The user mode VM handle.
      * @param   pvData  Pointer to the instance data.
      */
-    DECLCALLBACKMEMBER(int, pfnConstruct)(PVM pVM, void *pvData);
+    DECLCALLBACKMEMBER(int, pfnConstruct)(PUVM pUVM, void *pvData);
 
     /**
      * Destroys the instance.
      *
-     * @param   pVM     Pointer to the shared VM structure.
+     * @param   pUVM    The user mode VM handle.
      * @param   pvData  Pointer to the instance data.
      */
-    DECLCALLBACKMEMBER(void, pfnDestruct)(PVM pVM, void *pvData);
+    DECLCALLBACKMEMBER(void, pfnDestruct)(PUVM pUVM, void *pvData);
 
     /**
@@ -1568,8 +1573,8 @@
      *
      * @returns true if is an OS handled by this module, otherwise false.
-     * @param   pVM     Pointer to the shared VM structure.
+     * @param   pUVM    The user mode VM handle.
      * @param   pvData  Pointer to the instance data.
      */
-    DECLCALLBACKMEMBER(bool, pfnProbe)(PVM pVM, void *pvData);
+    DECLCALLBACKMEMBER(bool, pfnProbe)(PUVM pUVM, void *pvData);
 
     /**
@@ -1579,8 +1584,8 @@
      *
      * @returns VBox status code.
-     * @param   pVM     Pointer to the shared VM structure.
+     * @param   pUVM    The user mode VM handle.
      * @param   pvData  Pointer to the instance data.
      */
-    DECLCALLBACKMEMBER(int, pfnInit)(PVM pVM, void *pvData);
+    DECLCALLBACKMEMBER(int, pfnInit)(PUVM pUVM, void *pvData);
 
     /**
@@ -1590,8 +1595,8 @@
      *
      * @returns VBox status code.
-     * @param   pVM     Pointer to the shared VM structure.
+     * @param   pUVM    The user mode VM handle.
      * @param   pvData  Pointer to the instance data.
      */
-    DECLCALLBACKMEMBER(int, pfnRefresh)(PVM pVM, void *pvData);
+    DECLCALLBACKMEMBER(int, pfnRefresh)(PUVM pUVM, void *pvData);
 
     /**
@@ -1601,8 +1606,8 @@
      * This is called after pfnProbe and if needed before pfnDestruct.
      *
-     * @param   pVM     Pointer to the shared VM structure.
+     * @param   pUVM    The user mode VM handle.
      * @param   pvData  Pointer to the instance data.
      */
-    DECLCALLBACKMEMBER(void, pfnTerm)(PVM pVM, void *pvData);
+    DECLCALLBACKMEMBER(void, pfnTerm)(PUVM pUVM, void *pvData);
 
     /**
@@ -1612,10 +1617,10 @@
      *
      * @returns VBox status code.
-     * @param   pVM         Pointer to the shared VM structure.
+     * @param   pUVM    The user mode VM handle.
      * @param   pvData      Pointer to the instance data.
      * @param   pszVersion  Where to store the version string.
      * @param   cchVersion  The size of the version string buffer.
      */
-    DECLCALLBACKMEMBER(int, pfnQueryVersion)(PVM pVM, void *pvData, char *pszVersion, size_t cchVersion);
+    DECLCALLBACKMEMBER(int, pfnQueryVersion)(PUVM pUVM, void *pvData, char *pszVersion, size_t cchVersion);
 
     /**
@@ -1625,9 +1630,9 @@
      *
      * @returns Pointer to the interface if available, NULL if not available.
-     * @param   pVM     Pointer to the shared VM structure.
+     * @param   pUVM    The user mode VM handle.
      * @param   pvData  Pointer to the instance data.
      * @param   enmIf   The interface identifier.
      */
-    DECLCALLBACKMEMBER(void *, pfnQueryInterface)(PVM pVM, void *pvData, DBGFOSINTERFACE enmIf);
+    DECLCALLBACKMEMBER(void *, pfnQueryInterface)(PUVM pUVM, void *pvData, DBGFOSINTERFACE enmIf);
 
     /** Trailing magic (DBGFOSREG_MAGIC). */
@@ -1642,12 +1647,12 @@
 #define DBGFOSREG_MAGIC     0x19830808
 
-VMMR3DECL(int)      DBGFR3OSRegister(PVM pVM, PCDBGFOSREG pReg);
-VMMR3DECL(int)      DBGFR3OSDeregister(PVM pVM, PCDBGFOSREG pReg);
-VMMR3DECL(int)      DBGFR3OSDetect(PVM pVM, char *pszName, size_t cchName);
-VMMR3DECL(int)      DBGFR3OSQueryNameAndVersion(PVM pVM, char *pszName, size_t cchName, char *pszVersion, size_t cchVersion);
-VMMR3DECL(void *)   DBGFR3OSQueryInterface(PVM pVM, DBGFOSINTERFACE enmIf);
-
-
-VMMR3DECL(int)      DBGFR3CoreWrite(PVM pVM, const char *pszFilename, bool fReplaceFile);
+VMMR3DECL(int)      DBGFR3OSRegister(PUVM pUVM, PCDBGFOSREG pReg);
+VMMR3DECL(int)      DBGFR3OSDeregister(PUVM pUVM, PCDBGFOSREG pReg);
+VMMR3DECL(int)      DBGFR3OSDetect(PUVM pUVM, char *pszName, size_t cchName);
+VMMR3DECL(int)      DBGFR3OSQueryNameAndVersion(PUVM pUVM, char *pszName, size_t cchName, char *pszVersion, size_t cchVersion);
+VMMR3DECL(void *)   DBGFR3OSQueryInterface(PUVM pUVM, DBGFOSINTERFACE enmIf);
+
+
+VMMR3DECL(int)      DBGFR3CoreWrite(PUVM pUVM, const char *pszFilename, bool fReplaceFile);
 
 /** @} */
Index: trunk/include/VBox/vmm/pgm.h
===================================================================
--- trunk/include/VBox/vmm/pgm.h	(revision 44398)
+++ trunk/include/VBox/vmm/pgm.h	(revision 44399)
@@ -4,5 +4,5 @@
 
 /*
- * Copyright (C) 2006-2010 Oracle Corporation
+ * Copyright (C) 2006-2013 Oracle Corporation
  *
  * This file is part of VirtualBox Open Source Edition (OSE), as
@@ -555,13 +555,13 @@
 VMMR3DECL(int)      PGMR3CheckIntegrity(PVM pVM);
 
-VMMR3DECL(int)      PGMR3DbgR3Ptr2GCPhys(PVM pVM, RTR3PTR R3Ptr, PRTGCPHYS pGCPhys);
-VMMR3DECL(int)      PGMR3DbgR3Ptr2HCPhys(PVM pVM, RTR3PTR R3Ptr, PRTHCPHYS pHCPhys);
-VMMR3DECL(int)      PGMR3DbgHCPhys2GCPhys(PVM pVM, RTHCPHYS HCPhys, PRTGCPHYS pGCPhys);
-VMMR3DECL(int)      PGMR3DbgReadGCPhys(PVM pVM, void *pvDst, RTGCPHYS GCPhysSrc, size_t cb, uint32_t fFlags, size_t *pcbRead);
-VMMR3DECL(int)      PGMR3DbgWriteGCPhys(PVM pVM, RTGCPHYS GCPhysDst, const void *pvSrc, size_t cb, uint32_t fFlags, size_t *pcbWritten);
-VMMR3DECL(int)      PGMR3DbgReadGCPtr(PVM pVM, void *pvDst, RTGCPTR GCPtrSrc, size_t cb, uint32_t fFlags, size_t *pcbRead);
-VMMR3DECL(int)      PGMR3DbgWriteGCPtr(PVM pVM, RTGCPTR GCPtrDst, void const *pvSrc, size_t cb, uint32_t fFlags, size_t *pcbWritten);
-VMMR3DECL(int)      PGMR3DbgScanPhysical(PVM pVM, RTGCPHYS GCPhys, RTGCPHYS cbRange, RTGCPHYS GCPhysAlign, const uint8_t *pabNeedle, size_t cbNeedle, PRTGCPHYS pGCPhysHit);
-VMMR3DECL(int)      PGMR3DbgScanVirtual(PVM pVM, PVMCPU pVCpu, RTGCPTR GCPtr, RTGCPTR cbRange, RTGCPTR GCPtrAlign, const uint8_t *pabNeedle, size_t cbNeedle, PRTGCUINTPTR pGCPhysHit);
+VMMR3DECL(int)      PGMR3DbgR3Ptr2GCPhys(PUVM pUVM, RTR3PTR R3Ptr, PRTGCPHYS pGCPhys);
+VMMR3DECL(int)      PGMR3DbgR3Ptr2HCPhys(PUVM pUVM, RTR3PTR R3Ptr, PRTHCPHYS pHCPhys);
+VMMR3DECL(int)      PGMR3DbgHCPhys2GCPhys(PUVM pUVM, RTHCPHYS HCPhys, PRTGCPHYS pGCPhys);
+VMMR3_INT_DECL(int) PGMR3DbgReadGCPhys(PVM pVM, void *pvDst, RTGCPHYS GCPhysSrc, size_t cb, uint32_t fFlags, size_t *pcbRead);
+VMMR3_INT_DECL(int) PGMR3DbgWriteGCPhys(PVM pVM, RTGCPHYS GCPhysDst, const void *pvSrc, size_t cb, uint32_t fFlags, size_t *pcbWritten);
+VMMR3_INT_DECL(int) PGMR3DbgReadGCPtr(PVM pVM, void *pvDst, RTGCPTR GCPtrSrc, size_t cb, uint32_t fFlags, size_t *pcbRead);
+VMMR3_INT_DECL(int) PGMR3DbgWriteGCPtr(PVM pVM, RTGCPTR GCPtrDst, void const *pvSrc, size_t cb, uint32_t fFlags, size_t *pcbWritten);
+VMMR3_INT_DECL(int) PGMR3DbgScanPhysical(PVM pVM, RTGCPHYS GCPhys, RTGCPHYS cbRange, RTGCPHYS GCPhysAlign, const uint8_t *pabNeedle, size_t cbNeedle, PRTGCPHYS pGCPhysHit);
+VMMR3_INT_DECL(int) PGMR3DbgScanVirtual(PVM pVM, PVMCPU pVCpu, RTGCPTR GCPtr, RTGCPTR cbRange, RTGCPTR GCPtrAlign, const uint8_t *pabNeedle, size_t cbNeedle, PRTGCUINTPTR pGCPhysHit);
 VMMR3_INT_DECL(int) PGMR3DumpHierarchyShw(PVM pVM, uint64_t cr3, uint32_t fFlags, uint64_t u64FirstAddr, uint64_t u64LastAddr, uint32_t cMaxDepth, PCDBGFINFOHLP pHlp);
 VMMR3_INT_DECL(int) PGMR3DumpHierarchyGst(PVM pVM, uint64_t cr3, uint32_t fFlags, RTGCPTR FirstAddr, RTGCPTR LastAddr, uint32_t cMaxDepth, PCDBGFINFOHLP pHlp);
Index: trunk/include/VBox/vmm/uvm.h
===================================================================
--- trunk/include/VBox/vmm/uvm.h	(revision 44398)
+++ trunk/include/VBox/vmm/uvm.h	(revision 44399)
@@ -56,4 +56,14 @@
         uint8_t                     padding[512];
     } vm;
+
+    /** The DBGF data. */
+    union
+    {
+#ifdef ___DBGFInternal_h
+        struct DBGFUSERPERVMCPU     s;
+#endif
+        uint8_t                     padding[64];
+    } dbgf;
+
 } UVMCPU;
 AssertCompileMemberAlignment(UVMCPU, vm, 32);
@@ -127,4 +137,13 @@
     } stam;
 
+    /** The DBGF data. */
+    union
+    {
+#ifdef ___DBGFInternal_h
+        struct DBGFUSERPERVM    s;
+#endif
+        uint8_t                 padding[256];
+    } dbgf;
+
     /** Per virtual CPU data. */
     UVMCPU                      aCpus[1];
Index: trunk/include/VBox/vmm/vmapi.h
===================================================================
--- trunk/include/VBox/vmm/vmapi.h	(revision 44398)
+++ trunk/include/VBox/vmm/vmapi.h	(revision 44399)
@@ -105,6 +105,6 @@
 typedef FNVMATERROR *PFNVMATERROR;
 
-VMMDECL(int) VMSetError(PVM pVM, int rc, RT_SRC_POS_DECL, const char *pszFormat, ...);
-VMMDECL(int) VMSetErrorV(PVM pVM, int rc, RT_SRC_POS_DECL, const char *pszFormat, va_list args);
+VMMDECL(int)    VMSetError(PVM pVM, int rc, RT_SRC_POS_DECL, const char *pszFormat, ...);
+VMMDECL(int)    VMSetErrorV(PVM pVM, int rc, RT_SRC_POS_DECL, const char *pszFormat, va_list args);
 
 /** @def VM_SET_ERROR
@@ -122,4 +122,19 @@
  */
 #define VM_SET_ERROR(pVM, rc, pszMessage)   (VMSetError(pVM, rc, RT_SRC_POS, pszMessage))
+
+/** @def VM_SET_ERROR
+ * Macro for setting a simple VM error message.
+ * Don't use '%' in the message!
+ *
+ * @returns rc. Meaning you can do:
+ *    @code
+ *    return VM_SET_ERROR(pVM, VERR_OF_YOUR_CHOICE, "descriptive message");
+ *    @endcode
+ * @param   pVM             VM handle.
+ * @param   rc              VBox status code.
+ * @param   pszMessage      Error message string.
+ * @thread  Any
+ */
+#define VM_SET_ERROR_U(a_pUVM, a_rc, a_pszMessage)   (VMR3SetError(a_pUVM, a_rc, RT_SRC_POS, a_pszMessage))
 
 
@@ -366,4 +381,6 @@
 VMMR3DECL(int)          VMR3AtErrorRegister(PUVM pUVM, PFNVMATERROR pfnAtError, void *pvUser);
 VMMR3DECL(int)          VMR3AtErrorDeregister(PUVM pUVM, PFNVMATERROR pfnAtError, void *pvUser);
+VMMR3DECL(int)          VMR3SetError(PUVM pUVM, int rc, RT_SRC_POS_DECL, const char *pszFormat, ...);
+VMMR3DECL(int)          VMR3SetErrorV(PUVM pUVM, int rc, RT_SRC_POS_DECL, const char *pszFormat, va_list va);
 VMMR3_INT_DECL(void)    VMR3SetErrorWorker(PVM pVM);
 VMMR3_INT_DECL(uint32_t) VMR3GetErrorCount(PUVM pUVM);
Index: trunk/src/VBox/Debugger/DBGCCmdHlp.cpp
===================================================================
--- trunk/src/VBox/Debugger/DBGCCmdHlp.cpp	(revision 44398)
+++ trunk/src/VBox/Debugger/DBGCCmdHlp.cpp	(revision 44399)
@@ -316,5 +316,5 @@
  * @interface_method_impl{DBGCCMDHLP,pfnMemRead}
  */
-static DECLCALLBACK(int) dbgcHlpMemRead(PDBGCCMDHLP pCmdHlp, PVM pVM, void *pvBuffer, size_t cbRead, PCDBGCVAR pVarPointer, size_t *pcbRead)
+static DECLCALLBACK(int) dbgcHlpMemRead(PDBGCCMDHLP pCmdHlp, void *pvBuffer, size_t cbRead, PCDBGCVAR pVarPointer, size_t *pcbRead)
 {
     PDBGC       pDbgc = DBGC_CMDHLP2DBGC(pCmdHlp);
@@ -341,6 +341,6 @@
         case DBGCVAR_TYPE_GC_FAR:
             /* Use DBGFR3AddrFromSelOff for the conversion. */
-            Assert(pDbgc->pVM);
-            rc = DBGFR3AddrFromSelOff(pDbgc->pVM, pDbgc->idCpu, &Address, Var.u.GCFar.sel, Var.u.GCFar.off);
+            Assert(pDbgc->pUVM);
+            rc = DBGFR3AddrFromSelOff(pDbgc->pUVM, pDbgc->idCpu, &Address, Var.u.GCFar.sel, Var.u.GCFar.off);
             if (RT_FAILURE(rc))
                 return rc;
@@ -350,5 +350,5 @@
             {
                 DBGFSELINFO SelInfo;
-                rc = DBGFR3SelQueryInfo(pDbgc->pVM, pDbgc->idCpu, Address.Sel,
+                rc = DBGFR3SelQueryInfo(pDbgc->pUVM, pDbgc->idCpu, Address.Sel,
                                         DBGFSELQI_FLAGS_DT_GUEST | DBGFSELQI_FLAGS_DT_ADJ_64BIT_MODE, &SelInfo);
                 if (RT_SUCCESS(rc))
@@ -419,12 +419,12 @@
         {
             case DBGCVAR_TYPE_GC_FLAT:
-                rc = DBGFR3MemRead(pDbgc->pVM, pDbgc->idCpu,
-                                   DBGFR3AddrFromFlat(pVM, &Address, Var.u.GCFlat),
+                rc = DBGFR3MemRead(pDbgc->pUVM, pDbgc->idCpu,
+                                   DBGFR3AddrFromFlat(pDbgc->pUVM, &Address, Var.u.GCFlat),
                                    pvBuffer, cb);
                 break;
 
             case DBGCVAR_TYPE_GC_PHYS:
-                rc = DBGFR3MemRead(pDbgc->pVM, pDbgc->idCpu,
-                                   DBGFR3AddrFromPhys(pVM, &Address, Var.u.GCPhys),
+                rc = DBGFR3MemRead(pDbgc->pUVM, pDbgc->idCpu,
+                                   DBGFR3AddrFromPhys(pDbgc->pUVM, &Address, Var.u.GCPhys),
                                    pvBuffer, cb);
                 break;
@@ -488,5 +488,5 @@
  * @interface_method_impl{DBGCCMDHLP,pfnMemWrite}
  */
-static DECLCALLBACK(int) dbgcHlpMemWrite(PDBGCCMDHLP pCmdHlp, PVM pVM, const void *pvBuffer, size_t cbWrite, PCDBGCVAR pVarPointer, size_t *pcbWritten)
+static DECLCALLBACK(int) dbgcHlpMemWrite(PDBGCCMDHLP pCmdHlp, const void *pvBuffer, size_t cbWrite, PCDBGCVAR pVarPointer, size_t *pcbWritten)
 {
     PDBGC       pDbgc = DBGC_CMDHLP2DBGC(pCmdHlp);
@@ -514,6 +514,6 @@
         {
             /* Use DBGFR3AddrFromSelOff for the conversion. */
-            Assert(pDbgc->pVM);
-            rc = DBGFR3AddrFromSelOff(pDbgc->pVM, pDbgc->idCpu, &Address, Var.u.GCFar.sel, Var.u.GCFar.off);
+            Assert(pDbgc->pUVM);
+            rc = DBGFR3AddrFromSelOff(pDbgc->pUVM, pDbgc->idCpu, &Address, Var.u.GCFar.sel, Var.u.GCFar.off);
             if (RT_FAILURE(rc))
                 return rc;
@@ -523,5 +523,5 @@
             {
                 DBGFSELINFO SelInfo;
-                rc = DBGFR3SelQueryInfo(pDbgc->pVM, pDbgc->idCpu, Address.Sel,
+                rc = DBGFR3SelQueryInfo(pDbgc->pUVM, pDbgc->idCpu, Address.Sel,
                                         DBGFSELQI_FLAGS_DT_GUEST | DBGFSELQI_FLAGS_DT_ADJ_64BIT_MODE, &SelInfo);
                 if (RT_SUCCESS(rc))
@@ -556,6 +556,6 @@
         /* fall thru */
         case DBGCVAR_TYPE_GC_FLAT:
-            rc = DBGFR3MemWrite(pVM, pDbgc->idCpu,
-                                DBGFR3AddrFromFlat(pVM, &Address, Var.u.GCFlat),
+            rc = DBGFR3MemWrite(pDbgc->pUVM, pDbgc->idCpu,
+                                DBGFR3AddrFromFlat(pDbgc->pUVM, &Address, Var.u.GCFlat),
                                 pvBuffer, cbWrite);
             if (pcbWritten && RT_SUCCESS(rc))
@@ -564,6 +564,6 @@
 
         case DBGCVAR_TYPE_GC_PHYS:
-            rc = DBGFR3MemWrite(pVM, pDbgc->idCpu,
-                                DBGFR3AddrFromPhys(pVM, &Address, Var.u.GCPhys),
+            rc = DBGFR3MemWrite(pDbgc->pUVM, pDbgc->idCpu,
+                                DBGFR3AddrFromPhys(pDbgc->pUVM, &Address, Var.u.GCPhys),
                                 pvBuffer, cbWrite);
             if (pcbWritten && RT_SUCCESS(rc))
@@ -734,16 +734,16 @@
     {
         case DBGCVAR_TYPE_GC_FLAT:
-            DBGFR3AddrFromFlat(pDbgc->pVM, pAddress, pVar->u.GCFlat);
+            DBGFR3AddrFromFlat(pDbgc->pUVM, pAddress, pVar->u.GCFlat);
             return VINF_SUCCESS;
 
         case DBGCVAR_TYPE_NUMBER:
-            DBGFR3AddrFromFlat(pDbgc->pVM, pAddress, (RTGCUINTPTR)pVar->u.u64Number);
+            DBGFR3AddrFromFlat(pDbgc->pUVM, pAddress, (RTGCUINTPTR)pVar->u.u64Number);
             return VINF_SUCCESS;
 
         case DBGCVAR_TYPE_GC_FAR:
-            return DBGFR3AddrFromSelOff(pDbgc->pVM, pDbgc->idCpu, pAddress, pVar->u.GCFar.sel, pVar->u.GCFar.off);
+            return DBGFR3AddrFromSelOff(pDbgc->pUVM, pDbgc->idCpu, pAddress, pVar->u.GCFar.sel, pVar->u.GCFar.off);
 
         case DBGCVAR_TYPE_GC_PHYS:
-            DBGFR3AddrFromPhys(pDbgc->pVM, pAddress, pVar->u.GCPhys);
+            DBGFR3AddrFromPhys(pDbgc->pUVM, pAddress, pVar->u.GCPhys);
             return VINF_SUCCESS;
 
@@ -923,5 +923,5 @@
     int             rc;
 
-    Assert(pDbgc->pVM);
+    Assert(pDbgc->pUVM);
 
     *pResult = InVar;
@@ -939,6 +939,6 @@
                 case DBGCVAR_TYPE_GC_PHYS:
                     pResult->enmType = DBGCVAR_TYPE_GC_PHYS;
-                    rc = DBGFR3AddrToPhys(pDbgc->pVM, pDbgc->idCpu,
-                                          DBGFR3AddrFromFlat(pDbgc->pVM, &Address, pArg->u.GCFlat),
+                    rc = DBGFR3AddrToPhys(pDbgc->pUVM, pDbgc->idCpu,
+                                          DBGFR3AddrFromFlat(pDbgc->pUVM, &Address, pArg->u.GCFlat),
                                           &pResult->u.GCPhys);
                     if (RT_SUCCESS(rc))
@@ -948,6 +948,6 @@
                 case DBGCVAR_TYPE_HC_FLAT:
                     pResult->enmType = DBGCVAR_TYPE_HC_FLAT;
-                    rc = DBGFR3AddrToVolatileR3Ptr(pDbgc->pVM, pDbgc->idCpu,
-                                                   DBGFR3AddrFromFlat(pDbgc->pVM, &Address, pArg->u.GCFlat),
+                    rc = DBGFR3AddrToVolatileR3Ptr(pDbgc->pUVM, pDbgc->idCpu,
+                                                   DBGFR3AddrFromFlat(pDbgc->pUVM, &Address, pArg->u.GCFlat),
                                                    false /*fReadOnly */,
                                                    &pResult->u.pvHCFlat);
@@ -958,6 +958,6 @@
                 case DBGCVAR_TYPE_HC_PHYS:
                     pResult->enmType = DBGCVAR_TYPE_HC_PHYS;
-                    rc = DBGFR3AddrToHostPhys(pDbgc->pVM, pDbgc->idCpu,
-                                              DBGFR3AddrFromFlat(pDbgc->pVM, &Address, pArg->u.GCFlat),
+                    rc = DBGFR3AddrToHostPhys(pDbgc->pUVM, pDbgc->idCpu,
+                                              DBGFR3AddrFromFlat(pDbgc->pUVM, &Address, pArg->u.GCFlat),
                                               &pResult->u.GCPhys);
                     if (RT_SUCCESS(rc))
@@ -984,5 +984,5 @@
             {
                 case DBGCVAR_TYPE_GC_FLAT:
-                    rc = DBGFR3AddrFromSelOff(pDbgc->pVM, pDbgc->idCpu, &Address, pArg->u.GCFar.sel, pArg->u.GCFar.off);
+                    rc = DBGFR3AddrFromSelOff(pDbgc->pUVM, pDbgc->idCpu, &Address, pArg->u.GCFar.sel, pArg->u.GCFar.off);
                     if (RT_SUCCESS(rc))
                     {
@@ -997,9 +997,9 @@
 
                 case DBGCVAR_TYPE_GC_PHYS:
-                    rc = DBGFR3AddrFromSelOff(pDbgc->pVM, pDbgc->idCpu, &Address, pArg->u.GCFar.sel, pArg->u.GCFar.off);
+                    rc = DBGFR3AddrFromSelOff(pDbgc->pUVM, pDbgc->idCpu, &Address, pArg->u.GCFar.sel, pArg->u.GCFar.off);
                     if (RT_SUCCESS(rc))
                     {
                         pResult->enmType = DBGCVAR_TYPE_GC_PHYS;
-                        rc = DBGFR3AddrToPhys(pDbgc->pVM, pDbgc->idCpu, &Address, &pResult->u.GCPhys);
+                        rc = DBGFR3AddrToPhys(pDbgc->pUVM, pDbgc->idCpu, &Address, &pResult->u.GCPhys);
                         if (RT_SUCCESS(rc))
                             return VINF_SUCCESS;
@@ -1008,9 +1008,9 @@
 
                 case DBGCVAR_TYPE_HC_FLAT:
-                    rc = DBGFR3AddrFromSelOff(pDbgc->pVM, pDbgc->idCpu, &Address, pArg->u.GCFar.sel, pArg->u.GCFar.off);
+                    rc = DBGFR3AddrFromSelOff(pDbgc->pUVM, pDbgc->idCpu, &Address, pArg->u.GCFar.sel, pArg->u.GCFar.off);
                     if (RT_SUCCESS(rc))
                     {
                         pResult->enmType = DBGCVAR_TYPE_HC_FLAT;
-                        rc = DBGFR3AddrToVolatileR3Ptr(pDbgc->pVM, pDbgc->idCpu, &Address,
+                        rc = DBGFR3AddrToVolatileR3Ptr(pDbgc->pUVM, pDbgc->idCpu, &Address,
                                                        false /*fReadOnly*/, &pResult->u.pvHCFlat);
                         if (RT_SUCCESS(rc))
@@ -1020,9 +1020,9 @@
 
                 case DBGCVAR_TYPE_HC_PHYS:
-                    rc = DBGFR3AddrFromSelOff(pDbgc->pVM, pDbgc->idCpu, &Address, pArg->u.GCFar.sel, pArg->u.GCFar.off);
+                    rc = DBGFR3AddrFromSelOff(pDbgc->pUVM, pDbgc->idCpu, &Address, pArg->u.GCFar.sel, pArg->u.GCFar.off);
                     if (RT_SUCCESS(rc))
                     {
                         pResult->enmType = DBGCVAR_TYPE_HC_PHYS;
-                        rc = DBGFR3AddrToHostPhys(pDbgc->pVM, pDbgc->idCpu, &Address, &pResult->u.GCPhys);
+                        rc = DBGFR3AddrToHostPhys(pDbgc->pUVM, pDbgc->idCpu, &Address, &pResult->u.GCPhys);
                         if (RT_SUCCESS(rc))
                             return VINF_SUCCESS;
@@ -1060,6 +1060,6 @@
                 case DBGCVAR_TYPE_HC_FLAT:
                     pResult->enmType = DBGCVAR_TYPE_HC_FLAT;
-                    rc = DBGFR3AddrToVolatileR3Ptr(pDbgc->pVM, pDbgc->idCpu,
-                                                   DBGFR3AddrFromPhys(pDbgc->pVM, &Address, pArg->u.GCPhys),
+                    rc = DBGFR3AddrToVolatileR3Ptr(pDbgc->pUVM, pDbgc->idCpu,
+                                                   DBGFR3AddrFromPhys(pDbgc->pUVM, &Address, pArg->u.GCPhys),
                                                    false /*fReadOnly */,
                                                    &pResult->u.pvHCFlat);
@@ -1070,6 +1070,6 @@
                 case DBGCVAR_TYPE_HC_PHYS:
                     pResult->enmType = DBGCVAR_TYPE_HC_PHYS;
-                    rc = DBGFR3AddrToHostPhys(pDbgc->pVM, pDbgc->idCpu,
-                                              DBGFR3AddrFromPhys(pDbgc->pVM, &Address, pArg->u.GCPhys),
+                    rc = DBGFR3AddrToHostPhys(pDbgc->pUVM, pDbgc->idCpu,
+                                              DBGFR3AddrFromPhys(pDbgc->pUVM, &Address, pArg->u.GCPhys),
                                               &pResult->u.HCPhys);
                     if (RT_SUCCESS(rc))
@@ -1103,5 +1103,5 @@
                 case DBGCVAR_TYPE_GC_PHYS:
                     pResult->enmType = DBGCVAR_TYPE_GC_PHYS;
-                    rc = PGMR3DbgR3Ptr2GCPhys(pDbgc->pVM, pArg->u.pvHCFlat, &pResult->u.GCPhys);
+                    rc = PGMR3DbgR3Ptr2GCPhys(pDbgc->pUVM, pArg->u.pvHCFlat, &pResult->u.GCPhys);
                     if (RT_SUCCESS(rc))
                         return VINF_SUCCESS;
@@ -1114,5 +1114,5 @@
                 case DBGCVAR_TYPE_HC_PHYS:
                     pResult->enmType = DBGCVAR_TYPE_HC_PHYS;
-                    rc = PGMR3DbgR3Ptr2HCPhys(pDbgc->pVM, pArg->u.pvHCFlat, &pResult->u.HCPhys);
+                    rc = PGMR3DbgR3Ptr2HCPhys(pDbgc->pUVM, pArg->u.pvHCFlat, &pResult->u.HCPhys);
                     if (RT_SUCCESS(rc))
                         return VINF_SUCCESS;
@@ -1146,5 +1146,5 @@
                 case DBGCVAR_TYPE_GC_PHYS:
                     pResult->enmType = DBGCVAR_TYPE_GC_PHYS;
-                    rc = PGMR3DbgHCPhys2GCPhys(pDbgc->pVM, pArg->u.HCPhys, &pResult->u.GCPhys);
+                    rc = PGMR3DbgHCPhys2GCPhys(pDbgc->pUVM, pArg->u.HCPhys, &pResult->u.GCPhys);
                     if (RT_SUCCESS(rc))
                         return VINF_SUCCESS;
@@ -1310,6 +1310,6 @@
     if (pDbgc->fRegCtxGuest)
     {
-        if (pDbgc->pVM)
-            enmMode = DBGFR3CpuGetMode(pDbgc->pVM, DBGCCmdHlpGetCurrentCpu(pCmdHlp));
+        if (pDbgc->pUVM)
+            enmMode = DBGFR3CpuGetMode(pDbgc->pUVM, DBGCCmdHlpGetCurrentCpu(pCmdHlp));
         if (enmMode == CPUMMODE_INVALID)
 #if HC_ARCH_BITS == 64
Index: trunk/src/VBox/Debugger/DBGCCommands.cpp
===================================================================
--- trunk/src/VBox/Debugger/DBGCCommands.cpp	(revision 44398)
+++ trunk/src/VBox/Debugger/DBGCCommands.cpp	(revision 44399)
@@ -48,29 +48,29 @@
 *   Internal Functions                                                         *
 *******************************************************************************/
-static DECLCALLBACK(int) dbgcCmdHelp(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
-static DECLCALLBACK(int) dbgcCmdQuit(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
-static DECLCALLBACK(int) dbgcCmdStop(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
-static DECLCALLBACK(int) dbgcCmdDetect(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
-static DECLCALLBACK(int) dbgcCmdCpu(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
-static DECLCALLBACK(int) dbgcCmdInfo(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
-static DECLCALLBACK(int) dbgcCmdLog(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
-static DECLCALLBACK(int) dbgcCmdLogDest(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
-static DECLCALLBACK(int) dbgcCmdLogFlags(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
-static DECLCALLBACK(int) dbgcCmdFormat(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
-static DECLCALLBACK(int) dbgcCmdLoadImage(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
-static DECLCALLBACK(int) dbgcCmdLoadMap(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
-static DECLCALLBACK(int) dbgcCmdLoadSeg(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
-static DECLCALLBACK(int) dbgcCmdLoadSyms(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
-static DECLCALLBACK(int) dbgcCmdSet(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
-static DECLCALLBACK(int) dbgcCmdUnset(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
-static DECLCALLBACK(int) dbgcCmdLoadVars(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
-static DECLCALLBACK(int) dbgcCmdShowVars(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
-static DECLCALLBACK(int) dbgcCmdLoadPlugIn(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
-static DECLCALLBACK(int) dbgcCmdUnloadPlugIn(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
-static DECLCALLBACK(int) dbgcCmdShowPlugIns(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
-static DECLCALLBACK(int) dbgcCmdHarakiri(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
-static DECLCALLBACK(int) dbgcCmdEcho(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
-static DECLCALLBACK(int) dbgcCmdRunScript(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
-static DECLCALLBACK(int) dbgcCmdWriteCore(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
+static FNDBGCCMD dbgcCmdHelp;
+static FNDBGCCMD dbgcCmdQuit;
+static FNDBGCCMD dbgcCmdStop;
+static FNDBGCCMD dbgcCmdDetect;
+static FNDBGCCMD dbgcCmdCpu;
+static FNDBGCCMD dbgcCmdInfo;
+static FNDBGCCMD dbgcCmdLog;
+static FNDBGCCMD dbgcCmdLogDest;
+static FNDBGCCMD dbgcCmdLogFlags;
+static FNDBGCCMD dbgcCmdFormat;
+static FNDBGCCMD dbgcCmdLoadImage;
+static FNDBGCCMD dbgcCmdLoadMap;
+static FNDBGCCMD dbgcCmdLoadSeg;
+static FNDBGCCMD dbgcCmdLoadSyms;
+static FNDBGCCMD dbgcCmdSet;
+static FNDBGCCMD dbgcCmdUnset;
+static FNDBGCCMD dbgcCmdLoadVars;
+static FNDBGCCMD dbgcCmdShowVars;
+static FNDBGCCMD dbgcCmdLoadPlugIn;
+static FNDBGCCMD dbgcCmdUnloadPlugIn;
+static FNDBGCCMD dbgcCmdShowPlugIns;
+static FNDBGCCMD dbgcCmdHarakiri;
+static FNDBGCCMD dbgcCmdEcho;
+static FNDBGCCMD dbgcCmdRunScript;
+static FNDBGCCMD dbgcCmdWriteCore;
 
 
@@ -718,14 +718,7 @@
 
 /**
- * The 'help' command.
- *
- * @returns VBox status.
- * @param   pCmd        Pointer to the command descriptor (as registered).
- * @param   pCmdHlp     Pointer to command helper functions.
- * @param   pVM         Pointer to the current VM (if any).
- * @param   paArgs      Pointer to (readonly) array of arguments.
- * @param   cArgs       Number of arguments in the array.
- */
-static DECLCALLBACK(int) dbgcCmdHelp(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
+ * @interface_method_impl{FNDBCCMD, The 'help' command.}
+ */
+static DECLCALLBACK(int) dbgcCmdHelp(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
 {
     PDBGC       pDbgc = DBGC_CMDHLP2DBGC(pCmdHlp);
@@ -833,5 +826,5 @@
 
     NOREF(pCmd);
-    NOREF(pVM);
+    NOREF(pUVM);
     return rc;
 }
@@ -839,18 +832,11 @@
 
 /**
- * The 'quit', 'exit' and 'bye' commands.
- *
- * @returns VBox status.
- * @param   pCmd        Pointer to the command descriptor (as registered).
- * @param   pCmdHlp     Pointer to command helper functions.
- * @param   pVM         Pointer to the current VM (if any).
- * @param   paArgs      Pointer to (readonly) array of arguments.
- * @param   cArgs       Number of arguments in the array.
- */
-static DECLCALLBACK(int) dbgcCmdQuit(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
-{
-    pCmdHlp->pfnPrintf(pCmdHlp, NULL, "Quitting console...\n");
+ * @interface_method_impl{FNDBCCMD, The 'quit', 'exit' and 'bye' commands. }
+ */
+static DECLCALLBACK(int) dbgcCmdQuit(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
+{
+    DBGCCmdHlpPrintf(pCmdHlp, "Quitting console...\n");
     NOREF(pCmd);
-    NOREF(pVM);
+    NOREF(pUVM);
     NOREF(paArgs);
     NOREF(cArgs);
@@ -860,14 +846,7 @@
 
 /**
- * The 'stop' command.
- *
- * @returns VBox status.
- * @param   pCmd        Pointer to the command descriptor (as registered).
- * @param   pCmdHlp     Pointer to command helper functions.
- * @param   pVM         Pointer to the current VM (if any).
- * @param   paArgs      Pointer to (readonly) array of arguments.
- * @param   cArgs       Number of arguments in the array.
- */
-static DECLCALLBACK(int) dbgcCmdStop(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
+ * @interface_method_impl{FNDBCCMD, The 'stop' command.}
+ */
+static DECLCALLBACK(int) dbgcCmdStop(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
 {
     /*
@@ -875,13 +854,13 @@
      */
     int rc;
-    if (DBGFR3IsHalted(pVM))
-        rc = pCmdHlp->pfnPrintf(pCmdHlp, NULL, "warning: The VM is already halted...\n");
+    if (DBGFR3IsHalted(pUVM))
+        rc = DBGCCmdHlpPrintf(pCmdHlp, "warning: The VM is already halted...\n");
     else
     {
-        rc = DBGFR3Halt(pVM);
+        rc = DBGFR3Halt(pUVM);
         if (RT_SUCCESS(rc))
             rc = VWRN_DBGC_CMD_PENDING;
         else
-            rc = pCmdHlp->pfnVBoxError(pCmdHlp, rc, "Executing DBGFR3Halt().");
+            rc = DBGCCmdHlpVBoxError(pCmdHlp, rc, "Executing DBGFR3Halt().");
     }
 
@@ -892,14 +871,7 @@
 
 /**
- * The 'echo' command.
- *
- * @returns VBox status.
- * @param   pCmd        Pointer to the command descriptor (as registered).
- * @param   pCmdHlp     Pointer to command helper functions.
- * @param   pVM         Pointer to the current VM (if any).
- * @param   paArgs      Pointer to (readonly) array of arguments.
- * @param   cArgs       Number of arguments in the array.
- */
-static DECLCALLBACK(int) dbgcCmdEcho(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
+ * @interface_method_impl{FNDBCCMD, The 'echo' command.}
+ */
+static DECLCALLBACK(int) dbgcCmdEcho(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
 {
     /*
@@ -910,29 +882,22 @@
     {
         AssertReturn(paArgs[i].enmType == DBGCVAR_TYPE_STRING, VERR_DBGC_PARSE_BUG);
-        rc = pCmdHlp->pfnPrintf(pCmdHlp, NULL, i ? " %s" : "%s", paArgs[i].u.pszString);
+        rc = DBGCCmdHlpPrintf(pCmdHlp, i ? " %s" : "%s", paArgs[i].u.pszString);
         if (RT_FAILURE(rc))
             return rc;
     }
-    NOREF(pCmd); NOREF(pVM);
-    return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "\n");
-}
-
-
-/**
- * The 'runscript' command.
- *
- * @returns VBox status.
- * @param   pCmd        Pointer to the command descriptor (as registered).
- * @param   pCmdHlp     Pointer to command helper functions.
- * @param   pVM         Pointer to the current VM (if any).
- * @param   paArgs      Pointer to (readonly) array of arguments.
- * @param   cArgs       Number of arguments in the array.
- */
-static DECLCALLBACK(int) dbgcCmdRunScript(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
+    NOREF(pCmd); NOREF(pUVM);
+    return DBGCCmdHlpPrintf(pCmdHlp, "\n");
+}
+
+
+/**
+ * @interface_method_impl{FNDBCCMD, The 'runscript' command.}
+ */
+static DECLCALLBACK(int) dbgcCmdRunScript(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
 {
     /* check that the parser did what it's supposed to do. */
     if (    cArgs != 1
         ||  paArgs[0].enmType != DBGCVAR_TYPE_STRING)
-        return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "parser error\n");
+        return DBGCCmdHlpPrintf(pCmdHlp, "parser error\n");
 
     /** @todo Load the script here, but someone else should do the actual
@@ -945,5 +910,5 @@
     FILE *pFile = fopen(pszFilename, "r");
     if (!pFile)
-        return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "Failed to open '%s'.\n", pszFilename);
+        return DBGCCmdHlpPrintf(pCmdHlp, "Failed to open '%s'.\n", pszFilename);
 
     /*
@@ -959,5 +924,5 @@
         if (pszEnd == &szLine[sizeof(szLine) - 1])
         {
-            rc = pCmdHlp->pfnPrintf(pCmdHlp, NULL, "runscript error: Line #%u is too long\n", iLine);
+            rc = DBGCCmdHlpPrintf(pCmdHlp, "runscript error: Line #%u is too long\n", iLine);
             break;
         }
@@ -990,10 +955,10 @@
         {
             if (rc == VERR_BUFFER_OVERFLOW)
-                rc = pCmdHlp->pfnPrintf(pCmdHlp, NULL, "runscript error: Line #%u is too long (exec overflowed)\n", iLine);
+                rc = DBGCCmdHlpPrintf(pCmdHlp, "runscript error: Line #%u is too long (exec overflowed)\n", iLine);
             break;
         }
         if (rc == VWRN_DBGC_CMD_PENDING)
         {
-            rc = pCmdHlp->pfnPrintf(pCmdHlp, NULL, "runscript error: VWRN_DBGC_CMD_PENDING on line #%u, script terminated\n", iLine);
+            rc = DBGCCmdHlpPrintf(pCmdHlp, "runscript error: VWRN_DBGC_CMD_PENDING on line #%u, script terminated\n", iLine);
             break;
         }
@@ -1002,5 +967,5 @@
     fclose(pFile);
 
-    NOREF(pCmd); NOREF(pVM);
+    NOREF(pCmd); NOREF(pUVM);
     return rc;
 }
@@ -1008,18 +973,11 @@
 
 /**
- * The 'detect' command.
- *
- * @returns VBox status.
- * @param   pCmd        Pointer to the command descriptor (as registered).
- * @param   pCmdHlp     Pointer to command helper functions.
- * @param   pVM         Pointer to the current VM (if any).
- * @param   paArgs      Pointer to (readonly) array of arguments.
- * @param   cArgs       Number of arguments in the array.
- */
-static DECLCALLBACK(int) dbgcCmdDetect(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
+ * @interface_method_impl{FNDBCCMD, The 'detect' command.}
+ */
+static DECLCALLBACK(int) dbgcCmdDetect(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
 {
     /* check that the parser did what it's supposed to do. */
     if (cArgs != 0)
-        return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "parser error\n");
+        return DBGCCmdHlpPrintf(pCmdHlp, "parser error\n");
 
     /*
@@ -1027,17 +985,17 @@
      */
     char szName[64];
-    int rc = DBGFR3OSDetect(pVM, szName, sizeof(szName));
+    int rc = DBGFR3OSDetect(pUVM, szName, sizeof(szName));
     if (RT_FAILURE(rc))
-        return pCmdHlp->pfnVBoxError(pCmdHlp, rc, "Executing DBGFR3OSDetect().");
+        return DBGCCmdHlpVBoxError(pCmdHlp, rc, "Executing DBGFR3OSDetect().");
     if (rc == VINF_SUCCESS)
     {
-        rc = pCmdHlp->pfnPrintf(pCmdHlp, NULL, "Guest OS: %s\n", szName);
+        rc = DBGCCmdHlpPrintf(pCmdHlp, "Guest OS: %s\n", szName);
         char szVersion[512];
-        int rc2 = DBGFR3OSQueryNameAndVersion(pVM, NULL, 0, szVersion, sizeof(szVersion));
+        int rc2 = DBGFR3OSQueryNameAndVersion(pUVM, NULL, 0, szVersion, sizeof(szVersion));
         if (RT_SUCCESS(rc2))
-            rc = pCmdHlp->pfnPrintf(pCmdHlp, NULL, "Version : %s\n", szVersion);
+            rc = DBGCCmdHlpPrintf(pCmdHlp, "Version : %s\n", szVersion);
     }
     else
-        rc = pCmdHlp->pfnPrintf(pCmdHlp, NULL, "Unable to figure out which guest OS it is, sorry.\n");
+        rc = DBGCCmdHlpPrintf(pCmdHlp, "Unable to figure out which guest OS it is, sorry.\n");
     NOREF(pCmd); NOREF(paArgs);
     return rc;
@@ -1046,14 +1004,7 @@
 
 /**
- * The 'cpu' command.
- *
- * @returns VBox status.
- * @param   pCmd        Pointer to the command descriptor (as registered).
- * @param   pCmdHlp     Pointer to command helper functions.
- * @param   pVM         Pointer to the current VM (if any).
- * @param   paArgs      Pointer to (readonly) array of arguments.
- * @param   cArgs       Number of arguments in the array.
- */
-static DECLCALLBACK(int) dbgcCmdCpu(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
+ * @interface_method_impl{FNDBCCMD, The 'cpu' command.}
+ */
+static DECLCALLBACK(int) dbgcCmdCpu(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
 {
     PDBGC       pDbgc = DBGC_CMDHLP2DBGC(pCmdHlp);
@@ -1063,20 +1014,19 @@
         &&  (   cArgs != 1
              || paArgs[0].enmType != DBGCVAR_TYPE_NUMBER))
-        return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "parser error\n");
-    if (!pVM)
-        return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "error: No VM.\n");
+        return DBGCCmdHlpPrintf(pCmdHlp, "parser error\n");
+    DBGC_CMDHLP_REQ_UVM_RET(pCmdHlp, pCmd, pUVM);
 
     int rc;
     if (!cArgs)
-        rc = pCmdHlp->pfnPrintf(pCmdHlp, NULL, "Current CPU ID: %u\n", pDbgc->idCpu);
+        rc = DBGCCmdHlpPrintf(pCmdHlp, "Current CPU ID: %u\n", pDbgc->idCpu);
     else
     {
-/** @todo add a DBGF getter for this. */
-        if (paArgs[0].u.u64Number >= pVM->cCpus)
-            rc = pCmdHlp->pfnPrintf(pCmdHlp, NULL, "error: idCpu %u is out of range! Highest ID is %u.\n",
-                                    paArgs[0].u.u64Number, pVM->cCpus);
+        VMCPUID cCpus = DBGFR3CpuGetCount(pUVM);
+        if (paArgs[0].u.u64Number >= cCpus)
+            rc = DBGCCmdHlpPrintf(pCmdHlp, "error: idCpu %u is out of range! Highest ID is %u.\n",
+                                    paArgs[0].u.u64Number, cCpus);
         else
         {
-            rc = pCmdHlp->pfnPrintf(pCmdHlp, NULL, "Changed CPU from %u to %u.\n",
+            rc = DBGCCmdHlpPrintf(pCmdHlp, "Changed CPU from %u to %u.\n",
                                     pDbgc->idCpu, (VMCPUID)paArgs[0].u.u64Number);
             pDbgc->idCpu = (VMCPUID)paArgs[0].u.u64Number;
@@ -1088,14 +1038,7 @@
 
 /**
- * The 'info' command.
- *
- * @returns VBox status.
- * @param   pCmd        Pointer to the command descriptor (as registered).
- * @param   pCmdHlp     Pointer to command helper functions.
- * @param   pVM         Pointer to the current VM (if any).
- * @param   paArgs      Pointer to (readonly) array of arguments.
- * @param   cArgs       Number of arguments in the array.
- */
-static DECLCALLBACK(int) dbgcCmdInfo(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
+ * @interface_method_impl{FNDBCCMD, The 'info' command.}
+ */
+static DECLCALLBACK(int) dbgcCmdInfo(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
 {
     PDBGC       pDbgc = DBGC_CMDHLP2DBGC(pCmdHlp);
@@ -1108,17 +1051,16 @@
         ||  paArgs[0].enmType != DBGCVAR_TYPE_STRING
         ||  paArgs[cArgs - 1].enmType != DBGCVAR_TYPE_STRING)
-        return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "internal error: The parser doesn't do its job properly yet.. quote the string.\n");
-    if (!pVM)
-        return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "error: No VM.\n");
+        return DBGCCmdHlpPrintf(pCmdHlp, "internal error: The parser doesn't do its job properly yet.. quote the string.\n");
+    DBGC_CMDHLP_REQ_UVM_RET(pCmdHlp, pCmd, pUVM);
 
     /*
      * Dump it.
      */
-    int rc = DBGFR3InfoEx(pVM, pDbgc->idCpu,
+    int rc = DBGFR3InfoEx(pUVM, pDbgc->idCpu,
                           paArgs[0].u.pszString,
                           cArgs == 2 ? paArgs[1].u.pszString : NULL,
                           DBGCCmdHlpGetDbgfOutputHlp(pCmdHlp));
     if (RT_FAILURE(rc))
-        return pCmdHlp->pfnVBoxError(pCmdHlp, rc, "DBGFR3InfoEx()\n");
+        return DBGCCmdHlpVBoxError(pCmdHlp, rc, "DBGFR3InfoEx()\n");
 
     NOREF(pCmd);
@@ -1128,74 +1070,46 @@
 
 /**
- * The 'log' command.
- *
- * @returns VBox status.
- * @param   pCmd        Pointer to the command descriptor (as registered).
- * @param   pCmdHlp     Pointer to command helper functions.
- * @param   pVM         Pointer to the current VM (if any).
- * @param   paArgs      Pointer to (readonly) array of arguments.
- * @param   cArgs       Number of arguments in the array.
- */
-static DECLCALLBACK(int) dbgcCmdLog(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
-{
-    int rc = DBGFR3LogModifyGroups(pVM, paArgs[0].u.pszString);
+ * @interface_method_impl{FNDBCCMD, The 'log' command.}
+ */
+static DECLCALLBACK(int) dbgcCmdLog(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
+{
+    int rc = DBGFR3LogModifyGroups(pUVM, paArgs[0].u.pszString);
     if (RT_SUCCESS(rc))
         return VINF_SUCCESS;
     NOREF(pCmd); NOREF(cArgs);
-    return pCmdHlp->pfnVBoxError(pCmdHlp, rc, "DBGFR3LogModifyGroups(%p,'%s')\n", pVM, paArgs[0].u.pszString);
-}
-
-
-/**
- * The 'logdest' command.
- *
- * @returns VBox status.
- * @param   pCmd        Pointer to the command descriptor (as registered).
- * @param   pCmdHlp     Pointer to command helper functions.
- * @param   pVM         Pointer to the current VM (if any).
- * @param   paArgs      Pointer to (readonly) array of arguments.
- * @param   cArgs       Number of arguments in the array.
- */
-static DECLCALLBACK(int) dbgcCmdLogDest(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
-{
-    int rc = DBGFR3LogModifyDestinations(pVM, paArgs[0].u.pszString);
+    return DBGCCmdHlpVBoxError(pCmdHlp, rc, "DBGFR3LogModifyGroups(%p,'%s')\n", pUVM, paArgs[0].u.pszString);
+}
+
+
+/**
+ * @interface_method_impl{FNDBCCMD, The 'logdest' command.}
+ */
+static DECLCALLBACK(int) dbgcCmdLogDest(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
+{
+    int rc = DBGFR3LogModifyDestinations(pUVM, paArgs[0].u.pszString);
     if (RT_SUCCESS(rc))
         return VINF_SUCCESS;
     NOREF(pCmd); NOREF(cArgs);
-    return pCmdHlp->pfnVBoxError(pCmdHlp, rc, "DBGFR3LogModifyDestinations(%p,'%s')\n", pVM, paArgs[0].u.pszString);
-}
-
-
-/**
- * The 'logflags' command.
- *
- * @returns VBox status.
- * @param   pCmd        Pointer to the command descriptor (as registered).
- * @param   pCmdHlp     Pointer to command helper functions.
- * @param   pVM         Pointer to the current VM (if any).
- * @param   paArgs      Pointer to (readonly) array of arguments.
- * @param   cArgs       Number of arguments in the array.
- */
-static DECLCALLBACK(int) dbgcCmdLogFlags(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
-{
-    int rc = DBGFR3LogModifyFlags(pVM, paArgs[0].u.pszString);
+    return DBGCCmdHlpVBoxError(pCmdHlp, rc, "DBGFR3LogModifyDestinations(%p,'%s')\n", pUVM, paArgs[0].u.pszString);
+}
+
+
+/**
+ * @interface_method_impl{FNDBCCMD, The 'logflags' command.}
+ */
+static DECLCALLBACK(int) dbgcCmdLogFlags(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
+{
+    int rc = DBGFR3LogModifyFlags(pUVM, paArgs[0].u.pszString);
     if (RT_SUCCESS(rc))
         return VINF_SUCCESS;
     NOREF(pCmd); NOREF(cArgs);
-    return pCmdHlp->pfnVBoxError(pCmdHlp, rc, "DBGFR3LogModifyFlags(%p,'%s')\n", pVM, paArgs[0].u.pszString);
-}
-
-
-/**
- * The 'format' command.
- *
- * @returns VBox status.
- * @param   pCmd        Pointer to the command descriptor (as registered).
- * @param   pCmdHlp     Pointer to command helper functions.
- * @param   pVM         Pointer to the current VM (if any).
- * @param   paArgs      Pointer to (readonly) array of arguments.
- * @param   cArgs       Number of arguments in the array.
- */
-static DECLCALLBACK(int) dbgcCmdFormat(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
+    return DBGCCmdHlpVBoxError(pCmdHlp, rc, "DBGFR3LogModifyFlags(%p,'%s')\n", pUVM, paArgs[0].u.pszString);
+}
+
+
+/**
+ * @interface_method_impl{FNDBCCMD, The 'format' command.}
+ */
+static DECLCALLBACK(int) dbgcCmdFormat(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
 {
     LogFlow(("dbgcCmdFormat\n"));
@@ -1211,10 +1125,10 @@
         {
             case DBGCVAR_TYPE_UNKNOWN:
-                rc = pCmdHlp->pfnPrintf(pCmdHlp, NULL,
+                rc = DBGCCmdHlpPrintf(pCmdHlp,
                     "Unknown variable type!\n");
                 break;
             case DBGCVAR_TYPE_GC_FLAT:
                 if (paArgs[iArg].enmRangeType != DBGCVAR_RANGE_NONE)
-                    rc = pCmdHlp->pfnPrintf(pCmdHlp, NULL,
+                    rc = DBGCCmdHlpPrintf(pCmdHlp,
                         "Guest flat address: %%%08x range %lld %s\n",
                         paArgs[iArg].u.GCFlat,
@@ -1222,5 +1136,5 @@
                         apszRangeDesc[paArgs[iArg].enmRangeType]);
                 else
-                    rc = pCmdHlp->pfnPrintf(pCmdHlp, NULL,
+                    rc = DBGCCmdHlpPrintf(pCmdHlp,
                         "Guest flat address: %%%08x\n",
                         paArgs[iArg].u.GCFlat);
@@ -1228,5 +1142,5 @@
             case DBGCVAR_TYPE_GC_FAR:
                 if (paArgs[iArg].enmRangeType != DBGCVAR_RANGE_NONE)
-                    rc = pCmdHlp->pfnPrintf(pCmdHlp, NULL,
+                    rc = DBGCCmdHlpPrintf(pCmdHlp,
                         "Guest far address: %04x:%08x range %lld %s\n",
                         paArgs[iArg].u.GCFar.sel,
@@ -1235,5 +1149,5 @@
                         apszRangeDesc[paArgs[iArg].enmRangeType]);
                 else
-                    rc = pCmdHlp->pfnPrintf(pCmdHlp, NULL,
+                    rc = DBGCCmdHlpPrintf(pCmdHlp,
                         "Guest far address: %04x:%08x\n",
                         paArgs[iArg].u.GCFar.sel,
@@ -1242,5 +1156,5 @@
             case DBGCVAR_TYPE_GC_PHYS:
                 if (paArgs[iArg].enmRangeType != DBGCVAR_RANGE_NONE)
-                    rc = pCmdHlp->pfnPrintf(pCmdHlp, NULL,
+                    rc = DBGCCmdHlpPrintf(pCmdHlp,
                         "Guest physical address: %%%%%08x range %lld %s\n",
                         paArgs[iArg].u.GCPhys,
@@ -1248,5 +1162,5 @@
                         apszRangeDesc[paArgs[iArg].enmRangeType]);
                 else
-                    rc = pCmdHlp->pfnPrintf(pCmdHlp, NULL,
+                    rc = DBGCCmdHlpPrintf(pCmdHlp,
                         "Guest physical address: %%%%%08x\n",
                         paArgs[iArg].u.GCPhys);
@@ -1254,5 +1168,5 @@
             case DBGCVAR_TYPE_HC_FLAT:
                 if (paArgs[iArg].enmRangeType != DBGCVAR_RANGE_NONE)
-                    rc = pCmdHlp->pfnPrintf(pCmdHlp, NULL,
+                    rc = DBGCCmdHlpPrintf(pCmdHlp,
                         "Host flat address: %%%08x range %lld %s\n",
                         paArgs[iArg].u.pvHCFlat,
@@ -1260,5 +1174,5 @@
                         apszRangeDesc[paArgs[iArg].enmRangeType]);
                 else
-                    rc = pCmdHlp->pfnPrintf(pCmdHlp, NULL,
+                    rc = DBGCCmdHlpPrintf(pCmdHlp,
                         "Host flat address: %%%08x\n",
                         paArgs[iArg].u.pvHCFlat);
@@ -1266,5 +1180,5 @@
             case DBGCVAR_TYPE_HC_PHYS:
                 if (paArgs[iArg].enmRangeType != DBGCVAR_RANGE_NONE)
-                    rc = pCmdHlp->pfnPrintf(pCmdHlp, NULL,
+                    rc = DBGCCmdHlpPrintf(pCmdHlp,
                         "Host physical address: %RHp range %lld %s\n",
                         paArgs[iArg].u.HCPhys,
@@ -1272,5 +1186,5 @@
                         apszRangeDesc[paArgs[iArg].enmRangeType]);
                 else
-                    rc = pCmdHlp->pfnPrintf(pCmdHlp, NULL,
+                    rc = DBGCCmdHlpPrintf(pCmdHlp,
                         "Host physical address: %RHp\n",
                         paArgs[iArg].u.HCPhys);
@@ -1278,5 +1192,5 @@
 
             case DBGCVAR_TYPE_STRING:
-                rc = pCmdHlp->pfnPrintf(pCmdHlp, NULL,
+                rc = DBGCCmdHlpPrintf(pCmdHlp,
                     "String, %lld bytes long: %s\n",
                     paArgs[iArg].u64Range,
@@ -1285,5 +1199,5 @@
 
             case DBGCVAR_TYPE_SYMBOL:
-                rc = pCmdHlp->pfnPrintf(pCmdHlp, NULL,
+                rc = DBGCCmdHlpPrintf(pCmdHlp,
                     "Symbol, %lld bytes long: %s\n",
                     paArgs[iArg].u64Range,
@@ -1293,5 +1207,5 @@
             case DBGCVAR_TYPE_NUMBER:
                 if (paArgs[iArg].enmRangeType != DBGCVAR_RANGE_NONE)
-                    rc = pCmdHlp->pfnPrintf(pCmdHlp, NULL,
+                    rc = DBGCCmdHlpPrintf(pCmdHlp,
                         "Number: hex %llx  dec 0i%lld  oct 0t%llo  range %lld %s\n",
                         paArgs[iArg].u.u64Number,
@@ -1301,5 +1215,5 @@
                         apszRangeDesc[paArgs[iArg].enmRangeType]);
                 else
-                    rc = pCmdHlp->pfnPrintf(pCmdHlp, NULL,
+                    rc = DBGCCmdHlpPrintf(pCmdHlp,
                         "Number: hex %llx  dec 0i%lld  oct 0t%llo\n",
                         paArgs[iArg].u.u64Number,
@@ -1309,5 +1223,5 @@
 
             default:
-                rc = pCmdHlp->pfnPrintf(pCmdHlp, NULL,
+                rc = DBGCCmdHlpPrintf(pCmdHlp,
                     "Invalid argument type %d\n",
                     paArgs[iArg].enmType);
@@ -1316,5 +1230,5 @@
     } /* arg loop */
 
-    NOREF(pCmd); NOREF(pVM);
+    NOREF(pCmd); NOREF(pUVM);
     return 0;
 }
@@ -1322,14 +1236,7 @@
 
 /**
- * The 'loadimage' command.
- *
- * @returns VBox status.
- * @param   pCmd        Pointer to the command descriptor (as registered).
- * @param   pCmdHlp     Pointer to command helper functions.
- * @param   pVM         Pointer to the current VM (if any).
- * @param   paArgs      Pointer to (readonly) array of arguments.
- * @param   cArgs       Number of arguments in the array.
- */
-static DECLCALLBACK(int) dbgcCmdLoadImage(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
+ * @interface_method_impl{FNDBCCMD, The 'loadimage' command.}
+ */
+static DECLCALLBACK(int) dbgcCmdLoadImage(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
 {
     /*
@@ -1348,5 +1255,5 @@
     int rc = pCmdHlp->pfnVarToDbgfAddr(pCmdHlp, &paArgs[1], &ModAddress);
     if (RT_FAILURE(rc))
-        return pCmdHlp->pfnVBoxError(pCmdHlp, rc, "pfnVarToDbgfAddr: %Dv\n", &paArgs[1]);
+        return DBGCCmdHlpVBoxError(pCmdHlp, rc, "pfnVarToDbgfAddr: %Dv\n", &paArgs[1]);
 
     const char     *pszModName  = NULL;
@@ -1361,8 +1268,8 @@
      */
     PDBGC pDbgc = DBGC_CMDHLP2DBGC(pCmdHlp);
-    rc = DBGFR3AsLoadImage(pVM, pDbgc->hDbgAs, pszFilename, pszModName, &ModAddress, NIL_RTDBGSEGIDX, 0 /*fFlags*/);
+    rc = DBGFR3AsLoadImage(pUVM, pDbgc->hDbgAs, pszFilename, pszModName, &ModAddress, NIL_RTDBGSEGIDX, 0 /*fFlags*/);
     if (RT_FAILURE(rc))
-        return pCmdHlp->pfnVBoxError(pCmdHlp, rc, "DBGFR3ModuleLoadImage(,,'%s','%s',%Dv,)\n",
-                                     pszFilename, pszModName, &paArgs[1]);
+        return DBGCCmdHlpVBoxError(pCmdHlp, rc, "DBGFR3ModuleLoadImage(,,'%s','%s',%Dv,)\n",
+                                   pszFilename, pszModName, &paArgs[1]);
 
     NOREF(pCmd);
@@ -1372,14 +1279,7 @@
 
 /**
- * The 'loadmap' command.
- *
- * @returns VBox status.
- * @param   pCmd        Pointer to the command descriptor (as registered).
- * @param   pCmdHlp     Pointer to command helper functions.
- * @param   pVM         Pointer to the current VM (if any).
- * @param   paArgs      Pointer to (readonly) array of arguments.
- * @param   cArgs       Number of arguments in the array.
- */
-static DECLCALLBACK(int) dbgcCmdLoadMap(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
+ * @interface_method_impl{FNDBCCMD, The 'loadmap' command.}
+ */
+static DECLCALLBACK(int) dbgcCmdLoadMap(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
 {
     /*
@@ -1398,5 +1298,5 @@
     int rc = pCmdHlp->pfnVarToDbgfAddr(pCmdHlp, &paArgs[1], &ModAddress);
     if (RT_FAILURE(rc))
-        return pCmdHlp->pfnVBoxError(pCmdHlp, rc, "pfnVarToDbgfAddr: %Dv\n", &paArgs[1]);
+        return DBGCCmdHlpVBoxError(pCmdHlp, rc, "pfnVarToDbgfAddr: %Dv\n", &paArgs[1]);
 
     const char     *pszModName  = NULL;
@@ -1421,5 +1321,5 @@
         if (    iModSeg != paArgs[4].u.u64Number
             ||  iModSeg > RTDBGSEGIDX_LAST)
-            return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "Segment index out of range: %Dv; range={0..%#x}\n", &paArgs[1], RTDBGSEGIDX_LAST);
+            return DBGCCmdHlpPrintf(pCmdHlp, "Segment index out of range: %Dv; range={0..%#x}\n", &paArgs[1], RTDBGSEGIDX_LAST);
     }
 
@@ -1428,8 +1328,8 @@
      */
     PDBGC pDbgc = DBGC_CMDHLP2DBGC(pCmdHlp);
-    rc = DBGFR3AsLoadMap(pVM, pDbgc->hDbgAs, pszFilename, pszModName, &ModAddress, NIL_RTDBGSEGIDX, uSubtrahend, 0 /*fFlags*/);
+    rc = DBGFR3AsLoadMap(pUVM, pDbgc->hDbgAs, pszFilename, pszModName, &ModAddress, NIL_RTDBGSEGIDX, uSubtrahend, 0 /*fFlags*/);
     if (RT_FAILURE(rc))
-        return pCmdHlp->pfnVBoxError(pCmdHlp, rc, "DBGFR3AsLoadMap(,,'%s','%s',%Dv,)\n",
-                                     pszFilename, pszModName, &paArgs[1]);
+        return DBGCCmdHlpVBoxError(pCmdHlp, rc, "DBGFR3AsLoadMap(,,'%s','%s',%Dv,)\n",
+                                   pszFilename, pszModName, &paArgs[1]);
 
     NOREF(pCmd);
@@ -1439,14 +1339,7 @@
 
 /**
- * The 'loadseg' command.
- *
- * @returns VBox status.
- * @param   pCmd        Pointer to the command descriptor (as registered).
- * @param   pCmdHlp     Pointer to command helper functions.
- * @param   pVM         Pointer to the current VM (if any).
- * @param   paArgs      Pointer to (readonly) array of arguments.
- * @param   cArgs       Number of arguments in the array.
- */
-static DECLCALLBACK(int) dbgcCmdLoadSeg(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
+ * @interface_method_impl{FNDBCCMD, The 'loadseg' command.}
+ */
+static DECLCALLBACK(int) dbgcCmdLoadSeg(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
 {
     /*
@@ -1466,10 +1359,10 @@
     int rc = pCmdHlp->pfnVarToDbgfAddr(pCmdHlp, &paArgs[1], &ModAddress);
     if (RT_FAILURE(rc))
-        return pCmdHlp->pfnVBoxError(pCmdHlp, rc, "pfnVarToDbgfAddr: %Dv\n", &paArgs[1]);
+        return DBGCCmdHlpVBoxError(pCmdHlp, rc, "pfnVarToDbgfAddr: %Dv\n", &paArgs[1]);
 
     RTDBGSEGIDX     iModSeg     = (RTDBGSEGIDX)paArgs[1].u.u64Number;
     if (    iModSeg != paArgs[2].u.u64Number
         ||  iModSeg > RTDBGSEGIDX_LAST)
-        return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "Segment index out of range: %Dv; range={0..%#x}\n", &paArgs[1], RTDBGSEGIDX_LAST);
+        return DBGCCmdHlpPrintf(pCmdHlp, "Segment index out of range: %Dv; range={0..%#x}\n", &paArgs[1], RTDBGSEGIDX_LAST);
 
     const char     *pszModName  = NULL;
@@ -1484,8 +1377,8 @@
      */
     PDBGC pDbgc = DBGC_CMDHLP2DBGC(pCmdHlp);
-    rc = DBGFR3AsLoadImage(pVM, pDbgc->hDbgAs, pszFilename, pszModName, &ModAddress, iModSeg, 0 /*fFlags*/);
+    rc = DBGFR3AsLoadImage(pUVM, pDbgc->hDbgAs, pszFilename, pszModName, &ModAddress, iModSeg, 0 /*fFlags*/);
     if (RT_FAILURE(rc))
-        return pCmdHlp->pfnVBoxError(pCmdHlp, rc, "DBGFR3ModuleLoadImage(,,'%s','%s',%Dv,)\n",
-                                     pszFilename, pszModName, &paArgs[1]);
+        return DBGCCmdHlpVBoxError(pCmdHlp, rc, "DBGFR3ModuleLoadImage(,,'%s','%s',%Dv,)\n",
+                                   pszFilename, pszModName, &paArgs[1]);
 
     NOREF(pCmd);
@@ -1495,14 +1388,7 @@
 
 /**
- * The 'loadsyms' command.
- *
- * @returns VBox status.
- * @param   pCmd        Pointer to the command descriptor (as registered).
- * @param   pCmdHlp     Pointer to command helper functions.
- * @param   pVM         Pointer to the current VM (if any).
- * @param   paArgs      Pointer to (readonly) array of arguments.
- * @param   cArgs       Number of arguments in the array.
- */
-static DECLCALLBACK(int) dbgcCmdLoadSyms(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
+ * @interface_method_impl{FNDBCCMD, The 'loadsyms' command.}
+ */
+static DECLCALLBACK(int) dbgcCmdLoadSyms(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
 {
     /*
@@ -1547,5 +1433,5 @@
                 int rc = DBGCCmdHlpEval(pCmdHlp, &AddrVar, "%%(%Dv)", &paArgs[iArg]);
                 if (RT_FAILURE(rc))
-                    return pCmdHlp->pfnVBoxError(pCmdHlp, rc, "Module address cast %%(%Dv) failed.", &paArgs[iArg]);
+                    return DBGCCmdHlpVBoxError(pCmdHlp, rc, "Module address cast %%(%Dv) failed.", &paArgs[iArg]);
                 ModuleAddress = paArgs[iArg].u.GCFlat;
                 iArg++;
@@ -1572,8 +1458,8 @@
      * Call the debug info manager about this loading...
      */
-    int rc = DBGFR3ModuleLoad(pVM, paArgs[0].u.pszString, Delta, pszModule, ModuleAddress, cbModule);
+    int rc = DBGFR3ModuleLoad(pUVM, paArgs[0].u.pszString, Delta, pszModule, ModuleAddress, cbModule);
     if (RT_FAILURE(rc))
-        return pCmdHlp->pfnVBoxError(pCmdHlp, rc, "DBGInfoSymbolLoad(, '%s', %RGv, '%s', %RGv, 0)\n",
-                                     paArgs[0].u.pszString, Delta, pszModule, ModuleAddress);
+        return DBGCCmdHlpVBoxError(pCmdHlp, rc, "DBGInfoSymbolLoad(, '%s', %RGv, '%s', %RGv, 0)\n",
+                                   paArgs[0].u.pszString, Delta, pszModule, ModuleAddress);
 
     NOREF(pCmd);
@@ -1583,14 +1469,7 @@
 
 /**
- * The 'set' command.
- *
- * @returns VBox status.
- * @param   pCmd        Pointer to the command descriptor (as registered).
- * @param   pCmdHlp     Pointer to command helper functions.
- * @param   pVM         Pointer to the current VM (if any).
- * @param   paArgs      Pointer to (readonly) array of arguments.
- * @param   cArgs       Number of arguments in the array.
- */
-static DECLCALLBACK(int) dbgcCmdSet(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
+ * @interface_method_impl{FNDBCCMD, The 'set' command.}
+ */
+static DECLCALLBACK(int) dbgcCmdSet(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
 {
     PDBGC   pDbgc = DBGC_CMDHLP2DBGC(pCmdHlp);
@@ -1607,5 +1486,5 @@
     const char *pszVar = paArgs[0].u.pszString;
     if (!RT_C_IS_ALPHA(*pszVar) || *pszVar == '_')
-        return pCmdHlp->pfnPrintf(pCmdHlp, NULL,
+        return DBGCCmdHlpPrintf(pCmdHlp,
             "syntax error: Invalid variable name '%s'. Variable names must match regex '[_a-zA-Z][_a-zA-Z0-9*'!", paArgs[0].u.pszString);
 
@@ -1613,5 +1492,5 @@
         *pszVar++;
     if (*pszVar)
-        return pCmdHlp->pfnPrintf(pCmdHlp, NULL,
+        return DBGCCmdHlpPrintf(pCmdHlp,
             "syntax error: Invalid variable name '%s'. Variable names must match regex '[_a-zA-Z][_a-zA-Z0-9*]'!", paArgs[0].u.pszString);
 
@@ -1671,5 +1550,5 @@
     pDbgc->papVars[pDbgc->cVars++] = pVar;
 
-    NOREF(pCmd); NOREF(pVM); NOREF(cArgs);
+    NOREF(pCmd); NOREF(pUVM); NOREF(cArgs);
     return 0;
 }
@@ -1677,14 +1556,7 @@
 
 /**
- * The 'unset' command.
- *
- * @returns VBox status.
- * @param   pCmd        Pointer to the command descriptor (as registered).
- * @param   pCmdHlp     Pointer to command helper functions.
- * @param   pVM         Pointer to the current VM (if any).
- * @param   paArgs      Pointer to (readonly) array of arguments.
- * @param   cArgs       Number of arguments in the array.
- */
-static DECLCALLBACK(int) dbgcCmdUnset(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
+ * @interface_method_impl{FNDBCCMD, The 'unset' command.}
+ */
+static DECLCALLBACK(int) dbgcCmdUnset(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
 {
     PDBGC   pDbgc = DBGC_CMDHLP2DBGC(pCmdHlp);
@@ -1721,5 +1593,5 @@
     } /* arg loop */
 
-    NOREF(pCmd); NOREF(pVM);
+    NOREF(pCmd); NOREF(pUVM);
     return 0;
 }
@@ -1727,14 +1599,7 @@
 
 /**
- * The 'loadvars' command.
- *
- * @returns VBox status.
- * @param   pCmd        Pointer to the command descriptor (as registered).
- * @param   pCmdHlp     Pointer to command helper functions.
- * @param   pVM         Pointer to the current VM (if any).
- * @param   paArgs      Pointer to (readonly) array of arguments.
- * @param   cArgs       Number of arguments in the array.
- */
-static DECLCALLBACK(int) dbgcCmdLoadVars(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
+ * @interface_method_impl{FNDBCCMD, The 'loadvars' command.}
+ */
+static DECLCALLBACK(int) dbgcCmdLoadVars(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
 {
     /*
@@ -1769,5 +1634,5 @@
                 &&  *psz != ';')
             {
-                pCmdHlp->pfnPrintf(pCmdHlp, NULL, "dbg: set %s", psz);
+                DBGCCmdHlpPrintf(pCmdHlp, "dbg: set %s", psz);
                 pCmdHlp->pfnExec(pCmdHlp, "set %s", psz);
             }
@@ -1776,7 +1641,7 @@
     }
     else
-        return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "Failed to open file '%s'.\n", paArgs[0].u.pszString);
-
-    NOREF(pCmd); NOREF(pVM);
+        return DBGCCmdHlpPrintf(pCmdHlp, "Failed to open file '%s'.\n", paArgs[0].u.pszString);
+
+    NOREF(pCmd); NOREF(pUVM);
     return 0;
 }
@@ -1784,14 +1649,7 @@
 
 /**
- * The 'showvars' command.
- *
- * @returns VBox status.
- * @param   pCmd        Pointer to the command descriptor (as registered).
- * @param   pCmdHlp     Pointer to command helper functions.
- * @param   pVM         Pointer to the current VM (if any).
- * @param   paArgs      Pointer to (readonly) array of arguments.
- * @param   cArgs       Number of arguments in the array.
- */
-static DECLCALLBACK(int) dbgcCmdShowVars(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
+ * @interface_method_impl{FNDBCCMD, The 'showvars' command.}
+ */
+static DECLCALLBACK(int) dbgcCmdShowVars(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
 {
     PDBGC pDbgc = DBGC_CMDHLP2DBGC(pCmdHlp);
@@ -1799,7 +1657,7 @@
     for (unsigned iVar = 0; iVar < pDbgc->cVars; iVar++)
     {
-        int rc = pCmdHlp->pfnPrintf(pCmdHlp, NULL, "%-20s ", &pDbgc->papVars[iVar]->szName);
+        int rc = DBGCCmdHlpPrintf(pCmdHlp, "%-20s ", &pDbgc->papVars[iVar]->szName);
         if (!rc)
-            rc = dbgcCmdFormat(pCmd, pCmdHlp, pVM, &pDbgc->papVars[iVar]->Var, 1);
+            rc = dbgcCmdFormat(pCmd, pCmdHlp, pUVM, &pDbgc->papVars[iVar]->Var, 1);
         if (rc)
             return rc;
@@ -2034,5 +1892,5 @@
      * Try initialize it.
      */
-    rc = pPlugIn->pfnEntry(DBGCPLUGINOP_INIT, pDbgc->pVM, VBOX_VERSION);
+    rc = pPlugIn->pfnEntry(DBGCPLUGINOP_INIT, pDbgc->pUVM, VBOX_VERSION);
     if (RT_FAILURE(rc))
     {
@@ -2109,14 +1967,7 @@
 
 /**
- * The 'loadplugin' command.
- *
- * @returns VBox status.
- * @param   pCmd        Pointer to the command descriptor (as registered).
- * @param   pCmdHlp     Pointer to command helper functions.
- * @param   pVM         Pointer to the current VM (if any).
- * @param   paArgs      Pointer to (readonly) array of arguments.
- * @param   cArgs       Number of arguments in the array.
- */
-static DECLCALLBACK(int) dbgcCmdLoadPlugIn(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
+ * @interface_method_impl{FNDBCCMD, The 'loadplugin' command.}
+ */
+static DECLCALLBACK(int) dbgcCmdLoadPlugIn(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
 {
     PDBGC pDbgc = DBGC_CMDHLP2DBGC(pCmdHlp);
@@ -2165,5 +2016,5 @@
             &&  pDbgc->pVM->enmVMState < VMSTATE_DESTROYING)
         {
-            pPlugIn->pfnEntry(DBGCPLUGINOP_TERM, pDbgc->pVM, 0);
+            pPlugIn->pfnEntry(DBGCPLUGINOP_TERM, pDbgc->pUVM, 0);
             RTLdrClose(pPlugIn->hLdrMod);
         }
@@ -2176,14 +2027,7 @@
 
 /**
- * The 'unload' command.
- *
- * @returns VBox status.
- * @param   pCmd        Pointer to the command descriptor (as registered).
- * @param   pCmdHlp     Pointer to command helper functions.
- * @param   pVM         Pointer to the current VM (if any).
- * @param   paArgs      Pointer to (readonly) array of arguments.
- * @param   cArgs       Number of arguments in the array.
- */
-static DECLCALLBACK(int) dbgcCmdUnloadPlugIn(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
+ * @interface_method_impl{FNDBCCMD, The 'unload' command.}
+ */
+static DECLCALLBACK(int) dbgcCmdUnloadPlugIn(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
 {
     PDBGC pDbgc = DBGC_CMDHLP2DBGC(pCmdHlp);
@@ -2211,5 +2055,5 @@
          * Terminate and unload it.
          */
-        pPlugIn->pfnEntry(DBGCPLUGINOP_TERM, pDbgc->pVM, 0);
+        pPlugIn->pfnEntry(DBGCPLUGINOP_TERM, pDbgc->pUVM, 0);
         RTLdrClose(pPlugIn->hLdrMod);
         pPlugIn->hLdrMod = NIL_RTLDRMOD;
@@ -2228,14 +2072,7 @@
 
 /**
- * The 'showplugins' command.
- *
- * @returns VBox status.
- * @param   pCmd        Pointer to the command descriptor (as registered).
- * @param   pCmdHlp     Pointer to command helper functions.
- * @param   pVM         Pointer to the current VM (if any).
- * @param   paArgs      Pointer to (readonly) array of arguments.
- * @param   cArgs       Number of arguments in the array.
- */
-static DECLCALLBACK(int) dbgcCmdShowPlugIns(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
+ * @interface_method_impl{FNDBCCMD, The 'showplugins' command.}
+ */
+static DECLCALLBACK(int) dbgcCmdShowPlugIns(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
 {
     PDBGC       pDbgc = DBGC_CMDHLP2DBGC(pCmdHlp);
@@ -2258,33 +2095,19 @@
 
 /**
- * The 'harakiri' command.
- *
- * @returns VBox status.
- * @param   pCmd        Pointer to the command descriptor (as registered).
- * @param   pCmdHlp     Pointer to command helper functions.
- * @param   pVM         Pointer to the current VM (if any).
- * @param   paArgs      Pointer to (readonly) array of arguments.
- * @param   cArgs       Number of arguments in the array.
- */
-static DECLCALLBACK(int) dbgcCmdHarakiri(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
+ * @interface_method_impl{FNDBCCMD, The 'harakiri' command.}
+ */
+static DECLCALLBACK(int) dbgcCmdHarakiri(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
 {
     Log(("dbgcCmdHarakiri\n"));
     for (;;)
         exit(126);
-    NOREF(pCmd); NOREF(pCmdHlp); NOREF(pVM); NOREF(paArgs); NOREF(cArgs);
-}
-
-
-/**
- * The 'writecore' command.
- *
- * @returns VBox status.
- * @param   pCmd        Pointer to the command descriptor (as registered).
- * @param   pCmdHlp     Pointer to command helper functions.
- * @param   pVM         Pointer to the current VM (if any).
- * @param   paArgs      Pointer to (readonly) array of arguments.
- * @param   cArgs       Number of arguments in the array.
- */
-static DECLCALLBACK(int) dbgcCmdWriteCore(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
+    NOREF(pCmd); NOREF(pCmdHlp); NOREF(pUVM); NOREF(paArgs); NOREF(cArgs);
+}
+
+
+/**
+ * @interface_method_impl{FNDBCCMD, The 'writecore' command.}
+ */
+static DECLCALLBACK(int) dbgcCmdWriteCore(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
 {
     Log(("dbgcCmdWriteCore\n"));
@@ -2304,5 +2127,5 @@
         return DBGCCmdHlpFail(pCmdHlp, pCmd, "Missing file path.\n");
 
-    int rc = DBGFR3CoreWrite(pVM, pszDumpPath, true /*fReplaceFile*/);
+    int rc = DBGFR3CoreWrite(pUVM, pszDumpPath, true /*fReplaceFile*/);
     if (RT_FAILURE(rc))
         return DBGCCmdHlpFail(pCmdHlp, pCmd, "DBGFR3WriteCore failed. rc=%Rrc\n", rc);
@@ -2316,5 +2139,5 @@
  * @callback_method_impl{The randu32() function implementation.}
  */
-static DECLCALLBACK(int) dbgcFuncRandU32(PCDBGCFUNC pFunc, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, uint32_t cArgs,
+static DECLCALLBACK(int) dbgcFuncRandU32(PCDBGCFUNC pFunc, PDBGCCMDHLP pCmdHlp, PVM pUVM, PCDBGCVAR paArgs, uint32_t cArgs,
                                          PDBGCVAR pResult)
 {
@@ -2322,5 +2145,5 @@
     uint32_t u32 = RTRandU32();
     DBGCVAR_INIT_NUMBER(pResult, u32);
-    NOREF(pFunc); NOREF(pCmdHlp); NOREF(pVM); NOREF(paArgs);
+    NOREF(pFunc); NOREF(pCmdHlp); NOREF(pUVM); NOREF(paArgs);
     return VINF_SUCCESS;
 }
Index: trunk/src/VBox/Debugger/DBGCEmulateCodeView.cpp
===================================================================
--- trunk/src/VBox/Debugger/DBGCEmulateCodeView.cpp	(revision 44398)
+++ trunk/src/VBox/Debugger/DBGCEmulateCodeView.cpp	(revision 44399)
@@ -5,5 +5,5 @@
 
 /*
- * Copyright (C) 2006-2011 Oracle Corporation
+ * Copyright (C) 2006-2013 Oracle Corporation
  *
  * This file is part of VirtualBox Open Source Edition (OSE), as
@@ -44,35 +44,35 @@
 *   Internal Functions                                                         *
 *******************************************************************************/
-static DECLCALLBACK(int) dbgcCmdBrkAccess(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
-static DECLCALLBACK(int) dbgcCmdBrkClear(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
-static DECLCALLBACK(int) dbgcCmdBrkDisable(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
-static DECLCALLBACK(int) dbgcCmdBrkEnable(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
-static DECLCALLBACK(int) dbgcCmdBrkList(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
-static DECLCALLBACK(int) dbgcCmdBrkSet(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
-static DECLCALLBACK(int) dbgcCmdBrkREM(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
-static DECLCALLBACK(int) dbgcCmdDumpMem(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
-static DECLCALLBACK(int) dbgcCmdDumpDT(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
-static DECLCALLBACK(int) dbgcCmdDumpIDT(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
-static DECLCALLBACK(int) dbgcCmdDumpPageDir(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
-static DECLCALLBACK(int) dbgcCmdDumpPageDirBoth(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
-static DECLCALLBACK(int) dbgcCmdDumpPageHierarchy(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
-static DECLCALLBACK(int) dbgcCmdDumpPageTable(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
-static DECLCALLBACK(int) dbgcCmdDumpPageTableBoth(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
-static DECLCALLBACK(int) dbgcCmdDumpTSS(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
-static DECLCALLBACK(int) dbgcCmdEditMem(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
-static DECLCALLBACK(int) dbgcCmdGo(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
-static DECLCALLBACK(int) dbgcCmdListModules(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
-static DECLCALLBACK(int) dbgcCmdListNear(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
-static DECLCALLBACK(int) dbgcCmdListSource(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
-static DECLCALLBACK(int) dbgcCmdMemoryInfo(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
-static DECLCALLBACK(int) dbgcCmdReg(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
-static DECLCALLBACK(int) dbgcCmdRegGuest(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
-static DECLCALLBACK(int) dbgcCmdRegHyper(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
-static DECLCALLBACK(int) dbgcCmdRegTerse(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
-static DECLCALLBACK(int) dbgcCmdSearchMem(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
-static DECLCALLBACK(int) dbgcCmdSearchMemType(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
-static DECLCALLBACK(int) dbgcCmdStack(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
-static DECLCALLBACK(int) dbgcCmdTrace(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
-static DECLCALLBACK(int) dbgcCmdUnassemble(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
+static FNDBGCCMD dbgcCmdBrkAccess;
+static FNDBGCCMD dbgcCmdBrkClear;
+static FNDBGCCMD dbgcCmdBrkDisable;
+static FNDBGCCMD dbgcCmdBrkEnable;
+static FNDBGCCMD dbgcCmdBrkList;
+static FNDBGCCMD dbgcCmdBrkSet;
+static FNDBGCCMD dbgcCmdBrkREM;
+static FNDBGCCMD dbgcCmdDumpMem;
+static FNDBGCCMD dbgcCmdDumpDT;
+static FNDBGCCMD dbgcCmdDumpIDT;
+static FNDBGCCMD dbgcCmdDumpPageDir;
+static FNDBGCCMD dbgcCmdDumpPageDirBoth;
+static FNDBGCCMD dbgcCmdDumpPageHierarchy;
+static FNDBGCCMD dbgcCmdDumpPageTable;
+static FNDBGCCMD dbgcCmdDumpPageTableBoth;
+static FNDBGCCMD dbgcCmdDumpTSS;
+static FNDBGCCMD dbgcCmdEditMem;
+static FNDBGCCMD dbgcCmdGo;
+static FNDBGCCMD dbgcCmdListModules;
+static FNDBGCCMD dbgcCmdListNear;
+static FNDBGCCMD dbgcCmdListSource;
+static FNDBGCCMD dbgcCmdMemoryInfo;
+static FNDBGCCMD dbgcCmdReg;
+static FNDBGCCMD dbgcCmdRegGuest;
+static FNDBGCCMD dbgcCmdRegHyper;
+static FNDBGCCMD dbgcCmdRegTerse;
+static FNDBGCCMD dbgcCmdSearchMem;
+static FNDBGCCMD dbgcCmdSearchMemType;
+static FNDBGCCMD dbgcCmdStack;
+static FNDBGCCMD dbgcCmdTrace;
+static FNDBGCCMD dbgcCmdUnassemble;
 
 
@@ -374,24 +374,17 @@
 
 /**
- * The 'go' command.
- *
- * @returns VBox status.
- * @param   pCmd        Pointer to the command descriptor (as registered).
- * @param   pCmdHlp     Pointer to command helper functions.
- * @param   pVM         Pointer to the current VM (if any).
- * @param   paArgs      Pointer to (readonly) array of arguments.
- * @param   cArgs       Number of arguments in the array.
- */
-static DECLCALLBACK(int) dbgcCmdGo(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
-{
-    DBGC_CMDHLP_REQ_VM_RET(pCmdHlp, pCmd, pVM);
+ * @interface_method_impl{FNDBCCMD, The 'go' command.}
+ */
+static DECLCALLBACK(int) dbgcCmdGo(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
+{
+    DBGC_CMDHLP_REQ_UVM_RET(pCmdHlp, pCmd, pUVM);
 
     /*
      * Check if the VM is halted or not before trying to resume it.
      */
-    if (!DBGFR3IsHalted(pVM))
+    if (!DBGFR3IsHalted(pUVM))
         return DBGCCmdHlpFail(pCmdHlp, pCmd, "The VM is already running");
 
-    int rc = DBGFR3Resume(pVM);
+    int rc = DBGFR3Resume(pUVM);
     if (RT_FAILURE(rc))
         return DBGCCmdHlpFailRc(pCmdHlp, pCmd, rc, "DBGFR3Resume");
@@ -403,16 +396,9 @@
 
 /**
- * The 'ba' command.
- *
- * @returns VBox status.
- * @param   pCmd        Pointer to the command descriptor (as registered).
- * @param   pCmdHlp     Pointer to command helper functions.
- * @param   pVM         Pointer to the current VM (if any).
- * @param   paArgs      Pointer to (readonly) array of arguments.
- * @param   cArgs       Number of arguments in the array.
- */
-static DECLCALLBACK(int) dbgcCmdBrkAccess(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
-{
-    DBGC_CMDHLP_REQ_VM_RET(pCmdHlp, pCmd, pVM);
+ * @interface_method_impl{FNDBCCMD, The 'ba' command.}
+ */
+static DECLCALLBACK(int) dbgcCmdBrkAccess(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
+{
+    DBGC_CMDHLP_REQ_UVM_RET(pCmdHlp, pCmd, pUVM);
 
     /*
@@ -486,5 +472,5 @@
      */
     uint32_t iBp;
-    rc = DBGFR3BpSetReg(pVM, &Address, iHitTrigger, iHitDisable, fType, cb, &iBp);
+    rc = DBGFR3BpSetReg(pUVM, &Address, iHitTrigger, iHitDisable, fType, cb, &iBp);
     if (RT_SUCCESS(rc))
     {
@@ -499,5 +485,5 @@
                 return DBGCCmdHlpPrintf(pCmdHlp, "Updated access breakpoint %u at %RGv\n", iBp, Address.FlatPtr);
         }
-        int rc2 = DBGFR3BpClear(pDbgc->pVM, iBp);
+        int rc2 = DBGFR3BpClear(pDbgc->pUVM, iBp);
         AssertRC(rc2);
     }
@@ -507,16 +493,9 @@
 
 /**
- * The 'bc' command.
- *
- * @returns VBox status.
- * @param   pCmd        Pointer to the command descriptor (as registered).
- * @param   pCmdHlp     Pointer to command helper functions.
- * @param   pVM         Pointer to the current VM (if any).
- * @param   paArgs      Pointer to (readonly) array of arguments.
- * @param   cArgs       Number of arguments in the array.
- */
-static DECLCALLBACK(int) dbgcCmdBrkClear(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
-{
-    DBGC_CMDHLP_REQ_VM_RET(pCmdHlp, pCmd, pVM);
+ * @interface_method_impl{FNDBCCMD, The 'bc' command.}
+ */
+static DECLCALLBACK(int) dbgcCmdBrkClear(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
+{
+    DBGC_CMDHLP_REQ_UVM_RET(pCmdHlp, pCmd, pUVM);
 
     /*
@@ -533,5 +512,5 @@
             if (iBp == paArgs[iArg].u.u64Number)
             {
-                int rc2 = DBGFR3BpClear(pVM, iBp);
+                int rc2 = DBGFR3BpClear(pUVM, iBp);
                 if (RT_FAILURE(rc2))
                     rc = DBGCCmdHlpFailRc(pCmdHlp, pCmd, rc2, "DBGFR3BpClear(,%#x)", iBp);
@@ -551,5 +530,5 @@
                 pBp = pBp->pNext;
 
-                int rc2 = DBGFR3BpClear(pVM, iBp);
+                int rc2 = DBGFR3BpClear(pUVM, iBp);
                 if (RT_FAILURE(rc2))
                     rc = DBGCCmdHlpFailRc(pCmdHlp, pCmd, rc2, "DBGFR3BpClear(,%#x)", iBp);
@@ -566,14 +545,7 @@
 
 /**
- * The 'bd' command.
- *
- * @returns VBox status.
- * @param   pCmd        Pointer to the command descriptor (as registered).
- * @param   pCmdHlp     Pointer to command helper functions.
- * @param   pVM         Pointer to the current VM (if any).
- * @param   paArgs      Pointer to (readonly) array of arguments.
- * @param   cArgs       Number of arguments in the array.
- */
-static DECLCALLBACK(int) dbgcCmdBrkDisable(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
+ * @interface_method_impl{FNDBCCMD, The 'bd' command.}
+ */
+static DECLCALLBACK(int) dbgcCmdBrkDisable(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
 {
     /*
@@ -589,5 +561,5 @@
             if (iBp == paArgs[iArg].u.u64Number)
             {
-                rc = DBGFR3BpDisable(pVM, iBp);
+                rc = DBGFR3BpDisable(pUVM, iBp);
                 if (RT_FAILURE(rc))
                     rc = DBGCCmdHlpFailRc(pCmdHlp, pCmd, rc, "DBGFR3BpDisable failed for breakpoint %#x", iBp);
@@ -602,5 +574,5 @@
             for (PDBGCBP pBp = pDbgc->pFirstBp; pBp; pBp = pBp->pNext)
             {
-                int rc2 = DBGFR3BpDisable(pVM, pBp->iBp);
+                int rc2 = DBGFR3BpDisable(pUVM, pBp->iBp);
                 if (RT_FAILURE(rc2))
                     rc = DBGCCmdHlpFailRc(pCmdHlp, pCmd, rc2, "DBGFR3BpDisable failed for breakpoint %#x", pBp->iBp);
@@ -615,16 +587,9 @@
 
 /**
- * The 'be' command.
- *
- * @returns VBox status.
- * @param   pCmd        Pointer to the command descriptor (as registered).
- * @param   pCmdHlp     Pointer to command helper functions.
- * @param   pVM         Pointer to the current VM (if any).
- * @param   paArgs      Pointer to (readonly) array of arguments.
- * @param   cArgs       Number of arguments in the array.
- */
-static DECLCALLBACK(int) dbgcCmdBrkEnable(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
-{
-    DBGC_CMDHLP_REQ_VM_RET(pCmdHlp, pCmd, pVM);
+ * @interface_method_impl{FNDBCCMD, The 'be' command.}
+ */
+static DECLCALLBACK(int) dbgcCmdBrkEnable(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
+{
+    DBGC_CMDHLP_REQ_UVM_RET(pCmdHlp, pCmd, pUVM);
 
     /*
@@ -640,5 +605,5 @@
             if (iBp == paArgs[iArg].u.u64Number)
             {
-                rc = DBGFR3BpEnable(pVM, iBp);
+                rc = DBGFR3BpEnable(pUVM, iBp);
                 if (RT_FAILURE(rc))
                     rc = DBGCCmdHlpFailRc(pCmdHlp, pCmd, rc, "DBGFR3BpEnable failed for breakpoint %#x", iBp);
@@ -653,5 +618,5 @@
             for (PDBGCBP pBp = pDbgc->pFirstBp; pBp; pBp = pBp->pNext)
             {
-                int rc2 = DBGFR3BpEnable(pVM, pBp->iBp);
+                int rc2 = DBGFR3BpEnable(pUVM, pBp->iBp);
                 if (RT_FAILURE(rc2))
                     rc = DBGCCmdHlpFailRc(pCmdHlp, pCmd, rc2, "DBGFR3BpEnable failed for breakpoint %#x", pBp->iBp);
@@ -669,9 +634,9 @@
  *
  * @returns VBox status code. Any failure will stop the enumeration.
- * @param   pVM         The VM handle.
+ * @param   pUVM        The user mode VM handle.
  * @param   pvUser      The user argument.
  * @param   pBp         Pointer to the breakpoint information. (readonly)
  */
-static DECLCALLBACK(int) dbgcEnumBreakpointsCallback(PVM pVM, void *pvUser, PCDBGFBP pBp)
+static DECLCALLBACK(int) dbgcEnumBreakpointsCallback(PUVM pUVM, void *pvUser, PCDBGFBP pBp)
 {
     PDBGC   pDbgc   = (PDBGC)pvUser;
@@ -722,5 +687,5 @@
     RTINTPTR    off;
     DBGFADDRESS Addr;
-    int rc = DBGFR3AsSymbolByAddr(pVM, pDbgc->hDbgAs, DBGFR3AddrFromFlat(pVM, &Addr, pBp->GCPtr), &off, &Sym, NULL);
+    int rc = DBGFR3AsSymbolByAddr(pUVM, pDbgc->hDbgAs, DBGFR3AddrFromFlat(pDbgc->pUVM, &Addr, pBp->GCPtr), &off, &Sym, NULL);
     if (RT_SUCCESS(rc))
     {
@@ -751,17 +716,11 @@
 
 /**
- * The 'bl' command.
- *
- * @returns VBox status.
- * @param   pCmd        Pointer to the command descriptor (as registered).
- * @param   pCmdHlp     Pointer to command helper functions.
- * @param   pVM         Pointer to the current VM (if any).
- * @param   paArgs      Pointer to (readonly) array of arguments.
- * @param   cArgs       Number of arguments in the array.
- */
-static DECLCALLBACK(int) dbgcCmdBrkList(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR /*paArgs*/, unsigned cArgs)
-{
-    DBGC_CMDHLP_REQ_VM_RET(pCmdHlp, pCmd, pVM);
+ * @interface_method_impl{FNDBCCMD, The 'bl' command.}
+ */
+static DECLCALLBACK(int) dbgcCmdBrkList(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
+{
+    DBGC_CMDHLP_REQ_UVM_RET(pCmdHlp, pCmd, pUVM);
     DBGC_CMDHLP_ASSERT_PARSER_RET(pCmdHlp, pCmd, -1, cArgs == 0);
+    NOREF(paArgs);
 
     /*
@@ -769,5 +728,5 @@
      */
     PDBGC pDbgc = DBGC_CMDHLP2DBGC(pCmdHlp);
-    int rc = DBGFR3BpEnum(pVM, dbgcEnumBreakpointsCallback, pDbgc);
+    int rc = DBGFR3BpEnum(pUVM, dbgcEnumBreakpointsCallback, pDbgc);
     if (RT_FAILURE(rc))
         return DBGCCmdHlpFailRc(pCmdHlp, pCmd, rc, "DBGFR3BpEnum");
@@ -777,14 +736,7 @@
 
 /**
- * The 'bp' command.
- *
- * @returns VBox status.
- * @param   pCmd        Pointer to the command descriptor (as registered).
- * @param   pCmdHlp     Pointer to command helper functions.
- * @param   pVM         Pointer to the current VM (if any).
- * @param   paArgs      Pointer to (readonly) array of arguments.
- * @param   cArgs       Number of arguments in the array.
- */
-static DECLCALLBACK(int) dbgcCmdBrkSet(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
+ * @interface_method_impl{FNDBCCMD, The 'bp' command.}
+ */
+static DECLCALLBACK(int) dbgcCmdBrkSet(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
 {
     /*
@@ -823,5 +775,5 @@
      */
     uint32_t iBp;
-    rc = DBGFR3BpSet(pVM, &Address, iHitTrigger, iHitDisable, &iBp);
+    rc = DBGFR3BpSet(pUVM, &Address, iHitTrigger, iHitDisable, &iBp);
     if (RT_SUCCESS(rc))
     {
@@ -836,5 +788,5 @@
                 return DBGCCmdHlpPrintf(pCmdHlp, "Updated breakpoint %u at %RGv\n", iBp, Address.FlatPtr);
         }
-        int rc2 = DBGFR3BpClear(pDbgc->pVM, iBp);
+        int rc2 = DBGFR3BpClear(pDbgc->pUVM, iBp);
         AssertRC(rc2);
     }
@@ -844,14 +796,7 @@
 
 /**
- * The 'br' command.
- *
- * @returns VBox status.
- * @param   pCmd        Pointer to the command descriptor (as registered).
- * @param   pCmdHlp     Pointer to command helper functions.
- * @param   pVM         Pointer to the current VM (if any).
- * @param   paArgs      Pointer to (readonly) array of arguments.
- * @param   cArgs       Number of arguments in the array.
- */
-static DECLCALLBACK(int) dbgcCmdBrkREM(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
+ * @interface_method_impl{FNDBCCMD, The 'br' command.}
+ */
+static DECLCALLBACK(int) dbgcCmdBrkREM(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
 {
     /*
@@ -890,5 +835,5 @@
      */
     uint32_t iBp;
-    rc = DBGFR3BpSetREM(pVM, &Address, iHitTrigger, iHitDisable, &iBp);
+    rc = DBGFR3BpSetREM(pUVM, &Address, iHitTrigger, iHitDisable, &iBp);
     if (RT_SUCCESS(rc))
     {
@@ -903,5 +848,5 @@
                 return DBGCCmdHlpPrintf(pCmdHlp, "Updated REM breakpoint %u at %RGv\n", iBp, Address.FlatPtr);
         }
-        int rc2 = DBGFR3BpClear(pDbgc->pVM, iBp);
+        int rc2 = DBGFR3BpClear(pDbgc->pUVM, iBp);
         AssertRC(rc2);
     }
@@ -911,14 +856,7 @@
 
 /**
- * The 'u' command.
- *
- * @returns VBox status.
- * @param   pCmd        Pointer to the command descriptor (as registered).
- * @param   pCmdHlp     Pointer to command helper functions.
- * @param   pVM         Pointer to the current VM (if any).
- * @param   paArgs      Pointer to (readonly) array of arguments.
- * @param   cArgs       Number of arguments in the array.
- */
-static DECLCALLBACK(int) dbgcCmdUnassemble(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
+ * @interface_method_impl{FNDBCCMD, The 'u' command.}
+ */
+static DECLCALLBACK(int) dbgcCmdUnassemble(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
 {
     PDBGC pDbgc = DBGC_CMDHLP2DBGC(pCmdHlp);
@@ -927,5 +865,5 @@
      * Validate input.
      */
-    DBGC_CMDHLP_REQ_VM_RET(pCmdHlp, pCmd, pVM);
+    DBGC_CMDHLP_REQ_UVM_RET(pCmdHlp, pCmd, pUVM);
     DBGC_CMDHLP_ASSERT_PARSER_RET(pCmdHlp, pCmd, -1, cArgs <= 1);
     DBGC_CMDHLP_ASSERT_PARSER_RET(pCmdHlp, pCmd, 0, cArgs == 0 || DBGCVAR_ISPOINTER(paArgs[0].enmType));
@@ -956,5 +894,5 @@
         {
             /** @todo Batch query CS, RIP & CPU mode. */
-            PVMCPU pVCpu = VMMGetCpuById(pVM, pDbgc->idCpu);
+            PVMCPU pVCpu = VMMR3GetCpuByIdU(pUVM, pDbgc->idCpu);
             if (    pDbgc->fRegCtxGuest
                 &&  CPUMIsGuestIn64BitCode(pVCpu))
@@ -1053,8 +991,8 @@
         uint32_t    cbInstr = 1;
         if (pDbgc->DisasmPos.enmType == DBGCVAR_TYPE_GC_FLAT)
-            rc = DBGFR3DisasInstrEx(pVM, pDbgc->idCpu, DBGF_SEL_FLAT, pDbgc->DisasmPos.u.GCFlat, fFlags,
+            rc = DBGFR3DisasInstrEx(pUVM, pDbgc->idCpu, DBGF_SEL_FLAT, pDbgc->DisasmPos.u.GCFlat, fFlags,
                                     &szDis[0], sizeof(szDis), &cbInstr);
         else
-            rc = DBGFR3DisasInstrEx(pVM, pDbgc->idCpu, pDbgc->DisasmPos.u.GCFar.sel, pDbgc->DisasmPos.u.GCFar.off, fFlags,
+            rc = DBGFR3DisasInstrEx(pUVM, pDbgc->idCpu, pDbgc->DisasmPos.u.GCFar.sel, pDbgc->DisasmPos.u.GCFar.off, fFlags,
                                     &szDis[0], sizeof(szDis), &cbInstr);
         if (RT_SUCCESS(rc))
@@ -1097,14 +1035,7 @@
 
 /**
- * The 'ls' command.
- *
- * @returns VBox status.
- * @param   pCmd        Pointer to the command descriptor (as registered).
- * @param   pCmdHlp     Pointer to command helper functions.
- * @param   pVM         Pointer to the current VM (if any).
- * @param   paArgs      Pointer to (readonly) array of arguments.
- * @param   cArgs       Number of arguments in the array.
- */
-static DECLCALLBACK(int) dbgcCmdListSource(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
+ * @interface_method_impl{FNDBCCMD, The 'ls' command.}
+ */
+static DECLCALLBACK(int) dbgcCmdListSource(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
 {
     PDBGC  pDbgc = DBGC_CMDHLP2DBGC(pCmdHlp);
@@ -1113,11 +1044,11 @@
      * Validate input.
      */
-    if (    cArgs > 1
-        ||  (cArgs == 1 && !DBGCVAR_ISPOINTER(paArgs[0].enmType)))
-        return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "internal error: The parser doesn't do its job properly yet.. It might help to use the '%%' operator.\n");
-    if (!pVM && !cArgs && !DBGCVAR_ISPOINTER(pDbgc->SourcePos.enmType))
-        return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "error: Don't know where to start disassembling...\n");
-    if (!pVM && cArgs && DBGCVAR_ISGCPOINTER(paArgs[0].enmType))
-        return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "error: GC address but no VM.\n");
+    DBGC_CMDHLP_ASSERT_PARSER_RET(pCmdHlp, pCmd, 0, cArgs <= 1);
+    if (cArgs == 1)
+        DBGC_CMDHLP_ASSERT_PARSER_RET(pCmdHlp, pCmd, 0, DBGCVAR_ISPOINTER(paArgs[0].enmType));
+    if (!pUVM && !cArgs && !DBGCVAR_ISPOINTER(pDbgc->SourcePos.enmType))
+        return DBGCCmdHlpFail(pCmdHlp, pCmd, "Don't know where to start listing...");
+    if (!pUVM && cArgs && DBGCVAR_ISGCPOINTER(paArgs[0].enmType))
+        return DBGCCmdHlpFail(pCmdHlp, pCmd, "GC address but no VM");
 
     /*
@@ -1128,5 +1059,5 @@
         if (!DBGCVAR_ISPOINTER(pDbgc->SourcePos.enmType))
         {
-            PVMCPU pVCpu = VMMGetCpuById(pVM, pDbgc->idCpu);
+            PVMCPU pVCpu = VMMR3GetCpuByIdU(pUVM, pDbgc->idCpu);
             pDbgc->SourcePos.enmType     = DBGCVAR_TYPE_GC_FAR;
             pDbgc->SourcePos.u.GCFar.off = pDbgc->fRegCtxGuest ? CPUMGetGuestEIP(pVCpu) : CPUMGetHyperEIP(pVCpu);
@@ -1198,5 +1129,5 @@
         DBGFLINE    Line;
         RTGCINTPTR  off;
-        int rc = DBGFR3LineByAddr(pVM, pDbgc->SourcePos.u.GCFlat, &off, &Line);
+        int rc = DBGFR3LineByAddr(pUVM, pDbgc->SourcePos.u.GCFlat, &off, &Line);
         if (RT_FAILURE(rc))
             return VINF_SUCCESS;
@@ -1289,41 +1220,27 @@
 
 /**
- * The 'r' command.
- *
- * @returns VBox status.
- * @param   pCmd        Pointer to the command descriptor (as registered).
- * @param   pCmdHlp     Pointer to command helper functions.
- * @param   pVM         Pointer to the current VM (if any).
- * @param   paArgs      Pointer to (readonly) array of arguments.
- * @param   cArgs       Number of arguments in the array.
- */
-static DECLCALLBACK(int) dbgcCmdReg(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
+ * @interface_method_impl{FNDBCCMD, The 'r' command.}
+ */
+static DECLCALLBACK(int) dbgcCmdReg(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
 {
     PDBGC pDbgc = DBGC_CMDHLP2DBGC(pCmdHlp);
     if (!pDbgc->fRegCtxGuest)
-        return dbgcCmdRegHyper(pCmd, pCmdHlp, pVM, paArgs, cArgs);
-    return dbgcCmdRegGuest(pCmd, pCmdHlp, pVM, paArgs, cArgs);
-}
-
-
-/**
- * Common worker for the dbgcCmdReg*() commands.
- *
- * @returns VBox status.
- * @param   pCmd        Pointer to the command descriptor (as registered).
- * @param   pCmdHlp     Pointer to command helper functions.
- * @param   pVM         Pointer to the current VM (if any).
- * @param   paArgs      Pointer to (readonly) array of arguments.
- * @param   cArgs       Number of arguments in the array.
- * @param   pszPrefix   The symbol prefix.
- */
-static DECLCALLBACK(int) dbgcCmdRegCommon(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs,
+        return dbgcCmdRegHyper(pCmd, pCmdHlp, pUVM, paArgs, cArgs);
+    return dbgcCmdRegGuest(pCmd, pCmdHlp, pUVM, paArgs, cArgs);
+}
+
+
+/**
+ * @interface_method_impl{FNDBCCMD, Common worker for the dbgcCmdReg*()
+ *                       commands.}
+ */
+static DECLCALLBACK(int) dbgcCmdRegCommon(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs,
                                           const char *pszPrefix)
 {
     PDBGC pDbgc = DBGC_CMDHLP2DBGC(pCmdHlp);
-    Assert(cArgs == 1 || cArgs == 2); /* cArgs == 0 is handled by the caller */
-    if (   paArgs[0].enmType != DBGCVAR_TYPE_STRING
-        && paArgs[0].enmType != DBGCVAR_TYPE_SYMBOL)
-        return DBGCCmdHlpPrintf(pCmdHlp, "internal error: The parser doesn't do its job properly yet.. Try drop the '@' or/and quote the register name\n");
+    Assert(cArgs == 1 || cArgs == 2); /* cArgs == 0 is handled by the caller  */
+    DBGC_CMDHLP_ASSERT_PARSER_RET(pCmdHlp, pCmd, 0, cArgs == 1 || cArgs == 2);
+    DBGC_CMDHLP_ASSERT_PARSER_RET(pCmdHlp, pCmd, 0,    paArgs[0].enmType == DBGCVAR_TYPE_STRING
+                                                    || paArgs[0].enmType == DBGCVAR_TYPE_SYMBOL);
 
     /*
@@ -1348,5 +1265,5 @@
     DBGFREGVALTYPE  enmType;
     DBGFREGVAL      Value;
-    int rc = DBGFR3RegNmQuery(pVM, idCpu, pszReg, &Value, &enmType);
+    int rc = DBGFR3RegNmQuery(pUVM, idCpu, pszReg, &Value, &enmType);
     if (RT_FAILURE(rc))
     {
@@ -1374,7 +1291,6 @@
          * Modify the register.
          */
-        if (   paArgs[1].enmType == DBGCVAR_TYPE_STRING
-            || paArgs[1].enmType == DBGCVAR_TYPE_SYMBOL)
-            return DBGCCmdHlpPrintf(pCmdHlp, "internal error: The parser doesn't do its job properly on the 2nd argument yet...\n");
+        DBGC_CMDHLP_ASSERT_PARSER_RET(pCmdHlp, pCmd, 1,    paArgs[1].enmType == DBGCVAR_TYPE_STRING
+                                                        || paArgs[1].enmType == DBGCVAR_TYPE_SYMBOL);
         if (enmType != DBGFREGVALTYPE_DTR)
         {
@@ -1391,5 +1307,5 @@
         if (RT_SUCCESS(rc))
         {
-            rc = DBGFR3RegNmSet(pVM, idCpu, pszReg, &Value, enmType);
+            rc = DBGFR3RegNmSet(pUVM, idCpu, pszReg, &Value, enmType);
             if (RT_FAILURE(rc))
                 rc = DBGCCmdHlpVBoxError(pCmdHlp, rc, "DBGFR3RegNmSet failed settings '%s%s': %Rrc\n",
@@ -1409,14 +1325,7 @@
 
 /**
- * The 'rg', 'rg64' and 'rg32' commands.
- *
- * @returns VBox status.
- * @param   pCmd        Pointer to the command descriptor (as registered).
- * @param   pCmdHlp     Pointer to command helper functions.
- * @param   pVM         Pointer to the current VM (if any).
- * @param   paArgs      Pointer to (readonly) array of arguments.
- * @param   cArgs       Number of arguments in the array.
- */
-static DECLCALLBACK(int) dbgcCmdRegGuest(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
+ * @interface_method_impl{FNDBCCMD, The 'rg', 'rg64' and 'rg32' commands.}
+ */
+static DECLCALLBACK(int) dbgcCmdRegGuest(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
 {
     /*
@@ -1428,5 +1337,5 @@
         bool const  f64BitMode = !strcmp(pCmd->pszCmd, "rg64")
                               || (   !strcmp(pCmd->pszCmd, "rg32")
-                                  && CPUMIsGuestIn64BitCode(VMMGetCpuById(pVM, pDbgc->idCpu)));
+                                  && CPUMIsGuestIn64BitCode(VMMR3GetCpuByIdU(pUVM, pDbgc->idCpu)));
         char        szDisAndRegs[8192];
         int         rc;
@@ -1435,5 +1344,5 @@
         {
             if (f64BitMode)
-                rc = DBGFR3RegPrintf(pVM, pDbgc->idCpu, &szDisAndRegs[0], sizeof(szDisAndRegs),
+                rc = DBGFR3RegPrintf(pUVM, pDbgc->idCpu, &szDisAndRegs[0], sizeof(szDisAndRegs),
                                      "u %016VR{rip} L 0\n"
                                      "rax=%016VR{rax} rbx=%016VR{rbx} rcx=%016VR{rcx} rdx=%016VR{rdx}\n"
@@ -1444,5 +1353,5 @@
                                      "cs=%04VR{cs} ds=%04VR{ds} es=%04VR{es} fs=%04VR{fs} gs=%04VR{gs} ss=%04VR{ss}                     rflags=%08VR{rflags}\n");
             else
-                rc = DBGFR3RegPrintf(pVM, pDbgc->idCpu, szDisAndRegs, sizeof(szDisAndRegs),
+                rc = DBGFR3RegPrintf(pUVM, pDbgc->idCpu, szDisAndRegs, sizeof(szDisAndRegs),
                                      "u %04VR{cs}:%08VR{eip} L 0\n"
                                      "eax=%08VR{eax} ebx=%08VR{ebx} ecx=%08VR{ecx} edx=%08VR{edx} esi=%08VR{esi} edi=%08VR{edi}\n"
@@ -1453,5 +1362,5 @@
         {
             if (f64BitMode)
-                rc = DBGFR3RegPrintf(pVM, pDbgc->idCpu, &szDisAndRegs[0], sizeof(szDisAndRegs),
+                rc = DBGFR3RegPrintf(pUVM, pDbgc->idCpu, &szDisAndRegs[0], sizeof(szDisAndRegs),
                                      "u %016VR{rip} L 0\n"
                                      "rax=%016VR{rax} rbx=%016VR{rbx} rcx=%016VR{rcx} rdx=%016VR{rdx}\n"
@@ -1481,5 +1390,5 @@
                                      );
             else
-                rc = DBGFR3RegPrintf(pVM, pDbgc->idCpu, szDisAndRegs, sizeof(szDisAndRegs),
+                rc = DBGFR3RegPrintf(pUVM, pDbgc->idCpu, szDisAndRegs, sizeof(szDisAndRegs),
                                      "u %04VR{cs}:%08VR{eip} L 0\n"
                                      "eax=%08VR{eax} ebx=%08VR{ebx} ecx=%08VR{ecx} edx=%08VR{edx} esi=%08VR{esi} edi=%08VR{edi}\n"
@@ -1509,19 +1418,12 @@
         return pCmdHlp->pfnExec(pCmdHlp, "%s", szDisAndRegs);
     }
-    return dbgcCmdRegCommon(pCmd, pCmdHlp, pVM, paArgs, cArgs, "");
-}
-
-
-/**
- * The 'rh' command.
- *
- * @returns VBox status.
- * @param   pCmd        Pointer to the command descriptor (as registered).
- * @param   pCmdHlp     Pointer to command helper functions.
- * @param   pVM         Pointer to the current VM (if any).
- * @param   paArgs      Pointer to (readonly) array of arguments.
- * @param   cArgs       Number of arguments in the array.
- */
-static DECLCALLBACK(int) dbgcCmdRegHyper(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
+    return dbgcCmdRegCommon(pCmd, pCmdHlp, pUVM, paArgs, cArgs, "");
+}
+
+
+/**
+ * @interface_method_impl{FNDBCCMD, The 'rh' command.}
+ */
+static DECLCALLBACK(int) dbgcCmdRegHyper(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
 {
     /*
@@ -1535,5 +1437,5 @@
 
         if (pDbgc->fRegTerse)
-            rc = DBGFR3RegPrintf(pVM, pDbgc->idCpu | DBGFREG_HYPER_VMCPUID, szDisAndRegs, sizeof(szDisAndRegs),
+            rc = DBGFR3RegPrintf(pUVM, pDbgc->idCpu | DBGFREG_HYPER_VMCPUID, szDisAndRegs, sizeof(szDisAndRegs),
                                  "u %VR{cs}:%VR{eip} L 0\n"
                                  ".eax=%08VR{eax} .ebx=%08VR{ebx} .ecx=%08VR{ecx} .edx=%08VR{edx} .esi=%08VR{esi} .edi=%08VR{edi}\n"
@@ -1541,5 +1443,5 @@
                                  ".cs=%04VR{cs} .ds=%04VR{ds} .es=%04VR{es} .fs=%04VR{fs} .gs=%04VR{gs} .ss=%04VR{ss}              .eflags=%08VR{eflags}\n");
         else
-            rc = DBGFR3RegPrintf(pVM, pDbgc->idCpu | DBGFREG_HYPER_VMCPUID, szDisAndRegs, sizeof(szDisAndRegs),
+            rc = DBGFR3RegPrintf(pUVM, pDbgc->idCpu | DBGFREG_HYPER_VMCPUID, szDisAndRegs, sizeof(szDisAndRegs),
                                  "u %04VR{cs}:%08VR{eip} L 0\n"
                                  ".eax=%08VR{eax} .ebx=%08VR{ebx} .ecx=%08VR{ecx} .edx=%08VR{edx} .esi=%08VR{esi} .edi=%08VR{edi}\n"
@@ -1566,21 +1468,14 @@
         return pCmdHlp->pfnExec(pCmdHlp, "%s", szDisAndRegs);
     }
-    return dbgcCmdRegCommon(pCmd, pCmdHlp, pVM, paArgs, cArgs, ".");
-}
-
-
-/**
- * The 'rt' command.
- *
- * @returns VBox status.
- * @param   pCmd        Pointer to the command descriptor (as registered).
- * @param   pCmdHlp     Pointer to command helper functions.
- * @param   pVM         Pointer to the current VM (if any).
- * @param   paArgs      Pointer to (readonly) array of arguments.
- * @param   cArgs       Number of arguments in the array.
- */
-static DECLCALLBACK(int) dbgcCmdRegTerse(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
-{
-    NOREF(pCmd); NOREF(pVM); NOREF(paArgs); NOREF(cArgs);
+    return dbgcCmdRegCommon(pCmd, pCmdHlp, pUVM, paArgs, cArgs, ".");
+}
+
+
+/**
+ * @interface_method_impl{FNDBCCMD, The 'rt' command.}
+ */
+static DECLCALLBACK(int) dbgcCmdRegTerse(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
+{
+    NOREF(pCmd); NOREF(pUVM); NOREF(paArgs); NOREF(cArgs);
 
     PDBGC   pDbgc = DBGC_CMDHLP2DBGC(pCmdHlp);
@@ -1591,18 +1486,11 @@
 
 /**
- * The 't' command.
- *
- * @returns VBox status.
- * @param   pCmd        Pointer to the command descriptor (as registered).
- * @param   pCmdHlp     Pointer to command helper functions.
- * @param   pVM         Pointer to the current VM (if any).
- * @param   paArgs      Pointer to (readonly) array of arguments.
- * @param   cArgs       Number of arguments in the array.
- */
-static DECLCALLBACK(int) dbgcCmdTrace(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
+ * @interface_method_impl{FNDBCCMD, The 't' command.}
+ */
+static DECLCALLBACK(int) dbgcCmdTrace(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
 {
     PDBGC   pDbgc = DBGC_CMDHLP2DBGC(pCmdHlp);
 
-    int rc = DBGFR3Step(pVM, pDbgc->idCpu);
+    int rc = DBGFR3Step(pUVM, pDbgc->idCpu);
     if (RT_SUCCESS(rc))
         pDbgc->fReady = false;
@@ -1616,14 +1504,7 @@
 
 /**
- * The 'k', 'kg' and 'kh' commands.
- *
- * @returns VBox status.
- * @param   pCmd        Pointer to the command descriptor (as registered).
- * @param   pCmdHlp     Pointer to command helper functions.
- * @param   pVM         Pointer to the current VM (if any).
- * @param   paArgs      Pointer to (readonly) array of arguments.
- * @param   cArgs       Number of arguments in the array.
- */
-static DECLCALLBACK(int) dbgcCmdStack(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
+ * @interface_method_impl{FNDBCCMD, The 'k', 'kg' and 'kh' commands.}
+ */
+static DECLCALLBACK(int) dbgcCmdStack(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
 {
     PDBGC   pDbgc = DBGC_CMDHLP2DBGC(pCmdHlp);
@@ -1636,5 +1517,5 @@
     bool const          fGuest = pCmd->pszCmd[1] == 'g'
                               || (!pCmd->pszCmd[1] && pDbgc->fRegCtxGuest);
-    rc = DBGFR3StackWalkBegin(pVM, pDbgc->idCpu, fGuest ? DBGFCODETYPE_GUEST : DBGFCODETYPE_HYPER, &pFirstFrame);
+    rc = DBGFR3StackWalkBegin(pUVM, pDbgc->idCpu, fGuest ? DBGFCODETYPE_GUEST : DBGFCODETYPE_HYPER, &pFirstFrame);
     if (RT_FAILURE(rc))
         return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "Failed to begin stack walk, rc=%Rrc\n", rc);
@@ -2018,20 +1899,12 @@
 
 /**
- * The 'dg', 'dga', 'dl' and 'dla' commands.
- *
- * @returns VBox status.
- * @param   pCmd        Pointer to the command descriptor (as registered).
- * @param   pCmdHlp     Pointer to command helper functions.
- * @param   pVM         Pointer to the current VM (if any).
- * @param   paArgs      Pointer to (readonly) array of arguments.
- * @param   cArgs       Number of arguments in the array.
- */
-static DECLCALLBACK(int) dbgcCmdDumpDT(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
+ * @interface_method_impl{FNDBCCMD, The 'dg', 'dga', 'dl' and 'dla' commands.}
+ */
+static DECLCALLBACK(int) dbgcCmdDumpDT(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
 {
     /*
      * Validate input.
      */
-    if (!pVM)
-        return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "error: No VM.\n");
+    DBGC_CMDHLP_REQ_UVM_RET(pCmdHlp, pCmd, pUVM);
 
     /*
@@ -2040,5 +1913,5 @@
      */
     PDBGC       pDbgc   = DBGC_CMDHLP2DBGC(pCmdHlp);
-    PVMCPU      pVCpu   = VMMGetCpuById(pVM, pDbgc->idCpu);
+    PVMCPU      pVCpu   = VMMR3GetCpuByIdU(pUVM, pDbgc->idCpu);
     CPUMMODE    enmMode = CPUMGetGuestMode(pVCpu);
     bool        fGdt    = pCmd->pszCmd[1] == 'g';
@@ -2067,8 +1940,5 @@
           * argument is given, that that into account.
           */
-        /* check that what we got makes sense as we don't trust the parser yet. */
-        if (    paArgs[i].enmType != DBGCVAR_TYPE_NUMBER
-            &&  !DBGCVAR_ISPOINTER(paArgs[i].enmType))
-            return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "error: arg #%u isn't of number or pointer type but %d.\n", i, paArgs[i].enmType);
+        DBGC_CMDHLP_ASSERT_PARSER_RET(pCmdHlp, pCmd, i, paArgs[i].enmType == DBGCVAR_TYPE_NUMBER || DBGCVAR_ISPOINTER(paArgs[i].enmType));
         uint64_t u64;
         unsigned cSels = 1;
@@ -2099,5 +1969,5 @@
             {
                 DBGFSELINFO SelInfo;
-                int rc = DBGFR3SelQueryInfo(pVM, pDbgc->idCpu, Sel | SelTable, DBGFSELQI_FLAGS_DT_GUEST, &SelInfo);
+                int rc = DBGFR3SelQueryInfo(pUVM, pDbgc->idCpu, Sel | SelTable, DBGFSELQI_FLAGS_DT_GUEST, &SelInfo);
                 if (RT_SUCCESS(rc))
                 {
@@ -2142,20 +2012,12 @@
 
 /**
- * The 'di' and 'dia' commands.
- *
- * @returns VBox status.
- * @param   pCmd        Pointer to the command descriptor (as registered).
- * @param   pCmdHlp     Pointer to command helper functions.
- * @param   pVM         Pointer to the current VM (if any).
- * @param   paArgs      Pointer to (readonly) array of arguments.
- * @param   cArgs       Number of arguments in the array.
- */
-static DECLCALLBACK(int) dbgcCmdDumpIDT(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
+ * @interface_method_impl{FNDBCCMD, The 'di' and 'dia' commands.}
+ */
+static DECLCALLBACK(int) dbgcCmdDumpIDT(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
 {
     /*
      * Validate input.
      */
-    if (!pVM)
-        return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "error: No VM.\n");
+    DBGC_CMDHLP_REQ_UVM_RET(pCmdHlp, pCmd, pUVM);
 
     /*
@@ -2164,5 +2026,5 @@
      */
     PDBGC       pDbgc = DBGC_CMDHLP2DBGC(pCmdHlp);
-    PVMCPU      pVCpu     = VMMGetCpuById(pVM, pDbgc->idCpu);
+    PVMCPU      pVCpu     = VMMR3GetCpuByIdU(pUVM, pDbgc->idCpu);
     uint16_t    cbLimit;
     RTGCUINTPTR GCPtrBase = CPUMGetGuestIDTR(pVCpu, &cbLimit);
@@ -2195,7 +2057,5 @@
     for (unsigned i = 0; i < cArgs; i++)
     {
-        /* check that what we got makes sense as we don't trust the parser yet. */
-        if (paArgs[i].enmType != DBGCVAR_TYPE_NUMBER)
-            return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "error: arg #%u isn't of number type but %d.\n", i, paArgs[i].enmType);
+        DBGC_CMDHLP_ASSERT_PARSER_RET(pCmdHlp, pCmd, i, paArgs[i].enmType == DBGCVAR_TYPE_NUMBER);
         if (paArgs[i].u.u64Number < 256)
         {
@@ -2227,5 +2087,5 @@
                 AddrVar.u.GCFlat = GCPtrBase + iInt * cbEntry;
                 AddrVar.enmRangeType = DBGCVAR_RANGE_NONE;
-                int rc = pCmdHlp->pfnMemRead(pCmdHlp, pVM, &u, cbEntry, &AddrVar, NULL);
+                int rc = pCmdHlp->pfnMemRead(pCmdHlp, &u, cbEntry, &AddrVar, NULL);
                 if (RT_FAILURE(rc))
                     return pCmdHlp->pfnVBoxError(pCmdHlp, rc, "Reading IDT entry %#04x.\n", (unsigned)iInt);
@@ -2266,14 +2126,8 @@
 
 /**
- * The 'da', 'dq', 'dd', 'dw' and 'db' commands.
- *
- * @returns VBox status.
- * @param   pCmd        Pointer to the command descriptor (as registered).
- * @param   pCmdHlp     Pointer to command helper functions.
- * @param   pVM         Pointer to the current VM (if any).
- * @param   paArgs      Pointer to (readonly) array of arguments.
- * @param   cArgs       Number of arguments in the array.
- */
-static DECLCALLBACK(int) dbgcCmdDumpMem(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
+ * @interface_method_impl{FNDBCCMD, The 'da', 'dq', 'dd', 'dw' and 'db'
+ *                       commands.}
+ */
+static DECLCALLBACK(int) dbgcCmdDumpMem(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
 {
     PDBGC   pDbgc = DBGC_CMDHLP2DBGC(pCmdHlp);
@@ -2282,9 +2136,8 @@
      * Validate input.
      */
-    if (    cArgs > 1
-        ||  (cArgs == 1 && !DBGCVAR_ISPOINTER(paArgs[0].enmType)))
-        return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "internal error: The parser doesn't do its job properly yet.. It might help to use the '%%' operator.\n");
-    if (!pVM)
-        return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "error: No VM.\n");
+    DBGC_CMDHLP_ASSERT_PARSER_RET(pCmdHlp, pCmd, 0, cArgs <= 1);
+    if (cArgs == 1)
+        DBGC_CMDHLP_ASSERT_PARSER_RET(pCmdHlp, pCmd, 0, DBGCVAR_ISPOINTER(paArgs[0].enmType));
+    DBGC_CMDHLP_REQ_UVM_RET(pCmdHlp, pCmd, pUVM);
 
     /*
@@ -2362,5 +2215,5 @@
         size_t  cbReq = RT_MIN((int)sizeof(achBuffer), cbLeft);
         size_t  cb = RT_MIN((int)sizeof(achBuffer), cbLeft);
-        int rc = pCmdHlp->pfnMemRead(pCmdHlp, pVM, &achBuffer, cbReq, &pDbgc->DumpPos, &cb);
+        int rc = pCmdHlp->pfnMemRead(pCmdHlp, &achBuffer, cbReq, &pDbgc->DumpPos, &cb);
         if (RT_FAILURE(rc))
         {
@@ -2472,5 +2325,5 @@
 static RTGCPHYS dbgcGetGuestPageMode(PDBGC pDbgc, bool *pfPAE, bool *pfLME, bool *pfPSE, bool *pfPGE, bool *pfNXE)
 {
-    PVMCPU      pVCpu = VMMGetCpuById(pDbgc->pVM, pDbgc->idCpu);
+    PVMCPU      pVCpu = VMMR3GetCpuByIdU(pDbgc->pUVM, pDbgc->idCpu);
     RTGCUINTREG cr4   = CPUMGetGuestCR4(pVCpu);
     *pfPSE = !!(cr4 & X86_CR4_PSE);
@@ -2503,5 +2356,5 @@
 static RTHCPHYS dbgcGetShadowPageMode(PDBGC pDbgc, bool *pfPAE, bool *pfLME, bool *pfPSE, bool *pfPGE, bool *pfNXE)
 {
-    PVMCPU pVCpu = VMMGetCpuById(pDbgc->pVM, pDbgc->idCpu);
+    PVMCPU pVCpu = VMMR3GetCpuByIdU(pDbgc->pUVM, pDbgc->idCpu);
 
     *pfPSE = true;
@@ -2534,14 +2387,8 @@
 
 /**
- * The 'dpd', 'dpda', 'dpdb', 'dpdg' and 'dpdh' commands.
- *
- * @returns VBox status.
- * @param   pCmd        Pointer to the command descriptor (as registered).
- * @param   pCmdHlp     Pointer to command helper functions.
- * @param   pVM         Pointer to the current VM (if any).
- * @param   paArgs      Pointer to (readonly) array of arguments.
- * @param   cArgs       Number of arguments in the array.
- */
-static DECLCALLBACK(int) dbgcCmdDumpPageDir(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
+ * @interface_method_impl{FNDBCCMD, The 'dpd', 'dpda', 'dpdb', 'dpdg' and 'dpdh'
+ *                       commands.}
+ */
+static DECLCALLBACK(int) dbgcCmdDumpPageDir(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
 {
     PDBGC   pDbgc = DBGC_CMDHLP2DBGC(pCmdHlp);
@@ -2550,11 +2397,11 @@
      * Validate input.
      */
-    if (    cArgs > 1
-        ||  (cArgs == 1 && pCmd->pszCmd[3] == 'a' && !DBGCVAR_ISPOINTER(paArgs[0].enmType))
-        ||  (cArgs == 1 && pCmd->pszCmd[3] != 'a' && !(paArgs[0].enmType == DBGCVAR_TYPE_NUMBER || DBGCVAR_ISPOINTER(paArgs[0].enmType)))
-        )
-        return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "internal error: The parser doesn't do its job properly yet.. It might help to use the '%%' operator.\n");
-    if (!pVM)
-        return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "error: No VM.\n");
+    DBGC_CMDHLP_ASSERT_PARSER_RET(pCmdHlp, pCmd, 0, cArgs <= 1);
+    if (cArgs == 1 && pCmd->pszCmd[3] == 'a')
+        DBGC_CMDHLP_ASSERT_PARSER_RET(pCmdHlp, pCmd, 0, DBGCVAR_ISPOINTER(paArgs[0].enmType));
+    if (cArgs == 1 && pCmd->pszCmd[3] != 'a')
+        DBGC_CMDHLP_ASSERT_PARSER_RET(pCmdHlp, pCmd, 0,    paArgs[0].enmType == DBGCVAR_TYPE_NUMBER
+                                                        || DBGCVAR_ISPOINTER(paArgs[0].enmType));
+    DBGC_CMDHLP_REQ_UVM_RET(pCmdHlp, pCmd, pUVM);
 
     /*
@@ -2676,5 +2523,5 @@
             VarCur.u.u64Number += (((uint64_t)VarGCPtr.u.GCFlat >> X86_PML4_SHIFT) & X86_PML4_MASK) * sizeof(X86PML4E);
             X86PML4E Pml4e;
-            rc = pCmdHlp->pfnMemRead(pCmdHlp, pVM, &Pml4e, sizeof(Pml4e), &VarCur, NULL);
+            rc = pCmdHlp->pfnMemRead(pCmdHlp, &Pml4e, sizeof(Pml4e), &VarCur, NULL);
             if (RT_FAILURE(rc))
                 return DBGCCmdHlpVBoxError(pCmdHlp, rc, "Reading PML4E memory at %DV.\n", &VarCur);
@@ -2690,5 +2537,5 @@
             X86PDPE Pdpe;
             VarCur.u.u64Number += ((VarGCPtr.u.GCFlat >> X86_PDPT_SHIFT) & X86_PDPT_MASK_PAE) * sizeof(Pdpe);
-            rc = pCmdHlp->pfnMemRead(pCmdHlp, pVM, &Pdpe, sizeof(Pdpe), &VarCur, NULL);
+            rc = pCmdHlp->pfnMemRead(pCmdHlp, &Pdpe, sizeof(Pdpe), &VarCur, NULL);
             if (RT_FAILURE(rc))
                 return DBGCCmdHlpVBoxError(pCmdHlp, rc, "Reading PDPE memory at %DV.\n", &VarCur);
@@ -2727,5 +2574,5 @@
         X86PDEPAE Pde;
         Pde.u = 0;
-        rc = pCmdHlp->pfnMemRead(pCmdHlp, pVM, &Pde, cbEntry, &VarPDEAddr, NULL);
+        rc = pCmdHlp->pfnMemRead(pCmdHlp, &Pde, cbEntry, &VarPDEAddr, NULL);
         if (RT_FAILURE(rc))
             return pCmdHlp->pfnVBoxError(pCmdHlp, rc, "Reading PDE memory at %DV.\n", &VarPDEAddr);
@@ -2794,17 +2641,9 @@
 
 /**
- * The 'dpdb' command.
- *
- * @returns VBox status.
- * @param   pCmd        Pointer to the command descriptor (as registered).
- * @param   pCmdHlp     Pointer to command helper functions.
- * @param   pVM         Pointer to the current VM (if any).
- * @param   paArgs      Pointer to (readonly) array of arguments.
- * @param   cArgs       Number of arguments in the array.
- */
-static DECLCALLBACK(int) dbgcCmdDumpPageDirBoth(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
-{
-    if (!pVM)
-        return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "error: No VM.\n");
+ * @interface_method_impl{FNDBCCMD, The 'dpdb' command.}
+ */
+static DECLCALLBACK(int) dbgcCmdDumpPageDirBoth(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
+{
+    DBGC_CMDHLP_REQ_UVM_RET(pCmdHlp, pCmd, pUVM);
     int rc1 = pCmdHlp->pfnExec(pCmdHlp, "dpdg %DV", &paArgs[0]);
     int rc2 = pCmdHlp->pfnExec(pCmdHlp, "dpdh %DV", &paArgs[0]);
@@ -2817,18 +2656,10 @@
 
 /**
- * The 'dph*' commands and main part of 'm'.
- *
- * @returns VBox status.
- * @param   pCmd        Pointer to the command descriptor (as registered).
- * @param   pCmdHlp     Pointer to command helper functions.
- * @param   pVM         Pointer to the current VM (if any).
- * @param   paArgs      Pointer to (readonly) array of arguments.
- * @param   cArgs       Number of arguments in the array.
- */
-static DECLCALLBACK(int) dbgcCmdDumpPageHierarchy(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
+ * @interface_method_impl{FNDBCCMD, The 'dph*' commands and main part of 'm'.}
+ */
+static DECLCALLBACK(int) dbgcCmdDumpPageHierarchy(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
 {
     PDBGC pDbgc = DBGC_CMDHLP2DBGC(pCmdHlp);
-    if (!pVM)
-        return DBGCCmdHlpFail(pCmdHlp, pCmd, "No VM.\n");
+    DBGC_CMDHLP_REQ_UVM_RET(pCmdHlp, pCmd, pUVM);
 
     /*
@@ -2931,5 +2762,5 @@
      * Call the worker.
      */
-    rc = DBGFR3PagingDumpEx(pVM, pDbgc->idCpu, fFlags, cr3, GCPtrFirst, GCPtrLast, 99 /*cMaxDepth*/,
+    rc = DBGFR3PagingDumpEx(pUVM, pDbgc->idCpu, fFlags, cr3, GCPtrFirst, GCPtrLast, 99 /*cMaxDepth*/,
                             DBGCCmdHlpGetDbgfOutputHlp(pCmdHlp));
     if (RT_FAILURE(rc))
@@ -2941,14 +2772,7 @@
 
 /**
- * The 'dpg*' commands.
- *
- * @returns VBox status.
- * @param   pCmd        Pointer to the command descriptor (as registered).
- * @param   pCmdHlp     Pointer to command helper functions.
- * @param   pVM         Pointer to the current VM (if any).
- * @param   paArgs      Pointer to (readonly) array of arguments.
- * @param   cArgs       Number of arguments in the array.
- */
-static DECLCALLBACK(int) dbgcCmdDumpPageTable(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
+ * @interface_method_impl{FNDBCCMD, The 'dpg*' commands.}
+ */
+static DECLCALLBACK(int) dbgcCmdDumpPageTable(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
 {
     PDBGC   pDbgc = DBGC_CMDHLP2DBGC(pCmdHlp);
@@ -2957,11 +2781,11 @@
      * Validate input.
      */
-    if (    cArgs != 1
-        ||  (pCmd->pszCmd[3] == 'a' && !DBGCVAR_ISPOINTER(paArgs[0].enmType))
-        ||  (pCmd->pszCmd[3] != 'a' && !(paArgs[0].enmType == DBGCVAR_TYPE_NUMBER || DBGCVAR_ISPOINTER(paArgs[0].enmType)))
-        )
-        return DBGCCmdHlpPrintf(pCmdHlp, "internal error: The parser doesn't do its job properly yet.. It might help to use the '%%' operator.\n");
-    if (!pVM)
-        return DBGCCmdHlpPrintf(pCmdHlp, "error: No VM.\n");
+    DBGC_CMDHLP_ASSERT_PARSER_RET(pCmdHlp, pCmd, 0, cArgs == 1);
+    if (pCmd->pszCmd[3] == 'a')
+        DBGC_CMDHLP_ASSERT_PARSER_RET(pCmdHlp, pCmd, 0, DBGCVAR_ISPOINTER(paArgs[0].enmType));
+    else
+        DBGC_CMDHLP_ASSERT_PARSER_RET(pCmdHlp, pCmd, 0,    paArgs[0].enmType == DBGCVAR_TYPE_NUMBER
+                                                        || DBGCVAR_ISPOINTER(paArgs[0].enmType));
+    DBGC_CMDHLP_REQ_UVM_RET(pCmdHlp, pCmd, pUVM);
 
     /*
@@ -3045,5 +2869,5 @@
             VarCur.u.u64Number += (((uint64_t)VarGCPtr.u.GCFlat >> X86_PML4_SHIFT) & X86_PML4_MASK) * sizeof(X86PML4E);
             X86PML4E Pml4e;
-            rc = pCmdHlp->pfnMemRead(pCmdHlp, pVM, &Pml4e, sizeof(Pml4e), &VarCur, NULL);
+            rc = pCmdHlp->pfnMemRead(pCmdHlp, &Pml4e, sizeof(Pml4e), &VarCur, NULL);
             if (RT_FAILURE(rc))
                 return DBGCCmdHlpVBoxError(pCmdHlp, rc, "Reading PML4E memory at %DV.\n", &VarCur);
@@ -3059,5 +2883,5 @@
             X86PDPE Pdpe;
             VarCur.u.u64Number += ((VarGCPtr.u.GCFlat >> X86_PDPT_SHIFT) & X86_PDPT_MASK_PAE) * sizeof(Pdpe);
-            rc = pCmdHlp->pfnMemRead(pCmdHlp, pVM, &Pdpe, sizeof(Pdpe), &VarCur, NULL);
+            rc = pCmdHlp->pfnMemRead(pCmdHlp, &Pdpe, sizeof(Pdpe), &VarCur, NULL);
             if (RT_FAILURE(rc))
                 return DBGCCmdHlpVBoxError(pCmdHlp, rc, "Reading PDPE memory at %DV.\n", &VarCur);
@@ -3070,5 +2894,5 @@
             X86PDEPAE Pde;
             VarCur.u.u64Number += ((VarGCPtr.u.GCFlat >> X86_PD_PAE_SHIFT) & X86_PD_PAE_MASK) * sizeof(Pde);
-            rc = pCmdHlp->pfnMemRead(pCmdHlp, pVM, &Pde, sizeof(Pde), &VarCur, NULL);
+            rc = pCmdHlp->pfnMemRead(pCmdHlp, &Pde, sizeof(Pde), &VarCur, NULL);
             if (RT_FAILURE(rc))
                 return DBGCCmdHlpVBoxError(pCmdHlp, rc, "Reading PDE memory at %DV.\n", &VarCur);
@@ -3088,5 +2912,5 @@
             X86PDE Pde;
             VarCur.u.u64Number += ((VarGCPtr.u.GCFlat >> X86_PD_SHIFT) & X86_PD_MASK) * sizeof(Pde);
-            rc = pCmdHlp->pfnMemRead(pCmdHlp, pVM, &Pde, sizeof(Pde), &VarCur, NULL);
+            rc = pCmdHlp->pfnMemRead(pCmdHlp, &Pde, sizeof(Pde), &VarCur, NULL);
             if (RT_FAILURE(rc))
                 return DBGCCmdHlpVBoxError(pCmdHlp, rc, "Reading PDE memory at %DV.\n", &VarCur);
@@ -3120,5 +2944,5 @@
         X86PTEPAE Pte;
         Pte.u = 0;
-        rc = pCmdHlp->pfnMemRead(pCmdHlp, pVM, &Pte, cbEntry, &VarPTEAddr, NULL);
+        rc = pCmdHlp->pfnMemRead(pCmdHlp, &Pte, cbEntry, &VarPTEAddr, NULL);
         if (RT_FAILURE(rc))
             return DBGCCmdHlpVBoxError(pCmdHlp, rc, "Reading PTE memory at %DV.\n", &VarPTEAddr);
@@ -3169,17 +2993,9 @@
 
 /**
- * The 'dptb' command.
- *
- * @returns VBox status.
- * @param   pCmd        Pointer to the command descriptor (as registered).
- * @param   pCmdHlp     Pointer to command helper functions.
- * @param   pVM         Pointer to the current VM (if any).
- * @param   paArgs      Pointer to (readonly) array of arguments.
- * @param   cArgs       Number of arguments in the array.
- */
-static DECLCALLBACK(int) dbgcCmdDumpPageTableBoth(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
-{
-    if (!pVM)
-        return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "error: No VM.\n");
+ * @interface_method_impl{FNDBCCMD, The 'dptb' command.}
+ */
+static DECLCALLBACK(int) dbgcCmdDumpPageTableBoth(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
+{
+    DBGC_CMDHLP_REQ_UVM_RET(pCmdHlp, pCmd, pUVM);
     int rc1 = pCmdHlp->pfnExec(pCmdHlp, "dptg %DV", &paArgs[0]);
     int rc2 = pCmdHlp->pfnExec(pCmdHlp, "dpth %DV", &paArgs[0]);
@@ -3192,24 +3008,16 @@
 
 /**
- * The 'dt' command.
- *
- * @returns VBox status.
- * @param   pCmd        Pointer to the command descriptor (as registered).
- * @param   pCmdHlp     Pointer to command helper functions.
- * @param   pVM         Pointer to the current VM (if any).
- * @param   paArgs      Pointer to (readonly) array of arguments.
- * @param   cArgs       Number of arguments in the array.
- */
-static DECLCALLBACK(int) dbgcCmdDumpTSS(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
+ * @interface_method_impl{FNDBCCMD, The 'dt' command.}
+ */
+static DECLCALLBACK(int) dbgcCmdDumpTSS(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
 {
     PDBGC pDbgc = DBGC_CMDHLP2DBGC(pCmdHlp);
     int   rc;
 
-    if (!pVM)
-        return DBGCCmdHlpFail(pCmdHlp, pCmd, "No VM.\n");
-    if (    cArgs > 1
-        ||  (cArgs == 1 && paArgs[0].enmType == DBGCVAR_TYPE_STRING)
-        ||  (cArgs == 1 && paArgs[0].enmType == DBGCVAR_TYPE_SYMBOL))
-        return DBGCCmdHlpFail(pCmdHlp, pCmd, "internal error: The parser doesn't do its job properly yet...\n");
+    DBGC_CMDHLP_REQ_UVM_RET(pCmdHlp, pCmd, pUVM);
+    DBGC_CMDHLP_ASSERT_PARSER_RET(pCmdHlp, pCmd, 0, cArgs <= 1);
+    if (cArgs == 1)
+        DBGC_CMDHLP_ASSERT_PARSER_RET(pCmdHlp, pCmd, 0,    paArgs[0].enmType != DBGCVAR_TYPE_STRING
+                                                        && paArgs[0].enmType != DBGCVAR_TYPE_SYMBOL);
 
     /*
@@ -3233,5 +3041,5 @@
         /** @todo consider querying the hidden bits instead (missing API). */
         uint16_t SelTR;
-        rc = DBGFR3RegCpuQueryU16(pVM, pDbgc->idCpu, DBGFREG_TR, &SelTR);
+        rc = DBGFR3RegCpuQueryU16(pUVM, pDbgc->idCpu, DBGFREG_TR, &SelTR);
         if (RT_FAILURE(rc))
             return DBGCCmdHlpFail(pCmdHlp, pCmd, "Failed to query TR, rc=%Rrc\n", rc);
@@ -3265,5 +3073,5 @@
         SelTss = VarTssAddr.u.GCFar.sel;
         DBGFSELINFO SelInfo;
-        rc = DBGFR3SelQueryInfo(pVM, pDbgc->idCpu, VarTssAddr.u.GCFar.sel, DBGFSELQI_FLAGS_DT_GUEST, &SelInfo);
+        rc = DBGFR3SelQueryInfo(pUVM, pDbgc->idCpu, VarTssAddr.u.GCFar.sel, DBGFSELQI_FLAGS_DT_GUEST, &SelInfo);
         if (RT_FAILURE(rc))
             return DBGCCmdHlpFail(pCmdHlp, pCmd, "DBGFR3SelQueryInfo(,%u,%d,,) -> %Rrc.\n",
@@ -3307,5 +3115,5 @@
         {
             uint64_t uEfer;
-            rc = DBGFR3RegCpuQueryU64(pVM, pDbgc->idCpu, DBGFREG_MSR_K6_EFER, &uEfer);
+            rc = DBGFR3RegCpuQueryU64(pUVM, pDbgc->idCpu, DBGFREG_MSR_K6_EFER, &uEfer);
             if (   RT_FAILURE(rc)
                 || !(uEfer &  MSR_K6_EFER_LMA) )
@@ -3353,5 +3161,5 @@
     uint8_t  abBuf[_64K];
     size_t   cbTssRead;
-    rc = DBGCCmdHlpMemRead(pCmdHlp, pVM, abBuf, cbTss, &VarTssAddr, &cbTssRead);
+    rc = DBGCCmdHlpMemRead(pCmdHlp, abBuf, cbTss, &VarTssAddr, &cbTssRead);
     if (RT_FAILURE(rc))
         return DBGCCmdHlpFail(pCmdHlp, pCmd, "Failed to read TSS at %Dv: %Rrc\n", &VarTssAddr, rc);
@@ -3526,19 +3334,11 @@
 
 /**
- * The 'm' command.
- *
- * @returns VBox status.
- * @param   pCmd        Pointer to the command descriptor (as registered).
- * @param   pCmdHlp     Pointer to command helper functions.
- * @param   pVM         Pointer to the current VM (if any).
- * @param   paArgs      Pointer to (readonly) array of arguments.
- * @param   cArgs       Number of arguments in the array.
- */
-static DECLCALLBACK(int) dbgcCmdMemoryInfo(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
+ * @interface_method_impl{FNDBCCMD, The 'm' command.}
+ */
+static DECLCALLBACK(int) dbgcCmdMemoryInfo(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
 {
     DBGCCmdHlpPrintf(pCmdHlp, "Address: %DV\n", &paArgs[0]);
-    if (!pVM)
-        return DBGCCmdHlpFail(pCmdHlp, pCmd, "No VM.\n");
-    return dbgcCmdDumpPageHierarchy(pCmd, pCmdHlp, pVM, paArgs, cArgs);
+    DBGC_CMDHLP_REQ_UVM_RET(pCmdHlp, pCmd, pUVM);
+    return dbgcCmdDumpPageHierarchy(pCmd, pCmdHlp, pUVM, paArgs, cArgs);
 }
 
@@ -3682,14 +3482,7 @@
 
 /**
- * The 'eb', 'ew', 'ed' and 'eq' commands.
- *
- * @returns VBox status.
- * @param   pCmd        Pointer to the command descriptor (as registered).
- * @param   pCmdHlp     Pointer to command helper functions.
- * @param   pVM         Pointer to the current VM (if any).
- * @param   paArgs      Pointer to (readonly) array of arguments.
- * @param   cArgs       Number of arguments in the array.
- */
-static DECLCALLBACK(int) dbgcCmdEditMem(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
+ * @interface_method_impl{FNDBCCMD, The 'eb', 'ew', 'ed' and 'eq' commands.}
+ */
+static DECLCALLBACK(int) dbgcCmdEditMem(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
 {
     PDBGC pDbgc = DBGC_CMDHLP2DBGC(pCmdHlp);
@@ -3699,12 +3492,9 @@
      * Validate input.
      */
-    if (     cArgs < 2
-        ||  !DBGCVAR_ISPOINTER(paArgs[0].enmType))
-        return DBGCCmdHlpFail(pCmdHlp, pCmd, "internal error: The parser doesn't do its job properly yet... It might help to use the '%%' operator.\n");
+    DBGC_CMDHLP_ASSERT_PARSER_RET(pCmdHlp, pCmd, 0, cArgs >= 2);
+    DBGC_CMDHLP_ASSERT_PARSER_RET(pCmdHlp, pCmd, 0, DBGCVAR_ISPOINTER(paArgs[0].enmType));
     for (iArg = 1; iArg < cArgs; iArg++)
-        if (paArgs[iArg].enmType != DBGCVAR_TYPE_NUMBER)
-            return DBGCCmdHlpFail(pCmdHlp, pCmd, "internal error: The parser doesn't do its job properly yet: Arg #%u is not a number.\n", iArg);
-    if (!pVM)
-        return DBGCCmdHlpFail(pCmdHlp, pCmd, "error: No VM.\n");
+        DBGC_CMDHLP_ASSERT_PARSER_RET(pCmdHlp, pCmd, 0, paArgs[iArg].enmType == DBGCVAR_TYPE_NUMBER);
+    DBGC_CMDHLP_REQ_UVM_RET(pCmdHlp, pCmd, pUVM);
 
     /*
@@ -3728,5 +3518,5 @@
     {
         size_t cbWritten;
-        int rc = pCmdHlp->pfnMemWrite(pCmdHlp, pVM, &paArgs[iArg].u, cbElement, &Addr, &cbWritten);
+        int rc = pCmdHlp->pfnMemWrite(pCmdHlp, &paArgs[iArg].u, cbElement, &Addr, &cbWritten);
         if (RT_FAILURE(rc))
             return pCmdHlp->pfnVBoxError(pCmdHlp, rc, "Writing memory at %DV.\n", &Addr);
@@ -3752,5 +3542,5 @@
  * @returns VBox status code.
  * @param   pCmdHlp     The command helpers.
- * @param   pVM         The VM handle.
+ * @param   pUVM        The user mode VM handle.
  * @param   pAddress    The address to start searching from. (undefined on output)
  * @param   cbRange     The address range to search. Must not wrap.
@@ -3761,5 +3551,5 @@
  * @param   pResult     Where to store the result if it's a function invocation.
  */
-static int dbgcCmdWorkerSearchMemDoIt(PDBGCCMDHLP pCmdHlp, PVM pVM, PDBGFADDRESS pAddress, RTGCUINTPTR cbRange,
+static int dbgcCmdWorkerSearchMemDoIt(PDBGCCMDHLP pCmdHlp, PUVM pUVM, PDBGFADDRESS pAddress, RTGCUINTPTR cbRange,
                                       const uint8_t *pabBytes, uint32_t cbBytes,
                                       uint32_t cbUnit, uint64_t cMaxHits, PDBGCVAR pResult)
@@ -3775,5 +3565,5 @@
         /* search */
         DBGFADDRESS HitAddress;
-        int rc = DBGFR3MemScan(pVM, pDbgc->idCpu, pAddress, cbRange, 1, pabBytes, cbBytes, &HitAddress);
+        int rc = DBGFR3MemScan(pUVM, pDbgc->idCpu, pAddress, cbRange, 1, pabBytes, cbBytes, &HitAddress);
         if (RT_FAILURE(rc))
         {
@@ -3839,8 +3629,8 @@
  * @returns VBox status code.
  * @param   pCmdHlp     Pointer to the command helper functions.
- * @param   pVM         Pointer to the current VM (if any).
+ * @param   pUVM        The user mode VM handle.
  * @param   pResult     Where to store the result of a function invocation.
  */
-static int dbgcCmdWorkerSearchMemResume(PDBGCCMDHLP pCmdHlp, PVM pVM, PDBGCVAR pResult)
+static int dbgcCmdWorkerSearchMemResume(PDBGCCMDHLP pCmdHlp, PUVM pUVM, PDBGCVAR pResult)
 {
     PDBGC pDbgc = DBGC_CMDHLP2DBGC(pCmdHlp);
@@ -3871,5 +3661,5 @@
         cbRange = ~(RTGCUINTPTR)0 - pDbgc->SearchAddr.FlatPtr + !!pDbgc->SearchAddr.FlatPtr;
 
-    return dbgcCmdWorkerSearchMemDoIt(pCmdHlp, pVM, &Address, cbRange, pDbgc->abSearch, pDbgc->cbSearch,
+    return dbgcCmdWorkerSearchMemDoIt(pCmdHlp, pUVM, &Address, cbRange, pDbgc->abSearch, pDbgc->cbSearch,
                                       pDbgc->cbSearchUnit, pDbgc->cMaxSearchHits, pResult);
 }
@@ -3881,5 +3671,5 @@
  * @returns VBox status.
  * @param   pCmdHlp     Pointer to the command helper functions.
- * @param   pVM         Pointer to the current VM (if any).
+ * @param   pUVM        The user mode VM handle.
  * @param   pAddress    Where to start searching. If no range, search till end of address space.
  * @param   cMaxHits    The maximum number of hits.
@@ -3889,5 +3679,5 @@
  * @param   pResult     Where to store the result of a function invocation.
  */
-static int dbgcCmdWorkerSearchMem(PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR pAddress, uint64_t cMaxHits, char chType,
+static int dbgcCmdWorkerSearchMem(PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR pAddress, uint64_t cMaxHits, char chType,
                                   PCDBGCVAR paPatArgs, unsigned cPatArgs, PDBGCVAR pResult)
 {
@@ -3950,19 +3740,12 @@
      * Ok, do it.
      */
-    return dbgcCmdWorkerSearchMemDoIt(pCmdHlp, pVM, &Address, cbRange, abBytes, cbBytes, cbUnit, cMaxHits, pResult);
-}
-
-
-/**
- * The 's' command.
- *
- * @returns VBox status.
- * @param   pCmd        Pointer to the command descriptor (as registered).
- * @param   pCmdHlp     Pointer to command helper functions.
- * @param   pVM         Pointer to the current VM (if any).
- * @param   paArgs      Pointer to (readonly) array of arguments.
- * @param   cArgs       Number of arguments in the array.
- */
-static DECLCALLBACK(int) dbgcCmdSearchMem(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
+    return dbgcCmdWorkerSearchMemDoIt(pCmdHlp, pUVM, &Address, cbRange, abBytes, cbBytes, cbUnit, cMaxHits, pResult);
+}
+
+
+/**
+ * @interface_method_impl{FNDBCCMD, The 's' command.}
+ */
+static DECLCALLBACK(int) dbgcCmdSearchMem(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
 {
     /* check that the parser did what it's supposed to do. */
@@ -3975,5 +3758,5 @@
      */
     if (cArgs == 0)
-        return dbgcCmdWorkerSearchMemResume(pCmdHlp, pVM, NULL);
+        return dbgcCmdWorkerSearchMemResume(pCmdHlp, pUVM, NULL);
 
     /*
@@ -3986,20 +3769,11 @@
 
 /**
- * The 's?' command.
- *
- * @returns VBox status.
- * @param   pCmd        Pointer to the command descriptor (as registered).
- * @param   pCmdHlp     Pointer to command helper functions.
- * @param   pVM         Pointer to the current VM (if any).
- * @param   paArgs      Pointer to (readonly) array of arguments.
- * @param   cArgs       Number of arguments in the array.
- */
-static DECLCALLBACK(int) dbgcCmdSearchMemType(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
+ * @interface_method_impl{FNDBCCMD, The 's?' command.}
+ */
+static DECLCALLBACK(int) dbgcCmdSearchMemType(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
 {
     /* check that the parser did what it's supposed to do. */
-    if (    cArgs < 2
-        ||  !DBGCVAR_ISGCPOINTER(paArgs[0].enmType))
-        return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "parser error\n");
-    return dbgcCmdWorkerSearchMem(pCmdHlp, pVM, &paArgs[0], 25, pCmd->pszCmd[1], paArgs + 1, cArgs - 1, NULL);
+    DBGC_CMDHLP_ASSERT_PARSER_RET(pCmdHlp, pCmd, 0, cArgs >= 2 && DBGCVAR_ISGCPOINTER(paArgs[0].enmType));
+    return dbgcCmdWorkerSearchMem(pCmdHlp, pUVM, &paArgs[0], 25, pCmd->pszCmd[1], paArgs + 1, cArgs - 1, NULL);
 }
 
@@ -4010,8 +3784,8 @@
  * @returns VBox status code.
  * @param   pCmdHlp     Pointer to command helper functions.
- * @param   pVM         Pointer to the current VM (if any).
+ * @param   pUVM        The user mode VM handle.
  * @param   pArg        Pointer to the address or symbol to lookup.
  */
-static int dbgcDoListNear(PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR pArg)
+static int dbgcDoListNear(PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR pArg)
 {
     PDBGC pDbgc = DBGC_CMDHLP2DBGC(pCmdHlp);
@@ -4024,5 +3798,5 @@
          * Lookup the symbol address.
          */
-        rc = DBGFR3AsSymbolByName(pVM, pDbgc->hDbgAs, pArg->u.pszString, &Symbol, NULL);
+        rc = DBGFR3AsSymbolByName(pUVM, pDbgc->hDbgAs, pArg->u.pszString, &Symbol, NULL);
         if (RT_FAILURE(rc))
             return pCmdHlp->pfnVBoxError(pCmdHlp, rc, "DBGFR3AsSymbolByName(,,%s,)\n", pArg->u.pszString);
@@ -4042,5 +3816,5 @@
         RTINTPTR    offDisp;
         DBGFADDRESS Addr;
-        rc = DBGFR3AsSymbolByAddr(pVM, pDbgc->hDbgAs, DBGFR3AddrFromFlat(pVM, &Addr, AddrVar.u.GCFlat), &offDisp, &Symbol, NULL);
+        rc = DBGFR3AsSymbolByAddr(pUVM, pDbgc->hDbgAs, DBGFR3AddrFromFlat(pDbgc->pUVM, &Addr, AddrVar.u.GCFlat), &offDisp, &Symbol, NULL);
         if (RT_FAILURE(rc))
             return pCmdHlp->pfnVBoxError(pCmdHlp, rc, "DBGFR3ASymbolByAddr(,,%RGv,,)\n", AddrVar.u.GCFlat);
@@ -4063,14 +3837,7 @@
 
 /**
- * The 'ln' (listnear) command.
- *
- * @returns VBox status.
- * @param   pCmd        Pointer to the command descriptor (as registered).
- * @param   pCmdHlp     Pointer to command helper functions.
- * @param   pVM         Pointer to the current VM (if any).
- * @param   paArgs      Pointer to (readonly) array of arguments.
- * @param   cArgs       Number of arguments in the array.
- */
-static DECLCALLBACK(int) dbgcCmdListNear(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
+ * @interface_method_impl{FNDBCCMD, The 'ln' (listnear) command.}
+ */
+static DECLCALLBACK(int) dbgcCmdListNear(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
 {
     if (!cArgs)
@@ -4083,5 +3850,5 @@
         if (RT_FAILURE(rc))
             return pCmdHlp->pfnVBoxError(pCmdHlp, rc, "%%(cs:eip)\n");
-        return dbgcDoListNear(pCmdHlp, pVM, &AddrVar);
+        return dbgcDoListNear(pCmdHlp, pUVM, &AddrVar);
     }
 
@@ -4092,5 +3859,5 @@
     for (unsigned iArg = 0; iArg < cArgs; iArg++)
     {
-        int rc = dbgcDoListNear(pCmdHlp, pVM, &paArgs[iArg]);
+        int rc = dbgcDoListNear(pCmdHlp, pUVM, &paArgs[iArg]);
         if (RT_FAILURE(rc))
             return rc;
@@ -4120,14 +3887,7 @@
 
 /**
- * The 'ln' (listnear) command.
- *
- * @returns VBox status.
- * @param   pCmd        Pointer to the command descriptor (as registered).
- * @param   pCmdHlp     Pointer to command helper functions.
- * @param   pVM         Pointer to the current VM (if any).
- * @param   paArgs      Pointer to (readonly) array of arguments.
- * @param   cArgs       Number of arguments in the array.
- */
-static DECLCALLBACK(int) dbgcCmdListModules(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
+ * @interface_method_impl{FNDBCCMD, The 'ln' (list near) command.}
+ */
+static DECLCALLBACK(int) dbgcCmdListModules(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
 {
     bool const  fMappings   = pCmd->pszCmd[2] == 'o';
@@ -4138,5 +3898,5 @@
      * those matching the input.
      */
-    RTDBGAS     hAs         = DBGFR3AsResolveAndRetain(pVM, pDbgc->hDbgAs);
+    RTDBGAS     hAs         = DBGFR3AsResolveAndRetain(pUVM, pDbgc->hDbgAs);
     uint32_t    cMods       = RTDbgAsModuleCount(hAs);
     for (uint32_t iMod = 0; iMod < cMods; iMod++)
@@ -4213,5 +3973,5 @@
  * @callback_method_impl{Reads a unsigned 8-bit value.}
  */
-static DECLCALLBACK(int) dbgcFuncReadU8(PCDBGCFUNC pFunc, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, uint32_t cArgs,
+static DECLCALLBACK(int) dbgcFuncReadU8(PCDBGCFUNC pFunc, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, uint32_t cArgs,
                                         PDBGCVAR pResult)
 {
@@ -4221,5 +3981,5 @@
 
     uint8_t b;
-    int rc = DBGCCmdHlpMemRead(pCmdHlp, pVM, &b, sizeof(b), &paArgs[0], NULL);
+    int rc = DBGCCmdHlpMemRead(pCmdHlp, &b, sizeof(b), &paArgs[0], NULL);
     if (RT_FAILURE(rc))
         return rc;
@@ -4234,5 +3994,5 @@
  * @callback_method_impl{Reads a unsigned 16-bit value.}
  */
-static DECLCALLBACK(int) dbgcFuncReadU16(PCDBGCFUNC pFunc, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, uint32_t cArgs,
+static DECLCALLBACK(int) dbgcFuncReadU16(PCDBGCFUNC pFunc, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, uint32_t cArgs,
                                          PDBGCVAR pResult)
 {
@@ -4242,5 +4002,5 @@
 
     uint16_t u16;
-    int rc = DBGCCmdHlpMemRead(pCmdHlp, pVM, &u16, sizeof(u16), &paArgs[0], NULL);
+    int rc = DBGCCmdHlpMemRead(pCmdHlp, &u16, sizeof(u16), &paArgs[0], NULL);
     if (RT_FAILURE(rc))
         return rc;
@@ -4255,5 +4015,5 @@
  * @callback_method_impl{Reads a unsigned 32-bit value.}
  */
-static DECLCALLBACK(int) dbgcFuncReadU32(PCDBGCFUNC pFunc, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, uint32_t cArgs,
+static DECLCALLBACK(int) dbgcFuncReadU32(PCDBGCFUNC pFunc, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, uint32_t cArgs,
                                          PDBGCVAR pResult)
 {
@@ -4263,5 +4023,5 @@
 
     uint32_t u32;
-    int rc = DBGCCmdHlpMemRead(pCmdHlp, pVM, &u32, sizeof(u32), &paArgs[0], NULL);
+    int rc = DBGCCmdHlpMemRead(pCmdHlp, &u32, sizeof(u32), &paArgs[0], NULL);
     if (RT_FAILURE(rc))
         return rc;
@@ -4276,5 +4036,5 @@
  * @callback_method_impl{Reads a unsigned 64-bit value.}
  */
-static DECLCALLBACK(int) dbgcFuncReadU64(PCDBGCFUNC pFunc, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, uint32_t cArgs,
+static DECLCALLBACK(int) dbgcFuncReadU64(PCDBGCFUNC pFunc, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, uint32_t cArgs,
                                          PDBGCVAR pResult)
 {
@@ -4284,5 +4044,5 @@
 
     uint64_t u64;
-    int rc = DBGCCmdHlpMemRead(pCmdHlp, pVM, &u64, sizeof(u64), &paArgs[0], NULL);
+    int rc = DBGCCmdHlpMemRead(pCmdHlp, &u64, sizeof(u64), &paArgs[0], NULL);
     if (RT_FAILURE(rc))
         return rc;
@@ -4297,5 +4057,5 @@
  * @callback_method_impl{Reads a unsigned pointer-sized value.}
  */
-static DECLCALLBACK(int) dbgcFuncReadPtr(PCDBGCFUNC pFunc, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, uint32_t cArgs,
+static DECLCALLBACK(int) dbgcFuncReadPtr(PCDBGCFUNC pFunc, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, uint32_t cArgs,
                                          PDBGCVAR pResult)
 {
@@ -4306,6 +4066,6 @@
     CPUMMODE enmMode = DBGCCmdHlpGetCpuMode(pCmdHlp);
     if (enmMode == CPUMMODE_LONG)
-        return dbgcFuncReadU64(pFunc, pCmdHlp, pVM, paArgs, cArgs, pResult);
-    return dbgcFuncReadU32(pFunc, pCmdHlp, pVM, paArgs, cArgs, pResult);
+        return dbgcFuncReadU64(pFunc, pCmdHlp, pUVM, paArgs, cArgs, pResult);
+    return dbgcFuncReadU32(pFunc, pCmdHlp, pUVM, paArgs, cArgs, pResult);
 }
 
@@ -4314,5 +4074,5 @@
  * @callback_method_impl{The hi(value) function implementation.}
  */
-static DECLCALLBACK(int) dbgcFuncHi(PCDBGCFUNC pFunc, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, uint32_t cArgs,
+static DECLCALLBACK(int) dbgcFuncHi(PCDBGCFUNC pFunc, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, uint32_t cArgs,
                                     PDBGCVAR pResult)
 {
@@ -4334,5 +4094,5 @@
     DBGCVAR_SET_RANGE(pResult, paArgs[0].enmRangeType, paArgs[0].u64Range);
 
-    NOREF(pFunc); NOREF(pCmdHlp); NOREF(pVM);
+    NOREF(pFunc); NOREF(pCmdHlp); NOREF(pUVM);
     return VINF_SUCCESS;
 }
@@ -4342,5 +4102,5 @@
  * @callback_method_impl{The low(value) function implementation.}
  */
-static DECLCALLBACK(int) dbgcFuncLow(PCDBGCFUNC pFunc, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, uint32_t cArgs,
+static DECLCALLBACK(int) dbgcFuncLow(PCDBGCFUNC pFunc, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, uint32_t cArgs,
                                      PDBGCVAR pResult)
 {
@@ -4362,5 +4122,5 @@
     DBGCVAR_SET_RANGE(pResult, paArgs[0].enmRangeType, paArgs[0].u64Range);
 
-    NOREF(pFunc); NOREF(pCmdHlp); NOREF(pVM);
+    NOREF(pFunc); NOREF(pCmdHlp); NOREF(pUVM);
     return VINF_SUCCESS;
 }
@@ -4370,9 +4130,9 @@
  * @callback_method_impl{The low(value) function implementation.}
  */
-static DECLCALLBACK(int) dbgcFuncNot(PCDBGCFUNC pFunc, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, uint32_t cArgs,
+static DECLCALLBACK(int) dbgcFuncNot(PCDBGCFUNC pFunc, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, uint32_t cArgs,
                                      PDBGCVAR pResult)
 {
     AssertReturn(cArgs == 1, VERR_DBGC_PARSE_BUG);
-    NOREF(pFunc); NOREF(pCmdHlp); NOREF(pVM);
+    NOREF(pFunc); NOREF(pCmdHlp); NOREF(pUVM);
     return DBGCCmdHlpEval(pCmdHlp, pResult, "!(%Dv)", &paArgs[0]);
 }
Index: trunk/src/VBox/Debugger/DBGCEval.cpp
===================================================================
--- trunk/src/VBox/Debugger/DBGCEval.cpp	(revision 44398)
+++ trunk/src/VBox/Debugger/DBGCEval.cpp	(revision 44399)
@@ -5,5 +5,5 @@
 
 /*
- * Copyright (C) 2006-2012 Oracle Corporation
+ * Copyright (C) 2006-2013 Oracle Corporation
  *
  * This file is part of VirtualBox Open Source Edition (OSE), as
@@ -434,5 +434,5 @@
                                   pszArgs, &iArg, &cArgs);
     if (RT_SUCCESS(rc))
-        rc = pFunc->pfnHandler(pFunc, &pDbgc->CmdHlp, pDbgc->pVM, &pDbgc->aArgs[iArg], cArgs, pResult);
+        rc = pFunc->pfnHandler(pFunc, &pDbgc->CmdHlp, pDbgc->pUVM, &pDbgc->aArgs[iArg], cArgs, pResult);
     pDbgc->iArg = iArg;
     return rc;
@@ -1371,5 +1371,5 @@
          */
         if (!fNoExecute)
-            rc = pCmd->pfnHandler(pCmd, &pDbgc->CmdHlp, pDbgc->pVM, &pDbgc->aArgs[iArg], cArgs);
+            rc = pCmd->pfnHandler(pCmd, &pDbgc->CmdHlp, pDbgc->pUVM, &pDbgc->aArgs[iArg], cArgs);
         pDbgc->rcCmd = rc;
         pDbgc->iArg  = iArg;
Index: trunk/src/VBox/Debugger/DBGCFunctions.cpp
===================================================================
--- trunk/src/VBox/Debugger/DBGCFunctions.cpp	(revision 44398)
+++ trunk/src/VBox/Debugger/DBGCFunctions.cpp	(revision 44399)
@@ -5,5 +5,5 @@
 
 /*
- * Copyright (C) 2006-2012 Oracle Corporation
+ * Copyright (C) 2006-2013 Oracle Corporation
  *
  * This file is part of VirtualBox Open Source Edition (OSE), as
@@ -45,5 +45,5 @@
  * @callback_method_impl{The randu32() function implementation.}
  */
-static DECLCALLBACK(int) dbgcFuncRandU32(PCDBGCFUNC pFunc, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, uint32_t cArgs,
+static DECLCALLBACK(int) dbgcFuncRandU32(PCDBGCFUNC pFunc, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, uint32_t cArgs,
                                          PDBGCVAR pResult)
 {
@@ -51,5 +51,5 @@
     uint32_t u32 = RTRandU32();
     DBGCVAR_INIT_NUMBER(pResult, u32);
-    NOREF(pFunc); NOREF(pCmdHlp); NOREF(pVM); NOREF(paArgs);
+    NOREF(pFunc); NOREF(pCmdHlp); NOREF(pUVM); NOREF(paArgs);
     return VINF_SUCCESS;
 }
Index: trunk/src/VBox/Debugger/DBGCInternal.h
===================================================================
--- trunk/src/VBox/Debugger/DBGCInternal.h	(revision 44398)
+++ trunk/src/VBox/Debugger/DBGCInternal.h	(revision 44399)
@@ -112,4 +112,6 @@
     /** Pointer to the current VM. */
     PVM                 pVM;
+    /** The user mode handle of the current VM. */
+    PUVM                pUVM;
     /** The ID of current virtual CPU. */
     VMCPUID             idCpu;
Index: trunk/src/VBox/Debugger/DBGCOps.cpp
===================================================================
--- trunk/src/VBox/Debugger/DBGCOps.cpp	(revision 44398)
+++ trunk/src/VBox/Debugger/DBGCOps.cpp	(revision 44399)
@@ -462,5 +462,5 @@
     if (enmCat == DBGCVAR_CAT_SYMBOL)
     {
-        int rc = DBGFR3RegNmValidate(pDbgc->pVM, pDbgc->idCpu, pArg->u.pszString);
+        int rc = DBGFR3RegNmValidate(pDbgc->pUVM, pDbgc->idCpu, pArg->u.pszString);
         if (RT_SUCCESS(rc))
             DBGCVAR_INIT_STRING(pResult, pArg->u.pszString);
@@ -473,5 +473,5 @@
     DBGFREGVALTYPE  enmType;
     DBGFREGVAL      Value;
-    int rc = DBGFR3RegNmQuery(pDbgc->pVM, pDbgc->idCpu, pArg->u.pszString, &Value, &enmType);
+    int rc = DBGFR3RegNmQuery(pDbgc->pUVM, pDbgc->idCpu, pArg->u.pszString, &Value, &enmType);
     if (RT_SUCCESS(rc))
     {
Index: trunk/src/VBox/Debugger/DBGCTcp.cpp
===================================================================
--- trunk/src/VBox/Debugger/DBGCTcp.cpp	(revision 44398)
+++ trunk/src/VBox/Debugger/DBGCTcp.cpp	(revision 44399)
@@ -5,5 +5,5 @@
 
 /*
- * Copyright (C) 2006-2011 Oracle Corporation
+ * Copyright (C) 2006-2013 Oracle Corporation
  *
  * This file is part of VirtualBox Open Source Edition (OSE), as
@@ -185,5 +185,5 @@
  * @param   pvUser      The VM handle.
  */
-static int      dbgcTcpConnection(RTSOCKET Sock, void *pvUser)
+static DECLCALLBACK(int) dbgcTcpConnection(RTSOCKET Sock, void *pvUser)
 {
     LogFlow(("dbgcTcpConnection: connection! Sock=%d pvUser=%p\n", Sock, pvUser));
@@ -199,5 +199,5 @@
     DbgcTcp.fAlive = true;
     DbgcTcp.Sock   = Sock;
-    int rc = DBGCCreate((PVM)pvUser, &DbgcTcp.Back, 0);
+    int rc = DBGCCreate((PUVM)pvUser, &DbgcTcp.Back, 0);
     LogFlow(("dbgcTcpConnection: disconnect rc=%Rrc\n", rc));
     return rc;
@@ -209,13 +209,13 @@
  *
  * @returns VBox status.
- * @param   pVM         VM handle.
+ * @param   pUVM        The user mode VM handle.
  * @param   ppvData     Where to store a pointer to the instance data.
  */
-DBGDECL(int)    DBGCTcpCreate(PVM pVM, void **ppvData)
+DBGDECL(int)    DBGCTcpCreate(PUVM pUVM, void **ppvData)
 {
     /*
      * Check what the configuration says.
      */
-    PCFGMNODE pKey = CFGMR3GetChild(CFGMR3GetRoot(pVM), "DBGC");
+    PCFGMNODE pKey = CFGMR3GetChild(CFGMR3GetRootU(pUVM), "DBGC");
     bool fEnabled;
     int rc = CFGMR3QueryBoolDef(pKey, "Enabled", &fEnabled,
@@ -227,5 +227,5 @@
         );
     if (RT_FAILURE(rc))
-        return VM_SET_ERROR(pVM, rc, "Configuration error: Failed querying \"DBGC/Enabled\"");
+        return VM_SET_ERROR_U(pUVM, rc, "Configuration error: Failed querying \"DBGC/Enabled\"");
 
     if (!fEnabled)
@@ -241,5 +241,5 @@
     rc = CFGMR3QueryU32Def(pKey, "Port", &u32Port, 5000);
     if (RT_FAILURE(rc))
-        return VM_SET_ERROR(pVM, rc, "Configuration error: Failed querying \"DBGC/Port\"");
+        return VM_SET_ERROR_U(pUVM, rc, "Configuration error: Failed querying \"DBGC/Port\"");
 
     /*
@@ -249,5 +249,5 @@
     rc = CFGMR3QueryStringDef(pKey, "Address", szAddress, sizeof(szAddress), "");
     if (RT_FAILURE(rc))
-        return VM_SET_ERROR(pVM, rc, "Configuration error: Failed querying \"DBGC/Address\"");
+        return VM_SET_ERROR_U(pUVM, rc, "Configuration error: Failed querying \"DBGC/Address\"");
 
     /*
@@ -255,5 +255,5 @@
      */
     PRTTCPSERVER pServer;
-    rc = RTTcpServerCreate(szAddress, u32Port, RTTHREADTYPE_DEBUGGER, "DBGC", dbgcTcpConnection, pVM, &pServer);
+    rc = RTTcpServerCreate(szAddress, u32Port, RTTHREADTYPE_DEBUGGER, "DBGC", dbgcTcpConnection, pUVM, &pServer);
     if (RT_SUCCESS(rc))
     {
@@ -264,5 +264,5 @@
 
     LogFlow(("DBGCTcpCreate: returns %Rrc\n", rc));
-    return VM_SET_ERROR(pVM, rc, "Cannot start TCP-based debugging console service");
+    return VM_SET_ERROR_U(pUVM, rc, "Cannot start TCP-based debugging console service");
 }
 
@@ -272,7 +272,8 @@
  *
  * @returns VBox status.
- * @param   pVM         VM handle.
- */
-DBGDECL(int) DBGCTcpTerminate(PVM pVM, void *pvData)
+ * @param   pUVM            The user mode VM handle.
+ * @param   pvData          The data returned by DBGCTcpCreate.
+ */
+DBGDECL(int) DBGCTcpTerminate(PUVM pUVM, void *pvData)
 {
     /*
Index: trunk/src/VBox/Debugger/DBGConsole.cpp
===================================================================
--- trunk/src/VBox/Debugger/DBGConsole.cpp	(revision 44398)
+++ trunk/src/VBox/Debugger/DBGConsole.cpp	(revision 44399)
@@ -5,5 +5,5 @@
 
 /*
- * Copyright (C) 2006-2011 Oracle Corporation
+ * Copyright (C) 2006-2013 Oracle Corporation
  *
  * This file is part of VirtualBox Open Source Edition (OSE), as
@@ -162,4 +162,5 @@
 #include <VBox/dbg.h>
 #include <VBox/vmm/dbgf.h>
+#include <VBox/vmm/vmapi.h> /* VMR3GetVM() */
 #include <VBox/err.h>
 #include <VBox/log.h>
@@ -259,5 +260,5 @@
      */
     RTDBGSYMBOL Symbol;
-    rc = DBGFR3AsSymbolByName(pDbgc->pVM, pDbgc->hDbgAs, pszSymbol, &Symbol, NULL);
+    rc = DBGFR3AsSymbolByName(pDbgc->pUVM, pDbgc->hDbgAs, pszSymbol, &Symbol, NULL);
     if (RT_SUCCESS(rc))
     {
@@ -674,5 +675,5 @@
                     break;
             }
-            if (RT_SUCCESS(rc) && DBGFR3IsHalted(pDbgc->pVM))
+            if (RT_SUCCESS(rc) && DBGFR3IsHalted(pDbgc->pUVM))
                 rc = pDbgc->CmdHlp.pfnExec(&pDbgc->CmdHlp, "r");
             else
@@ -810,6 +811,6 @@
     for (;;)
     {
-        if (    pDbgc->pVM
-            &&  DBGFR3CanWait(pDbgc->pVM))
+        if (    pDbgc->pUVM
+            &&  DBGFR3CanWait(pDbgc->pUVM))
         {
             /*
@@ -817,5 +818,5 @@
              */
             PCDBGFEVENT pEvent;
-            rc = DBGFR3EventWait(pDbgc->pVM, pDbgc->fLog ? 1 : 32, &pEvent);
+            rc = DBGFR3EventWait(pDbgc->pUVM, pDbgc->fLog ? 1 : 32, &pEvent);
             if (RT_SUCCESS(rc))
             {
@@ -891,4 +892,5 @@
     pDbgc->pBack            = pBack;
     pDbgc->pVM              = NULL;
+    pDbgc->pUVM             = NULL;
     pDbgc->idCpu            = 0;
     pDbgc->hDbgAs           = DBGF_AS_GLOBAL;
@@ -954,6 +956,6 @@
 
     /* Detach from the VM. */
-    if (pDbgc->pVM)
-        DBGFR3Detach(pDbgc->pVM);
+    if (pDbgc->pUVM)
+        DBGFR3Detach(pDbgc->pUVM);
 
     /* finally, free the instance memory. */
@@ -971,5 +973,5 @@
  * @returns The VBox status code causing the console termination.
  *
- * @param   pVM         VM Handle.
+ * @param   pUVM        The user mode VM handle.
  * @param   pBack       Pointer to the backend structure. This must contain
  *                      a full set of function pointers to service the console.
@@ -978,10 +980,16 @@
  *          callbacks to return fatal failures.
  */
-DBGDECL(int) DBGCCreate(PVM pVM, PDBGCBACK pBack, unsigned fFlags)
+DBGDECL(int) DBGCCreate(PUVM pUVM, PDBGCBACK pBack, unsigned fFlags)
 {
     /*
      * Validate input.
      */
-    AssertPtrNullReturn(pVM, VERR_INVALID_POINTER);
+    AssertPtrNullReturn(pUVM, VERR_INVALID_VM_HANDLE);
+    PVM pVM = NULL;
+    if (pUVM)
+    {
+        pVM = VMR3GetVM(pUVM);
+        AssertPtrReturn(pVM, VERR_INVALID_VM_HANDLE);
+    }
 
     /*
@@ -1002,10 +1010,11 @@
      * Attach to the specified VM.
      */
-    if (RT_SUCCESS(rc) && pVM)
-    {
-        rc = DBGFR3Attach(pVM);
+    if (RT_SUCCESS(rc) && pUVM)
+    {
+        rc = DBGFR3Attach(pUVM);
         if (RT_SUCCESS(rc))
         {
             pDbgc->pVM   = pVM;
+            pDbgc->pUVM  = pUVM;
             pDbgc->idCpu = 0;
             rc = pDbgc->CmdHlp.pfnPrintf(&pDbgc->CmdHlp, NULL,
Index: trunk/src/VBox/Debugger/DBGPlugInCommonELF.h
===================================================================
--- trunk/src/VBox/Debugger/DBGPlugInCommonELF.h	(revision 44398)
+++ trunk/src/VBox/Debugger/DBGPlugInCommonELF.h	(revision 44399)
@@ -35,5 +35,5 @@
 /* @} */
 
-int DBGDiggerCommonParseElf32Mod(PVM pVM, const char *pszModName, const char *pszFilename, uint32_t fFlags,
+int DBGDiggerCommonParseElf32Mod(PUVM pUVM, const char *pszModName, const char *pszFilename, uint32_t fFlags,
                                  Elf32_Ehdr const *pEhdr, Elf32_Shdr const *paShdrs,
                                  Elf32_Sym const *paSyms, size_t cMaxSyms,
@@ -41,5 +41,5 @@
                                  RTGCPTR MinAddr, RTGCPTR MaxAddr, uint64_t uModTag);
 
-int DBGDiggerCommonParseElf64Mod(PVM pVM, const char *pszModName, const char *pszFilename, uint32_t fFlags,
+int DBGDiggerCommonParseElf64Mod(PUVM pUVM, const char *pszModName, const char *pszFilename, uint32_t fFlags,
                                  Elf64_Ehdr const *pEhdr, Elf64_Shdr const *paShdrs,
                                  Elf64_Sym const *paSyms, size_t cMaxSyms,
Index: trunk/src/VBox/Debugger/DBGPlugInCommonELFTmpl.cpp.h
===================================================================
--- trunk/src/VBox/Debugger/DBGPlugInCommonELFTmpl.cpp.h	(revision 44398)
+++ trunk/src/VBox/Debugger/DBGPlugInCommonELFTmpl.cpp.h	(revision 44399)
@@ -44,5 +44,5 @@
  * @returns VBox status code.
  *
- * @param   pVM             The VM handle.
+ * @param   pUVM            The user mode VM handle.
  * @param   pszModName      The module name.
  * @param   pszFilename     The filename. optional.
@@ -69,5 +69,5 @@
  * @param   uModTag         Module tag. Pass 0 if tagging is of no interest.
  */
-int DBGDiggerCommonParseElfMod(PVM pVM, const char *pszModName, const char *pszFilename, uint32_t fFlags,
+int DBGDiggerCommonParseElfMod(PUVM pUVM, const char *pszModName, const char *pszFilename, uint32_t fFlags,
                                Elf_Ehdr const *pEhdr, Elf_Shdr const *paShdrs,
                                Elf_Sym const *paSyms, size_t cMaxSyms,
@@ -75,5 +75,5 @@
                                RTGCPTR MinAddr, RTGCPTR MaxAddr, uint64_t uModTag)
 {
-    AssertPtrReturn(pVM, VERR_INVALID_POINTER);
+    AssertPtrReturn(pUVM, VERR_INVALID_POINTER);
     AssertPtrReturn(pszModName, VERR_INVALID_POINTER);
     AssertPtrReturn(pszFilename, VERR_INVALID_POINTER);
@@ -316,5 +316,5 @@
      * Link it into the address space.
      */
-    RTDBGAS hAs = DBGFR3AsResolveAndRetain(pVM, DBGF_AS_KERNEL);
+    RTDBGAS hAs = DBGFR3AsResolveAndRetain(pUVM, DBGF_AS_KERNEL);
     if (hAs != NIL_RTDBGAS)
         rc = dbgDiggerCommonLinkElfSegs(hAs, hMod, paSegs, cSegs);
Index: trunk/src/VBox/Debugger/DBGPlugInDiggers.cpp
===================================================================
--- trunk/src/VBox/Debugger/DBGPlugInDiggers.cpp	(revision 44398)
+++ trunk/src/VBox/Debugger/DBGPlugInDiggers.cpp	(revision 44399)
@@ -28,5 +28,5 @@
 
 
-DECLEXPORT(int) DBGCPlugInEntry(DBGCPLUGINOP enmOperation, PVM pVM, uintptr_t uArg)
+DECLEXPORT(int) DBGCPlugInEntry(DBGCPLUGINOP enmOperation, PUVM pUVM, uintptr_t uArg)
 {
     static PCDBGFOSREG s_aPlugIns[] =
@@ -48,10 +48,10 @@
             for (unsigned i = 0; i < RT_ELEMENTS(s_aPlugIns); i++)
             {
-                int rc = DBGFR3OSRegister(pVM, s_aPlugIns[i]);
+                int rc = DBGFR3OSRegister(pUVM, s_aPlugIns[i]);
                 if (RT_FAILURE(rc))
                 {
                     AssertRC(rc);
                     while (i-- > 0)
-                        DBGFR3OSDeregister(pVM, s_aPlugIns[i]);
+                        DBGFR3OSDeregister(pUVM, s_aPlugIns[i]);
                     return rc;
                 }
@@ -64,5 +64,5 @@
             for (unsigned i = 0; i < RT_ELEMENTS(s_aPlugIns); i++)
             {
-                int rc = DBGFR3OSDeregister(pVM, s_aPlugIns[i]);
+                int rc = DBGFR3OSDeregister(pUVM, s_aPlugIns[i]);
                 AssertRC(rc);
             }
Index: trunk/src/VBox/Debugger/DBGPlugInLinux.cpp
===================================================================
--- trunk/src/VBox/Debugger/DBGPlugInLinux.cpp	(revision 44398)
+++ trunk/src/VBox/Debugger/DBGPlugInLinux.cpp	(revision 44399)
@@ -74,5 +74,5 @@
 *   Internal Functions                                                         *
 *******************************************************************************/
-static DECLCALLBACK(int)  dbgDiggerLinuxInit(PVM pVM, void *pvData);
+static DECLCALLBACK(int)  dbgDiggerLinuxInit(PUVM pUVM, void *pvData);
 
 
@@ -92,5 +92,5 @@
  * @copydoc DBGFOSREG::pfnQueryInterface
  */
-static DECLCALLBACK(void *) dbgDiggerLinuxQueryInterface(PVM pVM, void *pvData, DBGFOSINTERFACE enmIf)
+static DECLCALLBACK(void *) dbgDiggerLinuxQueryInterface(PUVM pUVM, void *pvData, DBGFOSINTERFACE enmIf)
 {
     return NULL;
@@ -101,5 +101,5 @@
  * @copydoc DBGFOSREG::pfnQueryVersion
  */
-static DECLCALLBACK(int)  dbgDiggerLinuxQueryVersion(PVM pVM, void *pvData, char *pszVersion, size_t cchVersion)
+static DECLCALLBACK(int)  dbgDiggerLinuxQueryVersion(PUVM pUVM, void *pvData, char *pszVersion, size_t cchVersion)
 {
     PDBGDIGGERLINUX pThis = (PDBGDIGGERLINUX)pvData;
@@ -109,5 +109,5 @@
      * It's all in the linux banner.
      */
-    int rc = DBGFR3MemReadString(pVM, 0, &pThis->AddrLinuxBanner, pszVersion, cchVersion);
+    int rc = DBGFR3MemReadString(pUVM, 0, &pThis->AddrLinuxBanner, pszVersion, cchVersion);
     if (RT_SUCCESS(rc))
     {
@@ -129,5 +129,5 @@
  * @copydoc DBGFOSREG::pfnTerm
  */
-static DECLCALLBACK(void)  dbgDiggerLinuxTerm(PVM pVM, void *pvData)
+static DECLCALLBACK(void)  dbgDiggerLinuxTerm(PUVM pUVM, void *pvData)
 {
     PDBGDIGGERLINUX pThis = (PDBGDIGGERLINUX)pvData;
@@ -141,5 +141,5 @@
  * @copydoc DBGFOSREG::pfnRefresh
  */
-static DECLCALLBACK(int)  dbgDiggerLinuxRefresh(PVM pVM, void *pvData)
+static DECLCALLBACK(int)  dbgDiggerLinuxRefresh(PUVM pUVM, void *pvData)
 {
     PDBGDIGGERLINUX pThis = (PDBGDIGGERLINUX)pvData;
@@ -150,6 +150,6 @@
      * For now we'll flush and reload everything.
      */
-    dbgDiggerLinuxTerm(pVM, pvData);
-    return dbgDiggerLinuxInit(pVM, pvData);
+    dbgDiggerLinuxTerm(pUVM, pvData);
+    return dbgDiggerLinuxInit(pUVM, pvData);
 }
 
@@ -158,5 +158,5 @@
  * @copydoc DBGFOSREG::pfnInit
  */
-static DECLCALLBACK(int)  dbgDiggerLinuxInit(PVM pVM, void *pvData)
+static DECLCALLBACK(int)  dbgDiggerLinuxInit(PUVM pUVM, void *pvData)
 {
     PDBGDIGGERLINUX pThis = (PDBGDIGGERLINUX)pvData;
@@ -183,5 +183,5 @@
  * @copydoc DBGFOSREG::pfnProbe
  */
-static DECLCALLBACK(bool)  dbgDiggerLinuxProbe(PVM pVM, void *pvData)
+static DECLCALLBACK(bool)  dbgDiggerLinuxProbe(PUVM pUVM, void *pvData)
 {
     PDBGDIGGERLINUX pThis = (PDBGDIGGERLINUX)pvData;
@@ -196,8 +196,8 @@
     {
         DBGFADDRESS KernelAddr;
-        DBGFR3AddrFromFlat(pVM, &KernelAddr, g_au64LnxKernelAddresses[i]);
+        DBGFR3AddrFromFlat(pUVM, &KernelAddr, g_au64LnxKernelAddresses[i]);
         DBGFADDRESS HitAddr;
         static const uint8_t s_abLinuxVersion[] = "Linux version 2.";
-        int rc = DBGFR3MemScan(pVM, 0, &KernelAddr, LNX_MAX_KERNEL_SIZE, 1,
+        int rc = DBGFR3MemScan(pUVM, 0, &KernelAddr, LNX_MAX_KERNEL_SIZE, 1,
                                s_abLinuxVersion, sizeof(s_abLinuxVersion) - 1, &HitAddr);
         if (RT_SUCCESS(rc))
@@ -205,5 +205,5 @@
             char szTmp[128];
             char const *pszY = &szTmp[sizeof(s_abLinuxVersion) - 1];
-            rc = DBGFR3MemReadString(pVM, 0, &HitAddr, szTmp, sizeof(szTmp));
+            rc = DBGFR3MemReadString(pUVM, 0, &HitAddr, szTmp, sizeof(szTmp));
             if (    RT_SUCCESS(rc)
                 &&  *pszY >= '0'
@@ -223,5 +223,5 @@
  * @copydoc DBGFOSREG::pfnDestruct
  */
-static DECLCALLBACK(void)  dbgDiggerLinuxDestruct(PVM pVM, void *pvData)
+static DECLCALLBACK(void)  dbgDiggerLinuxDestruct(PUVM pUVM, void *pvData)
 {
 
@@ -232,5 +232,5 @@
  * @copydoc DBGFOSREG::pfnConstruct
  */
-static DECLCALLBACK(int)  dbgDiggerLinuxConstruct(PVM pVM, void *pvData)
+static DECLCALLBACK(int)  dbgDiggerLinuxConstruct(PUVM pUVM, void *pvData)
 {
     return VINF_SUCCESS;
Index: trunk/src/VBox/Debugger/DBGPlugInOS2.cpp
===================================================================
--- trunk/src/VBox/Debugger/DBGPlugInOS2.cpp	(revision 44398)
+++ trunk/src/VBox/Debugger/DBGPlugInOS2.cpp	(revision 44399)
@@ -85,5 +85,5 @@
 *   Internal Functions                                                         *
 *******************************************************************************/
-static DECLCALLBACK(int)  dbgDiggerOS2Init(PVM pVM, void *pvData);
+static DECLCALLBACK(int)  dbgDiggerOS2Init(PUVM pUVM, void *pvData);
 
 
@@ -96,14 +96,14 @@
  * Process a PE image found in guest memory.
  *
- * @param   pThis               The instance data.
- * @param   pVM                 The VM handle.
- * @param   pszName             The image name.
- * @param   pImageAddr          The image address.
- * @param   cbImage             The size of the image.
- * @param   pbBuf               Scratch buffer containing the first
- *                              RT_MIN(cbBuf, cbImage) bytes of the image.
- * @param   cbBuf               The scratch buffer size.
- */
-static void dbgDiggerOS2ProcessImage(PDBGDIGGEROS2 pThis, PVM pVM, const char *pszName,
+ * @param   pThis           The instance data.
+ * @param   pUVM            The user mode VM handle.
+ * @param   pszName         The image name.
+ * @param   pImageAddr      The image address.
+ * @param   cbImage         The size of the image.
+ * @param   pbBuf           Scratch buffer containing the first
+ *                          RT_MIN(cbBuf, cbImage) bytes of the image.
+ * @param   cbBuf           The scratch buffer size.
+ */
+static void dbgDiggerOS2ProcessImage(PDBGDIGGEROS2 pThis, PUVM pUVM, const char *pszName,
                                      PCDBGFADDRESS pImageAddr, uint32_t cbImage,
                                      uint8_t *pbBuf, size_t cbBuf)
@@ -118,5 +118,5 @@
  * @copydoc DBGFOSREG::pfnQueryInterface
  */
-static DECLCALLBACK(void *) dbgDiggerOS2QueryInterface(PVM pVM, void *pvData, DBGFOSINTERFACE enmIf)
+static DECLCALLBACK(void *) dbgDiggerOS2QueryInterface(PUVM pUVM, void *pvData, DBGFOSINTERFACE enmIf)
 {
     return NULL;
@@ -127,5 +127,5 @@
  * @copydoc DBGFOSREG::pfnQueryVersion
  */
-static DECLCALLBACK(int)  dbgDiggerOS2QueryVersion(PVM pVM, void *pvData, char *pszVersion, size_t cchVersion)
+static DECLCALLBACK(int)  dbgDiggerOS2QueryVersion(PUVM pUVM, void *pvData, char *pszVersion, size_t cchVersion)
 {
     PDBGDIGGEROS2 pThis = (PDBGDIGGEROS2)pvData;
@@ -171,5 +171,5 @@
  * @copydoc DBGFOSREG::pfnTerm
  */
-static DECLCALLBACK(void)  dbgDiggerOS2Term(PVM pVM, void *pvData)
+static DECLCALLBACK(void)  dbgDiggerOS2Term(PUVM pUVM, void *pvData)
 {
     PDBGDIGGEROS2 pThis = (PDBGDIGGEROS2)pvData;
@@ -183,5 +183,5 @@
  * @copydoc DBGFOSREG::pfnRefresh
  */
-static DECLCALLBACK(int)  dbgDiggerOS2Refresh(PVM pVM, void *pvData)
+static DECLCALLBACK(int)  dbgDiggerOS2Refresh(PUVM pUVM, void *pvData)
 {
     PDBGDIGGEROS2 pThis = (PDBGDIGGEROS2)pvData;
@@ -192,5 +192,5 @@
      * For now we'll flush and reload everything.
      */
-    RTDBGAS hDbgAs = DBGFR3AsResolveAndRetain(pVM, DBGF_AS_KERNEL);
+    RTDBGAS hDbgAs = DBGFR3AsResolveAndRetain(pUVM, DBGF_AS_KERNEL);
     if (hDbgAs != NIL_RTDBGAS)
     {
@@ -212,6 +212,6 @@
     }
 
-    dbgDiggerOS2Term(pVM, pvData);
-    return dbgDiggerOS2Init(pVM, pvData);
+    dbgDiggerOS2Term(pUVM, pvData);
+    return dbgDiggerOS2Init(pUVM, pvData);
 }
 
@@ -220,5 +220,5 @@
  * @copydoc DBGFOSREG::pfnInit
  */
-static DECLCALLBACK(int)  dbgDiggerOS2Init(PVM pVM, void *pvData)
+static DECLCALLBACK(int)  dbgDiggerOS2Init(PUVM pUVM, void *pvData)
 {
     PDBGDIGGEROS2 pThis = (PDBGDIGGEROS2)pvData;
@@ -240,8 +240,8 @@
     do {
         /* Version info is at GIS:15h (major/minor/revision). */
-        rc = DBGFR3AddrFromSelOff(pVM, 0 /*idCpu*/, &Addr, pThis->selGIS, 0x15);
+        rc = DBGFR3AddrFromSelOff(pUVM, 0 /*idCpu*/, &Addr, pThis->selGIS, 0x15);
         if (RT_FAILURE(rc))
             break;
-        rc = DBGFR3MemRead(pVM, 0 /*idCpu*/, &Addr, u.au32, sizeof(uint32_t));
+        rc = DBGFR3MemRead(pUVM, 0 /*idCpu*/, &Addr, u.au32, sizeof(uint32_t));
         if (RT_FAILURE(rc))
             break;
@@ -260,5 +260,5 @@
  * @copydoc DBGFOSREG::pfnProbe
  */
-static DECLCALLBACK(bool)  dbgDiggerOS2Probe(PVM pVM, void *pvData)
+static DECLCALLBACK(bool)  dbgDiggerOS2Probe(PUVM pUVM, void *pvData)
 {
     PDBGDIGGEROS2   pThis = (PDBGDIGGEROS2)pvData;
@@ -283,8 +283,8 @@
      */
     do {
-        rc = DBGFR3AddrFromSelOff(pVM, 0 /*idCpu*/, &Addr, 0x70, 0x00);
+        rc = DBGFR3AddrFromSelOff(pUVM, 0 /*idCpu*/, &Addr, 0x70, 0x00);
         if (RT_FAILURE(rc))
             break;
-        rc = DBGFR3MemRead(pVM, 0 /*idCpu*/, &Addr, u.au32, 256);
+        rc = DBGFR3MemRead(pUVM, 0 /*idCpu*/, &Addr, u.au32, 256);
         if (RT_FAILURE(rc))
             break;
@@ -318,5 +318,5 @@
  * @copydoc DBGFOSREG::pfnDestruct
  */
-static DECLCALLBACK(void)  dbgDiggerOS2Destruct(PVM pVM, void *pvData)
+static DECLCALLBACK(void)  dbgDiggerOS2Destruct(PUVM pUVM, void *pvData)
 {
 
@@ -327,5 +327,5 @@
  * @copydoc DBGFOSREG::pfnConstruct
  */
-static DECLCALLBACK(int)  dbgDiggerOS2Construct(PVM pVM, void *pvData)
+static DECLCALLBACK(int)  dbgDiggerOS2Construct(PUVM pUVM, void *pvData)
 {
     PDBGDIGGEROS2 pThis = (PDBGDIGGEROS2)pvData;
Index: trunk/src/VBox/Debugger/DBGPlugInSolaris.cpp
===================================================================
--- trunk/src/VBox/Debugger/DBGPlugInSolaris.cpp	(revision 44398)
+++ trunk/src/VBox/Debugger/DBGPlugInSolaris.cpp	(revision 44399)
@@ -350,5 +350,5 @@
 *   Internal Functions                                                         *
 *******************************************************************************/
-static DECLCALLBACK(int)  dbgDiggerSolarisInit(PVM pVM, void *pvData);
+static DECLCALLBACK(int)  dbgDiggerSolarisInit(PUVM pUVM, void *pvData);
 
 
@@ -357,5 +357,5 @@
  * @copydoc DBGFOSREG::pfnQueryInterface
  */
-static DECLCALLBACK(void *) dbgDiggerSolarisQueryInterface(PVM pVM, void *pvData, DBGFOSINTERFACE enmIf)
+static DECLCALLBACK(void *) dbgDiggerSolarisQueryInterface(PUVM pUVM, void *pvData, DBGFOSINTERFACE enmIf)
 {
     return NULL;
@@ -366,5 +366,5 @@
  * @copydoc DBGFOSREG::pfnQueryVersion
  */
-static DECLCALLBACK(int)  dbgDiggerSolarisQueryVersion(PVM pVM, void *pvData, char *pszVersion, size_t cchVersion)
+static DECLCALLBACK(int)  dbgDiggerSolarisQueryVersion(PUVM pUVM, void *pvData, char *pszVersion, size_t cchVersion)
 {
     PDBGDIGGERSOLARIS pThis = (PDBGDIGGERSOLARIS)pvData;
@@ -377,7 +377,7 @@
     SOL_utsname_t UtsName;
     RTDBGSYMBOL SymUtsName;
-    int rc = DBGFR3AsSymbolByName(pVM, DBGF_AS_KERNEL, "utsname", &SymUtsName, NULL);
+    int rc = DBGFR3AsSymbolByName(pUVM, DBGF_AS_KERNEL, "utsname", &SymUtsName, NULL);
     if (RT_SUCCESS(rc))
-        rc = DBGFR3MemRead(pVM, 0, DBGFR3AddrFromFlat(pVM, &Addr, SymUtsName.Value), &UtsName, sizeof(UtsName));
+        rc = DBGFR3MemRead(pUVM, 0, DBGFR3AddrFromFlat(pUVM, &Addr, SymUtsName.Value), &UtsName, sizeof(UtsName));
     if (RT_FAILURE(rc))
     {
@@ -387,8 +387,8 @@
         memset(&UtsName, '\0', sizeof(UtsName));
         strcpy(&UtsName.sysname[0], "SunOS");
-        rc = DBGFR3MemScan(pVM, 0, &pThis->AddrUnixData, SOL_UNIX_MAX_DATA_SEG_SIZE, 1,
+        rc = DBGFR3MemScan(pUVM, 0, &pThis->AddrUnixData, SOL_UNIX_MAX_DATA_SEG_SIZE, 1,
                            &UtsName.sysname[0], sizeof(UtsName.sysname), &Addr);
         if (RT_SUCCESS(rc))
-            rc = DBGFR3MemRead(pVM, 0, DBGFR3AddrFromFlat(pVM, &Addr, Addr.FlatPtr - RT_OFFSETOF(SOL_utsname_t, sysname)),
+            rc = DBGFR3MemRead(pUVM, 0, DBGFR3AddrFromFlat(pUVM, &Addr, Addr.FlatPtr - RT_OFFSETOF(SOL_utsname_t, sysname)),
                                &UtsName, sizeof(UtsName));
     }
@@ -423,9 +423,9 @@
  * Processes a modctl_t.
  *
- * @param   pVM     The VM handle.
+ * @param   pUVM    The user mode VM handle.
  * @param   pThis   Our instance data.
  * @param   pModCtl Pointer to the modctl structure.
  */
-static void dbgDiggerSolarisProcessModCtl32(PVM pVM, PDBGDIGGERSOLARIS pThis, SOL_modctl_t const *pModCtl)
+static void dbgDiggerSolarisProcessModCtl32(PUVM pUVM, PDBGDIGGERSOLARIS pThis, SOL_modctl_t const *pModCtl)
 {
     /* skip it if it's not loaded and installed */
@@ -444,5 +444,5 @@
     char szModName[64];
     DBGFADDRESS Addr;
-    int rc = DBGFR3MemReadString(pVM, 0, DBGFR3AddrFromFlat(pVM, &Addr, pModCtl->v9_32.mod_modname), szModName, sizeof(szModName));
+    int rc = DBGFR3MemReadString(pUVM, 0, DBGFR3AddrFromFlat(pUVM, &Addr, pModCtl->v9_32.mod_modname), szModName, sizeof(szModName));
     if (RT_FAILURE(rc))
         return;
@@ -452,5 +452,5 @@
     AssertCompile2MemberOffsets(SOL_modctl_t, v11_32.mod_filename, v9_32.mod_filename);
     char szFilename[256];
-    rc = DBGFR3MemReadString(pVM, 0, DBGFR3AddrFromFlat(pVM, &Addr, pModCtl->v9_32.mod_filename), szFilename, sizeof(szFilename));
+    rc = DBGFR3MemReadString(pUVM, 0, DBGFR3AddrFromFlat(pUVM, &Addr, pModCtl->v9_32.mod_filename), szFilename, sizeof(szFilename));
     if (RT_FAILURE(rc))
         strcpy(szFilename, szModName);
@@ -463,5 +463,5 @@
     AssertCompile2MemberOffsets(SOL_modctl_t, v11_32.mod_mp, v9_32.mod_mp);
     struct SOL32_module Module;
-    rc = DBGFR3MemRead(pVM, 0, DBGFR3AddrFromFlat(pVM, &Addr, pModCtl->v9_32.mod_mp), &Module, sizeof(Module));
+    rc = DBGFR3MemRead(pUVM, 0, DBGFR3AddrFromFlat(pUVM, &Addr, pModCtl->v9_32.mod_mp), &Module, sizeof(Module));
     if (RT_FAILURE(rc))
         return;
@@ -533,5 +533,5 @@
     if (!paShdrs)
         return;
-    rc = DBGFR3MemRead(pVM, 0, DBGFR3AddrFromFlat(pVM, &Addr, Module.shdrs), paShdrs, cb);
+    rc = DBGFR3MemRead(pUVM, 0, DBGFR3AddrFromFlat(pUVM, &Addr, Module.shdrs), paShdrs, cb);
     if (RT_SUCCESS(rc))
     {
@@ -539,5 +539,5 @@
         if (pvSymSpace)
         {
-            rc = DBGFR3MemRead(pVM, 0, DBGFR3AddrFromFlat(pVM, &Addr, Module.symspace), pvSymSpace, Module.symsize);
+            rc = DBGFR3MemRead(pUVM, 0, DBGFR3AddrFromFlat(pUVM, &Addr, Module.symspace), pvSymSpace, Module.symsize);
             if (RT_SUCCESS(rc))
             {
@@ -554,5 +554,5 @@
                 cMaxSyms = RT_MIN(cMaxSyms, Module.nsyms);
 
-                DBGDiggerCommonParseElf32Mod(pVM, szModName, szFilename, DBG_DIGGER_ELF_FUNNY_SHDRS,
+                DBGDiggerCommonParseElf32Mod(pUVM, szModName, szFilename, DBG_DIGGER_ELF_FUNNY_SHDRS,
                                              &Module.hdr, paShdrs, paSyms, cMaxSyms, pbStrings, cbMaxStrings,
                                              SOL32_MIN_KRNL_ADDR, SOL32_MAX_KRNL_ADDR - 1, DIG_SOL_MOD_TAG);
@@ -570,9 +570,9 @@
  * Processes a modctl_t.
  *
- * @param   pVM     The VM handle.
+ * @param   pUVM    The user mode VM handle.
  * @param   pThis   Our instance data.
  * @param   pModCtl Pointer to the modctl structure.
  */
-static void dbgDiggerSolarisProcessModCtl64(PVM pVM, PDBGDIGGERSOLARIS pThis, SOL_modctl_t const *pModCtl)
+static void dbgDiggerSolarisProcessModCtl64(PUVM pUVM, PDBGDIGGERSOLARIS pThis, SOL_modctl_t const *pModCtl)
 {
     /* skip it if it's not loaded and installed */
@@ -591,5 +591,5 @@
     char szModName[64];
     DBGFADDRESS Addr;
-    int rc = DBGFR3MemReadString(pVM, 0, DBGFR3AddrFromFlat(pVM, &Addr, pModCtl->v9_64.mod_modname), szModName, sizeof(szModName));
+    int rc = DBGFR3MemReadString(pUVM, 0, DBGFR3AddrFromFlat(pUVM, &Addr, pModCtl->v9_64.mod_modname), szModName, sizeof(szModName));
     if (RT_FAILURE(rc))
         return;
@@ -599,5 +599,5 @@
     AssertCompile2MemberOffsets(SOL_modctl_t, v11_64.mod_filename, v9_64.mod_filename);
     char szFilename[256];
-    rc = DBGFR3MemReadString(pVM, 0, DBGFR3AddrFromFlat(pVM, &Addr, pModCtl->v9_64.mod_filename), szFilename, sizeof(szFilename));
+    rc = DBGFR3MemReadString(pUVM, 0, DBGFR3AddrFromFlat(pUVM, &Addr, pModCtl->v9_64.mod_filename), szFilename, sizeof(szFilename));
     if (RT_FAILURE(rc))
         strcpy(szFilename, szModName);
@@ -610,5 +610,5 @@
     AssertCompile2MemberOffsets(SOL_modctl_t, v11_64.mod_mp, v9_64.mod_mp);
     struct SOL64_module Module;
-    rc = DBGFR3MemRead(pVM, 0, DBGFR3AddrFromFlat(pVM, &Addr, pModCtl->v9_64.mod_mp), &Module, sizeof(Module));
+    rc = DBGFR3MemRead(pUVM, 0, DBGFR3AddrFromFlat(pUVM, &Addr, pModCtl->v9_64.mod_mp), &Module, sizeof(Module));
     if (RT_FAILURE(rc))
         return;
@@ -679,5 +679,5 @@
     if (!paShdrs)
         return;
-    rc = DBGFR3MemRead(pVM, 0, DBGFR3AddrFromFlat(pVM, &Addr, Module.shdrs), paShdrs, cb);
+    rc = DBGFR3MemRead(pUVM, 0, DBGFR3AddrFromFlat(pUVM, &Addr, Module.shdrs), paShdrs, cb);
     if (RT_SUCCESS(rc))
     {
@@ -685,5 +685,5 @@
         if (pvSymSpace)
         {
-            rc = DBGFR3MemRead(pVM, 0, DBGFR3AddrFromFlat(pVM, &Addr, Module.symspace), pvSymSpace, Module.symsize);
+            rc = DBGFR3MemRead(pUVM, 0, DBGFR3AddrFromFlat(pUVM, &Addr, Module.symspace), pvSymSpace, Module.symsize);
             if (RT_SUCCESS(rc))
             {
@@ -700,5 +700,5 @@
                 cMaxSyms = RT_MIN(cMaxSyms, Module.nsyms);
 
-                DBGDiggerCommonParseElf64Mod(pVM, szModName, szFilename, DBG_DIGGER_ELF_FUNNY_SHDRS,
+                DBGDiggerCommonParseElf64Mod(pUVM, szModName, szFilename, DBG_DIGGER_ELF_FUNNY_SHDRS,
                                              &Module.hdr, paShdrs, paSyms, cMaxSyms, pbStrings, cbMaxStrings,
                                              SOL64_MIN_KRNL_ADDR, SOL64_MAX_KRNL_ADDR - 1, DIG_SOL_MOD_TAG);
@@ -716,5 +716,5 @@
  * @copydoc DBGFOSREG::pfnTerm
  */
-static DECLCALLBACK(void)  dbgDiggerSolarisTerm(PVM pVM, void *pvData)
+static DECLCALLBACK(void)  dbgDiggerSolarisTerm(PUVM pUVM, void *pvData)
 {
     PDBGDIGGERSOLARIS pThis = (PDBGDIGGERSOLARIS)pvData;
@@ -728,5 +728,5 @@
  * @copydoc DBGFOSREG::pfnRefresh
  */
-static DECLCALLBACK(int)  dbgDiggerSolarisRefresh(PVM pVM, void *pvData)
+static DECLCALLBACK(int)  dbgDiggerSolarisRefresh(PUVM pUVM, void *pvData)
 {
     PDBGDIGGERSOLARIS pThis = (PDBGDIGGERSOLARIS)pvData;
@@ -737,5 +737,5 @@
      * For now we'll flush and reload everything.
      */
-    RTDBGAS hDbgAs = DBGFR3AsResolveAndRetain(pVM, DBGF_AS_KERNEL);
+    RTDBGAS hDbgAs = DBGFR3AsResolveAndRetain(pUVM, DBGF_AS_KERNEL);
     if (hDbgAs != NIL_RTDBGAS)
     {
@@ -757,6 +757,6 @@
     }
 
-    dbgDiggerSolarisTerm(pVM, pvData);
-    return dbgDiggerSolarisInit(pVM, pvData);
+    dbgDiggerSolarisTerm(pUVM, pvData);
+    return dbgDiggerSolarisInit(pUVM, pvData);
 }
 
@@ -765,5 +765,5 @@
  * @copydoc DBGFOSREG::pfnInit
  */
-static DECLCALLBACK(int)  dbgDiggerSolarisInit(PVM pVM, void *pvData)
+static DECLCALLBACK(int)  dbgDiggerSolarisInit(PUVM pUVM, void *pvData)
 {
     PDBGDIGGERSOLARIS pThis = (PDBGDIGGERSOLARIS)pvData;
@@ -775,5 +775,5 @@
      * On Solaris the kernel and is the global address space.
      */
-    DBGFR3AsSetAlias(pVM, DBGF_AS_KERNEL, DBGF_AS_GLOBAL);
+    DBGFR3AsSetAlias(pUVM, DBGF_AS_KERNEL, DBGF_AS_GLOBAL);
 
 /** @todo Use debug_info, build 7x / S10U6. */
@@ -783,9 +783,9 @@
      * We know it resides in the unix data segment.
      */
-    DBGFR3AddrFromFlat(pVM, &pThis->AddrUnixModCtl, 0);
+    DBGFR3AddrFromFlat(pUVM, &pThis->AddrUnixModCtl, 0);
 
     DBGFADDRESS     CurAddr = pThis->AddrUnixData;
     DBGFADDRESS     MaxAddr;
-    DBGFR3AddrFromFlat(pVM, &MaxAddr, CurAddr.FlatPtr + SOL_UNIX_MAX_DATA_SEG_SIZE);
+    DBGFR3AddrFromFlat(pUVM, &MaxAddr, CurAddr.FlatPtr + SOL_UNIX_MAX_DATA_SEG_SIZE);
     const uint8_t  *pbExpr = (const uint8_t *)&pThis->AddrUnixText.FlatPtr;
     const uint32_t  cbExpr = pThis->f64Bit ? sizeof(uint64_t) : sizeof(uint32_t);
@@ -794,5 +794,5 @@
     {
         DBGFADDRESS HitAddr;
-        rc = DBGFR3MemScan(pVM, 0, &CurAddr, MaxAddr.FlatPtr - CurAddr.FlatPtr, 1, pbExpr, cbExpr, &HitAddr);
+        rc = DBGFR3MemScan(pUVM, 0, &CurAddr, MaxAddr.FlatPtr - CurAddr.FlatPtr, 1, pbExpr, cbExpr, &HitAddr);
         if (RT_FAILURE(rc))
             break;
@@ -806,7 +806,7 @@
         if (pThis->f64Bit)
         {
-            DBGFR3AddrFromFlat(pVM, &ModCtlAddr, HitAddr.FlatPtr - RT_OFFSETOF(SOL32v11_modctl_t, mod_text));
+            DBGFR3AddrFromFlat(pUVM, &ModCtlAddr, HitAddr.FlatPtr - RT_OFFSETOF(SOL32v11_modctl_t, mod_text));
             SOL64v11_modctl_t ModCtlv11;
-            rc = DBGFR3MemRead(pVM, 0, &ModCtlAddr, &ModCtlv11, sizeof(ModCtlv11));
+            rc = DBGFR3MemRead(pUVM, 0, &ModCtlAddr, &ModCtlv11, sizeof(ModCtlv11));
             if (RT_SUCCESS(rc))
             {
@@ -828,6 +828,6 @@
                     char szUnix[5];
                     DBGFADDRESS NameAddr;
-                    DBGFR3AddrFromFlat(pVM, &NameAddr, ModCtlv11.mod_modname);
-                    rc = DBGFR3MemRead(pVM, 0, &NameAddr, &szUnix, sizeof(szUnix));
+                    DBGFR3AddrFromFlat(pUVM, &NameAddr, ModCtlv11.mod_modname);
+                    rc = DBGFR3MemRead(pUVM, 0, &NameAddr, &szUnix, sizeof(szUnix));
                     if (RT_SUCCESS(rc))
                     {
@@ -846,7 +846,7 @@
         else
         {
-            DBGFR3AddrFromFlat(pVM, &ModCtlAddr, HitAddr.FlatPtr - RT_OFFSETOF(SOL32v11_modctl_t, mod_text));
+            DBGFR3AddrFromFlat(pUVM, &ModCtlAddr, HitAddr.FlatPtr - RT_OFFSETOF(SOL32v11_modctl_t, mod_text));
             SOL32v11_modctl_t ModCtlv11;
-            rc = DBGFR3MemRead(pVM, 0, &ModCtlAddr, &ModCtlv11, sizeof(ModCtlv11));
+            rc = DBGFR3MemRead(pUVM, 0, &ModCtlAddr, &ModCtlv11, sizeof(ModCtlv11));
             if (RT_SUCCESS(rc))
             {
@@ -868,6 +868,6 @@
                     char szUnix[5];
                     DBGFADDRESS NameAddr;
-                    DBGFR3AddrFromFlat(pVM, &NameAddr, ModCtlv11.mod_modname);
-                    rc = DBGFR3MemRead(pVM, 0, &NameAddr, &szUnix, sizeof(szUnix));
+                    DBGFR3AddrFromFlat(pUVM, &NameAddr, ModCtlv11.mod_modname);
+                    rc = DBGFR3MemRead(pUVM, 0, &NameAddr, &szUnix, sizeof(szUnix));
                     if (RT_SUCCESS(rc))
                     {
@@ -888,7 +888,7 @@
         if (pThis->f64Bit)
         {
-            DBGFR3AddrFromFlat(pVM, &ModCtlAddr, HitAddr.FlatPtr - RT_OFFSETOF(SOL64v9_modctl_t, mod_text));
+            DBGFR3AddrFromFlat(pUVM, &ModCtlAddr, HitAddr.FlatPtr - RT_OFFSETOF(SOL64v9_modctl_t, mod_text));
             SOL64v9_modctl_t ModCtlv9;
-            rc = DBGFR3MemRead(pVM, 0, &ModCtlAddr, &ModCtlv9, sizeof(ModCtlv9));
+            rc = DBGFR3MemRead(pUVM, 0, &ModCtlAddr, &ModCtlv9, sizeof(ModCtlv9));
             if (RT_SUCCESS(rc))
             {
@@ -908,6 +908,6 @@
                     char szUnix[5];
                     DBGFADDRESS NameAddr;
-                    DBGFR3AddrFromFlat(pVM, &NameAddr, ModCtlv9.mod_modname);
-                    rc = DBGFR3MemRead(pVM, 0, &NameAddr, &szUnix, sizeof(szUnix));
+                    DBGFR3AddrFromFlat(pUVM, &NameAddr, ModCtlv9.mod_modname);
+                    rc = DBGFR3MemRead(pUVM, 0, &NameAddr, &szUnix, sizeof(szUnix));
                     if (RT_SUCCESS(rc))
                     {
@@ -926,7 +926,7 @@
         else
         {
-            DBGFR3AddrFromFlat(pVM, &ModCtlAddr, HitAddr.FlatPtr - RT_OFFSETOF(SOL32v9_modctl_t, mod_text));
+            DBGFR3AddrFromFlat(pUVM, &ModCtlAddr, HitAddr.FlatPtr - RT_OFFSETOF(SOL32v9_modctl_t, mod_text));
             SOL32v9_modctl_t ModCtlv9;
-            rc = DBGFR3MemRead(pVM, 0, &ModCtlAddr, &ModCtlv9, sizeof(ModCtlv9));
+            rc = DBGFR3MemRead(pUVM, 0, &ModCtlAddr, &ModCtlv9, sizeof(ModCtlv9));
             if (RT_SUCCESS(rc))
             {
@@ -946,6 +946,6 @@
                     char szUnix[5];
                     DBGFADDRESS NameAddr;
-                    DBGFR3AddrFromFlat(pVM, &NameAddr, ModCtlv9.mod_modname);
-                    rc = DBGFR3MemRead(pVM, 0, &NameAddr, &szUnix, sizeof(szUnix));
+                    DBGFR3AddrFromFlat(pUVM, &NameAddr, ModCtlv9.mod_modname);
+                    rc = DBGFR3MemRead(pUVM, 0, &NameAddr, &szUnix, sizeof(szUnix));
                     if (RT_SUCCESS(rc))
                     {
@@ -964,5 +964,5 @@
 
         /* next */
-        DBGFR3AddrFromFlat(pVM, &CurAddr, HitAddr.FlatPtr + cbExpr);
+        DBGFR3AddrFromFlat(pUVM, &CurAddr, HitAddr.FlatPtr + cbExpr);
     }
 
@@ -978,5 +978,5 @@
             /* read it */
             SOL_modctl_t ModCtl;
-            rc = DBGFR3MemRead(pVM, 0, &CurAddr, &ModCtl, cbModCtl);
+            rc = DBGFR3MemRead(pUVM, 0, &CurAddr, &ModCtl, cbModCtl);
             if (RT_FAILURE(rc))
             {
@@ -987,7 +987,7 @@
             /* process it. */
             if (pThis->f64Bit)
-                dbgDiggerSolarisProcessModCtl64(pVM, pThis, &ModCtl);
+                dbgDiggerSolarisProcessModCtl64(pUVM, pThis, &ModCtl);
             else
-                dbgDiggerSolarisProcessModCtl32(pVM, pThis, &ModCtl);
+                dbgDiggerSolarisProcessModCtl32(pUVM, pThis, &ModCtl);
 
             /* next */
@@ -1000,5 +1000,5 @@
                     break;
                 }
-                DBGFR3AddrFromFlat(pVM, &CurAddr, ModCtl.v9_64.mod_next);
+                DBGFR3AddrFromFlat(pUVM, &CurAddr, ModCtl.v9_64.mod_next);
             }
             else
@@ -1010,5 +1010,5 @@
                     break;
                 }
-                DBGFR3AddrFromFlat(pVM, &CurAddr, ModCtl.v9_32.mod_next);
+                DBGFR3AddrFromFlat(pUVM, &CurAddr, ModCtl.v9_32.mod_next);
             }
             if (++iMod >= 1024)
@@ -1028,5 +1028,5 @@
  * @copydoc DBGFOSREG::pfnProbe
  */
-static DECLCALLBACK(bool)  dbgDiggerSolarisProbe(PVM pVM, void *pvData)
+static DECLCALLBACK(bool)  dbgDiggerSolarisProbe(PUVM pUVM, void *pvData)
 {
     PDBGDIGGERSOLARIS pThis = (PDBGDIGGERSOLARIS)pvData;
@@ -1039,16 +1039,16 @@
 
     /* 32-bit search range. */
-    DBGFR3AddrFromFlat(pVM, &Addr, 0xfe800000);
+    DBGFR3AddrFromFlat(pUVM, &Addr, 0xfe800000);
     RTGCUINTPTR cbRange = 0xfec00000 - 0xfe800000;
 
     DBGFADDRESS HitAddr;
     static const uint8_t s_abSunRelease[] = "SunOS Release ";
-    int rc = DBGFR3MemScan(pVM, 0, &Addr, cbRange, 1, s_abSunRelease, sizeof(s_abSunRelease) - 1, &HitAddr);
+    int rc = DBGFR3MemScan(pUVM, 0, &Addr, cbRange, 1, s_abSunRelease, sizeof(s_abSunRelease) - 1, &HitAddr);
     if (RT_FAILURE(rc))
     {
         /* 64-bit.... */
-        DBGFR3AddrFromFlat(pVM, &Addr, UINT64_C(0xfffffffffb800000));
+        DBGFR3AddrFromFlat(pUVM, &Addr, UINT64_C(0xfffffffffb800000));
         cbRange = UINT64_C(0xfffffffffbc00000) - UINT64_C(0xfffffffffb800000);
-        rc = DBGFR3MemScan(pVM, 0, &Addr, cbRange, 1, s_abSunRelease, sizeof(s_abSunRelease) - 1, &HitAddr);
+        rc = DBGFR3MemScan(pUVM, 0, &Addr, cbRange, 1, s_abSunRelease, sizeof(s_abSunRelease) - 1, &HitAddr);
         if (RT_FAILURE(rc))
             return false;
@@ -1061,9 +1061,9 @@
     static const uint8_t s_abSMI[] = "Sun Microsystems, Inc.";
     static const uint8_t s_abORCL[] = "Oracle and/or its affiliates.";
-    rc = DBGFR3MemScan(pVM, 0, &Addr, cbRange, 1, s_abSMI, sizeof(s_abSMI) - 1, &HitAddr);
+    rc = DBGFR3MemScan(pUVM, 0, &Addr, cbRange, 1, s_abSMI, sizeof(s_abSMI) - 1, &HitAddr);
     if (RT_FAILURE(rc))
     {
         /* Try the alternate copyright string. */
-        rc = DBGFR3MemScan(pVM, 0, &Addr, cbRange, 1, s_abORCL, sizeof(s_abORCL) - 1, &HitAddr);
+        rc = DBGFR3MemScan(pUVM, 0, &Addr, cbRange, 1, s_abORCL, sizeof(s_abORCL) - 1, &HitAddr);
         if (RT_FAILURE(rc))
             return false;
@@ -1085,5 +1085,5 @@
  * @copydoc DBGFOSREG::pfnDestruct
  */
-static DECLCALLBACK(void)  dbgDiggerSolarisDestruct(PVM pVM, void *pvData)
+static DECLCALLBACK(void)  dbgDiggerSolarisDestruct(PUVM pUVM, void *pvData)
 {
 
@@ -1094,5 +1094,5 @@
  * @copydoc DBGFOSREG::pfnConstruct
  */
-static DECLCALLBACK(int)  dbgDiggerSolarisConstruct(PVM pVM, void *pvData)
+static DECLCALLBACK(int)  dbgDiggerSolarisConstruct(PUVM pUVM, void *pvData)
 {
     return VINF_SUCCESS;
Index: trunk/src/VBox/Debugger/DBGPlugInWinNt.cpp
===================================================================
--- trunk/src/VBox/Debugger/DBGPlugInWinNt.cpp	(revision 44398)
+++ trunk/src/VBox/Debugger/DBGPlugInWinNt.cpp	(revision 44399)
@@ -261,5 +261,5 @@
 *   Internal Functions                                                         *
 *******************************************************************************/
-static DECLCALLBACK(int)  dbgDiggerWinNtInit(PVM pVM, void *pvData);
+static DECLCALLBACK(int)  dbgDiggerWinNtInit(PUVM pUVM, void *pvData);
 
 
@@ -277,14 +277,14 @@
  * Process a PE image found in guest memory.
  *
- * @param   pThis               The instance data.
- * @param   pVM                 The VM handle.
- * @param   pszName             The image name.
- * @param   pImageAddr          The image address.
- * @param   cbImage             The size of the image.
- * @param   pbBuf               Scratch buffer containing the first
- *                              RT_MIN(cbBuf, cbImage) bytes of the image.
- * @param   cbBuf               The scratch buffer size.
- */
-static void dbgDiggerWinNtProcessImage(PDBGDIGGERWINNT pThis, PVM pVM, const char *pszName,
+ * @param   pThis           The instance data.
+ * @param   pUVM            The user mode VM handle.
+ * @param   pszName         The image name.
+ * @param   pImageAddr      The image address.
+ * @param   cbImage         The size of the image.
+ * @param   pbBuf           Scratch buffer containing the first
+ *                          RT_MIN(cbBuf, cbImage) bytes of the image.
+ * @param   cbBuf           The scratch buffer size.
+ */
+static void dbgDiggerWinNtProcessImage(PDBGDIGGERWINNT pThis, PUVM pUVM, const char *pszName,
                                        PCDBGFADDRESS pImageAddr, uint32_t cbImage,
                                        uint8_t *pbBuf, size_t cbBuf)
@@ -409,5 +409,5 @@
         DBGFADDRESS Addr = *pImageAddr;
         DBGFR3AddrAdd(&Addr, uRvaDebugDir);
-        rc = DBGFR3MemRead(pVM, 0 /*idCpu*/, &Addr, pbBuf, RT_MIN(cbDebugDir, cbBuf));
+        rc = DBGFR3MemRead(pUVM, 0 /*idCpu*/, &Addr, pbBuf, RT_MIN(cbDebugDir, cbBuf));
         if (RT_SUCCESS(rc))
         {
@@ -430,5 +430,5 @@
      * Link the module.
      */
-    RTDBGAS hAs = DBGFR3AsResolveAndRetain(pVM, DBGF_AS_KERNEL);
+    RTDBGAS hAs = DBGFR3AsResolveAndRetain(pUVM, DBGF_AS_KERNEL);
     if (hAs != NIL_RTDBGAS)
         rc = RTDbgAsModuleLink(hAs, hMod, pImageAddr->FlatPtr, RTDBGASLINK_FLAGS_REPLACE /*fFlags*/);
@@ -443,5 +443,5 @@
  * @copydoc DBGFOSREG::pfnQueryInterface
  */
-static DECLCALLBACK(void *) dbgDiggerWinNtQueryInterface(PVM pVM, void *pvData, DBGFOSINTERFACE enmIf)
+static DECLCALLBACK(void *) dbgDiggerWinNtQueryInterface(PUVM pUVM, void *pvData, DBGFOSINTERFACE enmIf)
 {
     return NULL;
@@ -452,5 +452,5 @@
  * @copydoc DBGFOSREG::pfnQueryVersion
  */
-static DECLCALLBACK(int)  dbgDiggerWinNtQueryVersion(PVM pVM, void *pvData, char *pszVersion, size_t cchVersion)
+static DECLCALLBACK(int)  dbgDiggerWinNtQueryVersion(PUVM pUVM, void *pvData, char *pszVersion, size_t cchVersion)
 {
     PDBGDIGGERWINNT pThis = (PDBGDIGGERWINNT)pvData;
@@ -472,5 +472,5 @@
  * @copydoc DBGFOSREG::pfnTerm
  */
-static DECLCALLBACK(void)  dbgDiggerWinNtTerm(PVM pVM, void *pvData)
+static DECLCALLBACK(void)  dbgDiggerWinNtTerm(PUVM pUVM, void *pvData)
 {
     PDBGDIGGERWINNT pThis = (PDBGDIGGERWINNT)pvData;
@@ -484,5 +484,5 @@
  * @copydoc DBGFOSREG::pfnRefresh
  */
-static DECLCALLBACK(int)  dbgDiggerWinNtRefresh(PVM pVM, void *pvData)
+static DECLCALLBACK(int)  dbgDiggerWinNtRefresh(PUVM pUVM, void *pvData)
 {
     PDBGDIGGERWINNT pThis = (PDBGDIGGERWINNT)pvData;
@@ -493,5 +493,5 @@
      * For now we'll flush and reload everything.
      */
-    RTDBGAS hDbgAs = DBGFR3AsResolveAndRetain(pVM, DBGF_AS_KERNEL);
+    RTDBGAS hDbgAs = DBGFR3AsResolveAndRetain(pUVM, DBGF_AS_KERNEL);
     if (hDbgAs != NIL_RTDBGAS)
     {
@@ -513,6 +513,6 @@
     }
 
-    dbgDiggerWinNtTerm(pVM, pvData);
-    return dbgDiggerWinNtInit(pVM, pvData);
+    dbgDiggerWinNtTerm(pUVM, pvData);
+    return dbgDiggerWinNtInit(pUVM, pvData);
 }
 
@@ -521,5 +521,5 @@
  * @copydoc DBGFOSREG::pfnInit
  */
-static DECLCALLBACK(int)  dbgDiggerWinNtInit(PVM pVM, void *pvData)
+static DECLCALLBACK(int)  dbgDiggerWinNtInit(PUVM pUVM, void *pvData)
 {
     PDBGDIGGERWINNT pThis = (PDBGDIGGERWINNT)pvData;
@@ -538,6 +538,6 @@
      * Figure the NT version.
      */
-    DBGFR3AddrFromFlat(pVM, &Addr, pThis->f32Bit ? NTKUSERSHAREDDATA_WINNT32 : NTKUSERSHAREDDATA_WINNT64);
-    rc = DBGFR3MemRead(pVM, 0 /*idCpu*/, &Addr, &u, PAGE_SIZE);
+    DBGFR3AddrFromFlat(pUVM, &Addr, pThis->f32Bit ? NTKUSERSHAREDDATA_WINNT32 : NTKUSERSHAREDDATA_WINNT64);
+    rc = DBGFR3MemRead(pUVM, 0 /*idCpu*/, &Addr, &u, PAGE_SIZE);
     if (RT_FAILURE(rc))
         return rc;
@@ -557,5 +557,5 @@
         /* Read the validate the MTE. */
         NTMTE Mte;
-        rc = DBGFR3MemRead(pVM, 0 /*idCpu*/, &Addr, &Mte, pThis->f32Bit ? sizeof(Mte.vX_32) : sizeof(Mte.vX_64));
+        rc = DBGFR3MemRead(pUVM, 0 /*idCpu*/, &Addr, &Mte, pThis->f32Bit ? sizeof(Mte.vX_32) : sizeof(Mte.vX_64));
         if (RT_FAILURE(rc))
             break;
@@ -591,16 +591,16 @@
         /* Read the full name. */
         DBGFADDRESS AddrName;
-        DBGFR3AddrFromFlat(pVM, &AddrName, WINNT_UNION(pThis, &Mte, FullDllName.Buffer));
+        DBGFR3AddrFromFlat(pUVM, &AddrName, WINNT_UNION(pThis, &Mte, FullDllName.Buffer));
         uint16_t    cbName = WINNT_UNION(pThis, &Mte, FullDllName.Length);
         if (cbName < sizeof(u))
-            rc = DBGFR3MemRead(pVM, 0 /*idCpu*/, &AddrName, &u, cbName);
+            rc = DBGFR3MemRead(pUVM, 0 /*idCpu*/, &AddrName, &u, cbName);
         else
             rc = VERR_OUT_OF_RANGE;
         if (RT_FAILURE(rc))
         {
-            DBGFR3AddrFromFlat(pVM, &AddrName, WINNT_UNION(pThis, &Mte, BaseDllName.Buffer));
+            DBGFR3AddrFromFlat(pUVM, &AddrName, WINNT_UNION(pThis, &Mte, BaseDllName.Buffer));
             cbName = WINNT_UNION(pThis, &Mte, BaseDllName.Length);
             if (cbName < sizeof(u))
-                rc = DBGFR3MemRead(pVM, 0 /*idCpu*/, &AddrName, &u, cbName);
+                rc = DBGFR3MemRead(pUVM, 0 /*idCpu*/, &AddrName, &u, cbName);
             else
                 rc = VERR_OUT_OF_RANGE;
@@ -615,10 +615,10 @@
                 /* Read the start of the PE image and pass it along to a worker. */
                 DBGFADDRESS ImageAddr;
-                DBGFR3AddrFromFlat(pVM, &ImageAddr, WINNT_UNION(pThis, &Mte, DllBase));
+                DBGFR3AddrFromFlat(pUVM, &ImageAddr, WINNT_UNION(pThis, &Mte, DllBase));
                 uint32_t    cbImageBuf = RT_MIN(sizeof(u), WINNT_UNION(pThis, &Mte, SizeOfImage));
-                rc = DBGFR3MemRead(pVM, 0 /*idCpu*/, &ImageAddr, &u, cbImageBuf);
+                rc = DBGFR3MemRead(pUVM, 0 /*idCpu*/, &ImageAddr, &u, cbImageBuf);
                 if (RT_SUCCESS(rc))
                     dbgDiggerWinNtProcessImage(pThis,
-                                               pVM,
+                                               pUVM,
                                                pszName,
                                                &ImageAddr,
@@ -632,5 +632,5 @@
         /* next */
         AddrPrev = Addr;
-        DBGFR3AddrFromFlat(pVM, &Addr, WINNT_UNION(pThis, &Mte, InLoadOrderLinks.Flink));
+        DBGFR3AddrFromFlat(pUVM, &Addr, WINNT_UNION(pThis, &Mte, InLoadOrderLinks.Flink));
     } while (   Addr.FlatPtr != pThis->KernelMteAddr.FlatPtr
              && Addr.FlatPtr != pThis->PsLoadedModuleListAddr.FlatPtr);
@@ -644,5 +644,5 @@
  * @copydoc DBGFOSREG::pfnProbe
  */
-static DECLCALLBACK(bool)  dbgDiggerWinNtProbe(PVM pVM, void *pvData)
+static DECLCALLBACK(bool)  dbgDiggerWinNtProbe(PUVM pUVM, void *pvData)
 {
     PDBGDIGGERWINNT pThis = (PDBGDIGGERWINNT)pvData;
@@ -663,5 +663,5 @@
      * success.
      */
-    CPUMMODE enmMode = DBGFR3CpuGetMode(pVM, 0 /*idCpu*/);
+    CPUMMODE enmMode = DBGFR3CpuGetMode(pUVM, 0 /*idCpu*/);
     if (enmMode == CPUMMODE_LONG)
     {
@@ -671,9 +671,9 @@
     {
         DBGFADDRESS KernelAddr;
-        for (DBGFR3AddrFromFlat(pVM, &KernelAddr, UINT32_C(0x80001000));
+        for (DBGFR3AddrFromFlat(pUVM, &KernelAddr, UINT32_C(0x80001000));
              KernelAddr.FlatPtr < UINT32_C(0xffff0000);
              KernelAddr.FlatPtr += PAGE_SIZE)
         {
-            int rc = DBGFR3MemScan(pVM, 0 /*idCpu*/, &KernelAddr, UINT32_C(0xffff0000) - KernelAddr.FlatPtr,
+            int rc = DBGFR3MemScan(pUVM, 0 /*idCpu*/, &KernelAddr, UINT32_C(0xffff0000) - KernelAddr.FlatPtr,
                                    1, "MISYSPTE", sizeof("MISYSPTE") - 1, &KernelAddr);
             if (RT_FAILURE(rc))
@@ -682,5 +682,5 @@
 
             /* MZ + PE header. */
-            rc = DBGFR3MemRead(pVM, 0 /*idCpu*/, &KernelAddr, &u, sizeof(u));
+            rc = DBGFR3MemRead(pUVM, 0 /*idCpu*/, &KernelAddr, &u, sizeof(u));
             if (    RT_SUCCESS(rc)
                 &&  u.MzHdr.e_magic == IMAGE_DOS_SIGNATURE
@@ -707,5 +707,5 @@
                     Mte.SizeOfImage = pHdrs->OptionalHeader.SizeOfImage;
                     DBGFADDRESS HitAddr;
-                    rc = DBGFR3MemScan(pVM, 0 /*idCpu*/, &KernelAddr, UINT32_MAX - KernelAddr.FlatPtr,
+                    rc = DBGFR3MemScan(pUVM, 0 /*idCpu*/, &KernelAddr, UINT32_MAX - KernelAddr.FlatPtr,
                                        4 /*align*/, &Mte.DllBase, 3 * sizeof(uint32_t), &HitAddr);
                     while (RT_SUCCESS(rc))
@@ -714,5 +714,5 @@
                         NTMTE32 Mte2;
                         DBGFADDRESS MteAddr = HitAddr;
-                        rc = DBGFR3MemRead(pVM, 0 /*idCpu*/, DBGFR3AddrSub(&MteAddr, RT_OFFSETOF(NTMTE32, DllBase)),
+                        rc = DBGFR3MemRead(pUVM, 0 /*idCpu*/, DBGFR3AddrSub(&MteAddr, RT_OFFSETOF(NTMTE32, DllBase)),
                                            &Mte2, sizeof(Mte2));
                         if (    RT_SUCCESS(rc)
@@ -731,5 +731,5 @@
                            )
                         {
-                            rc = DBGFR3MemRead(pVM, 0 /*idCpu*/, DBGFR3AddrFromFlat(pVM, &Addr, Mte2.BaseDllName.Buffer),
+                            rc = DBGFR3MemRead(pUVM, 0 /*idCpu*/, DBGFR3AddrFromFlat(pUVM, &Addr, Mte2.BaseDllName.Buffer),
                                                u.wsz, Mte2.BaseDllName.Length);
                             u.wsz[Mte2.BaseDllName.Length / 2] = '\0';
@@ -741,5 +741,5 @@
                             {
                                 NTMTE32 Mte3;
-                                rc = DBGFR3MemRead(pVM, 0 /*idCpu*/, DBGFR3AddrFromFlat(pVM, &Addr, Mte2.InLoadOrderLinks.Blink),
+                                rc = DBGFR3MemRead(pUVM, 0 /*idCpu*/, DBGFR3AddrFromFlat(pUVM, &Addr, Mte2.InLoadOrderLinks.Blink),
                                                    &Mte3, RT_SIZEOFMEMB(NTMTE32, InLoadOrderLinks));
                                 if (   RT_SUCCESS(rc)
@@ -761,5 +761,5 @@
                         DBGFR3AddrAdd(&HitAddr, 4);
                         if (HitAddr.FlatPtr <= UINT32_C(0xfffff000))
-                            rc = DBGFR3MemScan(pVM, 0 /*idCpu*/, &HitAddr, UINT32_MAX - HitAddr.FlatPtr,
+                            rc = DBGFR3MemScan(pUVM, 0 /*idCpu*/, &HitAddr, UINT32_MAX - HitAddr.FlatPtr,
                                                4 /*align*/, &Mte.DllBase, 3 * sizeof(uint32_t), &HitAddr);
                         else
@@ -777,5 +777,5 @@
  * @copydoc DBGFOSREG::pfnDestruct
  */
-static DECLCALLBACK(void)  dbgDiggerWinNtDestruct(PVM pVM, void *pvData)
+static DECLCALLBACK(void)  dbgDiggerWinNtDestruct(PUVM pUVM, void *pvData)
 {
 
@@ -786,5 +786,5 @@
  * @copydoc DBGFOSREG::pfnConstruct
  */
-static DECLCALLBACK(int)  dbgDiggerWinNtConstruct(PVM pVM, void *pvData)
+static DECLCALLBACK(int)  dbgDiggerWinNtConstruct(PUVM pUVM, void *pvData)
 {
     PDBGDIGGERWINNT pThis = (PDBGDIGGERWINNT)pvData;
Index: trunk/src/VBox/Debugger/VBoxDbgBase.cpp
===================================================================
--- trunk/src/VBox/Debugger/VBoxDbgBase.cpp	(revision 44398)
+++ trunk/src/VBox/Debugger/VBoxDbgBase.cpp	(revision 44399)
@@ -98,5 +98,5 @@
     if (    pUVM
         &&  VMR3GetStateU(pUVM) < VMSTATE_DESTROYING)
-        return DBGCCreate(VMR3GetVM(pUVM), pBack, fFlags);
+        return DBGCCreate(pUVM, pBack, fFlags);
     return VERR_INVALID_HANDLE;
 }
Index: trunk/src/VBox/Debugger/testcase/tstDBGCStubs.cpp
===================================================================
--- trunk/src/VBox/Debugger/testcase/tstDBGCStubs.cpp	(revision 44398)
+++ trunk/src/VBox/Debugger/testcase/tstDBGCStubs.cpp	(revision 44399)
@@ -23,10 +23,10 @@
 
 #include <VBox/vmm/dbgf.h>
-VMMR3DECL(PDBGFADDRESS) DBGFR3AddrFromFlat(PVM pVM, PDBGFADDRESS pAddress, RTGCUINTPTR FlatPtr)
-{
-    return NULL;
-}
-
-VMMR3DECL(int) DBGFR3AddrFromSelOff(PVM pVM, VMCPUID idCpu, PDBGFADDRESS pAddress, RTSEL Sel, RTUINTPTR off)
+VMMR3DECL(PDBGFADDRESS) DBGFR3AddrFromFlat(PUVM pUVM, PDBGFADDRESS pAddress, RTGCUINTPTR FlatPtr)
+{
+    return NULL;
+}
+
+VMMR3DECL(int) DBGFR3AddrFromSelOff(PUVM pUVM, VMCPUID idCpu, PDBGFADDRESS pAddress, RTSEL Sel, RTUINTPTR off)
 {
     /* bad:bad -> provke error during parsing. */
@@ -42,123 +42,113 @@
 }
 
-VMMR3DECL(int)  DBGFR3AddrToPhys(PVM pVM, VMCPUID idCpu, PDBGFADDRESS pAddress, PRTGCPHYS pGCPhys)
-{
-    return VERR_INTERNAL_ERROR;
-}
-
-VMMR3DECL(int)  DBGFR3AddrToHostPhys(PVMCPU pVCpu, PDBGFADDRESS pAddress, PRTHCPHYS pHCPhys)
-{
-    return VERR_INTERNAL_ERROR;
-}
-
-VMMR3DECL(int)  DBGFR3AddrToVolatileR3Ptr(PVMCPU pVCpu, PDBGFADDRESS pAddress, bool fReadOnly, void **ppvR3Ptr)
-{
-    return VERR_INTERNAL_ERROR;
-}
-
-VMMR3DECL(int) DBGFR3Attach(PVM pVM)
-{
-    return VERR_INTERNAL_ERROR;
-}
-
-VMMR3DECL(int) DBGFR3BpClear(PVM pVM, RTUINT iBp)
-{
-    return VERR_INTERNAL_ERROR;
-}
-VMMR3DECL(int) DBGFR3BpDisable(PVM pVM, RTUINT iBp)
-{
-    return VERR_INTERNAL_ERROR;
-}
-VMMR3DECL(int) DBGFR3BpEnable(PVM pVM, RTUINT iBp)
-{
-    return VERR_INTERNAL_ERROR;
-}
-VMMR3DECL(int) DBGFR3BpEnum(PVM pVM, PFNDBGFBPENUM pfnCallback, void *pvUser)
-{
-    return VERR_INTERNAL_ERROR;
-}
-VMMR3DECL(int) DBGFR3BpSet(PVM pVM, PCDBGFADDRESS pAddress, uint64_t iHitTrigger, uint64_t iHitDisable, PRTUINT piBp)
-{
-    return VERR_INTERNAL_ERROR;
-}
-VMMR3DECL(int) DBGFR3BpSetReg(PVM pVM, PCDBGFADDRESS pAddress, uint64_t iHitTrigger, uint64_t iHitDisable,
+VMMR3DECL(int)  DBGFR3AddrToPhys(PUVM pUVM, VMCPUID idCpu, PDBGFADDRESS pAddress, PRTGCPHYS pGCPhys)
+{
+    return VERR_INTERNAL_ERROR;
+}
+
+VMMR3DECL(int) DBGFR3Attach(PUVM pUVM)
+{
+    return VERR_INTERNAL_ERROR;
+}
+
+VMMR3DECL(int) DBGFR3BpClear(PUVM pUVM, RTUINT iBp)
+{
+    return VERR_INTERNAL_ERROR;
+}
+VMMR3DECL(int) DBGFR3BpDisable(PUVM pUVM, RTUINT iBp)
+{
+    return VERR_INTERNAL_ERROR;
+}
+VMMR3DECL(int) DBGFR3BpEnable(PUVM pUVM, RTUINT iBp)
+{
+    return VERR_INTERNAL_ERROR;
+}
+VMMR3DECL(int) DBGFR3BpEnum(PUVM pUVM, PFNDBGFBPENUM pfnCallback, void *pvUser)
+{
+    return VERR_INTERNAL_ERROR;
+}
+VMMR3DECL(int) DBGFR3BpSet(PUVM pUVM, PCDBGFADDRESS pAddress, uint64_t iHitTrigger, uint64_t iHitDisable, PRTUINT piBp)
+{
+    return VERR_INTERNAL_ERROR;
+}
+VMMR3DECL(int) DBGFR3BpSetReg(PUVM pUVM, PCDBGFADDRESS pAddress, uint64_t iHitTrigger, uint64_t iHitDisable,
                               uint8_t fType, uint8_t cb, PRTUINT piBp)
 {
     return VERR_INTERNAL_ERROR;
 }
-VMMR3DECL(int) DBGFR3BpSetREM(PVM pVM, PCDBGFADDRESS pAddress, uint64_t iHitTrigger, uint64_t iHitDisable, PRTUINT piBp)
-{
-    return VERR_INTERNAL_ERROR;
-}
-VMMR3DECL(bool) DBGFR3CanWait(PVM pVM)
+VMMR3DECL(int) DBGFR3BpSetREM(PUVM pUVM, PCDBGFADDRESS pAddress, uint64_t iHitTrigger, uint64_t iHitDisable, PRTUINT piBp)
+{
+    return VERR_INTERNAL_ERROR;
+}
+VMMR3DECL(bool) DBGFR3CanWait(PUVM pUVM)
 {
     return true;
 }
-VMMR3DECL(int) DBGFR3Detach(PVM pVM)
-{
-    return VERR_INTERNAL_ERROR;
-}
-VMMR3DECL(int) DBGFR3DisasInstrEx(PVM pVM, VMCPUID idCpu, RTSEL Sel, RTGCPTR GCPtr, uint32_t fFlags,
+VMMR3DECL(int) DBGFR3Detach(PUVM pUVM)
+{
+    return VERR_INTERNAL_ERROR;
+}
+VMMR3DECL(int) DBGFR3DisasInstrEx(PUVM pUVM, VMCPUID idCpu, RTSEL Sel, RTGCPTR GCPtr, uint32_t fFlags,
                                   char *pszOutput, uint32_t cchOutput, uint32_t *pcbInstr)
 {
     return VERR_INTERNAL_ERROR;
 }
-VMMR3DECL(int) DBGFR3EventWait(PVM pVM, RTMSINTERVAL cMillies, PCDBGFEVENT *ppEvent)
-{
-    return VERR_INTERNAL_ERROR;
-}
-VMMR3DECL(int) DBGFR3Halt(PVM pVM)
-{
-    return VERR_INTERNAL_ERROR;
-}
-VMMR3DECL(int) DBGFR3Info(PVM pVM, const char *pszName, const char *pszArgs, PCDBGFINFOHLP pHlp)
-{
-    return VERR_INTERNAL_ERROR;
-}
-VMMR3DECL(int) DBGFR3InfoEx(PVM pVM, VMCPUID idCpu, const char *pszName, const char *pszArgs, PCDBGFINFOHLP pHlp)
-{
-    return VERR_INTERNAL_ERROR;
-}
-VMMR3DECL(bool) DBGFR3IsHalted(PVM pVM)
+VMMR3DECL(int) DBGFR3EventWait(PUVM pUVM, RTMSINTERVAL cMillies, PCDBGFEVENT *ppEvent)
+{
+    return VERR_INTERNAL_ERROR;
+}
+VMMR3DECL(int) DBGFR3Halt(PUVM pUVM)
+{
+    return VERR_INTERNAL_ERROR;
+}
+VMMR3DECL(int) DBGFR3Info(PUVM pUVM, const char *pszName, const char *pszArgs, PCDBGFINFOHLP pHlp)
+{
+    return VERR_INTERNAL_ERROR;
+}
+VMMR3DECL(int) DBGFR3InfoEx(PUVM pUVM, VMCPUID idCpu, const char *pszName, const char *pszArgs, PCDBGFINFOHLP pHlp)
+{
+    return VERR_INTERNAL_ERROR;
+}
+VMMR3DECL(bool) DBGFR3IsHalted(PUVM pUVM)
 {
     return true;
 }
-VMMR3DECL(int) DBGFR3LineByAddr(PVM pVM, RTGCUINTPTR Address, PRTGCINTPTR poffDisplacement, PDBGFLINE pLine)
-{
-    return VERR_INTERNAL_ERROR;
-}
-VMMR3DECL(int) DBGFR3LogModifyDestinations(PVM pVM, const char *pszDestSettings)
-{
-    return VERR_INTERNAL_ERROR;
-}
-VMMR3DECL(int) DBGFR3LogModifyFlags(PVM pVM, const char *pszFlagSettings)
-{
-    return VERR_INTERNAL_ERROR;
-}
-VMMR3DECL(int) DBGFR3LogModifyGroups(PVM pVM, const char *pszGroupSettings)
-{
-    return VERR_INTERNAL_ERROR;
-}
-VMMR3DECL(int) DBGFR3ModuleLoad(PVM pVM, const char *pszFilename, RTGCUINTPTR AddressDelta, const char *pszName, RTGCUINTPTR ModuleAddress, unsigned cbImage)
-{
-    return VERR_INTERNAL_ERROR;
-}
-VMMR3DECL(int) DBGFR3AsLoadImage(PVM pVM, RTDBGAS hAS, const char *pszFilename, const char *pszModName, PCDBGFADDRESS pModAddress, RTDBGSEGIDX iModSeg, uint32_t fFlags)
-{
-    return VERR_INTERNAL_ERROR;
-}
-VMMR3DECL(int) DBGFR3AsLoadMap(PVM pVM, RTDBGAS hAS, const char *pszFilename, const char *pszModName, PCDBGFADDRESS pModAddress, RTDBGSEGIDX iModSeg, RTGCUINTPTR uSubtrahend, uint32_t fFlags)
-{
-    return VERR_INTERNAL_ERROR;
-}
-VMMR3DECL(RTDBGAS) DBGFR3AsResolveAndRetain(PVM pVM, RTDBGAS hAlias)
+VMMR3DECL(int) DBGFR3LineByAddr(PUVM pUVM, RTGCUINTPTR Address, PRTGCINTPTR poffDisplacement, PDBGFLINE pLine)
+{
+    return VERR_INTERNAL_ERROR;
+}
+VMMR3DECL(int) DBGFR3LogModifyDestinations(PUVM pUVM, const char *pszDestSettings)
+{
+    return VERR_INTERNAL_ERROR;
+}
+VMMR3DECL(int) DBGFR3LogModifyFlags(PUVM pUVM, const char *pszFlagSettings)
+{
+    return VERR_INTERNAL_ERROR;
+}
+VMMR3DECL(int) DBGFR3LogModifyGroups(PUVM pUVM, const char *pszGroupSettings)
+{
+    return VERR_INTERNAL_ERROR;
+}
+VMMR3DECL(int) DBGFR3ModuleLoad(PUVM pUVM, const char *pszFilename, RTGCUINTPTR AddressDelta, const char *pszName, RTGCUINTPTR ModuleAddress, unsigned cbImage)
+{
+    return VERR_INTERNAL_ERROR;
+}
+VMMR3DECL(int) DBGFR3AsLoadImage(PUVM pUVM, RTDBGAS hAS, const char *pszFilename, const char *pszModName, PCDBGFADDRESS pModAddress, RTDBGSEGIDX iModSeg, uint32_t fFlags)
+{
+    return VERR_INTERNAL_ERROR;
+}
+VMMR3DECL(int) DBGFR3AsLoadMap(PUVM pUVM, RTDBGAS hAS, const char *pszFilename, const char *pszModName, PCDBGFADDRESS pModAddress, RTDBGSEGIDX iModSeg, RTGCUINTPTR uSubtrahend, uint32_t fFlags)
+{
+    return VERR_INTERNAL_ERROR;
+}
+VMMR3DECL(RTDBGAS) DBGFR3AsResolveAndRetain(PUVM pUVM, RTDBGAS hAlias)
 {
     return NIL_RTDBGAS;
 }
-VMMR3DECL(int) DBGFR3Resume(PVM pVM)
-{
-    return VERR_INTERNAL_ERROR;
-}
-VMMR3DECL(int) DBGFR3StackWalkBegin(PVM pVM, VMCPUID idCpu, DBGFCODETYPE enmCodeType, PCDBGFSTACKFRAME *ppFirstFrame)
+VMMR3DECL(int) DBGFR3Resume(PUVM pUVM)
+{
+    return VERR_INTERNAL_ERROR;
+}
+VMMR3DECL(int) DBGFR3StackWalkBegin(PUVM pUVM, VMCPUID idCpu, DBGFCODETYPE enmCodeType, PCDBGFSTACKFRAME *ppFirstFrame)
 {
     return VERR_INTERNAL_ERROR;
@@ -171,38 +161,38 @@
 {
 }
-VMMR3DECL(int) DBGFR3Step(PVM pVM, VMCPUID idCpu)
-{
-    return VERR_INTERNAL_ERROR;
-}
-VMMR3DECL(int) DBGFR3AsSymbolByAddr(PVM pVM, RTDBGAS hDbgAs, PCDBGFADDRESS pAddress, PRTGCINTPTR poffDisplacement, PRTDBGSYMBOL pSymbol, PRTDBGMOD phMod)
-{
-    return VERR_INTERNAL_ERROR;
-}
-VMMR3DECL(int) DBGFR3AsSymbolByName(PVM pVM, RTDBGAS hDbgAs, const char *pszSymbol, PRTDBGSYMBOL pSymbol, PRTDBGMOD phMod)
-{
-    return VERR_INTERNAL_ERROR;
-}
-VMMR3DECL(int) DBGFR3MemScan(PVM pVM, VMCPUID idCpu, PCDBGFADDRESS pAddress, RTGCUINTPTR cbRange, RTGCUINTPTR uAlign, const void *pabNeedle, size_t cbNeedle, PDBGFADDRESS pHitAddress)
-{
-    return VERR_INTERNAL_ERROR;
-}
-VMMR3DECL(int) DBGFR3MemRead(PVM pVM, VMCPUID idCpu, PCDBGFADDRESS pAddress, void *pvBuf, size_t cbRead)
-{
-    return VERR_INTERNAL_ERROR;
-}
-VMMR3DECL(int) DBGFR3MemReadString(PVM pVM, VMCPUID idCpu, PCDBGFADDRESS pAddress, char *pszBuf, size_t cchBuf)
-{
-    return VERR_INTERNAL_ERROR;
-}
-VMMR3DECL(int) DBGFR3MemWrite(PVM pVM, VMCPUID idCpu, PCDBGFADDRESS pAddress, const void *pvBuf, size_t cbRead)
-{
-    return VERR_INTERNAL_ERROR;
-}
-VMMDECL(int) DBGFR3PagingDumpEx(PVM pVM, VMCPUID idCpu, uint32_t fFlags, uint64_t cr3, uint64_t u64FirstAddr,
+VMMR3DECL(int) DBGFR3Step(PUVM pUVM, VMCPUID idCpu)
+{
+    return VERR_INTERNAL_ERROR;
+}
+VMMR3DECL(int) DBGFR3AsSymbolByAddr(PUVM pUVM, RTDBGAS hDbgAs, PCDBGFADDRESS pAddress, PRTGCINTPTR poffDisplacement, PRTDBGSYMBOL pSymbol, PRTDBGMOD phMod)
+{
+    return VERR_INTERNAL_ERROR;
+}
+VMMR3DECL(int) DBGFR3AsSymbolByName(PUVM pUVM, RTDBGAS hDbgAs, const char *pszSymbol, PRTDBGSYMBOL pSymbol, PRTDBGMOD phMod)
+{
+    return VERR_INTERNAL_ERROR;
+}
+VMMR3DECL(int) DBGFR3MemScan(PUVM pUVM, VMCPUID idCpu, PCDBGFADDRESS pAddress, RTGCUINTPTR cbRange, RTGCUINTPTR uAlign, const void *pabNeedle, size_t cbNeedle, PDBGFADDRESS pHitAddress)
+{
+    return VERR_INTERNAL_ERROR;
+}
+VMMR3DECL(int) DBGFR3MemRead(PUVM pUVM, VMCPUID idCpu, PCDBGFADDRESS pAddress, void *pvBuf, size_t cbRead)
+{
+    return VERR_INTERNAL_ERROR;
+}
+VMMR3DECL(int) DBGFR3MemReadString(PUVM pUVM, VMCPUID idCpu, PCDBGFADDRESS pAddress, char *pszBuf, size_t cchBuf)
+{
+    return VERR_INTERNAL_ERROR;
+}
+VMMR3DECL(int) DBGFR3MemWrite(PUVM pUVM, VMCPUID idCpu, PCDBGFADDRESS pAddress, const void *pvBuf, size_t cbRead)
+{
+    return VERR_INTERNAL_ERROR;
+}
+VMMDECL(int) DBGFR3PagingDumpEx(PUVM pUVM, VMCPUID idCpu, uint32_t fFlags, uint64_t cr3, uint64_t u64FirstAddr,
                                 uint64_t u64LastAddr, uint32_t cMaxDepth, PCDBGFINFOHLP pHlp)
 {
     return VERR_INTERNAL_ERROR;
 }
-VMMR3DECL(int) DBGFR3RegNmValidate(PVM pVM, VMCPUID idDefCpu, const char *pszReg)
+VMMR3DECL(int) DBGFR3RegNmValidate(PUVM pUVM, VMCPUID idDefCpu, const char *pszReg)
 {
     if (   !strcmp(pszReg, "ah")
@@ -213,21 +203,21 @@
     return VERR_DBGF_REGISTER_NOT_FOUND;
 }
-VMMR3DECL(int) DBGFR3RegCpuQueryU8(  PVM pVM, VMCPUID idCpu, DBGFREG enmReg, uint8_t     *pu8)
-{
-    return VERR_INTERNAL_ERROR;
-}
-VMMR3DECL(int) DBGFR3RegCpuQueryU16( PVM pVM, VMCPUID idCpu, DBGFREG enmReg, uint16_t    *pu16)
-{
-    return VERR_INTERNAL_ERROR;
-}
-VMMR3DECL(int) DBGFR3RegCpuQueryU32( PVM pVM, VMCPUID idCpu, DBGFREG enmReg, uint32_t    *pu32)
-{
-    return VERR_INTERNAL_ERROR;
-}
-VMMR3DECL(int) DBGFR3RegCpuQueryU64( PVM pVM, VMCPUID idCpu, DBGFREG enmReg, uint64_t    *pu64)
-{
-    return VERR_INTERNAL_ERROR;
-}
-VMMR3DECL(int) DBGFR3RegNmQuery(PVM pVM, VMCPUID idDefCpu, const char *pszReg, PDBGFREGVAL pValue, PDBGFREGVALTYPE penmType)
+VMMR3DECL(int) DBGFR3RegCpuQueryU8(  PUVM pUVM, VMCPUID idCpu, DBGFREG enmReg, uint8_t     *pu8)
+{
+    return VERR_INTERNAL_ERROR;
+}
+VMMR3DECL(int) DBGFR3RegCpuQueryU16( PUVM pUVM, VMCPUID idCpu, DBGFREG enmReg, uint16_t    *pu16)
+{
+    return VERR_INTERNAL_ERROR;
+}
+VMMR3DECL(int) DBGFR3RegCpuQueryU32( PUVM pUVM, VMCPUID idCpu, DBGFREG enmReg, uint32_t    *pu32)
+{
+    return VERR_INTERNAL_ERROR;
+}
+VMMR3DECL(int) DBGFR3RegCpuQueryU64( PUVM pUVM, VMCPUID idCpu, DBGFREG enmReg, uint64_t    *pu64)
+{
+    return VERR_INTERNAL_ERROR;
+}
+VMMR3DECL(int) DBGFR3RegNmQuery(PUVM pUVM, VMCPUID idDefCpu, const char *pszReg, PDBGFREGVAL pValue, PDBGFREGVALTYPE penmType)
 {
     if (idDefCpu == 0 || idDefCpu == DBGFREG_HYPER_VMCPUID)
@@ -260,5 +250,5 @@
     return VERR_DBGF_REGISTER_NOT_FOUND;
 }
-VMMR3DECL(int) DBGFR3RegPrintf(PVM pVM, VMCPUID idCpu, char *pszBuf, size_t cbBuf, const char *pszFormat, ...)
+VMMR3DECL(int) DBGFR3RegPrintf(PUVM pUVM, VMCPUID idCpu, char *pszBuf, size_t cbBuf, const char *pszFormat, ...)
 {
     return VERR_INTERNAL_ERROR;
@@ -268,46 +258,50 @@
     return VERR_INTERNAL_ERROR;
 }
-VMMR3DECL(int) DBGFR3RegNmSet(PVM pVM, VMCPUID idDefCpu, const char *pszReg, PCDBGFREGVAL pValue, DBGFREGVALTYPE enmType)
-{
-    return VERR_INTERNAL_ERROR;
-}
-
-VMMR3DECL(PDBGFADDRESS) DBGFR3AddrFromPhys(PVM pVM, PDBGFADDRESS pAddress, RTGCPHYS PhysAddr)
-{
-    return NULL;
-}
-VMMR3DECL(int)  DBGFR3AddrToHostPhys(PVM pVM, VMCPUID idCpu, PDBGFADDRESS pAddress, PRTHCPHYS pHCPhys)
-{
-    return VERR_INTERNAL_ERROR;
-}
-VMMR3DECL(int)  DBGFR3AddrToVolatileR3Ptr(PVM pVM, VMCPUID idCpu, PDBGFADDRESS pAddress, bool fReadOnly, void **ppvR3Ptr)
-{
-    return VERR_INTERNAL_ERROR;
-}
-
-VMMR3DECL(int) DBGFR3OSRegister(PVM pVM, PCDBGFOSREG pReg)
-{
-    return VERR_INTERNAL_ERROR;
-}
-VMMR3DECL(int) DBGFR3OSDetect(PVM pVM, char *pszName, size_t cchName)
-{
-    return VERR_INTERNAL_ERROR;
-}
-VMMR3DECL(int) DBGFR3OSQueryNameAndVersion(PVM pVM, char *pszName, size_t cchName, char *pszVersion, size_t cchVersion)
-{
-    return VERR_INTERNAL_ERROR;
-}
-
-VMMR3DECL(int) DBGFR3SelQueryInfo(PVM pVM, VMCPUID idCpu, RTSEL Sel, uint32_t fFlags, PDBGFSELINFO pSelInfo)
-{
-    return VERR_INTERNAL_ERROR;
-}
-
-VMMR3DECL(CPUMMODE) DBGFR3CpuGetMode(PVM pVM, VMCPUID idCpu)
+VMMR3DECL(int) DBGFR3RegNmSet(PUVM pUVM, VMCPUID idDefCpu, const char *pszReg, PCDBGFREGVAL pValue, DBGFREGVALTYPE enmType)
+{
+    return VERR_INTERNAL_ERROR;
+}
+
+VMMR3DECL(PDBGFADDRESS) DBGFR3AddrFromPhys(PUVM pUVM, PDBGFADDRESS pAddress, RTGCPHYS PhysAddr)
+{
+    return NULL;
+}
+VMMR3DECL(int)  DBGFR3AddrToHostPhys(PUVM pUVM, VMCPUID idCpu, PDBGFADDRESS pAddress, PRTHCPHYS pHCPhys)
+{
+    return VERR_INTERNAL_ERROR;
+}
+VMMR3DECL(int)  DBGFR3AddrToVolatileR3Ptr(PUVM pUVM, VMCPUID idCpu, PDBGFADDRESS pAddress, bool fReadOnly, void **ppvR3Ptr)
+{
+    return VERR_INTERNAL_ERROR;
+}
+
+VMMR3DECL(int) DBGFR3OSRegister(PUVM pUVM, PCDBGFOSREG pReg)
+{
+    return VERR_INTERNAL_ERROR;
+}
+VMMR3DECL(int) DBGFR3OSDetect(PUVM pUVM, char *pszName, size_t cchName)
+{
+    return VERR_INTERNAL_ERROR;
+}
+VMMR3DECL(int) DBGFR3OSQueryNameAndVersion(PUVM pUVM, char *pszName, size_t cchName, char *pszVersion, size_t cchVersion)
+{
+    return VERR_INTERNAL_ERROR;
+}
+
+VMMR3DECL(int) DBGFR3SelQueryInfo(PUVM pUVM, VMCPUID idCpu, RTSEL Sel, uint32_t fFlags, PDBGFSELINFO pSelInfo)
+{
+    return VERR_INTERNAL_ERROR;
+}
+
+VMMR3DECL(CPUMMODE) DBGFR3CpuGetMode(PUVM pUVM, VMCPUID idCpu)
 {
     return CPUMMODE_INVALID;
 }
-
-VMMR3DECL(int) DBGFR3CoreWrite(PVM pVM, const char *pszFilename, bool fReplaceFile)
+VMMR3DECL(VMCPUID) DBGFR3CpuGetCount(PUVM pUVM)
+{
+    return 1;
+}
+
+VMMR3DECL(int) DBGFR3CoreWrite(PUVM pUVM, const char *pszFilename, bool fReplaceFile)
 {
     return VERR_INTERNAL_ERROR;
@@ -382,13 +376,4 @@
 
 
-#include <VBox/vmm/mm.h>
-
-VMMR3DECL(int) MMR3HCPhys2HCVirt(PVM pVM, RTHCPHYS HCPhys, void **ppv)
-{
-    return VERR_INTERNAL_ERROR;
-}
-
-
-
 
 #include <VBox/vmm/pgm.h>
@@ -404,14 +389,14 @@
 }
 
-VMMR3DECL(int) PGMR3DbgR3Ptr2GCPhys(PVM pVM, RTR3PTR R3Ptr, PRTGCPHYS pGCPhys)
-{
-    return VERR_INTERNAL_ERROR;
-}
-
-VMMR3DECL(int) PGMR3DbgR3Ptr2HCPhys(PVM pVM, RTR3PTR R3Ptr, PRTHCPHYS pHCPhys)
-{
-    return VERR_INTERNAL_ERROR;
-}
-VMMR3DECL(int) PGMR3DbgHCPhys2GCPhys(PVM pVM, RTHCPHYS HCPhys, PRTGCPHYS pGCPhys)
+VMMR3DECL(int) PGMR3DbgR3Ptr2GCPhys(PUVM pUVM, RTR3PTR R3Ptr, PRTGCPHYS pGCPhys)
+{
+    return VERR_INTERNAL_ERROR;
+}
+
+VMMR3DECL(int) PGMR3DbgR3Ptr2HCPhys(PUVM pUVM, RTR3PTR R3Ptr, PRTHCPHYS pHCPhys)
+{
+    return VERR_INTERNAL_ERROR;
+}
+VMMR3DECL(int) PGMR3DbgHCPhys2GCPhys(PUVM pUVM, RTHCPHYS HCPhys, PRTGCPHYS pGCPhys)
 {
     return VERR_INTERNAL_ERROR;
@@ -421,7 +406,12 @@
 #include <VBox/vmm/vmm.h>
 
-VMMDECL(PVMCPU) VMMGetCpuById(PVM pVM, RTCPUID idCpu)
-{
-    return NULL;
-}
-
+VMMR3DECL(PVMCPU) VMMR3GetCpuByIdU(PUVM pUVM, RTCPUID idCpu)
+{
+    return NULL;
+}
+
+
+VMMR3DECL(PVM) VMR3GetVM(PUVM pUVM)
+{
+    return NULL;
+}
Index: trunk/src/VBox/Devices/VMMDev/VMMDev.cpp
===================================================================
--- trunk/src/VBox/Devices/VMMDev/VMMDev.cpp	(revision 44398)
+++ trunk/src/VBox/Devices/VMMDev/VMMDev.cpp	(revision 44399)
@@ -985,6 +985,6 @@
                      * Write the core file.
                      */
-                    PVM pVM = PDMDevHlpGetVM(pDevIns);
-                    pRequestHeader->rc = DBGFR3CoreWrite(pVM, szCorePath, true /*fReplaceFile*/);
+                    PUVM pUVM = PDMDevHlpGetUVM(pDevIns);
+                    pRequestHeader->rc = DBGFR3CoreWrite(pUVM, szCorePath, true /*fReplaceFile*/);
                 }
                 else
Index: trunk/src/VBox/Devices/VMMDev/VMMDevTesting.cpp
===================================================================
--- trunk/src/VBox/Devices/VMMDev/VMMDevTesting.cpp	(revision 44398)
+++ trunk/src/VBox/Devices/VMMDev/VMMDevTesting.cpp	(revision 44399)
@@ -134,8 +134,9 @@
     if (cchValueNm && pszRegNm && *pszRegNm)
     {
-        PVM         pVM = PDMDevHlpGetVM(pDevIns);
+        PUVM        pUVM  = PDMDevHlpGetUVM(pDevIns);
+        PVM         pVM   = PDMDevHlpGetVM(pDevIns);
         VMCPUID     idCpu = VMMGetCpuId(pVM);
         uint64_t    u64Value;
-        int rc2 = DBGFR3RegNmQueryU64(pVM, idCpu, pszRegNm, &u64Value);
+        int rc2 = DBGFR3RegNmQueryU64(pUVM, idCpu, pszRegNm, &u64Value);
         if (RT_SUCCESS(rc2))
         {
@@ -144,5 +145,5 @@
             char szFormat[128], szValue[128];
             RTStrPrintf(szFormat, sizeof(szFormat), "%%VR{%s}", pszRegNm);
-            rc2 = DBGFR3RegPrintf(pVM, idCpu, szValue, sizeof(szValue), szFormat);
+            rc2 = DBGFR3RegPrintf(pUVM, idCpu, szValue, sizeof(szValue), szFormat);
             if (RT_SUCCESS(rc2))
                 VMMDEV_TESTING_OUTPUT(("testing: VALUE '%s'%*s: %16s {reg=%s}%s\n",
Index: trunk/src/VBox/Main/src-client/ConsoleImpl2.cpp
===================================================================
--- trunk/src/VBox/Main/src-client/ConsoleImpl2.cpp	(revision 44398)
+++ trunk/src/VBox/Main/src-client/ConsoleImpl2.cpp	(revision 44399)
@@ -4935,5 +4935,5 @@
                 PFNDBGFHANDLEREXT pfnHandler = (PFNDBGFHANDLEREXT)(uintptr_t)Params[0].u.pointer.addr;
                 void *pService = (void*)Params[1].u.pointer.addr;
-                DBGFR3InfoRegisterExternal(VMR3GetVM(pUVM), "guestprops", "Display the guest properties", pfnHandler, pService);
+                DBGFR3InfoRegisterExternal(pUVM, "guestprops", "Display the guest properties", pfnHandler, pService);
             }
         }
Index: trunk/src/VBox/Main/src-client/MachineDebuggerImpl.cpp
===================================================================
--- trunk/src/VBox/Main/src-client/MachineDebuggerImpl.cpp	(revision 44398)
+++ trunk/src/VBox/Main/src-client/MachineDebuggerImpl.cpp	(revision 44399)
@@ -448,5 +448,5 @@
 
 #ifdef LOG_ENABLED
-    int vrc = DBGFR3LogModifyFlags(ptrVM, aEnabled ? "enabled" : "disabled");
+    int vrc = DBGFR3LogModifyFlags(ptrVM.rawUVM(), aEnabled ? "enabled" : "disabled");
     if (RT_FAILURE(vrc))
     {
@@ -676,5 +676,5 @@
              */
             char szName[64];
-            int vrc = DBGFR3OSQueryNameAndVersion(ptrVM.raw(), szName, sizeof(szName), NULL, 0);
+            int vrc = DBGFR3OSQueryNameAndVersion(ptrVM.rawUVM(), szName, sizeof(szName), NULL, 0);
             if (RT_SUCCESS(vrc))
             {
@@ -713,5 +713,5 @@
              */
             char szVersion[256];
-            int vrc = DBGFR3OSQueryNameAndVersion(ptrVM.raw(), NULL, 0, szVersion, sizeof(szVersion));
+            int vrc = DBGFR3OSQueryNameAndVersion(ptrVM.rawUVM(), NULL, 0, szVersion, sizeof(szVersion));
             if (RT_SUCCESS(vrc))
             {
@@ -753,5 +753,5 @@
     {
         uint32_t cr4;
-        int rc = DBGFR3RegCpuQueryU32(ptrVM.raw(), 0 /*idCpu*/,  DBGFREG_CR4, &cr4); AssertRC(rc);
+        int rc = DBGFR3RegCpuQueryU32(ptrVM.rawUVM(), 0 /*idCpu*/,  DBGFREG_CR4, &cr4); AssertRC(rc);
         *aEnabled = RT_BOOL(cr4 & X86_CR4_PAE);
     }
@@ -879,5 +879,5 @@
         if (SUCCEEDED(hrc))
         {
-            int vrc = DBGFR3CoreWrite(ptrVM, strFilename.c_str(), false /*fReplaceFile*/);
+            int vrc = DBGFR3CoreWrite(ptrVM.rawUVM(), strFilename.c_str(), false /*fReplaceFile*/);
             if (RT_SUCCESS(vrc))
                 hrc = S_OK;
@@ -1039,5 +1039,5 @@
             MACHINEDEBUGGERINOFHLP Hlp;
             MachineDebuggerInfoInit(&Hlp);
-            int vrc = DBGFR3Info(ptrVM.raw(),  strName.c_str(),  strArgs.c_str(), &Hlp.Core);
+            int vrc = DBGFR3Info(ptrVM.rawUVM(),  strName.c_str(),  strArgs.c_str(), &Hlp.Core);
             if (RT_SUCCESS(vrc))
             {
@@ -1106,5 +1106,5 @@
         if (SUCCEEDED(hrc))
         {
-            int vrc = DBGFR3LogModifyFlags(ptrVM, strSettings.c_str());
+            int vrc = DBGFR3LogModifyFlags(ptrVM.rawUVM(), strSettings.c_str());
             if (RT_SUCCESS(vrc))
                 hrc = S_OK;
@@ -1131,5 +1131,5 @@
         if (SUCCEEDED(hrc))
         {
-            int vrc = DBGFR3LogModifyGroups(ptrVM, strSettings.c_str());
+            int vrc = DBGFR3LogModifyGroups(ptrVM.rawUVM(), strSettings.c_str());
             if (RT_SUCCESS(vrc))
                 hrc = S_OK;
@@ -1156,5 +1156,5 @@
         if (SUCCEEDED(hrc))
         {
-            int vrc = DBGFR3LogModifyDestinations(ptrVM, strSettings.c_str());
+            int vrc = DBGFR3LogModifyDestinations(ptrVM.rawUVM(), strSettings.c_str());
             if (RT_SUCCESS(vrc))
                 hrc = S_OK;
@@ -1208,5 +1208,5 @@
 /** @todo automatically load the DBGC plugins or this is a waste of time. */
             char szName[64];
-            int vrc = DBGFR3OSDetect(ptrVM.raw(), szName, sizeof(szName));
+            int vrc = DBGFR3OSDetect(ptrVM.rawUVM(), szName, sizeof(szName));
             if (RT_SUCCESS(vrc) && vrc != VINF_DBGF_OS_NOT_DETCTED)
             {
@@ -1283,5 +1283,5 @@
             DBGFREGVAL      Value;
             DBGFREGVALTYPE  enmType;
-            int vrc = DBGFR3RegNmQuery(ptrVM.raw(), a_idCpu, strName.c_str(), &Value, &enmType);
+            int vrc = DBGFR3RegNmQuery(ptrVM.rawUVM(), a_idCpu, strName.c_str(), &Value, &enmType);
             if (RT_SUCCESS(vrc))
             {
@@ -1331,5 +1331,5 @@
              */
             size_t cRegs;
-            int vrc = DBGFR3RegNmQueryAllCount(ptrVM.raw(), &cRegs);
+            int vrc = DBGFR3RegNmQueryAllCount(ptrVM.rawUVM(), &cRegs);
             if (RT_SUCCESS(vrc))
             {
@@ -1337,5 +1337,5 @@
                 if (paRegs)
                 {
-                    vrc = DBGFR3RegNmQueryAll(ptrVM.raw(), paRegs, cRegs);
+                    vrc = DBGFR3RegNmQueryAll(ptrVM.rawUVM(), paRegs, cRegs);
                     if (RT_SUCCESS(vrc))
                     {
Index: trunk/src/VBox/VMM/VMMAll/DBGFAll.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMAll/DBGFAll.cpp	(revision 44398)
+++ trunk/src/VBox/VMM/VMMAll/DBGFAll.cpp	(revision 44399)
@@ -33,5 +33,5 @@
  * @param   pVM         Pointer to the VM.
  */
-VMMDECL(RTGCUINTREG) DBGFBpGetDR7(PVM pVM)
+VMM_INT_DECL(RTGCUINTREG) DBGFBpGetDR7(PVM pVM)
 {
     RTGCUINTREG uDr7 = X86_DR7_GD | X86_DR7_GE | X86_DR7_LE | X86_DR7_MB1_MASK;
@@ -64,5 +64,5 @@
  * @param   pVM         Pointer to the VM.
  */
-VMMDECL(RTGCUINTREG) DBGFBpGetDR0(PVM pVM)
+VMM_INT_DECL(RTGCUINTREG) DBGFBpGetDR0(PVM pVM)
 {
     PCDBGFBP    pBp = &pVM->dbgf.s.aHwBreakpoints[0];
@@ -78,5 +78,5 @@
  * @param   pVM         Pointer to the VM.
  */
-VMMDECL(RTGCUINTREG) DBGFBpGetDR1(PVM pVM)
+VMM_INT_DECL(RTGCUINTREG) DBGFBpGetDR1(PVM pVM)
 {
     PCDBGFBP    pBp = &pVM->dbgf.s.aHwBreakpoints[1];
@@ -92,5 +92,5 @@
  * @param   pVM         Pointer to the VM.
  */
-VMMDECL(RTGCUINTREG) DBGFBpGetDR2(PVM pVM)
+VMM_INT_DECL(RTGCUINTREG) DBGFBpGetDR2(PVM pVM)
 {
     PCDBGFBP    pBp = &pVM->dbgf.s.aHwBreakpoints[2];
@@ -106,5 +106,5 @@
  * @param   pVM         Pointer to the VM.
  */
-VMMDECL(RTGCUINTREG) DBGFBpGetDR3(PVM pVM)
+VMM_INT_DECL(RTGCUINTREG) DBGFBpGetDR3(PVM pVM)
 {
     PCDBGFBP    pBp = &pVM->dbgf.s.aHwBreakpoints[3];
@@ -121,5 +121,5 @@
  * @param   pVCpu       Pointer to the VMCPU.
  */
-VMMDECL(bool) DBGFIsStepping(PVMCPU pVCpu)
+VMM_INT_DECL(bool) DBGFIsStepping(PVMCPU pVCpu)
 {
     return pVCpu->dbgf.s.fSingleSteppingRaw;
Index: trunk/src/VBox/VMM/VMMAll/IEMAll.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMAll/IEMAll.cpp	(revision 44398)
+++ trunk/src/VBox/VMM/VMMAll/IEMAll.cpp	(revision 44399)
@@ -2459,5 +2459,5 @@
         PVMCPU  pVCpu = IEMCPU_TO_VMCPU(pIemCpu);
         char    szRegs[4096];
-        DBGFR3RegPrintf(pVM, pVCpu->idCpu, &szRegs[0], sizeof(szRegs),
+        DBGFR3RegPrintf(pVM->pUVM, pVCpu->idCpu, &szRegs[0], sizeof(szRegs),
                         "rax=%016VR{rax} rbx=%016VR{rbx} rcx=%016VR{rcx} rdx=%016VR{rdx}\n"
                         "rsi=%016VR{rsi} rdi=%016VR{rdi} r8 =%016VR{r8} r9 =%016VR{r9}\n"
@@ -2487,5 +2487,5 @@
 
         char szInstr[256];
-        DBGFR3DisasInstrEx(pVM, pVCpu->idCpu, 0, 0,
+        DBGFR3DisasInstrEx(pVM->pUVM, pVCpu->idCpu, 0, 0,
                            DBGF_DISAS_FLAGS_CURRENT_GUEST | DBGF_DISAS_FLAGS_DEFAULT_MODE,
                            szInstr, sizeof(szInstr), NULL);
@@ -2836,5 +2836,5 @@
     PVMCPU  pVCpu = IEMCPU_TO_VMCPU(pIemCpu);
     char szRegs[4096];
-    DBGFR3RegPrintf(pVM, pVCpu->idCpu, &szRegs[0], sizeof(szRegs),
+    DBGFR3RegPrintf(pVM->pUVM, pVCpu->idCpu, &szRegs[0], sizeof(szRegs),
                     "rax=%016VR{rax} rbx=%016VR{rbx} rcx=%016VR{rcx} rdx=%016VR{rdx}\n"
                     "rsi=%016VR{rsi} rdi=%016VR{rdi} r8 =%016VR{r8} r9 =%016VR{r9}\n"
@@ -2864,5 +2864,5 @@
 
     char szInstr[256];
-    DBGFR3DisasInstrEx(pVM, pVCpu->idCpu, 0, 0,
+    DBGFR3DisasInstrEx(pVM->pUVM, pVCpu->idCpu, 0, 0,
                        DBGF_DISAS_FLAGS_CURRENT_GUEST | DBGF_DISAS_FLAGS_DEFAULT_MODE,
                        szInstr, sizeof(szInstr), NULL);
@@ -7791,5 +7791,5 @@
     PVMCPU   pVCpu = IEMCPU_TO_VMCPU(pIemCpu);
     char szRegs[4096];
-    DBGFR3RegPrintf(pVM, pVCpu->idCpu, &szRegs[0], sizeof(szRegs),
+    DBGFR3RegPrintf(pVM->pUVM, pVCpu->idCpu, &szRegs[0], sizeof(szRegs),
                     "rax=%016VR{rax} rbx=%016VR{rbx} rcx=%016VR{rcx} rdx=%016VR{rdx}\n"
                     "rsi=%016VR{rsi} rdi=%016VR{rdi} r8 =%016VR{r8} r9 =%016VR{r9}\n"
@@ -7819,9 +7819,9 @@
 
     char szInstr1[256];
-    DBGFR3DisasInstrEx(pVM, pVCpu->idCpu, pIemCpu->uOldCs, pIemCpu->uOldRip,
+    DBGFR3DisasInstrEx(pVM->pUVM, pVCpu->idCpu, pIemCpu->uOldCs, pIemCpu->uOldRip,
                        DBGF_DISAS_FLAGS_DEFAULT_MODE,
                        szInstr1, sizeof(szInstr1), NULL);
     char szInstr2[256];
-    DBGFR3DisasInstrEx(pVM, pVCpu->idCpu, 0, 0,
+    DBGFR3DisasInstrEx(pVM->pUVM, pVCpu->idCpu, 0, 0,
                        DBGF_DISAS_FLAGS_CURRENT_GUEST | DBGF_DISAS_FLAGS_DEFAULT_MODE,
                        szInstr2, sizeof(szInstr2), NULL);
@@ -8170,5 +8170,5 @@
         if (cDiffs != 0)
         {
-            DBGFR3Info(pVM, "cpumguest", "verbose", NULL);
+            DBGFR3Info(pVM->pUVM, "cpumguest", "verbose", NULL);
             RTAssertMsg1(NULL, __LINE__, __FILE__, __FUNCTION__);
             iemVerifyAssertMsg2(pIemCpu);
@@ -8391,5 +8391,5 @@
         char     szInstr[256];
         uint32_t cbInstr = 0;
-        DBGFR3DisasInstrEx(pVCpu->pVMR3, pVCpu->idCpu, 0, 0,
+        DBGFR3DisasInstrEx(pVCpu->pVMR3->pUVM, pVCpu->idCpu, 0, 0,
                            DBGF_DISAS_FLAGS_CURRENT_GUEST | DBGF_DISAS_FLAGS_DEFAULT_MODE,
                            szInstr, sizeof(szInstr), &cbInstr);
@@ -8410,5 +8410,5 @@
 
         if (LogIs3Enabled())
-            DBGFR3Info(pVCpu->pVMR3, "cpumguest", "verbose", NULL);
+            DBGFR3Info(pVCpu->pVMR3->pUVM, "cpumguest", "verbose", NULL);
     }
     else
Index: trunk/src/VBox/VMM/VMMAll/PGMAllBth.h
===================================================================
--- trunk/src/VBox/VMM/VMMAll/PGMAllBth.h	(revision 44398)
+++ trunk/src/VBox/VMM/VMMAll/PGMAllBth.h	(revision 44399)
@@ -3730,5 +3730,5 @@
     pgmGstGet32bitPDPtr(pVCpu);
     RTGCPHYS GCPhys;
-    rc = PGMR3DbgR3Ptr2GCPhys(pVM, pPGM->pGst32BitPdR3, &GCPhys);
+    rc = PGMR3DbgR3Ptr2GCPhys(pVM->pUVM, pPGM->pGst32BitPdR3, &GCPhys);
     AssertRCReturn(rc, 1);
     AssertMsgReturn(PGM_A20_APPLY(pVCpu, cr3 & GST_CR3_PAGE_MASK) == GCPhys, ("GCPhys=%RGp cr3=%RGp\n", GCPhys, (RTGCPHYS)cr3), false);
@@ -4066,5 +4066,5 @@
 #  ifdef IN_RING3
                                 PGMAssertHandlerAndFlagsInSync(pVM);
-                                DBGFR3PagingDumpEx(pVM, pVCpu->idCpu, DBGFPGDMP_FLAGS_CURRENT_CR3 | DBGFPGDMP_FLAGS_CURRENT_MODE
+                                DBGFR3PagingDumpEx(pVM->pUVM, pVCpu->idCpu, DBGFPGDMP_FLAGS_CURRENT_CR3 | DBGFPGDMP_FLAGS_CURRENT_MODE
                                                    | DBGFPGDMP_FLAGS_GUEST | DBGFPGDMP_FLAGS_HEADER | DBGFPGDMP_FLAGS_PRINT_CR3,
                                                    0, 0, UINT64_MAX, 99, NULL);
Index: trunk/src/VBox/VMM/VMMAll/PGMAllHandler.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMAll/PGMAllHandler.cpp	(revision 44398)
+++ trunk/src/VBox/VMM/VMMAll/PGMAllHandler.cpp	(revision 44399)
@@ -130,5 +130,5 @@
     {
 #ifdef IN_RING3
-        DBGFR3Info(pVM, "phys", NULL, NULL);
+        DBGFR3Info(pVM->pUVM, "phys", NULL, NULL);
 #endif
         AssertMsgFailed(("No RAM range for %RGp-%RGp\n", GCPhys, GCPhysLast));
@@ -184,5 +184,5 @@
 
 #if defined(IN_RING3) && defined(VBOX_STRICT)
-    DBGFR3Info(pVM, "handlers", "phys nostats", NULL);
+    DBGFR3Info(pVM->pUVM, "handlers", "phys nostats", NULL);
 #endif
     AssertMsgFailed(("Conflict! GCPhys=%RGp GCPhysLast=%RGp pszDesc=%s\n", GCPhys, GCPhysLast, pszDesc));
Index: trunk/src/VBox/VMM/VMMR3/CFGM.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMR3/CFGM.cpp	(revision 44398)
+++ trunk/src/VBox/VMM/VMMR3/CFGM.cpp	(revision 44399)
@@ -108,5 +108,6 @@
      * Register DBGF into item.
      */
-    int rc = DBGFR3InfoRegisterInternal(pVM, "cfgm", "Dumps a part of the CFGM tree. The argument indicates where to start.", cfgmR3Info);
+    int rc = DBGFR3InfoRegisterInternal(pVM, "cfgm", "Dumps a part of the CFGM tree. The argument indicates where to start.",
+                                        cfgmR3Info);
     AssertRCReturn(rc,rc);
 
Index: trunk/src/VBox/VMM/VMMR3/CPUM.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMR3/CPUM.cpp	(revision 44398)
+++ trunk/src/VBox/VMM/VMMR3/CPUM.cpp	(revision 44399)
@@ -4402,7 +4402,7 @@
                 RTCpuSetToU64(RTMpGetOnlineSet(&OnlineSet)) ));
     LogRel(("************************* CPUID dump ************************\n"));
-    DBGFR3Info(pVM, "cpuid", "verbose", DBGFR3InfoLogRelHlp());
+    DBGFR3Info(pVM->pUVM, "cpuid", "verbose", DBGFR3InfoLogRelHlp());
     LogRel(("\n"));
-    DBGFR3InfoLog(pVM, "cpuid", "verbose"); /* macro */
+    DBGFR3_INFO_LOG(pVM, "cpuid", "verbose"); /* macro */
     RTLogRelSetBuffering(fOldBuffered);
     LogRel(("******************** End of CPUID dump **********************\n"));
Index: trunk/src/VBox/VMM/VMMR3/CSAM.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMR3/CSAM.cpp	(revision 44398)
+++ trunk/src/VBox/VMM/VMMR3/CSAM.cpp	(revision 44399)
@@ -84,11 +84,14 @@
 static bool fInCSAMCodePageInvalidate = false;
 
+#ifdef VBOX_WITH_DEBUGGER
+static FNDBGCCMD csamr3CmdOn;
+static FNDBGCCMD csamr3CmdOff;
+#endif
+
+
 /*******************************************************************************
 *   Global Variables                                                           *
 *******************************************************************************/
 #ifdef VBOX_WITH_DEBUGGER
-static DECLCALLBACK(int) csamr3CmdOn(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
-static DECLCALLBACK(int) csamr3CmdOff(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
-
 /** Command descriptors. */
 static const DBGCCMD    g_aCmds[] =
@@ -2723,42 +2726,28 @@
 
 /**
- * The '.csamoff' command.
- *
- * @returns VBox status.
- * @param   pCmd        Pointer to the command descriptor (as registered).
- * @param   pCmdHlp     Pointer to command helper functions.
- * @param   pVM         Pointer to the current VM (if any).
- * @param   paArgs      Pointer to (readonly) array of arguments.
- * @param   cArgs       Number of arguments in the array.
- */
-static DECLCALLBACK(int) csamr3CmdOff(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
-{
-    DBGC_CMDHLP_REQ_VM_RET(pCmdHlp, pCmd, pVM);
+ * @callback_method_impl{FNDBGCCMD, The '.csamoff' command.}
+ */
+static DECLCALLBACK(int) csamr3CmdOff(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
+{
+    DBGC_CMDHLP_REQ_UVM_RET(pCmdHlp, pCmd, pUVM);
     NOREF(cArgs); NOREF(paArgs);
 
-    int rc = CSAMDisableScanning(pVM);
+    int rc = CSAMR3SetScanningEnabled(pUVM, false);
     if (RT_FAILURE(rc))
-        return DBGCCmdHlpFailRc(pCmdHlp, pCmd, rc, "CSAMDisableScanning");
+        return DBGCCmdHlpFailRc(pCmdHlp, pCmd, rc, "CSAMR3SetScanningEnabled");
     return DBGCCmdHlpPrintf(pCmdHlp, "CSAM Scanning disabled\n");
 }
 
 /**
- * The '.csamon' command.
- *
- * @returns VBox status.
- * @param   pCmd        Pointer to the command descriptor (as registered).
- * @param   pCmdHlp     Pointer to command helper functions.
- * @param   pVM         Pointer to the current VM (if any).
- * @param   paArgs      Pointer to (readonly) array of arguments.
- * @param   cArgs       Number of arguments in the array.
- */
-static DECLCALLBACK(int) csamr3CmdOn(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
-{
-    DBGC_CMDHLP_REQ_VM_RET(pCmdHlp, pCmd, pVM);
+ * @callback_method_impl{FNDBGCCMD, The '.csamon' command.}
+ */
+static DECLCALLBACK(int) csamr3CmdOn(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
+{
+    DBGC_CMDHLP_REQ_UVM_RET(pCmdHlp, pCmd, pUVM);
     NOREF(cArgs); NOREF(paArgs);
 
-    int rc = CSAMEnableScanning(pVM);
+    int rc = CSAMR3SetScanningEnabled(pUVM, true);
     if (RT_FAILURE(rc))
-        return DBGCCmdHlpFailRc(pCmdHlp, pCmd, rc, "CSAMEnableScanning");
+        return DBGCCmdHlpFailRc(pCmdHlp, pCmd, rc, "CSAMR3SetScanningEnabled");
     return DBGCCmdHlpPrintf(pCmdHlp, "CSAM Scanning enabled\n");
 }
Index: trunk/src/VBox/VMM/VMMR3/DBGF.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMR3/DBGF.cpp	(revision 44398)
+++ trunk/src/VBox/VMM/VMMR3/DBGF.cpp	(revision 44399)
@@ -135,13 +135,14 @@
  * @param   pVM     Pointer to the VM.
  */
-VMMR3DECL(int) DBGFR3Init(PVM pVM)
-{
-    int rc = dbgfR3InfoInit(pVM);
+VMMR3_INT_DECL(int) DBGFR3Init(PVM pVM)
+{
+    PUVM pUVM = pVM->pUVM;
+    int rc = dbgfR3InfoInit(pUVM);
     if (RT_SUCCESS(rc))
         rc = dbgfR3TraceInit(pVM);
     if (RT_SUCCESS(rc))
-        rc = dbgfR3RegInit(pVM);
+        rc = dbgfR3RegInit(pUVM);
     if (RT_SUCCESS(rc))
-        rc = dbgfR3AsInit(pVM);
+        rc = dbgfR3AsInit(pUVM);
     if (RT_SUCCESS(rc))
         rc = dbgfR3SymInit(pVM);
@@ -158,6 +159,7 @@
  * @param   pVM     Pointer to the VM.
  */
-VMMR3DECL(int) DBGFR3Term(PVM pVM)
-{
+VMMR3_INT_DECL(int) DBGFR3Term(PVM pVM)
+{
+    PUVM pUVM = pVM->pUVM;
     int rc;
 
@@ -213,9 +215,9 @@
      * Terminate the other bits.
      */
-    dbgfR3OSTerm(pVM);
-    dbgfR3AsTerm(pVM);
-    dbgfR3RegTerm(pVM);
+    dbgfR3OSTerm(pUVM);
+    dbgfR3AsTerm(pUVM);
+    dbgfR3RegTerm(pUVM);
     dbgfR3TraceTerm(pVM);
-    dbgfR3InfoTerm(pVM);
+    dbgfR3InfoTerm(pUVM);
     return VINF_SUCCESS;
 }
@@ -230,8 +232,8 @@
  * @param   offDelta    Relocation delta relative to old location.
  */
-VMMR3DECL(void) DBGFR3Relocate(PVM pVM, RTGCINTPTR offDelta)
+VMMR3_INT_DECL(void) DBGFR3Relocate(PVM pVM, RTGCINTPTR offDelta)
 {
     dbgfR3TraceRelocate(pVM);
-    dbgfR3AsRelocate(pVM, offDelta);
+    dbgfR3AsRelocate(pVM->pUVM, offDelta);
 }
 
@@ -300,5 +302,5 @@
  * @param   pVM         Pointer to the VM.
  */
-VMMR3DECL(int) DBGFR3VMMForcedAction(PVM pVM)
+VMMR3_INT_DECL(int) DBGFR3VMMForcedAction(PVM pVM)
 {
     int rc = VINF_SUCCESS;
@@ -450,4 +452,5 @@
  * @param   pVM         Pointer to the VM.
  * @param   enmEvent    The event to send.
+ * @internal
  */
 VMMR3DECL(int) DBGFR3Event(PVM pVM, DBGFEVENTTYPE enmEvent)
@@ -477,4 +480,5 @@
  * @param   pszFormat   Message which accompanies the event.
  * @param   ...         Message arguments.
+ * @internal
  */
 VMMR3DECL(int) DBGFR3EventSrc(PVM pVM, DBGFEVENTTYPE enmEvent, const char *pszFile, unsigned uLine, const char *pszFunction, const char *pszFormat, ...)
@@ -499,4 +503,5 @@
  * @param   pszFormat   Message which accompanies the event.
  * @param   args        Message arguments.
+ * @internal
  */
 VMMR3DECL(int) DBGFR3EventSrcV(PVM pVM, DBGFEVENTTYPE enmEvent, const char *pszFile, unsigned uLine, const char *pszFunction, const char *pszFormat, va_list args)
@@ -539,5 +544,5 @@
  * @param   pszMsg2     Second assertion message.
  */
-VMMR3DECL(int) DBGFR3EventAssertion(PVM pVM, DBGFEVENTTYPE enmEvent, const char *pszMsg1, const char *pszMsg2)
+VMMR3_INT_DECL(int) DBGFR3EventAssertion(PVM pVM, DBGFEVENTTYPE enmEvent, const char *pszMsg1, const char *pszMsg2)
 {
     int rc = dbgfR3EventPrologue(pVM, enmEvent);
@@ -564,5 +569,5 @@
  * @param   enmEvent    DBGFEVENT_BREAKPOINT_HYPER or DBGFEVENT_BREAKPOINT.
  */
-VMMR3DECL(int) DBGFR3EventBreakpoint(PVM pVM, DBGFEVENTTYPE enmEvent)
+VMMR3_INT_DECL(int) DBGFR3EventBreakpoint(PVM pVM, DBGFEVENTTYPE enmEvent)
 {
     int rc = dbgfR3EventPrologue(pVM, enmEvent);
@@ -857,9 +862,11 @@
  *
  * @returns VBox status code.
- * @param   pVM     Pointer to the VM.
- */
-VMMR3DECL(int) DBGFR3Attach(PVM pVM)
-{
-    VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
+ * @param   pUVM        The user mode VM handle.
+ */
+VMMR3DECL(int) DBGFR3Attach(PUVM pUVM)
+{
+    UVM_ASSERT_VALID_EXT_RETURN(pUVM, false);
+    PVM pVM = pUVM->pVM;
+    VM_ASSERT_VALID_EXT_RETURN(pVM, false);
 
     /*
@@ -905,7 +912,7 @@
  *
  * @returns VBox status code.
- * @param   pVM     Pointer to the VM.
- */
-VMMR3DECL(int) DBGFR3Detach(PVM pVM)
+ * @param   pUVM        The user mode VM handle.
+ */
+VMMR3DECL(int) DBGFR3Detach(PUVM pUVM)
 {
     LogFlow(("DBGFR3Detach:\n"));
@@ -915,4 +922,7 @@
      * Check if attached.
      */
+    UVM_ASSERT_VALID_EXT_RETURN(pUVM, false);
+    PVM pVM = pUVM->pVM;
+    VM_ASSERT_VALID_EXT_RETURN(pVM, false);
     AssertReturn(pVM->dbgf.s.fAttached, VERR_DBGF_NOT_ATTACHED);
 
@@ -951,13 +961,16 @@
  *
  * @returns VBox status. Will not return VBOX_INTERRUPTED.
- * @param   pVM         Pointer to the VM.
+ * @param   pUVM        The user mode VM handle.
  * @param   cMillies    Number of millis to wait.
  * @param   ppEvent     Where to store the event pointer.
  */
-VMMR3DECL(int) DBGFR3EventWait(PVM pVM, RTMSINTERVAL cMillies, PCDBGFEVENT *ppEvent)
+VMMR3DECL(int) DBGFR3EventWait(PUVM pUVM, RTMSINTERVAL cMillies, PCDBGFEVENT *ppEvent)
 {
     /*
      * Check state.
      */
+    UVM_ASSERT_VALID_EXT_RETURN(pUVM, false);
+    PVM pVM = pUVM->pVM;
+    VM_ASSERT_VALID_EXT_RETURN(pVM, false);
     AssertReturn(pVM->dbgf.s.fAttached, VERR_DBGF_NOT_ATTACHED);
     *ppEvent = NULL;
@@ -985,11 +998,14 @@
  *
  * @returns VBox status.
- * @param   pVM     Pointer to the VM.
- */
-VMMR3DECL(int) DBGFR3Halt(PVM pVM)
+ * @param   pUVM        The user mode VM handle.
+ */
+VMMR3DECL(int) DBGFR3Halt(PUVM pUVM)
 {
     /*
      * Check state.
      */
+    UVM_ASSERT_VALID_EXT_RETURN(pUVM, false);
+    PVM pVM = pUVM->pVM;
+    VM_ASSERT_VALID_EXT_RETURN(pVM, false);
     AssertReturn(pVM->dbgf.s.fAttached, VERR_DBGF_NOT_ATTACHED);
     RTPINGPONGSPEAKER enmSpeaker = pVM->dbgf.s.PingPong.enmSpeaker;
@@ -1012,9 +1028,13 @@
  * @returns True if halted.
  * @returns False if not halted.
- * @param   pVM     Pointer to the VM.
- */
-VMMR3DECL(bool) DBGFR3IsHalted(PVM pVM)
-{
+ * @param   pUVM        The user mode VM handle.
+ */
+VMMR3DECL(bool) DBGFR3IsHalted(PUVM pUVM)
+{
+    UVM_ASSERT_VALID_EXT_RETURN(pUVM, false);
+    PVM pVM = pUVM->pVM;
+    VM_ASSERT_VALID_EXT_RETURN(pVM, false);
     AssertReturn(pVM->dbgf.s.fAttached, false);
+
     RTPINGPONGSPEAKER enmSpeaker = pVM->dbgf.s.PingPong.enmSpeaker;
     return enmSpeaker == RTPINGPONGSPEAKER_PONG_SIGNALED
@@ -1030,9 +1050,13 @@
  * @returns True if waitable.
  * @returns False if not waitable.
- * @param   pVM     Pointer to the VM.
- */
-VMMR3DECL(bool) DBGFR3CanWait(PVM pVM)
-{
+ * @param   pUVM        The user mode VM handle.
+ */
+VMMR3DECL(bool) DBGFR3CanWait(PUVM pUVM)
+{
+    UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE);
+    PVM pVM = pUVM->pVM;
+    VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
     AssertReturn(pVM->dbgf.s.fAttached, false);
+
     return RTSemPongShouldWait(&pVM->dbgf.s.PingPong);
 }
@@ -1045,11 +1069,14 @@
  *
  * @returns VBox status.
- * @param   pVM     Pointer to the VM.
- */
-VMMR3DECL(int) DBGFR3Resume(PVM pVM)
+ * @param   pUVM        The user mode VM handle.
+ */
+VMMR3DECL(int) DBGFR3Resume(PUVM pUVM)
 {
     /*
      * Check state.
      */
+    UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE);
+    PVM pVM = pUVM->pVM;
+    VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
     AssertReturn(pVM->dbgf.s.fAttached, VERR_DBGF_NOT_ATTACHED);
     AssertReturn(RTSemPongIsSpeaker(&pVM->dbgf.s.PingPong), VERR_SEM_OUT_OF_TURN);
@@ -1073,12 +1100,15 @@
  *
  * @returns VBox status.
- * @param   pVM     Pointer to the VM.
+ * @param   pUVM        The user mode VM handle.
  * @param   idCpu   The ID of the CPU to single step on.
  */
-VMMR3DECL(int) DBGFR3Step(PVM pVM, VMCPUID idCpu)
+VMMR3DECL(int) DBGFR3Step(PUVM pUVM, VMCPUID idCpu)
 {
     /*
      * Check state.
      */
+    UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE);
+    PVM pVM = pUVM->pVM;
+    VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
     AssertReturn(pVM->dbgf.s.fAttached, VERR_DBGF_NOT_ATTACHED);
     AssertReturn(RTSemPongIsSpeaker(&pVM->dbgf.s.PingPong), VERR_SEM_OUT_OF_TURN);
@@ -1108,6 +1138,7 @@
  *
  * @thread  VCpu EMT
- */
-VMMR3DECL(int) DBGFR3PrgStep(PVMCPU pVCpu)
+ * @internal
+ */
+VMMR3_INT_DECL(int) DBGFR3PrgStep(PVMCPU pVCpu)
 {
     VMCPU_ASSERT_EMT(pVCpu);
Index: trunk/src/VBox/VMM/VMMR3/DBGFAddr.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMR3/DBGFAddr.cpp	(revision 44398)
+++ trunk/src/VBox/VMM/VMMR3/DBGFAddr.cpp	(revision 44399)
@@ -27,4 +27,6 @@
 #include "DBGFInternal.h"
 #include <VBox/vmm/vm.h>
+#include <VBox/vmm/uvm.h>
+
 #include <VBox/param.h>
 #include <VBox/err.h>
@@ -36,12 +38,14 @@
 /**
  * Checks if an address is in the HMA or not.
- * @returns true if it's inside the HMA.
- * @returns flase if it's not inside the HMA.
- * @param   pVM         Pointer to the VM.
- * @param   FlatPtr     The address in question.
- */
-DECLINLINE(bool) dbgfR3IsHMA(PVM pVM, RTGCUINTPTR FlatPtr)
-{
-    return MMHyperIsInsideArea(pVM, FlatPtr);
+ *
+ * @retval  true if it's inside the HMA.
+ * @retval  flase if it's not inside the HMA.
+ *
+ * @param   pUVM            The user mode VM handle.
+ * @param   FlatPtr         The address in question.
+ */
+DECLINLINE(bool) dbgfR3IsHMA(PUVM pUVM, RTGCUINTPTR FlatPtr)
+{
+    return MMHyperIsInsideArea(pUVM->pVM, FlatPtr);
 }
 
@@ -92,13 +96,15 @@
  *
  * @returns VBox status code.
- * @param   pVM         Pointer to the VM.
- * @param   idCpu       The CPU ID.
- * @param   pAddress    Where to store the mixed address.
- * @param   Sel         The selector part.
- * @param   off         The offset part.
- */
-VMMR3DECL(int) DBGFR3AddrFromSelOff(PVM pVM, VMCPUID idCpu, PDBGFADDRESS pAddress, RTSEL Sel, RTUINTPTR off)
-{
-    AssertReturn(idCpu < pVM->cCpus, VERR_INVALID_PARAMETER);
+ * @param   pUVM            The user mode VM handle.
+ * @param   idCpu           The CPU ID.
+ * @param   pAddress        Where to store the mixed address.
+ * @param   Sel             The selector part.
+ * @param   off             The offset part.
+ */
+VMMR3DECL(int) DBGFR3AddrFromSelOff(PUVM pUVM, VMCPUID idCpu, PDBGFADDRESS pAddress, RTSEL Sel, RTUINTPTR off)
+{
+    UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE);
+    VM_ASSERT_VALID_EXT_RETURN(pUVM->pVM, VERR_INVALID_VM_HANDLE);
+    AssertReturn(idCpu < pUVM->cCpus, VERR_INVALID_PARAMETER);
 
     pAddress->Sel = Sel;
@@ -107,5 +113,5 @@
     {
         DBGFSELINFO SelInfo;
-        int rc = DBGFR3SelQueryInfo(pVM, idCpu, Sel, DBGFSELQI_FLAGS_DT_GUEST | DBGFSELQI_FLAGS_DT_ADJ_64BIT_MODE, &SelInfo);
+        int rc = DBGFR3SelQueryInfo(pUVM, idCpu, Sel, DBGFSELQI_FLAGS_DT_GUEST | DBGFSELQI_FLAGS_DT_ADJ_64BIT_MODE, &SelInfo);
         if (RT_FAILURE(rc))
             return rc;
@@ -120,5 +126,5 @@
     }
     pAddress->fFlags |= DBGFADDRESS_FLAGS_VALID;
-    if (dbgfR3IsHMA(pVM, pAddress->FlatPtr))
+    if (dbgfR3IsHMA(pUVM, pAddress->FlatPtr))
         pAddress->fFlags |= DBGFADDRESS_FLAGS_HMA;
 
@@ -132,12 +138,15 @@
  *
  * @returns VBox status code.
- * @param   pVM         Pointer to the VM.
- * @param   idCpu       The CPU ID.
- * @param   pAddress    Where to store the mixed address.
- * @param   pSelInfo    The selector info.
- * @param   off         The offset part.
- */
-VMMR3DECL(int) DBGFR3AddrFromSelInfoOff(PVM pVM, PDBGFADDRESS pAddress, PCDBGFSELINFO pSelInfo, RTUINTPTR off)
-{
+ * @param   pUVM            The user mode VM handle.
+ * @param   idCpu           The CPU ID.
+ * @param   pAddress        Where to store the mixed address.
+ * @param   pSelInfo        The selector info.
+ * @param   off             The offset part.
+ */
+VMMR3DECL(int) DBGFR3AddrFromSelInfoOff(PUVM pUVM, PDBGFADDRESS pAddress, PCDBGFSELINFO pSelInfo, RTUINTPTR off)
+{
+    UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE);
+    VM_ASSERT_VALID_EXT_RETURN(pUVM->pVM, VERR_INVALID_VM_HANDLE);
+
     pAddress->Sel = pSelInfo->Sel;
     pAddress->off = off;
@@ -145,7 +154,9 @@
     if (RT_FAILURE(rc))
         return rc;
+
     pAddress->fFlags |= DBGFADDRESS_FLAGS_VALID;
-    if (dbgfR3IsHMA(pVM, pAddress->FlatPtr))
+    if (dbgfR3IsHMA(pUVM, pAddress->FlatPtr))
         pAddress->fFlags |= DBGFADDRESS_FLAGS_HMA;
+
     return VINF_SUCCESS;
 }
@@ -156,15 +167,17 @@
  *
  * @returns pAddress.
- * @param   pVM         Pointer to the VM.
- * @param   pAddress    Where to store the mixed address.
- * @param   FlatPtr     The flat pointer.
- */
-VMMR3DECL(PDBGFADDRESS) DBGFR3AddrFromFlat(PVM pVM, PDBGFADDRESS pAddress, RTGCUINTPTR FlatPtr)
-{
+ * @param   pUVM            The user mode VM handle.
+ * @param   pAddress        Where to store the mixed address.
+ * @param   FlatPtr         The flat pointer.
+ */
+VMMR3DECL(PDBGFADDRESS) DBGFR3AddrFromFlat(PUVM pUVM, PDBGFADDRESS pAddress, RTGCUINTPTR FlatPtr)
+{
+    UVM_ASSERT_VALID_EXT_RETURN(pUVM, NULL);
+    VM_ASSERT_VALID_EXT_RETURN(pUVM->pVM, NULL);
     pAddress->Sel     = DBGF_SEL_FLAT;
     pAddress->off     = FlatPtr;
     pAddress->FlatPtr = FlatPtr;
     pAddress->fFlags  = DBGFADDRESS_FLAGS_FLAT | DBGFADDRESS_FLAGS_VALID;
-    if (dbgfR3IsHMA(pVM, pAddress->FlatPtr))
+    if (dbgfR3IsHMA(pUVM, pAddress->FlatPtr))
         pAddress->fFlags |= DBGFADDRESS_FLAGS_HMA;
     return pAddress;
@@ -176,11 +189,11 @@
  *
  * @returns pAddress.
- * @param   pVM         Pointer to the VM.
- * @param   pAddress    Where to store the mixed address.
- * @param   PhysAddr    The guest physical address.
- */
-VMMR3DECL(PDBGFADDRESS) DBGFR3AddrFromPhys(PVM pVM, PDBGFADDRESS pAddress, RTGCPHYS PhysAddr)
-{
-    NOREF(pVM);
+ * @param   pUVM            The user mode VM handle.
+ * @param   pAddress        Where to store the mixed address.
+ * @param   PhysAddr        The guest physical address.
+ */
+VMMR3DECL(PDBGFADDRESS) DBGFR3AddrFromPhys(PUVM pUVM, PDBGFADDRESS pAddress, RTGCPHYS PhysAddr)
+{
+    UVM_ASSERT_VALID_EXT_RETURN(pUVM, NULL);
     pAddress->Sel     = DBGF_SEL_FLAT;
     pAddress->off     = PhysAddr;
@@ -196,10 +209,10 @@
  * @returns true if valid.
  * @returns false if invalid.
- * @param   pVM         Pointer to the VM.
- * @param   pAddress    The address to validate.
- */
-VMMR3DECL(bool) DBGFR3AddrIsValid(PVM pVM, PCDBGFADDRESS pAddress)
-{
-    NOREF(pVM);
+ * @param   pUVM            The user mode VM handle.
+ * @param   pAddress        The address to validate.
+ */
+VMMR3DECL(bool) DBGFR3AddrIsValid(PUVM pUVM, PCDBGFADDRESS pAddress)
+{
+    UVM_ASSERT_VALID_EXT_RETURN(pUVM, false);
     if (!VALID_PTR(pAddress))
         return false;
@@ -241,5 +254,5 @@
  * @retval  VERR_PAGE_MAP_LEVEL4_NOT_PRESENT
  *
- * @param   pVM             Pointer to the VM.
+ * @param   pUVM            The user mode VM handle.
  * @param   idCpu           The ID of the CPU context to convert virtual
  *                          addresses.
@@ -247,5 +260,5 @@
  * @param   pGCPhys         Where to return the physical address.
  */
-VMMR3DECL(int)  DBGFR3AddrToPhys(PVM pVM, VMCPUID idCpu, PDBGFADDRESS pAddress, PRTGCPHYS pGCPhys)
+VMMR3DECL(int)  DBGFR3AddrToPhys(PUVM pUVM, VMCPUID idCpu, PDBGFADDRESS pAddress, PRTGCPHYS pGCPhys)
 {
     /*
@@ -256,6 +269,8 @@
     AssertPtr(pAddress);
     AssertReturn(DBGFADDRESS_IS_VALID(pAddress), VERR_INVALID_PARAMETER);
-    VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_STATE);
-    AssertReturn(idCpu < pVM->cCpus, VERR_INVALID_PARAMETER);
+    UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_STATE);
+    PVM pVM = pUVM->pVM;
+    VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
+    AssertReturn(idCpu < pUVM->cCpus, VERR_INVALID_PARAMETER);
 
     /*
@@ -276,6 +291,6 @@
             rc = dbgfR3AddrToPhysOnVCpu(pVCpu, pAddress, pGCPhys);
         else
-            rc = VMR3ReqPriorityCallWait(pVCpu->pVMR3, pVCpu->idCpu,
-                                         (PFNRT)dbgfR3AddrToPhysOnVCpu, 3, pVCpu, pAddress, pGCPhys);
+            rc = VMR3ReqPriorityCallWaitU(pUVM, pVCpu->idCpu,
+                                          (PFNRT)dbgfR3AddrToPhysOnVCpu, 3, pVCpu, pAddress, pGCPhys);
     }
     return rc;
@@ -299,5 +314,5 @@
  * @retval  VERR_PGM_INVALID_GC_PHYSICAL_ADDRESS
  *
- * @param   pVM             Pointer to the VM.
+ * @param   pUVM            The user mode VM handle.
  * @param   idCpu           The ID of the CPU context to convert virtual
  *                          addresses.
@@ -305,5 +320,5 @@
  * @param   pHCPhys         Where to return the physical address.
  */
-VMMR3DECL(int)  DBGFR3AddrToHostPhys(PVM pVM, VMCPUID idCpu, PDBGFADDRESS pAddress, PRTHCPHYS pHCPhys)
+VMMR3DECL(int)  DBGFR3AddrToHostPhys(PUVM pUVM, VMCPUID idCpu, PDBGFADDRESS pAddress, PRTHCPHYS pHCPhys)
 {
     /*
@@ -314,6 +329,8 @@
     AssertPtr(pAddress);
     AssertReturn(DBGFADDRESS_IS_VALID(pAddress), VERR_INVALID_PARAMETER);
-    VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_STATE);
-    AssertReturn(idCpu < pVM->cCpus, VERR_INVALID_PARAMETER);
+    UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_STATE);
+    PVM pVM = pUVM->pVM;
+    VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
+    AssertReturn(idCpu < pUVM->cCpus, VERR_INVALID_PARAMETER);
 
     /*
@@ -326,5 +343,5 @@
     {
         RTGCPHYS GCPhys;
-        rc = DBGFR3AddrToPhys(pVM, idCpu, pAddress, &GCPhys);
+        rc = DBGFR3AddrToPhys(pUVM, idCpu, pAddress, &GCPhys);
         if (RT_SUCCESS(rc))
             rc = PGMPhysGCPhys2HCPhys(pVM, pAddress->FlatPtr, pHCPhys);
@@ -339,5 +356,5 @@
  * @returns VBox status code.
  *
- * @param   pVM             Pointer to the VM.
+ * @param   pUVM            The user mode VM handle.
  * @param   idCpu           The ID of the CPU context.
  * @param   pAddress        The address.
@@ -345,6 +362,9 @@
  * @param   ppvR3Ptr        Where to return the address.
  */
-static DECLCALLBACK(int) dbgfR3AddrToVolatileR3PtrOnVCpu(PVM pVM, VMCPUID idCpu, PDBGFADDRESS pAddress, bool fReadOnly, void **ppvR3Ptr)
-{
+static DECLCALLBACK(int) dbgfR3AddrToVolatileR3PtrOnVCpu(PUVM pUVM, VMCPUID idCpu, PDBGFADDRESS pAddress, bool fReadOnly,
+                                                         void **ppvR3Ptr)
+{
+    PVM pVM = pUVM->pVM;
+    VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
     Assert(idCpu == VMMGetCpuId(pVM));
 
@@ -410,5 +430,5 @@
  * @retval  VERR_PGM_INVALID_GC_PHYSICAL_ADDRESS
  *
- * @param   pVM             Pointer to the VM.
+ * @param   pUVM            The user mode VM handle.
  * @param   idCpu           The ID of the CPU context to convert virtual
  *                          addresses.
@@ -419,5 +439,5 @@
  * @param   ppvR3Ptr        Where to return the address.
  */
-VMMR3DECL(int)  DBGFR3AddrToVolatileR3Ptr(PVM pVM, VMCPUID idCpu, PDBGFADDRESS pAddress, bool fReadOnly, void **ppvR3Ptr)
+VMMR3DECL(int)  DBGFR3AddrToVolatileR3Ptr(PUVM pUVM, VMCPUID idCpu, PDBGFADDRESS pAddress, bool fReadOnly, void **ppvR3Ptr)
 {
     /*
@@ -428,11 +448,12 @@
     AssertPtr(pAddress);
     AssertReturn(DBGFADDRESS_IS_VALID(pAddress), VERR_INVALID_PARAMETER);
-    VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_STATE);
-    AssertReturn(idCpu < pVM->cCpus, VERR_INVALID_PARAMETER);
+    UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_STATE);
+    AssertReturn(idCpu < pUVM->cCpus, VERR_INVALID_PARAMETER);
 
     /*
      * Convert it.
      */
-    return VMR3ReqPriorityCallWait(pVM, idCpu, (PFNRT)dbgfR3AddrToVolatileR3PtrOnVCpu, 5, pVM, idCpu, pAddress, fReadOnly, ppvR3Ptr);
+    return VMR3ReqPriorityCallWaitU(pUVM, idCpu, (PFNRT)dbgfR3AddrToVolatileR3PtrOnVCpu, 5,
+                                    pUVM, idCpu, pAddress, fReadOnly, ppvR3Ptr);
 }
 
Index: trunk/src/VBox/VMM/VMMR3/DBGFAddrSpace.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMR3/DBGFAddrSpace.cpp	(revision 44398)
+++ trunk/src/VBox/VMM/VMMR3/DBGFAddrSpace.cpp	(revision 44399)
@@ -5,5 +5,5 @@
 
 /*
- * Copyright (C) 2008 Oracle Corporation
+ * Copyright (C) 2008-2013 Oracle Corporation
  *
  * This file is part of VirtualBox Open Source Edition (OSE), as
@@ -42,4 +42,5 @@
 #include <VBox/vmm/mm.h>
 #include "DBGFInternal.h"
+#include <VBox/vmm/uvm.h>
 #include <VBox/vmm/vm.h>
 #include <VBox/err.h>
@@ -79,8 +80,8 @@
 typedef struct DBGFR3ASLOADOPENDATA
 {
-    const char *pszModName;
-    RTGCUINTPTR uSubtrahend;
-    uint32_t fFlags;
-    RTDBGMOD hMod;
+    const char     *pszModName;
+    RTGCUINTPTR     uSubtrahend;
+    uint32_t        fFlags;
+    RTDBGMOD        hMod;
 } DBGFR3ASLOADOPENDATA;
 
@@ -101,28 +102,28 @@
 *******************************************************************************/
 /** Locks the address space database for writing. */
-#define DBGF_AS_DB_LOCK_WRITE(pVM) \
+#define DBGF_AS_DB_LOCK_WRITE(pUVM) \
     do { \
-        int rcSem = RTSemRWRequestWrite((pVM)->dbgf.s.hAsDbLock, RT_INDEFINITE_WAIT); \
+        int rcSem = RTSemRWRequestWrite((pUVM)->dbgf.s.hAsDbLock, RT_INDEFINITE_WAIT); \
         AssertRC(rcSem); \
     } while (0)
 
 /** Unlocks the address space database after writing. */
-#define DBGF_AS_DB_UNLOCK_WRITE(pVM) \
+#define DBGF_AS_DB_UNLOCK_WRITE(pUVM) \
     do { \
-        int rcSem = RTSemRWReleaseWrite((pVM)->dbgf.s.hAsDbLock); \
+        int rcSem = RTSemRWReleaseWrite((pUVM)->dbgf.s.hAsDbLock); \
         AssertRC(rcSem); \
     } while (0)
 
 /** Locks the address space database for reading. */
-#define DBGF_AS_DB_LOCK_READ(pVM) \
+#define DBGF_AS_DB_LOCK_READ(pUVM) \
     do { \
-        int rcSem = RTSemRWRequestRead((pVM)->dbgf.s.hAsDbLock, RT_INDEFINITE_WAIT); \
+        int rcSem = RTSemRWRequestRead((pUVM)->dbgf.s.hAsDbLock, RT_INDEFINITE_WAIT); \
         AssertRC(rcSem); \
     } while (0)
 
 /** Unlocks the address space database after reading. */
-#define DBGF_AS_DB_UNLOCK_READ(pVM) \
+#define DBGF_AS_DB_UNLOCK_READ(pUVM) \
     do { \
-        int rcSem = RTSemRWReleaseRead((pVM)->dbgf.s.hAsDbLock); \
+        int rcSem = RTSemRWReleaseRead((pUVM)->dbgf.s.hAsDbLock); \
         AssertRC(rcSem); \
     } while (0)
@@ -134,12 +135,12 @@
  *
  * @returns VBox status code.
- * @param   pVM             Pointer to the VM.
- */
-int dbgfR3AsInit(PVM pVM)
+ * @param   pUVM        The user mode VM handle.
+ */
+int dbgfR3AsInit(PUVM pUVM)
 {
     /*
      * Create the semaphore.
      */
-    int rc = RTSemRWCreate(&pVM->dbgf.s.hAsDbLock);
+    int rc = RTSemRWCreate(&pUVM->dbgf.s.hAsDbLock);
     AssertRCReturn(rc, rc);
 
@@ -150,34 +151,34 @@
     rc = RTDbgAsCreate(&hDbgAs, 0, RTGCPTR_MAX, "Global");
     AssertRCReturn(rc, rc);
-    rc = DBGFR3AsAdd(pVM, hDbgAs, NIL_RTPROCESS);
+    rc = DBGFR3AsAdd(pUVM, hDbgAs, NIL_RTPROCESS);
     AssertRCReturn(rc, rc);
     RTDbgAsRetain(hDbgAs);
-    pVM->dbgf.s.ahAsAliases[DBGF_AS_ALIAS_2_INDEX(DBGF_AS_GLOBAL)] = hDbgAs;
+    pUVM->dbgf.s.ahAsAliases[DBGF_AS_ALIAS_2_INDEX(DBGF_AS_GLOBAL)] = hDbgAs;
 
     RTDbgAsRetain(hDbgAs);
-    pVM->dbgf.s.ahAsAliases[DBGF_AS_ALIAS_2_INDEX(DBGF_AS_KERNEL)] = hDbgAs;
+    pUVM->dbgf.s.ahAsAliases[DBGF_AS_ALIAS_2_INDEX(DBGF_AS_KERNEL)] = hDbgAs;
 
     rc = RTDbgAsCreate(&hDbgAs, 0, RTGCPHYS_MAX, "Physical");
     AssertRCReturn(rc, rc);
-    rc = DBGFR3AsAdd(pVM, hDbgAs, NIL_RTPROCESS);
+    rc = DBGFR3AsAdd(pUVM, hDbgAs, NIL_RTPROCESS);
     AssertRCReturn(rc, rc);
     RTDbgAsRetain(hDbgAs);
-    pVM->dbgf.s.ahAsAliases[DBGF_AS_ALIAS_2_INDEX(DBGF_AS_PHYS)] = hDbgAs;
+    pUVM->dbgf.s.ahAsAliases[DBGF_AS_ALIAS_2_INDEX(DBGF_AS_PHYS)] = hDbgAs;
 
     rc = RTDbgAsCreate(&hDbgAs, 0, RTRCPTR_MAX, "HyperRawMode");
     AssertRCReturn(rc, rc);
-    rc = DBGFR3AsAdd(pVM, hDbgAs, NIL_RTPROCESS);
+    rc = DBGFR3AsAdd(pUVM, hDbgAs, NIL_RTPROCESS);
     AssertRCReturn(rc, rc);
     RTDbgAsRetain(hDbgAs);
-    pVM->dbgf.s.ahAsAliases[DBGF_AS_ALIAS_2_INDEX(DBGF_AS_RC)] = hDbgAs;
+    pUVM->dbgf.s.ahAsAliases[DBGF_AS_ALIAS_2_INDEX(DBGF_AS_RC)] = hDbgAs;
     RTDbgAsRetain(hDbgAs);
-    pVM->dbgf.s.ahAsAliases[DBGF_AS_ALIAS_2_INDEX(DBGF_AS_RC_AND_GC_GLOBAL)] = hDbgAs;
+    pUVM->dbgf.s.ahAsAliases[DBGF_AS_ALIAS_2_INDEX(DBGF_AS_RC_AND_GC_GLOBAL)] = hDbgAs;
 
     rc = RTDbgAsCreate(&hDbgAs, 0, RTR0PTR_MAX, "HyperRing0");
     AssertRCReturn(rc, rc);
-    rc = DBGFR3AsAdd(pVM, hDbgAs, NIL_RTPROCESS);
+    rc = DBGFR3AsAdd(pUVM, hDbgAs, NIL_RTPROCESS);
     AssertRCReturn(rc, rc);
     RTDbgAsRetain(hDbgAs);
-    pVM->dbgf.s.ahAsAliases[DBGF_AS_ALIAS_2_INDEX(DBGF_AS_R0)] = hDbgAs;
+    pUVM->dbgf.s.ahAsAliases[DBGF_AS_ALIAS_2_INDEX(DBGF_AS_R0)] = hDbgAs;
 
     return VINF_SUCCESS;
@@ -207,23 +208,23 @@
  * Terminates the address space parts of DBGF.
  *
- * @param   pVM             Pointer to the VM.
- */
-void dbgfR3AsTerm(PVM pVM)
+ * @param   pUVM        The user mode VM handle.
+ */
+void dbgfR3AsTerm(PUVM pUVM)
 {
     /*
      * Create the semaphore.
      */
-    int rc = RTSemRWDestroy(pVM->dbgf.s.hAsDbLock);
+    int rc = RTSemRWDestroy(pUVM->dbgf.s.hAsDbLock);
     AssertRC(rc);
-    pVM->dbgf.s.hAsDbLock = NIL_RTSEMRW;
+    pUVM->dbgf.s.hAsDbLock = NIL_RTSEMRW;
 
     /*
      * Release all the address spaces.
      */
-    RTAvlPVDestroy(&pVM->dbgf.s.AsHandleTree, dbgfR3AsTermDestroyNode, NULL);
-    for (size_t i = 0; i < RT_ELEMENTS(pVM->dbgf.s.ahAsAliases); i++)
-    {
-        RTDbgAsRelease(pVM->dbgf.s.ahAsAliases[i]);
-        pVM->dbgf.s.ahAsAliases[i] = NIL_RTDBGAS;
+    RTAvlPVDestroy(&pUVM->dbgf.s.AsHandleTree, dbgfR3AsTermDestroyNode, NULL);
+    for (size_t i = 0; i < RT_ELEMENTS(pUVM->dbgf.s.ahAsAliases); i++)
+    {
+        RTDbgAsRelease(pUVM->dbgf.s.ahAsAliases[i]);
+        pUVM->dbgf.s.ahAsAliases[i] = NIL_RTDBGAS;
     }
 }
@@ -233,11 +234,11 @@
  * Relocates the RC address space.
  *
- * @param   pVM             Pointer to the VM.
- * @param   offDelta        The relocation delta.
- */
-void dbgfR3AsRelocate(PVM pVM, RTGCUINTPTR offDelta)
+ * @param   pUVM        The user mode VM handle.
+ * @param   offDelta    The relocation delta.
+ */
+void dbgfR3AsRelocate(PUVM pUVM, RTGCUINTPTR offDelta)
 {
     /** @todo */
-    NOREF(pVM); NOREF(offDelta);
+    NOREF(pUVM); NOREF(offDelta);
 }
 
@@ -247,15 +248,15 @@
  *
  * @returns VBox status code.
- * @param   pVM             Pointer to the VM.
- * @param   hDbgAs          The address space handle. The reference of the
- *                          caller will NOT be consumed.
- * @param   ProcId          The process id or NIL_RTPROCESS.
- */
-VMMR3DECL(int) DBGFR3AsAdd(PVM pVM, RTDBGAS hDbgAs, RTPROCESS ProcId)
+ * @param   pUVM        The user mode VM handle.
+ * @param   hDbgAs      The address space handle. The reference of the caller
+ *                      will NOT be consumed.
+ * @param   ProcId      The process id or NIL_RTPROCESS.
+ */
+VMMR3DECL(int) DBGFR3AsAdd(PUVM pUVM, RTDBGAS hDbgAs, RTPROCESS ProcId)
 {
     /*
      * Input validation.
      */
-    VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
+    UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE);
     const char *pszName = RTDbgAsName(hDbgAs);
     if (!pszName)
@@ -269,5 +270,5 @@
      */
     int rc = VERR_NO_MEMORY;
-    PDBGFASDBNODE pDbNode = (PDBGFASDBNODE)MMR3HeapAlloc(pVM, MM_TAG_DBGF_AS, sizeof(*pDbNode));
+    PDBGFASDBNODE pDbNode = (PDBGFASDBNODE)MMR3HeapAllocU(pUVM, MM_TAG_DBGF_AS, sizeof(*pDbNode));
     if (pDbNode)
     {
@@ -276,17 +277,17 @@
         pDbNode->NameCore.pszString = pszName;
         pDbNode->NameCore.cchString = strlen(pszName);
-        DBGF_AS_DB_LOCK_WRITE(pVM);
-        if (RTStrSpaceInsert(&pVM->dbgf.s.AsNameSpace, &pDbNode->NameCore))
+        DBGF_AS_DB_LOCK_WRITE(pUVM);
+        if (RTStrSpaceInsert(&pUVM->dbgf.s.AsNameSpace, &pDbNode->NameCore))
         {
-            if (RTAvlPVInsert(&pVM->dbgf.s.AsHandleTree, &pDbNode->HandleCore))
+            if (RTAvlPVInsert(&pUVM->dbgf.s.AsHandleTree, &pDbNode->HandleCore))
             {
-                DBGF_AS_DB_UNLOCK_WRITE(pVM);
+                DBGF_AS_DB_UNLOCK_WRITE(pUVM);
                 return VINF_SUCCESS;
             }
 
             /* bail out */
-            RTStrSpaceRemove(&pVM->dbgf.s.AsNameSpace, pszName);
+            RTStrSpaceRemove(&pUVM->dbgf.s.AsNameSpace, pszName);
         }
-        DBGF_AS_DB_UNLOCK_WRITE(pVM);
+        DBGF_AS_DB_UNLOCK_WRITE(pUVM);
         MMR3HeapFree(pDbNode);
     }
@@ -305,8 +306,8 @@
  * @retval  VERR_NOT_FOUND if not found in the address space database.
  *
- * @param   pVM             Pointer to the VM.
- * @param   hDbgAs          The address space handle. Aliases are not allowed.
- */
-VMMR3DECL(int) DBGFR3AsDelete(PVM pVM, RTDBGAS hDbgAs)
+ * @param   pUVM        The user mode VM handle.
+ * @param   hDbgAs      The address space handle. Aliases are not allowed.
+ */
+VMMR3DECL(int) DBGFR3AsDelete(PUVM pUVM, RTDBGAS hDbgAs)
 {
     /*
@@ -314,5 +315,5 @@
      * the lock as well as validated.
      */
-    VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
+    UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE);
     if (hDbgAs == NIL_RTDBGAS)
         return VINF_SUCCESS;
@@ -322,13 +323,13 @@
     RTDbgAsRelease(hDbgAs);
 
-    DBGF_AS_DB_LOCK_WRITE(pVM);
+    DBGF_AS_DB_LOCK_WRITE(pUVM);
 
     /*
      * You cannot delete any of the aliases.
      */
-    for (size_t i = 0; i < RT_ELEMENTS(pVM->dbgf.s.ahAsAliases); i++)
-        if (pVM->dbgf.s.ahAsAliases[i] == hDbgAs)
+    for (size_t i = 0; i < RT_ELEMENTS(pUVM->dbgf.s.ahAsAliases); i++)
+        if (pUVM->dbgf.s.ahAsAliases[i] == hDbgAs)
         {
-            DBGF_AS_DB_UNLOCK_WRITE(pVM);
+            DBGF_AS_DB_UNLOCK_WRITE(pUVM);
             return VERR_SHARING_VIOLATION;
         }
@@ -337,15 +338,15 @@
      * Ok, try remove it from the database.
      */
-    PDBGFASDBNODE pDbNode = (PDBGFASDBNODE)RTAvlPVRemove(&pVM->dbgf.s.AsHandleTree, hDbgAs);
+    PDBGFASDBNODE pDbNode = (PDBGFASDBNODE)RTAvlPVRemove(&pUVM->dbgf.s.AsHandleTree, hDbgAs);
     if (!pDbNode)
     {
-        DBGF_AS_DB_UNLOCK_WRITE(pVM);
+        DBGF_AS_DB_UNLOCK_WRITE(pUVM);
         return VERR_NOT_FOUND;
     }
-    RTStrSpaceRemove(&pVM->dbgf.s.AsNameSpace, pDbNode->NameCore.pszString);
+    RTStrSpaceRemove(&pUVM->dbgf.s.AsNameSpace, pDbNode->NameCore.pszString);
     if (pDbNode->PidCore.Key != NIL_RTPROCESS)
-        RTAvlU32Remove(&pVM->dbgf.s.AsPidTree, pDbNode->PidCore.Key);
-
-    DBGF_AS_DB_UNLOCK_WRITE(pVM);
+        RTAvlU32Remove(&pUVM->dbgf.s.AsPidTree, pDbNode->PidCore.Key);
+
+    DBGF_AS_DB_UNLOCK_WRITE(pUVM);
 
     /*
@@ -366,19 +367,19 @@
  *
  * @returns VBox status code.
- * @param   pVM             Pointer to the VM.
- * @param   hAlias          The alias to change.
- * @param   hAliasFor       The address space hAlias should be an alias for.
- *                          This can be an alias. The caller's reference to
- *                          this address space will NOT be consumed.
- */
-VMMR3DECL(int) DBGFR3AsSetAlias(PVM pVM, RTDBGAS hAlias, RTDBGAS hAliasFor)
+ * @param   pUVM        The user mode VM handle.
+ * @param   hAlias      The alias to change.
+ * @param   hAliasFor   The address space hAlias should be an alias for.  This
+ *                      can be an alias. The caller's reference to this address
+ *                      space will NOT be consumed.
+ */
+VMMR3DECL(int) DBGFR3AsSetAlias(PUVM pUVM, RTDBGAS hAlias, RTDBGAS hAliasFor)
 {
     /*
      * Input validation.
      */
-    VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
+    UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE);
     AssertMsgReturn(DBGF_AS_IS_ALIAS(hAlias), ("%p\n", hAlias), VERR_INVALID_PARAMETER);
     AssertMsgReturn(!DBGF_AS_IS_FIXED_ALIAS(hAlias), ("%p\n", hAlias), VERR_INVALID_PARAMETER);
-    RTDBGAS hRealAliasFor = DBGFR3AsResolveAndRetain(pVM, hAliasFor);
+    RTDBGAS hRealAliasFor = DBGFR3AsResolveAndRetain(pUVM, hAliasFor);
     if (hRealAliasFor == NIL_RTDBGAS)
         return VERR_INVALID_HANDLE;
@@ -388,6 +389,6 @@
      */
     int rc = VERR_NOT_FOUND;
-    DBGF_AS_DB_LOCK_WRITE(pVM);
-    if (RTAvlPVGet(&pVM->dbgf.s.AsHandleTree, hRealAliasFor))
+    DBGF_AS_DB_LOCK_WRITE(pUVM);
+    if (RTAvlPVGet(&pUVM->dbgf.s.AsHandleTree, hRealAliasFor))
     {
         /*
@@ -395,10 +396,10 @@
          */
         RTDBGAS hAsOld;
-        ASMAtomicXchgHandle(&pVM->dbgf.s.ahAsAliases[DBGF_AS_ALIAS_2_INDEX(hAlias)], hRealAliasFor, &hAsOld);
+        ASMAtomicXchgHandle(&pUVM->dbgf.s.ahAsAliases[DBGF_AS_ALIAS_2_INDEX(hAlias)], hRealAliasFor, &hAsOld);
         uint32_t cRefs = RTDbgAsRelease(hAsOld);
         Assert(cRefs > 0); Assert(cRefs != UINT32_MAX); NOREF(cRefs);
         rc = VINF_SUCCESS;
     }
-    DBGF_AS_DB_UNLOCK_WRITE(pVM);
+    DBGF_AS_DB_UNLOCK_WRITE(pUVM);
 
     return rc;
@@ -437,21 +438,21 @@
  * Lazily populates the specified address space.
  *
- * @param   pVM                 Pointer to the VM.
- * @param   hAlias              The alias.
- */
-static void dbgfR3AsLazyPopulate(PVM pVM, RTDBGAS hAlias)
-{
-    DBGF_AS_DB_LOCK_WRITE(pVM);
+ * @param   pUVM        The user mode VM handle.
+ * @param   hAlias      The alias.
+ */
+static void dbgfR3AsLazyPopulate(PUVM pUVM, RTDBGAS hAlias)
+{
+    DBGF_AS_DB_LOCK_WRITE(pUVM);
     uintptr_t iAlias = DBGF_AS_ALIAS_2_INDEX(hAlias);
-    if (!pVM->dbgf.s.afAsAliasPopuplated[iAlias])
-    {
-        RTDBGAS hAs = pVM->dbgf.s.ahAsAliases[iAlias];
-        if (hAlias == DBGF_AS_R0)
-            PDMR3LdrEnumModules(pVM, dbgfR3AsLazyPopulateR0Callback, hAs);
+    if (!pUVM->dbgf.s.afAsAliasPopuplated[iAlias])
+    {
+        RTDBGAS hAs = pUVM->dbgf.s.ahAsAliases[iAlias];
+        if (hAlias == DBGF_AS_R0 && pUVM->pVM)
+            PDMR3LdrEnumModules(pUVM->pVM, dbgfR3AsLazyPopulateR0Callback, hAs);
         /** @todo what do we do about DBGF_AS_RC?  */
 
-        pVM->dbgf.s.afAsAliasPopuplated[iAlias] = true;
-    }
-    DBGF_AS_DB_UNLOCK_WRITE(pVM);
+        pUVM->dbgf.s.afAsAliasPopuplated[iAlias] = true;
+    }
+    DBGF_AS_DB_UNLOCK_WRITE(pUVM);
 }
 
@@ -462,17 +463,17 @@
  * @returns Real address space handle. NIL_RTDBGAS if invalid handle.
  *
- * @param   pVM             Pointer to the VM.
- * @param   hAlias          The possibly address space alias.
+ * @param   pUVM        The user mode VM handle.
+ * @param   hAlias      The possibly address space alias.
  *
  * @remarks Doesn't take any locks.
  */
-VMMR3DECL(RTDBGAS) DBGFR3AsResolve(PVM pVM, RTDBGAS hAlias)
-{
-    VM_ASSERT_VALID_EXT_RETURN(pVM, NULL);
+VMMR3DECL(RTDBGAS) DBGFR3AsResolve(PUVM pUVM, RTDBGAS hAlias)
+{
+    UVM_ASSERT_VALID_EXT_RETURN(pUVM, NULL);
     AssertCompileNS(NIL_RTDBGAS == (RTDBGAS)0);
 
     uintptr_t   iAlias = DBGF_AS_ALIAS_2_INDEX(hAlias);
     if (iAlias < DBGF_AS_COUNT)
-        ASMAtomicReadHandle(&pVM->dbgf.s.ahAsAliases[iAlias], &hAlias);
+        ASMAtomicReadHandle(&pUVM->dbgf.s.ahAsAliases[iAlias], &hAlias);
     return hAlias;
 }
@@ -485,10 +486,10 @@
  * @returns Real address space handle. NIL_RTDBGAS if invalid handle.
  *
- * @param   pVM             Pointer to the VM.
- * @param   hAlias          The possibly address space alias.
- */
-VMMR3DECL(RTDBGAS) DBGFR3AsResolveAndRetain(PVM pVM, RTDBGAS hAlias)
-{
-    VM_ASSERT_VALID_EXT_RETURN(pVM, NULL);
+ * @param   pUVM        The user mode VM handle.
+ * @param   hAlias      The possibly address space alias.
+ */
+VMMR3DECL(RTDBGAS) DBGFR3AsResolveAndRetain(PUVM pUVM, RTDBGAS hAlias)
+{
+    UVM_ASSERT_VALID_EXT_RETURN(pUVM, NULL);
     AssertCompileNS(NIL_RTDBGAS == (RTDBGAS)0);
 
@@ -500,9 +501,9 @@
         {
             /* Perform lazy address space population. */
-            if (!pVM->dbgf.s.afAsAliasPopuplated[iAlias])
-                dbgfR3AsLazyPopulate(pVM, hAlias);
+            if (!pUVM->dbgf.s.afAsAliasPopuplated[iAlias])
+                dbgfR3AsLazyPopulate(pUVM, hAlias);
 
             /* Won't ever change, no need to grab the lock. */
-            hAlias = pVM->dbgf.s.ahAsAliases[iAlias];
+            hAlias = pUVM->dbgf.s.ahAsAliases[iAlias];
             cRefs = RTDbgAsRetain(hAlias);
         }
@@ -510,8 +511,8 @@
         {
             /* May change, grab the lock so we can read it safely. */
-            DBGF_AS_DB_LOCK_READ(pVM);
-            hAlias = pVM->dbgf.s.ahAsAliases[iAlias];
+            DBGF_AS_DB_LOCK_READ(pUVM);
+            hAlias = pUVM->dbgf.s.ahAsAliases[iAlias];
             cRefs = RTDbgAsRetain(hAlias);
-            DBGF_AS_DB_UNLOCK_READ(pVM);
+            DBGF_AS_DB_UNLOCK_READ(pUVM);
         }
     }
@@ -529,13 +530,13 @@
  * @returns Retained address space handle if found, NIL_RTDBGAS if not.
  *
- * @param   pVM         Pointer to the VM.
+ * @param   pUVM        The user mode VM handle.
  * @param   pszName     The name.
  */
-VMMR3DECL(RTDBGAS) DBGFR3AsQueryByName(PVM pVM, const char *pszName)
+VMMR3DECL(RTDBGAS) DBGFR3AsQueryByName(PUVM pUVM, const char *pszName)
 {
     /*
      * Validate the input.
      */
-    VM_ASSERT_VALID_EXT_RETURN(pVM, NIL_RTDBGAS);
+    UVM_ASSERT_VALID_EXT_RETURN(pUVM, NIL_RTDBGAS);
     AssertPtrReturn(pszName, NIL_RTDBGAS);
     AssertReturn(*pszName, NIL_RTDBGAS);
@@ -545,7 +546,7 @@
      */
     RTDBGAS hDbgAs = NIL_RTDBGAS;
-    DBGF_AS_DB_LOCK_READ(pVM);
-
-    PRTSTRSPACECORE pNode = RTStrSpaceGet(&pVM->dbgf.s.AsNameSpace, pszName);
+    DBGF_AS_DB_LOCK_READ(pUVM);
+
+    PRTSTRSPACECORE pNode = RTStrSpaceGet(&pUVM->dbgf.s.AsNameSpace, pszName);
     if (pNode)
     {
@@ -556,6 +557,6 @@
             hDbgAs = NIL_RTDBGAS;
     }
-    DBGF_AS_DB_UNLOCK_READ(pVM);
-
+
+    DBGF_AS_DB_UNLOCK_READ(pUVM);
     return hDbgAs;
 }
@@ -567,13 +568,13 @@
  * @returns Retained address space handle if found, NIL_RTDBGAS if not.
  *
- * @param   pVM         Pointer to the VM.
+ * @param   pUVM        The user mode VM handle.
  * @param   ProcId      The process ID.
  */
-VMMR3DECL(RTDBGAS) DBGFR3AsQueryByPid(PVM pVM, RTPROCESS ProcId)
+VMMR3DECL(RTDBGAS) DBGFR3AsQueryByPid(PUVM pUVM, RTPROCESS ProcId)
 {
     /*
      * Validate the input.
      */
-    VM_ASSERT_VALID_EXT_RETURN(pVM, NIL_RTDBGAS);
+    UVM_ASSERT_VALID_EXT_RETURN(pUVM, NIL_RTDBGAS);
     AssertReturn(ProcId != NIL_RTPROCESS, NIL_RTDBGAS);
 
@@ -582,7 +583,7 @@
      */
     RTDBGAS hDbgAs = NIL_RTDBGAS;
-    DBGF_AS_DB_LOCK_READ(pVM);
-
-    PAVLU32NODECORE pNode = RTAvlU32Get(&pVM->dbgf.s.AsPidTree, ProcId);
+    DBGF_AS_DB_LOCK_READ(pUVM);
+
+    PAVLU32NODECORE pNode = RTAvlU32Get(&pUVM->dbgf.s.AsPidTree, ProcId);
     if (pNode)
     {
@@ -593,5 +594,5 @@
             hDbgAs = NIL_RTDBGAS;
     }
-    DBGF_AS_DB_UNLOCK_READ(pVM);
+    DBGF_AS_DB_UNLOCK_READ(pUVM);
 
     return hDbgAs;
@@ -717,4 +718,5 @@
  *
  * @returns VBox status code.
+ * @param   pUVM            The user mode VM handle.
  * @param   pszFilename     The filename.
  * @param   pszCfgValue     The name of the config variable (under /DBGF/).
@@ -722,8 +724,9 @@
  * @param   pvUser          User argument for the callback.
  */
-static int dbgfR3AsSearchCfgPath(PVM pVM, const char *pszFilename, const char *pszCfgValue, PFNDBGFR3ASSEARCHOPEN pfnOpen, void *pvUser)
+static int dbgfR3AsSearchCfgPath(PUVM pUVM, const char *pszFilename, const char *pszCfgValue,
+                                 PFNDBGFR3ASSEARCHOPEN pfnOpen, void *pvUser)
 {
     char *pszPath;
-    int rc = CFGMR3QueryStringAllocDef(CFGMR3GetChild(CFGMR3GetRoot(pVM), "/DBGF"), pszCfgValue, &pszPath, NULL);
+    int rc = CFGMR3QueryStringAllocDef(CFGMR3GetChild(CFGMR3GetRootU(pUVM), "/DBGF"), pszCfgValue, &pszPath, NULL);
     if (RT_FAILURE(rc))
         return rc;
@@ -758,5 +761,5 @@
  * @returns VBox status code.
  *
- * @param   pVM             Pointer to the VM.
+ * @param   pUVM            The user mode VM handle.
  * @param   hDbgAs          The address space.
  * @param   pszFilename     The filename of the executable module.
@@ -768,14 +771,15 @@
  * @param   fFlags          Flags reserved for future extensions, must be 0.
  */
-VMMR3DECL(int) DBGFR3AsLoadImage(PVM pVM, RTDBGAS hDbgAs, const char *pszFilename, const char *pszModName, PCDBGFADDRESS pModAddress, RTDBGSEGIDX iModSeg, uint32_t fFlags)
+VMMR3DECL(int) DBGFR3AsLoadImage(PUVM pUVM, RTDBGAS hDbgAs, const char *pszFilename, const char *pszModName, PCDBGFADDRESS pModAddress, RTDBGSEGIDX iModSeg, uint32_t fFlags)
 {
     /*
      * Validate input
      */
+    UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE);
     AssertPtrReturn(pszFilename, VERR_INVALID_POINTER);
     AssertReturn(*pszFilename, VERR_INVALID_PARAMETER);
-    AssertReturn(DBGFR3AddrIsValid(pVM, pModAddress), VERR_INVALID_PARAMETER);
+    AssertReturn(DBGFR3AddrIsValid(pUVM, pModAddress), VERR_INVALID_PARAMETER);
     AssertReturn(fFlags == 0, VERR_INVALID_PARAMETER);
-    RTDBGAS hRealAS = DBGFR3AsResolveAndRetain(pVM, hDbgAs);
+    RTDBGAS hRealAS = DBGFR3AsResolveAndRetain(pUVM, hDbgAs);
     if (hRealAS == NIL_RTDBGAS)
         return VERR_INVALID_HANDLE;
@@ -789,14 +793,14 @@
     Data.fFlags = 0;
     Data.hMod = NIL_RTDBGMOD;
-    int rc = dbgfR3AsSearchCfgPath(pVM, pszFilename, "ImagePath", dbgfR3AsLoadImageOpen, &Data);
+    int rc = dbgfR3AsSearchCfgPath(pUVM, pszFilename, "ImagePath", dbgfR3AsLoadImageOpen, &Data);
     if (RT_FAILURE(rc))
         rc = dbgfR3AsSearchEnvPath(pszFilename, "VBOXDBG_IMAGE_PATH", dbgfR3AsLoadImageOpen, &Data);
     if (RT_FAILURE(rc))
-        rc = dbgfR3AsSearchCfgPath(pVM, pszFilename, "Path", dbgfR3AsLoadImageOpen, &Data);
+        rc = dbgfR3AsSearchCfgPath(pUVM, pszFilename, "Path", dbgfR3AsLoadImageOpen, &Data);
     if (RT_FAILURE(rc))
         rc = dbgfR3AsSearchEnvPath(pszFilename, "VBOXDBG_PATH", dbgfR3AsLoadImageOpen, &Data);
     if (RT_SUCCESS(rc))
     {
-        rc = DBGFR3AsLinkModule(pVM, hRealAS, Data.hMod, pModAddress, iModSeg, 0);
+        rc = DBGFR3AsLinkModule(pUVM, hRealAS, Data.hMod, pModAddress, iModSeg, 0);
         if (RT_FAILURE(rc))
             RTDbgModRelease(Data.hMod);
@@ -830,5 +834,5 @@
  * @returns VBox status code.
  *
- * @param   pVM             Pointer to the VM.
+ * @param   pUVM            The user mode VM handle.
  * @param   hDbgAs          The address space.
  * @param   pszFilename     The map file.
@@ -843,5 +847,5 @@
  * @param   fFlags          Flags reserved for future extensions, must be 0.
  */
-VMMR3DECL(int) DBGFR3AsLoadMap(PVM pVM, RTDBGAS hDbgAs, const char *pszFilename, const char *pszModName,
+VMMR3DECL(int) DBGFR3AsLoadMap(PUVM pUVM, RTDBGAS hDbgAs, const char *pszFilename, const char *pszModName,
                                PCDBGFADDRESS pModAddress, RTDBGSEGIDX iModSeg, RTGCUINTPTR uSubtrahend, uint32_t fFlags)
 {
@@ -849,9 +853,10 @@
      * Validate input
      */
+    UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE);
     AssertPtrReturn(pszFilename, VERR_INVALID_POINTER);
     AssertReturn(*pszFilename, VERR_INVALID_PARAMETER);
-    AssertReturn(DBGFR3AddrIsValid(pVM, pModAddress), VERR_INVALID_PARAMETER);
+    AssertReturn(DBGFR3AddrIsValid(pUVM, pModAddress), VERR_INVALID_PARAMETER);
     AssertReturn(fFlags == 0, VERR_INVALID_PARAMETER);
-    RTDBGAS hRealAS = DBGFR3AsResolveAndRetain(pVM, hDbgAs);
+    RTDBGAS hRealAS = DBGFR3AsResolveAndRetain(pUVM, hDbgAs);
     if (hRealAS == NIL_RTDBGAS)
         return VERR_INVALID_HANDLE;
@@ -865,14 +870,14 @@
     Data.fFlags = 0;
     Data.hMod = NIL_RTDBGMOD;
-    int rc = dbgfR3AsSearchCfgPath(pVM, pszFilename, "MapPath", dbgfR3AsLoadMapOpen, &Data);
+    int rc = dbgfR3AsSearchCfgPath(pUVM, pszFilename, "MapPath", dbgfR3AsLoadMapOpen, &Data);
     if (RT_FAILURE(rc))
         rc = dbgfR3AsSearchEnvPath(pszFilename, "VBOXDBG_MAP_PATH", dbgfR3AsLoadMapOpen, &Data);
     if (RT_FAILURE(rc))
-        rc = dbgfR3AsSearchCfgPath(pVM, pszFilename, "Path", dbgfR3AsLoadMapOpen, &Data);
+        rc = dbgfR3AsSearchCfgPath(pUVM, pszFilename, "Path", dbgfR3AsLoadMapOpen, &Data);
     if (RT_FAILURE(rc))
         rc = dbgfR3AsSearchEnvPath(pszFilename, "VBOXDBG_PATH", dbgfR3AsLoadMapOpen, &Data);
     if (RT_SUCCESS(rc))
     {
-        rc = DBGFR3AsLinkModule(pVM, hRealAS, Data.hMod, pModAddress, iModSeg, 0);
+        rc = DBGFR3AsLinkModule(pUVM, hRealAS, Data.hMod, pModAddress, iModSeg, 0);
         if (RT_FAILURE(rc))
             RTDbgModRelease(Data.hMod);
@@ -888,5 +893,5 @@
  *
  * @returns VBox status code.
- * @param   pVM             Pointer to the VM.
+ * @param   pUVM            The user mode VM handle.
  * @param   hDbgAs          The address space handle.
  * @param   hMod            The module handle.
@@ -895,12 +900,13 @@
  * @param   fFlags          Flags to pass to the link functions, see RTDBGASLINK_FLAGS_*.
  */
-VMMR3DECL(int) DBGFR3AsLinkModule(PVM pVM, RTDBGAS hDbgAs, RTDBGMOD hMod, PCDBGFADDRESS pModAddress, RTDBGSEGIDX iModSeg, uint32_t fFlags)
+VMMR3DECL(int) DBGFR3AsLinkModule(PUVM pUVM, RTDBGAS hDbgAs, RTDBGMOD hMod, PCDBGFADDRESS pModAddress,
+                                  RTDBGSEGIDX iModSeg, uint32_t fFlags)
 {
     /*
      * Input validation.
      */
-    VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
-    AssertReturn(DBGFR3AddrIsValid(pVM, pModAddress), VERR_INVALID_PARAMETER);
-    RTDBGAS hRealAS = DBGFR3AsResolveAndRetain(pVM, hDbgAs);
+    UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE);
+    AssertReturn(DBGFR3AddrIsValid(pUVM, pModAddress), VERR_INVALID_PARAMETER);
+    RTDBGAS hRealAS = DBGFR3AsResolveAndRetain(pUVM, hDbgAs);
     if (hRealAS == NIL_RTDBGAS)
         return VERR_INVALID_HANDLE;
@@ -967,15 +973,15 @@
  * @returns VBox status code. See RTDbgAsSymbolByAddr.
  *
- * @param   pVM                 Pointer to the VM.
- * @param   hDbgAs              The address space handle.
- * @param   pAddress            The address to lookup.
- * @param   poffDisp            Where to return the distance between the
- *                              returned symbol and pAddress. Optional.
- * @param   pSymbol             Where to return the symbol information.
- *                              The returned symbol name will be prefixed by
- *                              the module name as far as space allows.
- * @param   phMod               Where to return the module handle. Optional.
- */
-VMMR3DECL(int) DBGFR3AsSymbolByAddr(PVM pVM, RTDBGAS hDbgAs, PCDBGFADDRESS pAddress,
+ * @param   pUVM            The user mode VM handle.
+ * @param   hDbgAs          The address space handle.
+ * @param   pAddress        The address to lookup.
+ * @param   poffDisp        Where to return the distance between the returned
+ *                          symbol and pAddress. Optional.
+ * @param   pSymbol         Where to return the symbol information. The returned
+ *                          symbol name will be prefixed by the module name as
+ *                          far as space allows.
+ * @param   phMod           Where to return the module handle. Optional.
+ */
+VMMR3DECL(int) DBGFR3AsSymbolByAddr(PUVM pUVM, RTDBGAS hDbgAs, PCDBGFADDRESS pAddress,
                                     PRTGCINTPTR poffDisp, PRTDBGSYMBOL pSymbol, PRTDBGMOD phMod)
 {
@@ -985,7 +991,7 @@
     if (hDbgAs == DBGF_AS_RC_AND_GC_GLOBAL)
     {
-        int rc = DBGFR3AsSymbolByAddr(pVM, DBGF_AS_RC, pAddress, poffDisp, pSymbol, phMod);
+        int rc = DBGFR3AsSymbolByAddr(pUVM, DBGF_AS_RC, pAddress, poffDisp, pSymbol, phMod);
         if (RT_FAILURE(rc))
-            rc = DBGFR3AsSymbolByAddr(pVM, DBGF_AS_GLOBAL, pAddress, poffDisp, pSymbol, phMod);
+            rc = DBGFR3AsSymbolByAddr(pUVM, DBGF_AS_GLOBAL, pAddress, poffDisp, pSymbol, phMod);
         return rc;
     }
@@ -994,6 +1000,6 @@
      * Input validation.
      */
-    VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
-    AssertReturn(DBGFR3AddrIsValid(pVM, pAddress), VERR_INVALID_PARAMETER);
+    UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE);
+    AssertReturn(DBGFR3AddrIsValid(pUVM, pAddress), VERR_INVALID_PARAMETER);
     AssertPtrNullReturn(poffDisp, VERR_INVALID_POINTER);
     AssertPtrReturn(pSymbol, VERR_INVALID_POINTER);
@@ -1003,5 +1009,5 @@
     if (phMod)
         *phMod = NIL_RTDBGMOD;
-    RTDBGAS hRealAS = DBGFR3AsResolveAndRetain(pVM, hDbgAs);
+    RTDBGAS hRealAS = DBGFR3AsResolveAndRetain(pUVM, hDbgAs);
     if (hRealAS == NIL_RTDBGAS)
         return VERR_INVALID_HANDLE;
@@ -1022,5 +1028,5 @@
     {
         DBGFSYMBOL DbgfSym;
-        rc = DBGFR3SymbolByAddr(pVM, pAddress->FlatPtr, poffDisp, &DbgfSym);
+        rc = DBGFR3SymbolByAddr(pUVM->pVM, pAddress->FlatPtr, poffDisp, &DbgfSym);
         if (RT_SUCCESS(rc))
             dbgfR3AsSymbolConvert(pSymbol, &DbgfSym);
@@ -1032,5 +1038,6 @@
         RTR0PTR     R0PtrNearSym;
         RTR0PTR     R0PtrNearSym2;
-        rc = PDMR3LdrQueryR0ModFromPC(pVM, pAddress->FlatPtr,
+        VM_ASSERT_VALID_EXT_RETURN(pUVM->pVM, VERR_INVALID_VM_HANDLE);
+        rc = PDMR3LdrQueryR0ModFromPC(pUVM->pVM, pAddress->FlatPtr,
                                       pSymbol->szName, sizeof(pSymbol->szName) / 2, &R0PtrMod,
                                       &szNearSym[0],   sizeof(szNearSym),           &R0PtrNearSym,
@@ -1066,14 +1073,14 @@
  *          occurs.
  *
- * @param   pVM                 Pointer to the VM.
- * @param   hDbgAs              See DBGFR3AsSymbolByAddr.
- * @param   pAddress            See DBGFR3AsSymbolByAddr.
- * @param   poffDisp            See DBGFR3AsSymbolByAddr.
- * @param   phMod               See DBGFR3AsSymbolByAddr.
- */
-VMMR3DECL(PRTDBGSYMBOL) DBGFR3AsSymbolByAddrA(PVM pVM, RTDBGAS hDbgAs, PCDBGFADDRESS pAddress, PRTGCINTPTR poffDisp, PRTDBGMOD phMod)
+ * @param   pUVM            The user mode VM handle.
+ * @param   hDbgAs          See DBGFR3AsSymbolByAddr.
+ * @param   pAddress        See DBGFR3AsSymbolByAddr.
+ * @param   poffDisp        See DBGFR3AsSymbolByAddr.
+ * @param   phMod           See DBGFR3AsSymbolByAddr.
+ */
+VMMR3DECL(PRTDBGSYMBOL) DBGFR3AsSymbolByAddrA(PUVM pUVM, RTDBGAS hDbgAs, PCDBGFADDRESS pAddress, PRTGCINTPTR poffDisp, PRTDBGMOD phMod)
 {
     RTDBGSYMBOL SymInfo;
-    int rc = DBGFR3AsSymbolByAddr(pVM, hDbgAs, pAddress, poffDisp, &SymInfo, phMod);
+    int rc = DBGFR3AsSymbolByAddr(pUVM, hDbgAs, pAddress, poffDisp, &SymInfo, phMod);
     if (RT_SUCCESS(rc))
         return RTDbgSymbolDup(&SymInfo);
@@ -1091,14 +1098,14 @@
  * @returns VBox status code. See RTDbgAsSymbolByAddr.
  *
- * @param   pVM                 Pointer to the VM.
- * @param   hDbgAs              The address space handle.
- * @param   pszSymbol           The symbol to search for, maybe prefixed by a
- *                              module pattern.
- * @param   pSymbol             Where to return the symbol information.
- *                              The returned symbol name will be prefixed by
- *                              the module name as far as space allows.
- * @param   phMod               Where to return the module handle. Optional.
- */
-VMMR3DECL(int) DBGFR3AsSymbolByName(PVM pVM, RTDBGAS hDbgAs, const char *pszSymbol,
+ * @param   pUVM            The user mode VM handle.
+ * @param   hDbgAs          The address space handle.
+ * @param   pszSymbol       The symbol to search for, maybe prefixed by a
+ *                          module pattern.
+ * @param   pSymbol         Where to return the symbol information.
+ *                          The returned symbol name will be prefixed by
+ *                          the module name as far as space allows.
+ * @param   phMod           Where to return the module handle. Optional.
+ */
+VMMR3DECL(int) DBGFR3AsSymbolByName(PUVM pUVM, RTDBGAS hDbgAs, const char *pszSymbol,
                                     PRTDBGSYMBOL pSymbol, PRTDBGMOD phMod)
 {
@@ -1108,7 +1115,7 @@
     if (hDbgAs == DBGF_AS_RC_AND_GC_GLOBAL)
     {
-        int rc = DBGFR3AsSymbolByName(pVM, DBGF_AS_RC, pszSymbol, pSymbol, phMod);
+        int rc = DBGFR3AsSymbolByName(pUVM, DBGF_AS_RC, pszSymbol, pSymbol, phMod);
         if (RT_FAILURE(rc))
-            rc = DBGFR3AsSymbolByName(pVM, DBGF_AS_GLOBAL, pszSymbol, pSymbol, phMod);
+            rc = DBGFR3AsSymbolByName(pUVM, DBGF_AS_GLOBAL, pszSymbol, pSymbol, phMod);
         return rc;
     }
@@ -1117,10 +1124,10 @@
      * Input validation.
      */
-    VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
+    UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE);
     AssertPtrReturn(pSymbol, VERR_INVALID_POINTER);
     AssertPtrNullReturn(phMod, VERR_INVALID_POINTER);
     if (phMod)
         *phMod = NIL_RTDBGMOD;
-    RTDBGAS hRealAS = DBGFR3AsResolveAndRetain(pVM, hDbgAs);
+    RTDBGAS hRealAS = DBGFR3AsResolveAndRetain(pUVM, hDbgAs);
     if (hRealAS == NIL_RTDBGAS)
         return VERR_INVALID_HANDLE;
@@ -1142,5 +1149,5 @@
     {
         DBGFSYMBOL DbgfSym;
-        rc = DBGFR3SymbolByName(pVM, pszSymbol, &DbgfSym);
+        rc = DBGFR3SymbolByName(pUVM->pVM, pszSymbol, &DbgfSym);
         if (RT_SUCCESS(rc))
             dbgfR3AsSymbolConvert(pSymbol, &DbgfSym);
Index: trunk/src/VBox/VMM/VMMR3/DBGFBp.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMR3/DBGFBp.cpp	(revision 44398)
+++ trunk/src/VBox/VMM/VMMR3/DBGFBp.cpp	(revision 44399)
@@ -28,7 +28,9 @@
 # include <VBox/vmm/iem.h>
 #endif
+#include <VBox/vmm/mm.h>
 #include "DBGFInternal.h"
 #include <VBox/vmm/vm.h>
-#include <VBox/vmm/mm.h>
+#include <VBox/vmm/uvm.h>
+
 #include <VBox/err.h>
 #include <VBox/log.h>
@@ -41,16 +43,6 @@
 *******************************************************************************/
 RT_C_DECLS_BEGIN
-static DECLCALLBACK(int) dbgfR3BpSetReg(PVM pVM, PCDBGFADDRESS pAddress, uint64_t *piHitTrigger, uint64_t *piHitDisable,
-                                        uint8_t u8Type, uint8_t cb, uint32_t *piBp);
-static DECLCALLBACK(int) dbgfR3BpSetInt3(PVM pVM, PCDBGFADDRESS pAddress, uint64_t *piHitTrigger, uint64_t *piHitDisable, uint32_t *piBp);
-static DECLCALLBACK(int) dbgfR3BpSetREM(PVM pVM, PCDBGFADDRESS pAddress, uint64_t *piHitTrigger, uint64_t *piHitDisable, uint32_t *piBp);
-static DECLCALLBACK(int) dbgfR3BpClear(PVM pVM, uint32_t iBp);
-static DECLCALLBACK(int) dbgfR3BpEnable(PVM pVM, uint32_t iBp);
-static DECLCALLBACK(int) dbgfR3BpDisable(PVM pVM, uint32_t iBp);
-static DECLCALLBACK(int) dbgfR3BpEnum(PVM pVM, PFNDBGFBPENUM pfnCallback, void *pvUser);
 static int dbgfR3BpRegArm(PVM pVM, PDBGFBP pBp);
-static int dbgfR3BpRegDisarm(PVM pVM, PDBGFBP pBp);
-static int dbgfR3BpInt3Arm(PVM pVM, PDBGFBP pBp);
-static int dbgfR3BpInt3Disarm(PVM pVM, PDBGFBP pBp);
+static int dbgfR3BpInt3Arm(PUVM pUVM, PDBGFBP pBp);
 RT_C_DECLS_END
 
@@ -279,5 +271,79 @@
  *
  * @returns VBox status code.
- * @param   pVM         Pointer to the VM.
+ * @param   pUVM            The user mode VM handle.
+ * @param   pAddress        The address of the breakpoint.
+ * @param   piHitTrigger    The hit count at which the breakpoint start triggering.
+ *                          Use 0 (or 1) if it's gonna trigger at once.
+ * @param   piHitDisable    The hit count which disables the breakpoint.
+ *                          Use ~(uint64_t) if it's never gonna be disabled.
+ * @param   piBp            Where to store the breakpoint id. (optional)
+ * @thread  Any thread.
+ */
+static DECLCALLBACK(int) dbgfR3BpSetInt3(PUVM pUVM, PCDBGFADDRESS pAddress, uint64_t *piHitTrigger,
+                                         uint64_t *piHitDisable, uint32_t *piBp)
+{
+    /*
+     * Validate input.
+     */
+    PVM pVM = pUVM->pVM;
+    VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
+    if (!DBGFR3AddrIsValid(pUVM, pAddress))
+        return VERR_INVALID_PARAMETER;
+    if (*piHitTrigger > *piHitDisable)
+        return VERR_INVALID_PARAMETER;
+    AssertMsgReturn(!piBp || VALID_PTR(piBp), ("piBp=%p\n", piBp), VERR_INVALID_POINTER);
+    if (piBp)
+        *piBp = ~0;
+
+    /*
+     * Check if the breakpoint already exists.
+     */
+    PDBGFBP pBp = dbgfR3BpGetByAddr(pVM, DBGFBPTYPE_INT3, pAddress->FlatPtr);
+    if (pBp)
+    {
+        int rc = VINF_SUCCESS;
+        if (!pBp->fEnabled)
+            rc = dbgfR3BpInt3Arm(pUVM, pBp);
+        if (RT_SUCCESS(rc))
+        {
+            rc = VINF_DBGF_BP_ALREADY_EXIST;
+            if (piBp)
+                *piBp = pBp->iBp;
+        }
+        return rc;
+    }
+
+    /*
+     * Allocate and initialize the bp.
+     */
+    pBp = dbgfR3BpAlloc(pVM, DBGFBPTYPE_INT3);
+    if (!pBp)
+        return VERR_DBGF_NO_MORE_BP_SLOTS;
+    pBp->GCPtr       = pAddress->FlatPtr;
+    pBp->iHitTrigger = *piHitTrigger;
+    pBp->iHitDisable = *piHitDisable;
+    pBp->fEnabled    = true;
+
+    /*
+     * Now ask REM to set the breakpoint.
+     */
+    int rc = dbgfR3BpInt3Arm(pUVM, pBp);
+    if (RT_SUCCESS(rc))
+    {
+        if (piBp)
+            *piBp = pBp->iBp;
+    }
+    else
+        dbgfR3BpFree(pVM, pBp);
+
+    return rc;
+}
+
+
+/**
+ * Sets a breakpoint (int 3 based).
+ *
+ * @returns VBox status code.
+ * @param   pUVM        The user mode VM handle.
  * @param   pAddress    The address of the breakpoint.
  * @param   iHitTrigger The hit count at which the breakpoint start triggering.
@@ -288,5 +354,5 @@
  * @thread  Any thread.
  */
-VMMR3DECL(int) DBGFR3BpSet(PVM pVM, PCDBGFADDRESS pAddress, uint64_t iHitTrigger, uint64_t iHitDisable, uint32_t *piBp)
+VMMR3DECL(int) DBGFR3BpSet(PUVM pUVM, PCDBGFADDRESS pAddress, uint64_t iHitTrigger, uint64_t iHitDisable, uint32_t *piBp)
 {
     /*
@@ -294,77 +360,7 @@
      */
     /** @todo SMP? */
-    int rc = VMR3ReqPriorityCallWait(pVM, VMCPUID_ANY, (PFNRT)dbgfR3BpSetInt3, 5, pVM, pAddress, &iHitTrigger, &iHitDisable, piBp);
+    int rc = VMR3ReqPriorityCallWaitU(pUVM, VMCPUID_ANY, (PFNRT)dbgfR3BpSetInt3, 5,
+                                      pUVM, pAddress, &iHitTrigger, &iHitDisable, piBp);
     LogFlow(("DBGFR3BpSet: returns %Rrc\n", rc));
-    return rc;
-}
-
-
-/**
- * Sets a breakpoint (int 3 based).
- *
- * @returns VBox status code.
- * @param   pVM             Pointer to the VM.
- * @param   pAddress        The address of the breakpoint.
- * @param   piHitTrigger    The hit count at which the breakpoint start triggering.
- *                          Use 0 (or 1) if it's gonna trigger at once.
- * @param   piHitDisable    The hit count which disables the breakpoint.
- *                          Use ~(uint64_t) if it's never gonna be disabled.
- * @param   piBp            Where to store the breakpoint id. (optional)
- * @thread  Any thread.
- */
-static DECLCALLBACK(int) dbgfR3BpSetInt3(PVM pVM, PCDBGFADDRESS pAddress, uint64_t *piHitTrigger, uint64_t *piHitDisable, uint32_t *piBp)
-{
-    /*
-     * Validate input.
-     */
-    if (!DBGFR3AddrIsValid(pVM, pAddress))
-        return VERR_INVALID_PARAMETER;
-    if (*piHitTrigger > *piHitDisable)
-        return VERR_INVALID_PARAMETER;
-    AssertMsgReturn(!piBp || VALID_PTR(piBp), ("piBp=%p\n", piBp), VERR_INVALID_POINTER);
-    if (piBp)
-        *piBp = ~0;
-
-    /*
-     * Check if the breakpoint already exists.
-     */
-    PDBGFBP pBp = dbgfR3BpGetByAddr(pVM, DBGFBPTYPE_INT3, pAddress->FlatPtr);
-    if (pBp)
-    {
-        int rc = VINF_SUCCESS;
-        if (!pBp->fEnabled)
-            rc = dbgfR3BpInt3Arm(pVM, pBp);
-        if (RT_SUCCESS(rc))
-        {
-            rc = VINF_DBGF_BP_ALREADY_EXIST;
-            if (piBp)
-                *piBp = pBp->iBp;
-        }
-        return rc;
-    }
-
-    /*
-     * Allocate and initialize the bp.
-     */
-    pBp = dbgfR3BpAlloc(pVM, DBGFBPTYPE_INT3);
-    if (!pBp)
-        return VERR_DBGF_NO_MORE_BP_SLOTS;
-    pBp->GCPtr       = pAddress->FlatPtr;
-    pBp->iHitTrigger = *piHitTrigger;
-    pBp->iHitDisable = *piHitDisable;
-    pBp->fEnabled    = true;
-
-    /*
-     * Now ask REM to set the breakpoint.
-     */
-    int rc = dbgfR3BpInt3Arm(pVM, pBp);
-    if (RT_SUCCESS(rc))
-    {
-        if (piBp)
-            *piBp = pBp->iBp;
-    }
-    else
-        dbgfR3BpFree(pVM, pBp);
-
     return rc;
 }
@@ -376,52 +372,52 @@
  *
  * @returns VBox status code.
- * @param   pVM         Pointer to the VM.
+ * @param   pUVM        The user mode VM handle.
  * @param   pBp         The breakpoint.
  */
-static int dbgfR3BpInt3Arm(PVM pVM, PDBGFBP pBp)
+static int dbgfR3BpInt3Arm(PUVM pUVM, PDBGFBP pBp)
 {
     /** @todo should actually use physical address here! */
 
+    /** @todo SMP support! */
+    VMCPUID idCpu = 0;
+
+    /*
+     * Save current byte and write int3 instruction.
+     */
+    DBGFADDRESS Addr;
+    DBGFR3AddrFromFlat(pUVM, &Addr, pBp->GCPtr);
+    int rc = DBGFR3MemRead(pUVM, idCpu, &Addr, &pBp->u.Int3.bOrg, 1);
+    if (RT_SUCCESS(rc))
+    {
+        static const uint8_t s_bInt3 = 0xcc;
+        rc = DBGFR3MemWrite(pUVM, idCpu, &Addr, &s_bInt3, 1);
+    }
+    return rc;
+}
+
+
+/**
+ * Disarms an int 3 breakpoint.
+ * This is used to implement both DBGFR3BpClear() and DBGFR3BpDisable().
+ *
+ * @returns VBox status code.
+ * @param   pUVM        The user mode VM handle.
+ * @param   pBp         The breakpoint.
+ */
+static int dbgfR3BpInt3Disarm(PUVM pUVM, PDBGFBP pBp)
+{
     /* @todo SMP support! */
     VMCPUID idCpu = 0;
 
     /*
-     * Save current byte and write int3 instruction.
-     */
-    DBGFADDRESS Addr;
-    DBGFR3AddrFromFlat(pVM, &Addr, pBp->GCPtr);
-    int rc = DBGFR3MemRead(pVM, idCpu, &Addr, &pBp->u.Int3.bOrg, 1);
-    if (RT_SUCCESS(rc))
-    {
-        static const uint8_t s_bInt3 = 0xcc;
-        rc = DBGFR3MemWrite(pVM, idCpu, &Addr, &s_bInt3, 1);
-    }
-    return rc;
-}
-
-
-/**
- * Disarms an int 3 breakpoint.
- * This is used to implement both DBGFR3BpClear() and DBGFR3BpDisable().
- *
- * @returns VBox status code.
- * @param   pVM         Pointer to the VM.
- * @param   pBp         The breakpoint.
- */
-static int dbgfR3BpInt3Disarm(PVM pVM, PDBGFBP pBp)
-{
-    /* @todo SMP support! */
-    VMCPUID idCpu = 0;
-
-    /*
      * Check that the current byte is the int3 instruction, and restore the original one.
      * We currently ignore invalid bytes.
      */
     DBGFADDRESS     Addr;
-    DBGFR3AddrFromFlat(pVM, &Addr, pBp->GCPtr);
+    DBGFR3AddrFromFlat(pUVM, &Addr, pBp->GCPtr);
     uint8_t         bCurrent;
-    int rc = DBGFR3MemRead(pVM, idCpu, &Addr, &bCurrent, 1);
+    int rc = DBGFR3MemRead(pUVM, idCpu, &Addr, &bCurrent, 1);
     if (bCurrent == 0xcc)
-        rc = DBGFR3MemWrite(pVM, idCpu, &Addr, &pBp->u.Int3.bOrg, 1);
+        rc = DBGFR3MemWrite(pUVM, idCpu, &Addr, &pBp->u.Int3.bOrg, 1);
     return rc;
 }
@@ -432,35 +428,5 @@
  *
  * @returns VBox status code.
- * @param   pVM         Pointer to the VM.
- * @param   pAddress    The address of the breakpoint.
- * @param   iHitTrigger The hit count at which the breakpoint start triggering.
- *                      Use 0 (or 1) if it's gonna trigger at once.
- * @param   iHitDisable The hit count which disables the breakpoint.
- *                      Use ~(uint64_t) if it's never gonna be disabled.
- * @param   fType       The access type (one of the X86_DR7_RW_* defines).
- * @param   cb          The access size - 1,2,4 or 8 (the latter is AMD64 long mode only.
- *                      Must be 1 if fType is X86_DR7_RW_EO.
- * @param   piBp        Where to store the breakpoint id. (optional)
- * @thread  Any thread.
- */
-VMMR3DECL(int) DBGFR3BpSetReg(PVM pVM, PCDBGFADDRESS pAddress, uint64_t iHitTrigger, uint64_t iHitDisable,
-                              uint8_t fType, uint8_t cb, uint32_t *piBp)
-{
-    /** @todo SMP - broadcast, VT-x/AMD-V. */
-    /*
-     * This must be done on EMT.
-     */
-    int rc = VMR3ReqPriorityCallWait(pVM, VMCPUID_ANY, (PFNRT)dbgfR3BpSetReg, 7, pVM, pAddress, &iHitTrigger, &iHitDisable, fType, cb, piBp);
-    LogFlow(("DBGFR3BpSetReg: returns %Rrc\n", rc));
-    return rc;
-
-}
-
-
-/**
- * Sets a register breakpoint.
- *
- * @returns VBox status code.
- * @param   pVM             Pointer to the VM.
+ * @param   pUVM            The user mode VM handle.
  * @param   pAddress        The address of the breakpoint.
  * @param   piHitTrigger    The hit count at which the breakpoint start triggering.
@@ -475,5 +441,5 @@
  * @internal
  */
-static DECLCALLBACK(int) dbgfR3BpSetReg(PVM pVM, PCDBGFADDRESS pAddress, uint64_t *piHitTrigger, uint64_t *piHitDisable,
+static DECLCALLBACK(int) dbgfR3BpSetReg(PUVM pUVM, PCDBGFADDRESS pAddress, uint64_t *piHitTrigger, uint64_t *piHitDisable,
                                         uint8_t fType, uint8_t cb, uint32_t *piBp)
 {
@@ -481,5 +447,7 @@
      * Validate input.
      */
-    if (!DBGFR3AddrIsValid(pVM, pAddress))
+    PVM pVM = pUVM->pVM;
+    VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
+    if (!DBGFR3AddrIsValid(pUVM, pAddress))
         return VERR_INVALID_PARAMETER;
     if (*piHitTrigger > *piHitDisable)
@@ -565,44 +533,8 @@
 
 /**
- * Arms a debug register breakpoint.
- * This is used to implement both DBGFR3BpSetReg() and DBGFR3BpEnable().
- *
- * @returns VBox status code.
- * @param   pVM         Pointer to the VM.
- * @param   pBp         The breakpoint.
- */
-static int dbgfR3BpRegArm(PVM pVM, PDBGFBP pBp)
-{
-    /* @todo SMP support! */
-    PVMCPU pVCpu = &pVM->aCpus[0];
-
-    Assert(pBp->fEnabled);
-    return CPUMRecalcHyperDRx(pVCpu);
-}
-
-
-/**
- * Disarms a debug register breakpoint.
- * This is used to implement both DBGFR3BpClear() and DBGFR3BpDisable().
- *
- * @returns VBox status code.
- * @param   pVM         Pointer to the VM.
- * @param   pBp         The breakpoint.
- */
-static int dbgfR3BpRegDisarm(PVM pVM, PDBGFBP pBp)
-{
-    /** @todo SMP support! */
-    PVMCPU pVCpu = &pVM->aCpus[0];
-
-    Assert(!pBp->fEnabled);
-    return CPUMRecalcHyperDRx(pVCpu);
-}
-
-
-/**
- * Sets a recompiler breakpoint.
- *
- * @returns VBox status code.
- * @param   pVM         Pointer to the VM.
+ * Sets a register breakpoint.
+ *
+ * @returns VBox status code.
+ * @param   pUVM        The user mode VM handle.
  * @param   pAddress    The address of the breakpoint.
  * @param   iHitTrigger The hit count at which the breakpoint start triggering.
@@ -610,15 +542,59 @@
  * @param   iHitDisable The hit count which disables the breakpoint.
  *                      Use ~(uint64_t) if it's never gonna be disabled.
+ * @param   fType       The access type (one of the X86_DR7_RW_* defines).
+ * @param   cb          The access size - 1,2,4 or 8 (the latter is AMD64 long mode only.
+ *                      Must be 1 if fType is X86_DR7_RW_EO.
  * @param   piBp        Where to store the breakpoint id. (optional)
  * @thread  Any thread.
  */
-VMMR3DECL(int) DBGFR3BpSetREM(PVM pVM, PCDBGFADDRESS pAddress, uint64_t iHitTrigger, uint64_t iHitDisable, uint32_t *piBp)
+VMMR3DECL(int) DBGFR3BpSetReg(PUVM pUVM, PCDBGFADDRESS pAddress, uint64_t iHitTrigger, uint64_t iHitDisable,
+                              uint8_t fType, uint8_t cb, uint32_t *piBp)
 {
     /*
      * This must be done on EMT.
      */
-    int rc = VMR3ReqPriorityCallWait(pVM, VMCPUID_ANY, (PFNRT)dbgfR3BpSetREM, 5, pVM, pAddress, &iHitTrigger, &iHitDisable, piBp);
-    LogFlow(("DBGFR3BpSetREM: returns %Rrc\n", rc));
-    return rc;
+    int rc = VMR3ReqPriorityCallWaitU(pUVM, VMCPUID_ANY, (PFNRT)dbgfR3BpSetReg, 7,
+                                      pUVM, pAddress, &iHitTrigger, &iHitDisable, fType, cb, piBp);
+    LogFlow(("DBGFR3BpSetReg: returns %Rrc\n", rc));
+    return rc;
+
+}
+
+
+/** @callback_method_impl{FNVMMEMTRENDEZVOUS}  */
+DECLCALLBACK(VBOXSTRICTRC) dbgfR3BpRegRecalcOnCpu(PVM pVM, PVMCPU pVCpu, void *pvUser)
+{
+    NOREF(pVM); NOREF(pvUser);
+    return CPUMRecalcHyperDRx(pVCpu);
+}
+
+
+/**
+ * Arms a debug register breakpoint.
+ * This is used to implement both DBGFR3BpSetReg() and DBGFR3BpEnable().
+ *
+ * @returns VBox status code.
+ * @param   pUVM        The user mode VM handle.
+ * @param   pBp         The breakpoint.
+ */
+static int dbgfR3BpRegArm(PVM pVM, PDBGFBP pBp)
+{
+    Assert(pBp->fEnabled);
+    return VMMR3EmtRendezvous(pVM, VMMEMTRENDEZVOUS_FLAGS_TYPE_ALL_AT_ONCE, dbgfR3BpRegRecalcOnCpu, NULL);
+}
+
+
+/**
+ * Disarms a debug register breakpoint.
+ * This is used to implement both DBGFR3BpClear() and DBGFR3BpDisable().
+ *
+ * @returns VBox status code.
+ * @param   pUVM        The user mode VM handle.
+ * @param   pBp         The breakpoint.
+ */
+static int dbgfR3BpRegDisarm(PVM pVM, PDBGFBP pBp)
+{
+    Assert(!pBp->fEnabled);
+    return VMMR3EmtRendezvous(pVM, VMMEMTRENDEZVOUS_FLAGS_TYPE_ALL_AT_ONCE, dbgfR3BpRegRecalcOnCpu, NULL);
 }
 
@@ -628,5 +604,5 @@
  *
  * @returns VBox status code.
- * @param   pVM             Pointer to the VM.
+ * @param   pUVM            The user mode VM handle.
  * @param   pAddress        The address of the breakpoint.
  * @param   piHitTrigger    The hit count at which the breakpoint start triggering.
@@ -638,10 +614,13 @@
  * @internal
  */
-static DECLCALLBACK(int) dbgfR3BpSetREM(PVM pVM, PCDBGFADDRESS pAddress, uint64_t *piHitTrigger, uint64_t *piHitDisable, uint32_t *piBp)
+static DECLCALLBACK(int) dbgfR3BpSetREM(PUVM pUVM, PCDBGFADDRESS pAddress, uint64_t *piHitTrigger,
+                                        uint64_t *piHitDisable, uint32_t *piBp)
 {
     /*
      * Validate input.
      */
-    if (!DBGFR3AddrIsValid(pVM, pAddress))
+    PVM pVM = pUVM->pVM;
+    VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
+    if (!DBGFR3AddrIsValid(pUVM, pAddress))
         return VERR_INVALID_PARAMETER;
     if (*piHitTrigger > *piHitDisable)
@@ -706,18 +685,24 @@
 
 /**
- * Clears a breakpoint.
- *
- * @returns VBox status code.
- * @param   pVM         Pointer to the VM.
- * @param   iBp         The id of the breakpoint which should be removed (cleared).
+ * Sets a recompiler breakpoint.
+ *
+ * @returns VBox status code.
+ * @param   pUVM        The user mode VM handle.
+ * @param   pAddress    The address of the breakpoint.
+ * @param   iHitTrigger The hit count at which the breakpoint start triggering.
+ *                      Use 0 (or 1) if it's gonna trigger at once.
+ * @param   iHitDisable The hit count which disables the breakpoint.
+ *                      Use ~(uint64_t) if it's never gonna be disabled.
+ * @param   piBp        Where to store the breakpoint id. (optional)
  * @thread  Any thread.
  */
-VMMR3DECL(int) DBGFR3BpClear(PVM pVM, uint32_t iBp)
+VMMR3DECL(int) DBGFR3BpSetREM(PUVM pUVM, PCDBGFADDRESS pAddress, uint64_t iHitTrigger, uint64_t iHitDisable, uint32_t *piBp)
 {
     /*
      * This must be done on EMT.
      */
-    int rc = VMR3ReqPriorityCallWait(pVM, VMCPUID_ANY, (PFNRT)dbgfR3BpClear, 2, pVM, iBp);
-    LogFlow(("DBGFR3BpClear: returns %Rrc\n", rc));
+    int rc = VMR3ReqPriorityCallWaitU(pUVM, VMCPUID_ANY, (PFNRT)dbgfR3BpSetREM, 5,
+                                      pUVM, pAddress, &iHitTrigger, &iHitDisable, piBp);
+    LogFlow(("DBGFR3BpSetREM: returns %Rrc\n", rc));
     return rc;
 }
@@ -728,14 +713,16 @@
  *
  * @returns VBox status code.
- * @param   pVM         Pointer to the VM.
+ * @param   pUVM        The user mode VM handle.
  * @param   iBp         The id of the breakpoint which should be removed (cleared).
  * @thread  EMT
  * @internal
  */
-static DECLCALLBACK(int) dbgfR3BpClear(PVM pVM, uint32_t iBp)
+static DECLCALLBACK(int) dbgfR3BpClear(PUVM pUVM, uint32_t iBp)
 {
     /*
      * Validate input.
      */
+    PVM pVM = pUVM->pVM;
+    VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
     PDBGFBP pBp = dbgfR3BpGet(pVM, iBp);
     if (!pBp)
@@ -756,5 +743,5 @@
 
             case DBGFBPTYPE_INT3:
-                rc = dbgfR3BpInt3Disarm(pVM, pBp);
+                rc = dbgfR3BpInt3Disarm(pUVM, pBp);
                 break;
 
@@ -782,18 +769,18 @@
 
 /**
- * Enables a breakpoint.
- *
- * @returns VBox status code.
- * @param   pVM         Pointer to the VM.
- * @param   iBp         The id of the breakpoint which should be enabled.
+ * Clears a breakpoint.
+ *
+ * @returns VBox status code.
+ * @param   pUVM        The user mode VM handle.
+ * @param   iBp         The id of the breakpoint which should be removed (cleared).
  * @thread  Any thread.
  */
-VMMR3DECL(int) DBGFR3BpEnable(PVM pVM, uint32_t iBp)
+VMMR3DECL(int) DBGFR3BpClear(PUVM pUVM, uint32_t iBp)
 {
     /*
      * This must be done on EMT.
      */
-    int rc = VMR3ReqPriorityCallWait(pVM, VMCPUID_ANY, (PFNRT)dbgfR3BpEnable, 2, pVM, iBp);
-    LogFlow(("DBGFR3BpEnable: returns %Rrc\n", rc));
+    int rc = VMR3ReqPriorityCallWaitU(pUVM, VMCPUID_ANY, (PFNRT)dbgfR3BpClear, 2, pUVM, iBp);
+    LogFlow(("DBGFR3BpClear: returns %Rrc\n", rc));
     return rc;
 }
@@ -804,14 +791,16 @@
  *
  * @returns VBox status code.
- * @param   pVM         Pointer to the VM.
+ * @param   pUVM        The user mode VM handle.
  * @param   iBp         The id of the breakpoint which should be enabled.
  * @thread  EMT
  * @internal
  */
-static DECLCALLBACK(int) dbgfR3BpEnable(PVM pVM, uint32_t iBp)
+static DECLCALLBACK(int) dbgfR3BpEnable(PUVM pUVM, uint32_t iBp)
 {
     /*
      * Validate input.
      */
+    PVM pVM = pUVM->pVM;
+    VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
     PDBGFBP pBp = dbgfR3BpGet(pVM, iBp);
     if (!pBp)
@@ -836,5 +825,5 @@
 
         case DBGFBPTYPE_INT3:
-            rc = dbgfR3BpInt3Arm(pVM, pBp);
+            rc = dbgfR3BpInt3Arm(pUVM, pBp);
             break;
 
@@ -858,18 +847,18 @@
 
 /**
- * Disables a breakpoint.
- *
- * @returns VBox status code.
- * @param   pVM         Pointer to the VM.
- * @param   iBp         The id of the breakpoint which should be disabled.
+ * Enables a breakpoint.
+ *
+ * @returns VBox status code.
+ * @param   pUVM        The user mode VM handle.
+ * @param   iBp         The id of the breakpoint which should be enabled.
  * @thread  Any thread.
  */
-VMMR3DECL(int) DBGFR3BpDisable(PVM pVM, uint32_t iBp)
+VMMR3DECL(int) DBGFR3BpEnable(PUVM pUVM, uint32_t iBp)
 {
     /*
      * This must be done on EMT.
      */
-    int rc = VMR3ReqPriorityCallWait(pVM, VMCPUID_ANY, (PFNRT)dbgfR3BpDisable, 2, pVM, iBp);
-    LogFlow(("DBGFR3BpDisable: returns %Rrc\n", rc));
+    int rc = VMR3ReqPriorityCallWaitU(pUVM, VMCPUID_ANY, (PFNRT)dbgfR3BpEnable, 2, pUVM, iBp);
+    LogFlow(("DBGFR3BpEnable: returns %Rrc\n", rc));
     return rc;
 }
@@ -880,14 +869,16 @@
  *
  * @returns VBox status code.
- * @param   pVM         Pointer to the VM.
+ * @param   pUVM        The user mode VM handle.
  * @param   iBp         The id of the breakpoint which should be disabled.
  * @thread  EMT
  * @internal
  */
-static DECLCALLBACK(int) dbgfR3BpDisable(PVM pVM, uint32_t iBp)
+static DECLCALLBACK(int) dbgfR3BpDisable(PUVM pUVM, uint32_t iBp)
 {
     /*
      * Validate input.
      */
+    PVM pVM = pUVM->pVM;
+    VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
     PDBGFBP pBp = dbgfR3BpGet(pVM, iBp);
     if (!pBp)
@@ -912,5 +903,5 @@
 
         case DBGFBPTYPE_INT3:
-            rc = dbgfR3BpInt3Disarm(pVM, pBp);
+            rc = dbgfR3BpInt3Disarm(pUVM, pBp);
             break;
 
@@ -932,19 +923,18 @@
 
 /**
- * Enumerate the breakpoints.
- *
- * @returns VBox status code.
- * @param   pVM         Pointer to the VM.
- * @param   pfnCallback The callback function.
- * @param   pvUser      The user argument to pass to the callback.
- * @thread  Any thread but the callback will be called from EMT.
- */
-VMMR3DECL(int) DBGFR3BpEnum(PVM pVM, PFNDBGFBPENUM pfnCallback, void *pvUser)
+ * Disables a breakpoint.
+ *
+ * @returns VBox status code.
+ * @param   pUVM        The user mode VM handle.
+ * @param   iBp         The id of the breakpoint which should be disabled.
+ * @thread  Any thread.
+ */
+VMMR3DECL(int) DBGFR3BpDisable(PUVM pUVM, uint32_t iBp)
 {
     /*
      * This must be done on EMT.
      */
-    int rc = VMR3ReqPriorityCallWait(pVM, VMCPUID_ANY, (PFNRT)dbgfR3BpEnum, 3, pVM, pfnCallback, pvUser);
-    LogFlow(("DBGFR3BpClear: returns %Rrc\n", rc));
+    int rc = VMR3ReqPriorityCallWaitU(pUVM, VMCPUID_ANY, (PFNRT)dbgfR3BpDisable, 2, pUVM, iBp);
+    LogFlow(("DBGFR3BpDisable: returns %Rrc\n", rc));
     return rc;
 }
@@ -955,5 +945,5 @@
  *
  * @returns VBox status code.
- * @param   pVM         Pointer to the VM.
+ * @param   pUVM        The user mode VM handle.
  * @param   pfnCallback The callback function.
  * @param   pvUser      The user argument to pass to the callback.
@@ -961,10 +951,12 @@
  * @internal
  */
-static DECLCALLBACK(int) dbgfR3BpEnum(PVM pVM, PFNDBGFBPENUM pfnCallback, void *pvUser)
+static DECLCALLBACK(int) dbgfR3BpEnum(PUVM pUVM, PFNDBGFBPENUM pfnCallback, void *pvUser)
 {
     /*
      * Validate input.
      */
-    AssertMsgReturn(VALID_PTR(pfnCallback), ("pfnCallback=%p\n", pfnCallback), VERR_INVALID_POINTER);
+    PVM pVM = pUVM->pVM;
+    VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
+    AssertPtrReturn(pfnCallback, VERR_INVALID_POINTER);
 
     /*
@@ -975,5 +967,5 @@
         if (pVM->dbgf.s.aHwBreakpoints[i].enmType != DBGFBPTYPE_FREE)
         {
-            int rc = pfnCallback(pVM, pvUser, &pVM->dbgf.s.aHwBreakpoints[i]);
+            int rc = pfnCallback(pUVM, pvUser, &pVM->dbgf.s.aHwBreakpoints[i]);
             if (RT_FAILURE(rc))
                 return rc;
@@ -986,5 +978,5 @@
         if (pVM->dbgf.s.aBreakpoints[i].enmType != DBGFBPTYPE_FREE)
         {
-            int rc = pfnCallback(pVM, pvUser, &pVM->dbgf.s.aBreakpoints[i]);
+            int rc = pfnCallback(pUVM, pvUser, &pVM->dbgf.s.aBreakpoints[i]);
             if (RT_FAILURE(rc))
                 return rc;
@@ -994,2 +986,22 @@
 }
 
+
+/**
+ * Enumerate the breakpoints.
+ *
+ * @returns VBox status code.
+ * @param   pUVM        The user mode VM handle.
+ * @param   pfnCallback The callback function.
+ * @param   pvUser      The user argument to pass to the callback.
+ * @thread  Any thread but the callback will be called from EMT.
+ */
+VMMR3DECL(int) DBGFR3BpEnum(PUVM pUVM, PFNDBGFBPENUM pfnCallback, void *pvUser)
+{
+    /*
+     * This must be done on EMT.
+     */
+    int rc = VMR3ReqPriorityCallWaitU(pUVM, VMCPUID_ANY, (PFNRT)dbgfR3BpEnum, 3, pUVM, pfnCallback, pvUser);
+    LogFlow(("DBGFR3BpClear: returns %Rrc\n", rc));
+    return rc;
+}
+
Index: trunk/src/VBox/VMM/VMMR3/DBGFCoreWrite.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMR3/DBGFCoreWrite.cpp	(revision 44398)
+++ trunk/src/VBox/VMM/VMMR3/DBGFCoreWrite.cpp	(revision 44399)
@@ -5,5 +5,5 @@
 
 /*
- * Copyright (C) 2010 Oracle Corporation
+ * Copyright (C) 2010-2013 Oracle Corporation
  *
  * This file is part of VirtualBox Open Source Edition (OSE), as
@@ -55,12 +55,13 @@
 
 #include <VBox/vmm/cpum.h>
-#include "CPUMInternal.h"
+#include <VBox/vmm/pgm.h>
 #include <VBox/vmm/dbgf.h>
 #include <VBox/vmm/dbgfcorefmt.h>
+#include <VBox/vmm/mm.h>
 #include <VBox/vmm/vm.h>
-#include <VBox/vmm/pgm.h>
+#include <VBox/vmm/uvm.h>
+
 #include <VBox/err.h>
 #include <VBox/log.h>
-#include <VBox/vmm/mm.h>
 #include <VBox/version.h>
 
@@ -430,5 +431,5 @@
     for (uint32_t iCpu = 0; iCpu < pVM->cCpus; iCpu++)
     {
-        PCPUMCTX pCpuCtx = &pVM->aCpus[iCpu].cpum.s.Guest;
+        PCPUMCTX pCpuCtx = CPUMQueryGuestCtxPtr(&pVM->aCpus[iCpu]);
         rc = Elf64WriteNoteHdr(hFile, NT_VBOXCPU, s_pcszCoreVBoxCpu, pCpuCtx, sizeof(CPUMCTX));
         if (RT_FAILURE(rc))
@@ -534,5 +535,5 @@
  *
  * @returns VBox status code.
- * @param   pVM                 Pointer to the VM.
+ * @param   pUVM                The user mode VM handle.
  * @param   pszFilename         The name of the file to which the guest core
  *                              dump should be written.
@@ -542,6 +543,8 @@
  *          interfer with the state.
  */
-VMMR3DECL(int) DBGFR3CoreWrite(PVM pVM, const char *pszFilename, bool fReplaceFile)
-{
+VMMR3DECL(int) DBGFR3CoreWrite(PUVM pUVM, const char *pszFilename, bool fReplaceFile)
+{
+    UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE);
+    PVM pVM = pUVM->pVM;
     VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
     AssertReturn(pszFilename, VERR_INVALID_HANDLE);
Index: trunk/src/VBox/VMM/VMMR3/DBGFCpu.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMR3/DBGFCpu.cpp	(revision 44398)
+++ trunk/src/VBox/VMM/VMMR3/DBGFCpu.cpp	(revision 44399)
@@ -25,4 +25,5 @@
 #include "DBGFInternal.h"
 #include <VBox/vmm/vm.h>
+#include <VBox/vmm/uvm.h>
 #include <VBox/err.h>
 #include <VBox/log.h>
@@ -35,7 +36,7 @@
  *
  * @returns VINF_SUCCESS.
- * @param   pVM                 Pointer to the VM.
- * @param   idCpu               The current CPU ID.
- * @param   penmMode            Where to return the mode.
+ * @param   pVM         Pointer to the VM.
+ * @param   idCpu       The current CPU ID.
+ * @param   penmMode    Where to return the mode.
  */
 static DECLCALLBACK(int) dbgfR3CpuGetMode(PVM pVM, VMCPUID idCpu, CPUMMODE *penmMode)
@@ -52,14 +53,15 @@
  *
  * @returns The CPU mode on success, CPUMMODE_INVALID on failure.
- * @param   pVM                 Pointer to the VM.
- * @param   idCpu               The target CPU ID.
+ * @param   pUVM        The user mode VM handle.
+ * @param   idCpu       The target CPU ID.
  */
-VMMR3DECL(CPUMMODE) DBGFR3CpuGetMode(PVM pVM, VMCPUID idCpu)
+VMMR3DECL(CPUMMODE) DBGFR3CpuGetMode(PUVM pUVM, VMCPUID idCpu)
 {
-    VM_ASSERT_VALID_EXT_RETURN(pVM, CPUMMODE_INVALID);
-    AssertReturn(idCpu < pVM->cCpus, CPUMMODE_INVALID);
+    UVM_ASSERT_VALID_EXT_RETURN(pUVM, CPUMMODE_INVALID);
+    VM_ASSERT_VALID_EXT_RETURN(pUVM->pVM, CPUMMODE_INVALID);
+    AssertReturn(idCpu < pUVM->pVM->cCpus, CPUMMODE_INVALID);
 
     CPUMMODE enmMode;
-    int rc = VMR3ReqPriorityCallWait(pVM, idCpu, (PFNRT)dbgfR3CpuGetMode, 3, pVM, idCpu, &enmMode);
+    int rc = VMR3ReqPriorityCallWaitU(pUVM, idCpu, (PFNRT)dbgfR3CpuGetMode, 3, pUVM->pVM, idCpu, &enmMode);
     if (RT_FAILURE(rc))
         return CPUMMODE_INVALID;
@@ -67,2 +69,15 @@
 }
 
+
+/**
+ * Get the number of CPUs (or threads if you insist).
+ *
+ * @returns The number of CPUs
+ * @param   pUVM        The user mode VM handle.
+ */
+VMMR3DECL(VMCPUID) DBGFR3CpuGetCount(PUVM pUVM)
+{
+    UVM_ASSERT_VALID_EXT_RETURN(pUVM, 1);
+    return pUVM->cCpus;
+}
+
Index: trunk/src/VBox/VMM/VMMR3/DBGFDisas.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMR3/DBGFDisas.cpp	(revision 44398)
+++ trunk/src/VBox/VMM/VMMR3/DBGFDisas.cpp	(revision 44399)
@@ -30,4 +30,5 @@
 #include <VBox/param.h>
 #include <VBox/vmm/vm.h>
+#include <VBox/vmm/uvm.h>
 #include "internal/pgm.h"
 
@@ -296,7 +297,7 @@
         :  pSelInfo->Sel == DIS_FMT_SEL_GET_VALUE(u32Sel))
     {
-        rc = DBGFR3AddrFromSelInfoOff(pState->pVM, &Addr, pSelInfo, uAddress);
+        rc = DBGFR3AddrFromSelInfoOff(pState->pVM->pUVM, &Addr, pSelInfo, uAddress);
         if (RT_SUCCESS(rc))
-            rc = DBGFR3AsSymbolByAddr(pState->pVM, pState->hAs, &Addr, &off, &Sym, NULL /*phMod*/);
+            rc = DBGFR3AsSymbolByAddr(pState->pVM->pUVM, pState->hAs, &Addr, &off, &Sym, NULL /*phMod*/);
     }
     else
@@ -576,5 +577,5 @@
  *
  * @returns VBox status code.
- * @param   pVM             Pointer to the VM.
+ * @param   pUVM            The user mode VM handle.
  * @param   idCpu           The ID of virtual CPU.
  * @param   Sel             The code selector. This used to determine the 32/16 bit ness and
@@ -591,11 +592,13 @@
  *          address conversion.
  */
-VMMR3DECL(int) DBGFR3DisasInstrEx(PVM pVM, VMCPUID idCpu, RTSEL Sel, RTGCPTR GCPtr, uint32_t fFlags,
+VMMR3DECL(int) DBGFR3DisasInstrEx(PUVM pUVM, VMCPUID idCpu, RTSEL Sel, RTGCPTR GCPtr, uint32_t fFlags,
                                   char *pszOutput, uint32_t cbOutput, uint32_t *pcbInstr)
 {
     AssertReturn(cbOutput > 0, VERR_INVALID_PARAMETER);
     *pszOutput = '\0';
+    UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE);
+    PVM pVM = pUVM->pVM;
     VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
-    AssertReturn(idCpu < pVM->cCpus, VERR_INVALID_CPU_ID);
+    AssertReturn(idCpu < pUVM->cCpus, VERR_INVALID_CPU_ID);
     AssertReturn(!(fFlags & ~DBGF_DISAS_FLAGS_VALID_MASK), VERR_INVALID_PARAMETER);
     AssertReturn((fFlags & DBGF_DISAS_FLAGS_MODE_MASK) <= DBGF_DISAS_FLAGS_64BIT_MODE, VERR_INVALID_PARAMETER);
@@ -626,13 +629,16 @@
  *                          terminated if @a cbOutput is greater than zero.
  * @param   cbOutput        Size of the output buffer.
- */
-VMMR3DECL(int) DBGFR3DisasInstrCurrent(PVMCPU pVCpu, char *pszOutput, uint32_t cbOutput)
+ * @thread  EMT(pVCpu)
+ */
+VMMR3_INT_DECL(int) DBGFR3DisasInstrCurrent(PVMCPU pVCpu, char *pszOutput, uint32_t cbOutput)
 {
     AssertReturn(cbOutput > 0, VERR_INVALID_PARAMETER);
     *pszOutput = '\0';
-    AssertReturn(pVCpu, VERR_INVALID_CONTEXT);
-    return DBGFR3DisasInstrEx(pVCpu->pVMR3, pVCpu->idCpu, 0, 0,
-                              DBGF_DISAS_FLAGS_CURRENT_GUEST | DBGF_DISAS_FLAGS_DEFAULT_MODE,
-                              pszOutput, cbOutput, NULL);
+    Assert(VMCPU_IS_EMT(pVCpu));
+
+    RTGCPTR GCPtr = 0;
+    return dbgfR3DisasInstrExOnVCpu(pVCpu->pVMR3, pVCpu, 0, &GCPtr,
+                                    DBGF_DISAS_FLAGS_CURRENT_GUEST | DBGF_DISAS_FLAGS_DEFAULT_MODE,
+                                    pszOutput, cbOutput, NULL);
 }
 
@@ -645,4 +651,5 @@
  * @param   pVCpu           Pointer to the VMCPU.
  * @param   pszPrefix       Short prefix string to the disassembly string. (optional)
+ * @thread  EMT(pVCpu)
  */
 VMMR3DECL(int) DBGFR3DisasInstrCurrentLogInternal(PVMCPU pVCpu, const char *pszPrefix)
@@ -667,5 +674,4 @@
  *
  * @returns VBox status code.
- * @param   pVM             Pointer to the VM.
  * @param   pVCpu           Pointer to the VMCPU, defaults to CPU 0 if NULL.
  * @param   Sel             The code selector. This used to determine the 32/16 bit-ness and
@@ -673,10 +679,14 @@
  * @param   GCPtr           The code address relative to the base of Sel.
  * @param   pszPrefix       Short prefix string to the disassembly string. (optional)
+ * @thread  EMT(pVCpu)
  */
 VMMR3DECL(int) DBGFR3DisasInstrLogInternal(PVMCPU pVCpu, RTSEL Sel, RTGCPTR GCPtr, const char *pszPrefix)
 {
+    Assert(VMCPU_IS_EMT(pVCpu));
+
     char szBuf[256];
-    int rc = DBGFR3DisasInstrEx(pVCpu->pVMR3, pVCpu->idCpu, Sel, GCPtr, DBGF_DISAS_FLAGS_DEFAULT_MODE,
-                                &szBuf[0], sizeof(szBuf), NULL);
+    RTGCPTR GCPtrTmp = GCPtr;
+    int rc = dbgfR3DisasInstrExOnVCpu(pVCpu->pVMR3, pVCpu, Sel, &GCPtrTmp, DBGF_DISAS_FLAGS_DEFAULT_MODE,
+                                      &szBuf[0], sizeof(szBuf), NULL);
     if (RT_FAILURE(rc))
         RTStrPrintf(szBuf, sizeof(szBuf), "DBGFR3DisasInstrLog(, %RTsel, %RGv) failed with rc=%Rrc\n", Sel, GCPtr, rc);
Index: trunk/src/VBox/VMM/VMMR3/DBGFInfo.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMR3/DBGFInfo.cpp	(revision 44398)
+++ trunk/src/VBox/VMM/VMMR3/DBGFInfo.cpp	(revision 44399)
@@ -5,5 +5,5 @@
 
 /*
- * Copyright (C) 2006-2007 Oracle Corporation
+ * Copyright (C) 2006-2013 Oracle Corporation
  *
  * This file is part of VirtualBox Open Source Edition (OSE), as
@@ -26,4 +26,5 @@
 #include "DBGFInternal.h"
 #include <VBox/vmm/vm.h>
+#include <VBox/vmm/uvm.h>
 #include <VBox/err.h>
 #include <VBox/log.h>
@@ -31,4 +32,5 @@
 #include <iprt/assert.h>
 #include <iprt/ctype.h>
+#include <iprt/param.h>
 #include <iprt/semaphore.h>
 #include <iprt/stream.h>
@@ -78,12 +80,12 @@
  *
  * @returns VBox status code.
- * @param   pVM     Pointer to the VM.
- */
-int dbgfR3InfoInit(PVM pVM)
+ * @param   pUVM        The user mode VM handle.
+ */
+int dbgfR3InfoInit(PUVM pUVM)
 {
     /*
      * Make sure we already didn't initialized in the lazy manner.
      */
-    if (RTCritSectIsInitialized(&pVM->dbgf.s.InfoCritSect))
+    if (RTCritSectIsInitialized(&pUVM->dbgf.s.InfoCritSect))
         return VINF_SUCCESS;
 
@@ -91,5 +93,5 @@
      * Initialize the crit sect.
      */
-    int rc = RTCritSectInit(&pVM->dbgf.s.InfoCritSect);
+    int rc = RTCritSectInit(&pUVM->dbgf.s.InfoCritSect);
     AssertRCReturn(rc, rc);
 
@@ -97,5 +99,5 @@
      * Register the 'info help' item.
      */
-    rc = DBGFR3InfoRegisterInternal(pVM, "help", "List of info items.", dbgfR3InfoHelp);
+    rc = DBGFR3InfoRegisterInternal(pUVM->pVM, "help", "List of info items.", dbgfR3InfoHelp);
     AssertRCReturn(rc, rc);
 
@@ -108,12 +110,12 @@
  *
  * @returns VBox status code.
- * @param   pVM     Pointer to the VM.
- */
-int dbgfR3InfoTerm(PVM pVM)
+ * @param   pUVM        The user mode VM handle.
+ */
+int dbgfR3InfoTerm(PUVM pUVM)
 {
     /*
      * Delete the crit sect.
      */
-    int rc = RTCritSectDelete(&pVM->dbgf.s.InfoCritSect);
+    int rc = RTCritSectDelete(&pUVM->dbgf.s.InfoCritSect);
     AssertRC(rc);
     return rc;
@@ -211,5 +213,5 @@
  *
  * @returns VBox status code.
- * @param   pVM         Pointer to the VM.
+ * @param   pUVM        The user mode VM handle.
  * @param   pszName     The identifier of the info.
  * @param   pszDesc     The description of the info and any arguments the handler may take.
@@ -217,5 +219,5 @@
  * @param   ppInfo      Where to store the created
  */
-static int dbgfR3InfoRegister(PVM pVM, const char *pszName, const char *pszDesc, uint32_t fFlags, PDBGFINFO *ppInfo)
+static int dbgfR3InfoRegister(PUVM pUVM, const char *pszName, const char *pszDesc, uint32_t fFlags, PDBGFINFO *ppInfo)
 {
     /*
@@ -232,5 +234,5 @@
     int rc;
     size_t cchName = strlen(pszName) + 1;
-    PDBGFINFO pInfo = (PDBGFINFO)MMR3HeapAlloc(pVM, MM_TAG_DBGF_INFO, RT_OFFSETOF(DBGFINFO, szName[cchName]));
+    PDBGFINFO pInfo = (PDBGFINFO)MMR3HeapAllocU(pUVM, MM_TAG_DBGF_INFO, RT_OFFSETOF(DBGFINFO, szName[cchName]));
     if (pInfo)
     {
@@ -243,6 +245,6 @@
         /* lazy init */
         rc = VINF_SUCCESS;
-        if (!RTCritSectIsInitialized(&pVM->dbgf.s.InfoCritSect))
-            rc = dbgfR3InfoInit(pVM);
+        if (!RTCritSectIsInitialized(&pUVM->dbgf.s.InfoCritSect))
+            rc = dbgfR3InfoInit(pUVM);
         if (RT_SUCCESS(rc))
         {
@@ -250,9 +252,9 @@
              * Insert in alphabetical order.
              */
-            rc = RTCritSectEnter(&pVM->dbgf.s.InfoCritSect);
+            rc = RTCritSectEnter(&pUVM->dbgf.s.InfoCritSect);
             AssertRC(rc);
             PDBGFINFO pPrev = NULL;
             PDBGFINFO pCur;
-            for (pCur = pVM->dbgf.s.pInfoFirst; pCur; pPrev = pCur, pCur = pCur->pNext)
+            for (pCur = pUVM->dbgf.s.pInfoFirst; pCur; pPrev = pCur, pCur = pCur->pNext)
                 if (strcmp(pszName, pCur->szName) < 0)
                     break;
@@ -261,5 +263,5 @@
                 pPrev->pNext = pInfo;
             else
-                pVM->dbgf.s.pInfoFirst = pInfo;
+                pUVM->dbgf.s.pInfoFirst = pInfo;
 
             *ppInfo = pInfo;
@@ -284,5 +286,6 @@
  * @param   pDevIns     The device instance owning the info.
  */
-VMMR3DECL(int) DBGFR3InfoRegisterDevice(PVM pVM, const char *pszName, const char *pszDesc, PFNDBGFHANDLERDEV pfnHandler, PPDMDEVINS pDevIns)
+VMMR3_INT_DECL(int) DBGFR3InfoRegisterDevice(PVM pVM, const char *pszName, const char *pszDesc,
+                                             PFNDBGFHANDLERDEV pfnHandler, PPDMDEVINS pDevIns)
 {
     LogFlow(("DBGFR3InfoRegisterDevice: pszName=%p:{%s} pszDesc=%p:{%s} pfnHandler=%p pDevIns=%p\n",
@@ -292,14 +295,6 @@
      * Validate the specific stuff.
      */
-    if (!pfnHandler)
-    {
-        AssertMsgFailed(("No handler\n"));
-        return VERR_INVALID_PARAMETER;
-    }
-    if (!pDevIns)
-    {
-        AssertMsgFailed(("No pDevIns\n"));
-        return VERR_INVALID_PARAMETER;
-    }
+    AssertPtrReturn(pfnHandler, VERR_INVALID_POINTER);
+    AssertPtrReturn(pDevIns, VERR_INVALID_POINTER);
 
     /*
@@ -307,5 +302,5 @@
      */
     PDBGFINFO pInfo;
-    int rc = dbgfR3InfoRegister(pVM, pszName, pszDesc, 0, &pInfo);
+    int rc = dbgfR3InfoRegister(pVM->pUVM, pszName, pszDesc, 0, &pInfo);
     if (RT_SUCCESS(rc))
     {
@@ -313,5 +308,5 @@
         pInfo->u.Dev.pfnHandler = pfnHandler;
         pInfo->u.Dev.pDevIns = pDevIns;
-        RTCritSectLeave(&pVM->dbgf.s.InfoCritSect);
+        RTCritSectLeave(&pVM->pUVM->dbgf.s.InfoCritSect);
     }
 
@@ -330,5 +325,5 @@
  * @param   pDrvIns     The driver instance owning the info.
  */
-VMMR3DECL(int) DBGFR3InfoRegisterDriver(PVM pVM, const char *pszName, const char *pszDesc, PFNDBGFHANDLERDRV pfnHandler, PPDMDRVINS pDrvIns)
+VMMR3_INT_DECL(int) DBGFR3InfoRegisterDriver(PVM pVM, const char *pszName, const char *pszDesc, PFNDBGFHANDLERDRV pfnHandler, PPDMDRVINS pDrvIns)
 {
     LogFlow(("DBGFR3InfoRegisterDriver: pszName=%p:{%s} pszDesc=%p:{%s} pfnHandler=%p pDrvIns=%p\n",
@@ -338,14 +333,6 @@
      * Validate the specific stuff.
      */
-    if (!pfnHandler)
-    {
-        AssertMsgFailed(("No handler\n"));
-        return VERR_INVALID_PARAMETER;
-    }
-    if (!pDrvIns)
-    {
-        AssertMsgFailed(("No pDrvIns\n"));
-        return VERR_INVALID_PARAMETER;
-    }
+    AssertPtrReturn(pfnHandler, VERR_INVALID_POINTER);
+    AssertPtrReturn(pDrvIns, VERR_INVALID_POINTER);
 
     /*
@@ -353,5 +340,5 @@
      */
     PDBGFINFO pInfo;
-    int rc = dbgfR3InfoRegister(pVM, pszName, pszDesc, 0, &pInfo);
+    int rc = dbgfR3InfoRegister(pVM->pUVM, pszName, pszDesc, 0, &pInfo);
     if (RT_SUCCESS(rc))
     {
@@ -359,5 +346,5 @@
         pInfo->u.Drv.pfnHandler = pfnHandler;
         pInfo->u.Drv.pDrvIns = pDrvIns;
-        RTCritSectLeave(&pVM->dbgf.s.InfoCritSect);
+        RTCritSectLeave(&pVM->pUVM->dbgf.s.InfoCritSect);
     }
 
@@ -375,5 +362,5 @@
  * @param   pfnHandler  The handler function to be called to display the info.
  */
-VMMR3DECL(int) DBGFR3InfoRegisterInternal(PVM pVM, const char *pszName, const char *pszDesc, PFNDBGFHANDLERINT pfnHandler)
+VMMR3_INT_DECL(int) DBGFR3InfoRegisterInternal(PVM pVM, const char *pszName, const char *pszDesc, PFNDBGFHANDLERINT pfnHandler)
 {
     return DBGFR3InfoRegisterInternalEx(pVM, pszName, pszDesc, pfnHandler, 0);
@@ -391,5 +378,6 @@
  * @param   fFlags      Flags, see the DBGFINFO_FLAGS_*.
  */
-VMMR3DECL(int) DBGFR3InfoRegisterInternalEx(PVM pVM, const char *pszName, const char *pszDesc, PFNDBGFHANDLERINT pfnHandler, uint32_t fFlags)
+VMMR3_INT_DECL(int) DBGFR3InfoRegisterInternalEx(PVM pVM, const char *pszName, const char *pszDesc,
+                                                 PFNDBGFHANDLERINT pfnHandler, uint32_t fFlags)
 {
     LogFlow(("DBGFR3InfoRegisterInternal: pszName=%p:{%s} pszDesc=%p:{%s} pfnHandler=%p fFlags=%x\n",
@@ -399,9 +387,5 @@
      * Validate the specific stuff.
      */
-    if (!pfnHandler)
-    {
-        AssertMsgFailed(("No handler\n"));
-        return VERR_INVALID_PARAMETER;
-    }
+    AssertPtrReturn(pfnHandler, VERR_INVALID_POINTER);
 
     /*
@@ -409,10 +393,10 @@
      */
     PDBGFINFO pInfo;
-    int rc = dbgfR3InfoRegister(pVM, pszName, pszDesc, fFlags, &pInfo);
+    int rc = dbgfR3InfoRegister(pVM->pUVM, pszName, pszDesc, fFlags, &pInfo);
     if (RT_SUCCESS(rc))
     {
         pInfo->enmType = DBGFINFOTYPE_INT;
         pInfo->u.Int.pfnHandler = pfnHandler;
-        RTCritSectLeave(&pVM->dbgf.s.InfoCritSect);
+        RTCritSectLeave(&pVM->pUVM->dbgf.s.InfoCritSect);
     }
 
@@ -425,5 +409,5 @@
  *
  * @returns VBox status code.
- * @param   pVM         Pointer to the VM.
+ * @param   pUVM        The user mode VM handle.
  * @param   pszName     The identifier of the info.
  * @param   pszDesc     The description of the info and any arguments the handler may take.
@@ -431,5 +415,6 @@
  * @param   pvUser      User argument to be passed to the handler.
  */
-VMMR3DECL(int) DBGFR3InfoRegisterExternal(PVM pVM, const char *pszName, const char *pszDesc, PFNDBGFHANDLEREXT pfnHandler, void *pvUser)
+VMMR3DECL(int) DBGFR3InfoRegisterExternal(PUVM pUVM, const char *pszName, const char *pszDesc,
+                                          PFNDBGFHANDLEREXT pfnHandler, void *pvUser)
 {
     LogFlow(("DBGFR3InfoRegisterExternal: pszName=%p:{%s} pszDesc=%p:{%s} pfnHandler=%p pvUser=%p\n",
@@ -439,9 +424,6 @@
      * Validate the specific stuff.
      */
-    if (!pfnHandler)
-    {
-        AssertMsgFailed(("No handler\n"));
-        return VERR_INVALID_PARAMETER;
-    }
+    AssertPtrReturn(pfnHandler, VERR_INVALID_POINTER);
+    UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE);
 
     /*
@@ -449,5 +431,5 @@
      */
     PDBGFINFO pInfo;
-    int rc = dbgfR3InfoRegister(pVM, pszName, pszDesc, 0, &pInfo);
+    int rc = dbgfR3InfoRegister(pUVM, pszName, pszDesc, 0, &pInfo);
     if (RT_SUCCESS(rc))
     {
@@ -455,5 +437,5 @@
         pInfo->u.Ext.pfnHandler = pfnHandler;
         pInfo->u.Ext.pvUser = pvUser;
-        RTCritSectLeave(&pVM->dbgf.s.InfoCritSect);
+        RTCritSectLeave(&pUVM->dbgf.s.InfoCritSect);
     }
 
@@ -470,5 +452,5 @@
  * @param   pszName     The identifier of the info. If NULL all owned by the device.
  */
-VMMR3DECL(int) DBGFR3InfoDeregisterDevice(PVM pVM, PPDMDEVINS pDevIns, const char *pszName)
+VMMR3_INT_DECL(int) DBGFR3InfoDeregisterDevice(PVM pVM, PPDMDEVINS pDevIns, const char *pszName)
 {
     LogFlow(("DBGFR3InfoDeregisterDevice: pDevIns=%p pszName=%p:{%s}\n", pDevIns, pszName, pszName));
@@ -477,19 +459,16 @@
      * Validate input.
      */
-    if (!pDevIns)
-    {
-        AssertMsgFailed(("!pDevIns\n"));
-        return VERR_INVALID_PARAMETER;
-    }
+    AssertPtrReturn(pDevIns, VERR_INVALID_POINTER);
+    AssertPtrNullReturn(pszName, VERR_INVALID_POINTER);
     size_t cchName = pszName ? strlen(pszName) : 0;
+    PUVM pUVM = pVM->pUVM;
 
     /*
      * Enumerate the info handlers and free the requested entries.
      */
-    int rc = RTCritSectEnter(&pVM->dbgf.s.InfoCritSect);
-    AssertRC(rc);
+    int rc = RTCritSectEnter(&pUVM->dbgf.s.InfoCritSect); AssertRC(rc);
     rc = VERR_FILE_NOT_FOUND;
     PDBGFINFO pPrev = NULL;
-    PDBGFINFO pInfo = pVM->dbgf.s.pInfoFirst;
+    PDBGFINFO pInfo = pUVM->dbgf.s.pInfoFirst;
     if (pszName)
     {
@@ -506,5 +485,5 @@
                     pPrev->pNext = pInfo->pNext;
                 else
-                    pVM->dbgf.s.pInfoFirst = pInfo->pNext;
+                    pUVM->dbgf.s.pInfoFirst = pInfo->pNext;
                 MMR3HeapFree(pInfo);
                 rc = VINF_SUCCESS;
@@ -515,5 +494,5 @@
     {
         /*
-         * Free all owned by the driver.
+         * Free all owned by the device.
          */
         for (; pInfo; pPrev = pInfo, pInfo = pInfo->pNext)
@@ -524,5 +503,5 @@
                     pPrev->pNext = pInfo->pNext;
                 else
-                    pVM->dbgf.s.pInfoFirst = pInfo->pNext;
+                    pUVM->dbgf.s.pInfoFirst = pInfo->pNext;
                 MMR3HeapFree(pInfo);
                 pInfo = pPrev;
@@ -530,5 +509,5 @@
         rc = VINF_SUCCESS;
     }
-    int rc2 = RTCritSectLeave(&pVM->dbgf.s.InfoCritSect);
+    int rc2 = RTCritSectLeave(&pUVM->dbgf.s.InfoCritSect);
     AssertRC(rc2);
     AssertRC(rc);
@@ -545,5 +524,5 @@
  * @param   pszName     The identifier of the info. If NULL all owned by the driver.
  */
-VMMR3DECL(int) DBGFR3InfoDeregisterDriver(PVM pVM, PPDMDRVINS pDrvIns, const char *pszName)
+VMMR3_INT_DECL(int) DBGFR3InfoDeregisterDriver(PVM pVM, PPDMDRVINS pDrvIns, const char *pszName)
 {
     LogFlow(("DBGFR3InfoDeregisterDriver: pDrvIns=%p pszName=%p:{%s}\n", pDrvIns, pszName, pszName));
@@ -552,19 +531,16 @@
      * Validate input.
      */
-    if (!pDrvIns)
-    {
-        AssertMsgFailed(("!pDrvIns\n"));
-        return VERR_INVALID_PARAMETER;
-    }
+    AssertPtrReturn(pDrvIns, VERR_INVALID_POINTER);
+    AssertPtrNullReturn(pszName, VERR_INVALID_POINTER);
     size_t cchName = pszName ? strlen(pszName) : 0;
+    PUVM pUVM = pVM->pUVM;
 
     /*
      * Enumerate the info handlers and free the requested entries.
      */
-    int rc = RTCritSectEnter(&pVM->dbgf.s.InfoCritSect);
-    AssertRC(rc);
+    int rc = RTCritSectEnter(&pUVM->dbgf.s.InfoCritSect); AssertRC(rc);
     rc = VERR_FILE_NOT_FOUND;
     PDBGFINFO pPrev = NULL;
-    PDBGFINFO pInfo = pVM->dbgf.s.pInfoFirst;
+    PDBGFINFO pInfo = pUVM->dbgf.s.pInfoFirst;
     if (pszName)
     {
@@ -581,5 +557,5 @@
                     pPrev->pNext = pInfo->pNext;
                 else
-                    pVM->dbgf.s.pInfoFirst = pInfo->pNext;
+                    pUVM->dbgf.s.pInfoFirst = pInfo->pNext;
                 MMR3HeapFree(pInfo);
                 rc = VINF_SUCCESS;
@@ -599,5 +575,5 @@
                     pPrev->pNext = pInfo->pNext;
                 else
-                    pVM->dbgf.s.pInfoFirst = pInfo->pNext;
+                    pUVM->dbgf.s.pInfoFirst = pInfo->pNext;
                 MMR3HeapFree(pInfo);
                 pInfo = pPrev;
@@ -605,5 +581,5 @@
         rc = VINF_SUCCESS;
     }
-    int rc2 = RTCritSectLeave(&pVM->dbgf.s.InfoCritSect);
+    int rc2 = RTCritSectLeave(&pUVM->dbgf.s.InfoCritSect);
     AssertRC(rc2);
     AssertRC(rc);
@@ -617,18 +593,14 @@
  *
  * @returns VBox status code.
- * @param   pVM         Pointer to the VM.
+ * @param   pUVM        Pointer to the VM.
  * @param   pszName     The identifier of the info.
  * @param   enmType     The info owner type.
  */
-static int dbgfR3InfoDeregister(PVM pVM, const char *pszName, DBGFINFOTYPE enmType)
+static int dbgfR3InfoDeregister(PUVM pUVM, const char *pszName, DBGFINFOTYPE enmType)
 {
     /*
      * Validate input.
      */
-    if (!pszName)
-    {
-        AssertMsgFailed(("!pszName\n"));
-        return VERR_INVALID_PARAMETER;
-    }
+    AssertPtrReturn(pszName, VERR_INVALID_POINTER);
 
     /*
@@ -636,9 +608,9 @@
      */
     size_t cchName = strlen(pszName);
-    int rc = RTCritSectEnter(&pVM->dbgf.s.InfoCritSect);
+    int rc = RTCritSectEnter(&pUVM->dbgf.s.InfoCritSect);
     AssertRC(rc);
     rc = VERR_FILE_NOT_FOUND;
     PDBGFINFO pPrev = NULL;
-    PDBGFINFO pInfo = pVM->dbgf.s.pInfoFirst;
+    PDBGFINFO pInfo = pUVM->dbgf.s.pInfoFirst;
     for (; pInfo; pPrev = pInfo, pInfo = pInfo->pNext)
         if (    pInfo->cchName == cchName
@@ -649,10 +621,10 @@
                 pPrev->pNext = pInfo->pNext;
             else
-                pVM->dbgf.s.pInfoFirst = pInfo->pNext;
+                pUVM->dbgf.s.pInfoFirst = pInfo->pNext;
             MMR3HeapFree(pInfo);
             rc = VINF_SUCCESS;
             break;
         }
-    int rc2 = RTCritSectLeave(&pVM->dbgf.s.InfoCritSect);
+    int rc2 = RTCritSectLeave(&pUVM->dbgf.s.InfoCritSect);
     AssertRC(rc2);
     AssertRC(rc);
@@ -669,8 +641,8 @@
  * @param   pszName     The identifier of the info. If NULL all owned by the device.
  */
-VMMR3DECL(int) DBGFR3InfoDeregisterInternal(PVM pVM, const char *pszName)
+VMMR3_INT_DECL(int) DBGFR3InfoDeregisterInternal(PVM pVM, const char *pszName)
 {
     LogFlow(("DBGFR3InfoDeregisterInternal: pszName=%p:{%s}\n", pszName, pszName));
-    return dbgfR3InfoDeregister(pVM, pszName, DBGFINFOTYPE_INT);
+    return dbgfR3InfoDeregister(pVM->pUVM, pszName, DBGFINFOTYPE_INT);
 }
 
@@ -680,11 +652,12 @@
  *
  * @returns VBox status code.
- * @param   pVM         Pointer to the VM.
+ * @param   pUVM        The user mode VM handle.
  * @param   pszName     The identifier of the info. If NULL all owned by the device.
  */
-VMMR3DECL(int) DBGFR3InfoDeregisterExternal(PVM pVM, const char *pszName)
+VMMR3DECL(int) DBGFR3InfoDeregisterExternal(PUVM pUVM, const char *pszName)
 {
     LogFlow(("DBGFR3InfoDeregisterExternal: pszName=%p:{%s}\n", pszName, pszName));
-    return dbgfR3InfoDeregister(pVM, pszName, DBGFINFOTYPE_EXT);
+    UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE);
+    return dbgfR3InfoDeregister(pUVM, pszName, DBGFINFOTYPE_EXT);
 }
 
@@ -694,12 +667,12 @@
  *
  * @returns VBox status code.
- * @param   pVM                 Pointer to the VM.
- * @param   idCpu               Which CPU to run EMT bound handlers on.
- *                              VMCPUID_ANY or a valid CPU ID.
- * @param   pszName             What to dump.
- * @param   pszArgs             Arguments, optional.
- * @param   pHlp                Output helper, optional.
- */
-static DECLCALLBACK(int) dbgfR3Info(PVM pVM, VMCPUID idCpu, const char *pszName, const char *pszArgs, PCDBGFINFOHLP pHlp)
+ * @param   pUVM        The user mode VM handle.
+ * @param   idCpu       Which CPU to run EMT bound handlers on.  VMCPUID_ANY or
+ *                      a valid CPU ID.
+ * @param   pszName     What to dump.
+ * @param   pszArgs     Arguments, optional.
+ * @param   pHlp        Output helper, optional.
+ */
+static DECLCALLBACK(int) dbgfR3Info(PUVM pUVM, VMCPUID idCpu, const char *pszName, const char *pszArgs, PCDBGFINFOHLP pHlp)
 {
     /*
@@ -707,12 +680,10 @@
      */
     AssertPtrReturn(pszName, VERR_INVALID_POINTER);
+    AssertPtrNullReturn(pszArgs, VERR_INVALID_POINTER);
     if (pHlp)
     {
-        if (    !pHlp->pfnPrintf
-            ||  !pHlp->pfnPrintfV)
-        {
-            AssertMsgFailed(("A pHlp member is missing!\n"));
-            return VERR_INVALID_PARAMETER;
-        }
+        AssertPtrReturn(pHlp, VERR_INVALID_PARAMETER);
+        AssertPtrReturn(pHlp->pfnPrintf, VERR_INVALID_PARAMETER);
+        AssertPtrReturn(pHlp->pfnPrintfV, VERR_INVALID_PARAMETER);
     }
     else
@@ -723,7 +694,7 @@
      */
     size_t cchName = strlen(pszName);
-    int rc = RTCritSectEnter(&pVM->dbgf.s.InfoCritSect);
+    int rc = RTCritSectEnter(&pUVM->dbgf.s.InfoCritSect);
     AssertRC(rc);
-    PDBGFINFO pInfo = pVM->dbgf.s.pInfoFirst;
+    PDBGFINFO pInfo = pUVM->dbgf.s.pInfoFirst;
     for (; pInfo; pInfo = pInfo->pNext)
         if (    pInfo->cchName == cchName
@@ -738,5 +709,5 @@
          */
         DBGFINFO Info = *pInfo;
-        rc = RTCritSectLeave(&pVM->dbgf.s.InfoCritSect);
+        rc = RTCritSectLeave(&pUVM->dbgf.s.InfoCritSect);
         AssertRC(rc);
         rc = VINF_SUCCESS;
@@ -745,5 +716,5 @@
             case DBGFINFOTYPE_DEV:
                 if (Info.fFlags & DBGFINFO_FLAGS_RUN_ON_EMT)
-                    rc = VMR3ReqCallVoidWait(pVM, idCpu, (PFNRT)Info.u.Dev.pfnHandler, 3, Info.u.Dev.pDevIns, pHlp, pszArgs);
+                    rc = VMR3ReqCallVoidWaitU(pUVM, idCpu, (PFNRT)Info.u.Dev.pfnHandler, 3, Info.u.Dev.pDevIns, pHlp, pszArgs);
                 else
                     Info.u.Dev.pfnHandler(Info.u.Dev.pDevIns, pHlp, pszArgs);
@@ -752,5 +723,5 @@
             case DBGFINFOTYPE_DRV:
                 if (Info.fFlags & DBGFINFO_FLAGS_RUN_ON_EMT)
-                    rc = VMR3ReqCallVoidWait(pVM, idCpu, (PFNRT)Info.u.Drv.pfnHandler, 3, Info.u.Drv.pDrvIns, pHlp, pszArgs);
+                    rc = VMR3ReqCallVoidWaitU(pUVM, idCpu, (PFNRT)Info.u.Drv.pfnHandler, 3, Info.u.Drv.pDrvIns, pHlp, pszArgs);
                 else
                     Info.u.Drv.pfnHandler(Info.u.Drv.pDrvIns, pHlp, pszArgs);
@@ -758,13 +729,18 @@
 
             case DBGFINFOTYPE_INT:
-                if (Info.fFlags & DBGFINFO_FLAGS_RUN_ON_EMT)
-                    rc = VMR3ReqCallVoidWait(pVM, idCpu, (PFNRT)Info.u.Int.pfnHandler, 3, pVM, pHlp, pszArgs);
+                if (RT_VALID_PTR(pUVM->pVM))
+                {
+                    if (Info.fFlags & DBGFINFO_FLAGS_RUN_ON_EMT)
+                        rc = VMR3ReqCallVoidWaitU(pUVM, idCpu, (PFNRT)Info.u.Int.pfnHandler, 3, pUVM->pVM, pHlp, pszArgs);
+                    else
+                        Info.u.Int.pfnHandler(pUVM->pVM, pHlp, pszArgs);
+                }
                 else
-                    Info.u.Int.pfnHandler(pVM, pHlp, pszArgs);
+                    rc = VERR_INVALID_VM_HANDLE;
                 break;
 
             case DBGFINFOTYPE_EXT:
                 if (Info.fFlags & DBGFINFO_FLAGS_RUN_ON_EMT)
-                    rc = VMR3ReqCallVoidWait(pVM, idCpu, (PFNRT)Info.u.Ext.pfnHandler, 3, Info.u.Ext.pvUser, pHlp, pszArgs);
+                    rc = VMR3ReqCallVoidWaitU(pUVM, idCpu, (PFNRT)Info.u.Ext.pfnHandler, 3, Info.u.Ext.pvUser, pHlp, pszArgs);
                 else
                     Info.u.Ext.pfnHandler(Info.u.Ext.pvUser, pHlp, pszArgs);
@@ -777,5 +753,5 @@
     else
     {
-        rc = RTCritSectLeave(&pVM->dbgf.s.InfoCritSect);
+        rc = RTCritSectLeave(&pUVM->dbgf.s.InfoCritSect);
         AssertRC(rc);
         rc = VERR_FILE_NOT_FOUND;
@@ -788,12 +764,13 @@
  *
  * @returns VBox status code.
- * @param   pVM         Pointer to the VM.
+ * @param   pUVM        The user mode VM handle.
  * @param   pszName     The identifier of the info to display.
  * @param   pszArgs     Arguments to the info handler.
  * @param   pHlp        The output helper functions. If NULL the logger will be used.
  */
-VMMR3DECL(int) DBGFR3Info(PVM pVM, const char *pszName, const char *pszArgs, PCDBGFINFOHLP pHlp)
-{
-    return dbgfR3Info(pVM, VMCPUID_ANY, pszName, pszArgs, pHlp);
+VMMR3DECL(int) DBGFR3Info(PUVM pUVM, const char *pszName, const char *pszArgs, PCDBGFINFOHLP pHlp)
+{
+    UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE);
+    return dbgfR3Info(pUVM, VMCPUID_ANY, pszName, pszArgs, pHlp);
 }
 
@@ -803,5 +780,5 @@
  *
  * @returns VBox status code.
- * @param   pVM         Pointer to the VM.
+ * @param   pUVM        The user mode VM handle.
  * @param   idCpu       The CPU to exectue the request on.  Pass NIL_VMCPUID
  *                      to not involve any EMT.
@@ -810,10 +787,11 @@
  * @param   pHlp        The output helper functions. If NULL the logger will be used.
  */
-VMMR3DECL(int) DBGFR3InfoEx(PVM pVM, VMCPUID idCpu, const char *pszName, const char *pszArgs, PCDBGFINFOHLP pHlp)
-{
+VMMR3DECL(int) DBGFR3InfoEx(PUVM pUVM, VMCPUID idCpu, const char *pszName, const char *pszArgs, PCDBGFINFOHLP pHlp)
+{
+    UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE);
     if (idCpu == NIL_VMCPUID)
-        return dbgfR3Info(pVM, VMCPUID_ANY, pszName, pszArgs, pHlp);
-    return VMR3ReqPriorityCallWait(pVM, idCpu,
-                                   (PFNRT)dbgfR3Info, 5, pVM, idCpu, pszName, pszArgs, pHlp);
+        return dbgfR3Info(pUVM, VMCPUID_ANY, pszName, pszArgs, pHlp);
+    return VMR3ReqPriorityCallWaitU(pUVM, idCpu,
+                                    (PFNRT)dbgfR3Info, 5, pUVM, idCpu, pszName, pszArgs, pHlp);
 }
 
@@ -823,11 +801,11 @@
  *
  * @returns See DBGFR3Info.
- * @param   pVM                 Pointer to the VM.
- * @param   pszName             See DBGFR3Info.
- * @param   pszArgs             See DBGFR3Info.
- */
-VMMR3DECL(int) DBGFR3InfoLogRel(PVM pVM, const char *pszName, const char *pszArgs)
-{
-    return DBGFR3Info(pVM, pszName, pszArgs, &g_dbgfR3InfoLogRelHlp);
+ * @param   pUVM        The user mode VM handle.
+ * @param   pszName     See DBGFR3Info.
+ * @param   pszArgs     See DBGFR3Info.
+ */
+VMMR3DECL(int) DBGFR3InfoLogRel(PUVM pUVM, const char *pszName, const char *pszArgs)
+{
+    return DBGFR3Info(pUVM, pszName, pszArgs, &g_dbgfR3InfoLogRelHlp);
 }
 
@@ -837,11 +815,11 @@
  *
  * @returns See DBGFR3Info.
- * @param   pVM                 Pointer to the VM.
- * @param   pszName             See DBGFR3Info.
- * @param   pszArgs             See DBGFR3Info.
- */
-VMMR3DECL(int) DBGFR3InfoStdErr(PVM pVM, const char *pszName, const char *pszArgs)
-{
-    return DBGFR3Info(pVM, pszName, pszArgs, &g_dbgfR3InfoStdErrHlp);
+ * @param   pUVM        The user mode VM handle.
+ * @param   pszName     See DBGFR3Info.
+ * @param   pszArgs     See DBGFR3Info.
+ */
+VMMR3DECL(int) DBGFR3InfoStdErr(PUVM pUVM, const char *pszName, const char *pszArgs)
+{
+    return DBGFR3Info(pUVM, pszName, pszArgs, &g_dbgfR3InfoStdErrHlp);
 }
 
@@ -863,10 +841,11 @@
  * @threads EMT
  */
-VMMR3DECL(int) DBGFR3InfoMulti(PVM pVM, const char *pszIncludePat, const char *pszExcludePat, const char *pszSepFmt,
-                               PCDBGFINFOHLP pHlp)
+VMMR3_INT_DECL(int) DBGFR3InfoMulti(PVM pVM, const char *pszIncludePat, const char *pszExcludePat, const char *pszSepFmt,
+                                    PCDBGFINFOHLP pHlp)
 {
     /*
      * Validate input.
      */
+    PUVM pUVM = pVM->pUVM;
     VM_ASSERT_EMT_RETURN(pVM, VERR_VM_THREAD_NOT_EMT);
     AssertPtrReturn(pszIncludePat, VERR_INVALID_POINTER);
@@ -888,8 +867,8 @@
      * Note! We won't leave the critical section here...
      */
-    int rc = RTCritSectEnter(&pVM->dbgf.s.InfoCritSect);
+    int rc = RTCritSectEnter(&pUVM->dbgf.s.InfoCritSect);
     AssertRC(rc);
     rc = VWRN_NOT_FOUND;
-    for (PDBGFINFO pInfo = pVM->dbgf.s.pInfoFirst; pInfo; pInfo = pInfo->pNext)
+    for (PDBGFINFO pInfo = pUVM->dbgf.s.pInfoFirst; pInfo; pInfo = pInfo->pNext)
     {
         if (   RTStrSimplePatternMultiMatch(pszIncludePat, cchIncludePat, pInfo->szName, pInfo->cchName, NULL)
@@ -902,5 +881,6 @@
                 case DBGFINFOTYPE_DEV:
                     if (pInfo->fFlags & DBGFINFO_FLAGS_RUN_ON_EMT)
-                        rc = VMR3ReqCallVoidWait(pVM, VMCPUID_ANY, (PFNRT)pInfo->u.Dev.pfnHandler, 3, pInfo->u.Dev.pDevIns, pHlp, pszArgs);
+                        rc = VMR3ReqCallVoidWaitU(pUVM, VMCPUID_ANY, (PFNRT)pInfo->u.Dev.pfnHandler, 3,
+                                                  pInfo->u.Dev.pDevIns, pHlp, pszArgs);
                     else
                         pInfo->u.Dev.pfnHandler(pInfo->u.Dev.pDevIns, pHlp, pszArgs);
@@ -909,5 +889,6 @@
                 case DBGFINFOTYPE_DRV:
                     if (pInfo->fFlags & DBGFINFO_FLAGS_RUN_ON_EMT)
-                        rc = VMR3ReqCallVoidWait(pVM, VMCPUID_ANY, (PFNRT)pInfo->u.Drv.pfnHandler, 3, pInfo->u.Drv.pDrvIns, pHlp, pszArgs);
+                        rc = VMR3ReqCallVoidWaitU(pUVM, VMCPUID_ANY, (PFNRT)pInfo->u.Drv.pfnHandler, 3,
+                                                  pInfo->u.Drv.pDrvIns, pHlp, pszArgs);
                     else
                         pInfo->u.Drv.pfnHandler(pInfo->u.Drv.pDrvIns, pHlp, pszArgs);
@@ -916,5 +897,5 @@
                 case DBGFINFOTYPE_INT:
                     if (pInfo->fFlags & DBGFINFO_FLAGS_RUN_ON_EMT)
-                        rc = VMR3ReqCallVoidWait(pVM, VMCPUID_ANY, (PFNRT)pInfo->u.Int.pfnHandler, 3, pVM, pHlp, pszArgs);
+                        rc = VMR3ReqCallVoidWaitU(pUVM, VMCPUID_ANY, (PFNRT)pInfo->u.Int.pfnHandler, 3, pVM, pHlp, pszArgs);
                     else
                         pInfo->u.Int.pfnHandler(pVM, pHlp, pszArgs);
@@ -923,5 +904,6 @@
                 case DBGFINFOTYPE_EXT:
                     if (pInfo->fFlags & DBGFINFO_FLAGS_RUN_ON_EMT)
-                        rc = VMR3ReqCallVoidWait(pVM, VMCPUID_ANY, (PFNRT)pInfo->u.Ext.pfnHandler, 3, pInfo->u.Ext.pvUser, pHlp, pszArgs);
+                        rc = VMR3ReqCallVoidWaitU(pUVM, VMCPUID_ANY, (PFNRT)pInfo->u.Ext.pfnHandler, 3,
+                                                  pInfo->u.Ext.pvUser, pHlp, pszArgs);
                     else
                         pInfo->u.Ext.pfnHandler(pInfo->u.Ext.pvUser, pHlp, pszArgs);
@@ -933,5 +915,5 @@
         }
     }
-    int rc2 = RTCritSectLeave(&pVM->dbgf.s.InfoCritSect);
+    int rc2 = RTCritSectLeave(&pUVM->dbgf.s.InfoCritSect);
     AssertRC(rc2);
 
@@ -944,9 +926,9 @@
  *
  * @returns VBox status code.
- * @param   pVM             Pointer to the VM.
+ * @param   pUVM            The user mode VM handle.
  * @param   pfnCallback     Pointer to callback function.
  * @param   pvUser          User argument to pass to the callback.
  */
-VMMR3DECL(int) DBGFR3InfoEnum(PVM pVM, PFNDBGFINFOENUM pfnCallback, void *pvUser)
+VMMR3DECL(int) DBGFR3InfoEnum(PUVM pUVM, PFNDBGFINFOENUM pfnCallback, void *pvUser)
 {
     LogFlow(("DBGFR3InfoLog: pfnCallback=%p pvUser=%p\n", pfnCallback, pvUser));
@@ -960,19 +942,20 @@
         return VERR_INVALID_PARAMETER;
     }
+    UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE);
 
     /*
      * Enter and enumerate.
      */
-    int rc = RTCritSectEnter(&pVM->dbgf.s.InfoCritSect);
+    int rc = RTCritSectEnter(&pUVM->dbgf.s.InfoCritSect);
     AssertRC(rc);
 
     rc = VINF_SUCCESS;
-    for (PDBGFINFO pInfo = pVM->dbgf.s.pInfoFirst; RT_SUCCESS(rc) && pInfo; pInfo = pInfo->pNext)
-        rc = pfnCallback(pVM, pInfo->szName, pInfo->pszDesc, pvUser);
+    for (PDBGFINFO pInfo = pUVM->dbgf.s.pInfoFirst; RT_SUCCESS(rc) && pInfo; pInfo = pInfo->pNext)
+        rc = pfnCallback(pUVM, pInfo->szName, pInfo->pszDesc, pvUser);
 
     /*
      * Leave and exit.
      */
-    int rc2 = RTCritSectLeave(&pVM->dbgf.s.InfoCritSect);
+    int rc2 = RTCritSectLeave(&pUVM->dbgf.s.InfoCritSect);
     AssertRC(rc2);
 
@@ -996,10 +979,11 @@
      * Enter and enumerate.
      */
-    int rc = RTCritSectEnter(&pVM->dbgf.s.InfoCritSect);
+    PUVM pUVM = pVM->pUVM;
+    int rc = RTCritSectEnter(&pUVM->dbgf.s.InfoCritSect);
     AssertRC(rc);
 
     if (pszArgs && *pszArgs)
     {
-        for (PDBGFINFO pInfo = pVM->dbgf.s.pInfoFirst; pInfo; pInfo = pInfo->pNext)
+        for (PDBGFINFO pInfo = pUVM->dbgf.s.pInfoFirst; pInfo; pInfo = pInfo->pNext)
         {
             const char *psz = strstr(pszArgs, pInfo->szName);
@@ -1015,5 +999,5 @@
     else
     {
-        for (PDBGFINFO pInfo = pVM->dbgf.s.pInfoFirst; pInfo; pInfo = pInfo->pNext)
+        for (PDBGFINFO pInfo = pUVM->dbgf.s.pInfoFirst; pInfo; pInfo = pInfo->pNext)
             pHlp->pfnPrintf(pHlp, "%-16s  %s\n",
                             pInfo->szName, pInfo->pszDesc);
@@ -1023,5 +1007,5 @@
      * Leave and exit.
      */
-    rc = RTCritSectLeave(&pVM->dbgf.s.InfoCritSect);
+    rc = RTCritSectLeave(&pUVM->dbgf.s.InfoCritSect);
     AssertRC(rc);
 }
Index: trunk/src/VBox/VMM/VMMR3/DBGFLog.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMR3/DBGFLog.cpp	(revision 44398)
+++ trunk/src/VBox/VMM/VMMR3/DBGFLog.cpp	(revision 44399)
@@ -23,16 +23,11 @@
 #include <VBox/vmm/vmm.h>
 #include <VBox/vmm/dbgf.h>
+#include <VBox/vmm/uvm.h>
+#include <VBox/vmm/vm.h>
 #include <VBox/log.h>
 #include <VBox/err.h>
 #include <iprt/assert.h>
+#include <iprt/param.h>
 #include <iprt/string.h>
-
-
-/*******************************************************************************
-*   Internal Functions                                                         *
-*******************************************************************************/
-static DECLCALLBACK(int) dbgfR3LogModifyGroups(PVM pVM, const char *pszGroupSettings);
-static DECLCALLBACK(int) dbgfR3LogModifyFlags(PVM pVM, const char *pszFlagSettings);
-static DECLCALLBACK(int) dbgfR3LogModifyDestinations(PVM pVM, const char *pszDestSettings);
 
 
@@ -63,8 +58,31 @@
 
 /**
+ * EMT worker for DBGFR3LogModifyGroups.
+ *
+ * @returns VBox status code.
+ * @param   pUVM                The user mode VM handle.
+ * @param   pszGroupSettings    The group settings string. (VBOX_LOG)
+ */
+static DECLCALLBACK(int) dbgfR3LogModifyGroups(PUVM pUVM, const char *pszGroupSettings)
+{
+    PRTLOGGER pLogger = dbgfR3LogResolvedLogger(&pszGroupSettings);
+    if (!pLogger)
+        return VINF_SUCCESS;
+
+    int rc = RTLogGroupSettings(pLogger, pszGroupSettings);
+    if (RT_SUCCESS(rc) && pUVM->pVM)
+    {
+        VM_ASSERT_VALID_EXT_RETURN(pUVM->pVM, VERR_INVALID_VM_HANDLE);
+        rc = VMMR3UpdateLoggers(pUVM->pVM);
+    }
+    return rc;
+}
+
+
+/**
  * Changes the logger group settings.
  *
  * @returns VBox status code.
- * @param   pVM                 Pointer to the VM.
+ * @param   pUVM                The user mode VM handle.
  * @param   pszGroupSettings    The group settings string. (VBOX_LOG)
  *                              By prefixing the string with \"release:\" the
@@ -73,29 +91,32 @@
  *                              is also recognized.
  */
-VMMR3DECL(int) DBGFR3LogModifyGroups(PVM pVM, const char *pszGroupSettings)
+VMMR3DECL(int) DBGFR3LogModifyGroups(PUVM pUVM, const char *pszGroupSettings)
 {
-    AssertPtrReturn(pVM, VERR_INVALID_POINTER);
+    UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE);
     AssertPtrReturn(pszGroupSettings, VERR_INVALID_POINTER);
 
-    return VMR3ReqPriorityCallWait(pVM, VMCPUID_ANY, (PFNRT)dbgfR3LogModifyGroups, 2, pVM, pszGroupSettings);
+    return VMR3ReqPriorityCallWaitU(pUVM, VMCPUID_ANY, (PFNRT)dbgfR3LogModifyGroups, 2, pUVM, pszGroupSettings);
 }
 
 
 /**
- * EMT worker for DBGFR3LogModifyGroups.
+ * EMT worker for DBGFR3LogModifyFlags.
  *
  * @returns VBox status code.
- * @param   pVM                 Pointer to the VM.
- * @param   pszGroupSettings    The group settings string. (VBOX_LOG)
+ * @param   pUVM                The user mode VM handle.
+ * @param   pszFlagSettings     The group settings string. (VBOX_LOG_FLAGS)
  */
-static DECLCALLBACK(int) dbgfR3LogModifyGroups(PVM pVM, const char *pszGroupSettings)
+static DECLCALLBACK(int) dbgfR3LogModifyFlags(PUVM pUVM, const char *pszFlagSettings)
 {
-    PRTLOGGER pLogger = dbgfR3LogResolvedLogger(&pszGroupSettings);
+    PRTLOGGER pLogger = dbgfR3LogResolvedLogger(&pszFlagSettings);
     if (!pLogger)
         return VINF_SUCCESS;
 
-    int rc = RTLogGroupSettings(pLogger, pszGroupSettings);
-    if (RT_SUCCESS(rc))
-        rc = VMMR3UpdateLoggers(pVM);
+    int rc = RTLogFlags(pLogger, pszFlagSettings);
+    if (RT_SUCCESS(rc) && pUVM->pVM)
+    {
+        VM_ASSERT_VALID_EXT_RETURN(pUVM->pVM, VERR_INVALID_VM_HANDLE);
+        rc = VMMR3UpdateLoggers(pUVM->pVM);
+    }
     return rc;
 }
@@ -106,5 +127,5 @@
  *
  * @returns VBox status code.
- * @param   pVM                 Pointer to the VM.
+ * @param   pUVM                The user mode VM handle.
  * @param   pszFlagSettings     The group settings string. (VBOX_LOG_FLAGS)
  *                              By prefixing the string with \"release:\" the
@@ -113,10 +134,10 @@
  *                              is also recognized.
  */
-VMMR3DECL(int) DBGFR3LogModifyFlags(PVM pVM, const char *pszFlagSettings)
+VMMR3DECL(int) DBGFR3LogModifyFlags(PUVM pUVM, const char *pszFlagSettings)
 {
-    AssertPtrReturn(pVM, VERR_INVALID_POINTER);
+    UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE);
     AssertPtrReturn(pszFlagSettings, VERR_INVALID_POINTER);
 
-    return VMR3ReqPriorityCallWait(pVM, VMCPUID_ANY, (PFNRT)dbgfR3LogModifyFlags, 2, pVM, pszFlagSettings);
+    return VMR3ReqPriorityCallWaitU(pUVM, VMCPUID_ANY, (PFNRT)dbgfR3LogModifyFlags, 2, pUVM, pszFlagSettings);
 }
 
@@ -126,16 +147,19 @@
  *
  * @returns VBox status code.
- * @param   pVM                 Pointer to the VM.
- * @param   pszFlagSettings     The group settings string. (VBOX_LOG_FLAGS)
+ * @param   pUVM                The user mode VM handle.
+ * @param   pszDestSettings     The destination settings string. (VBOX_LOG_DEST)
  */
-static DECLCALLBACK(int) dbgfR3LogModifyFlags(PVM pVM, const char *pszFlagSettings)
+static DECLCALLBACK(int) dbgfR3LogModifyDestinations(PUVM pUVM, const char *pszDestSettings)
 {
-    PRTLOGGER pLogger = dbgfR3LogResolvedLogger(&pszFlagSettings);
+    PRTLOGGER pLogger = dbgfR3LogResolvedLogger(&pszDestSettings);
     if (!pLogger)
         return VINF_SUCCESS;
 
-    int rc = RTLogFlags(pLogger, pszFlagSettings);
-    if (RT_SUCCESS(rc))
-        rc = VMMR3UpdateLoggers(pVM);
+    int rc = RTLogDestinations(NULL, pszDestSettings);
+    if (RT_SUCCESS(rc) && pUVM->pVM)
+    {
+        VM_ASSERT_VALID_EXT_RETURN(pUVM->pVM, VERR_INVALID_VM_HANDLE);
+        rc = VMMR3UpdateLoggers(pUVM->pVM);
+    }
     return rc;
 }
@@ -146,5 +170,5 @@
  *
  * @returns VBox status code.
- * @param   pVM                 Pointer to the VM.
+ * @param   pUVM                The user mode VM handle.
  * @param   pszDestSettings     The destination settings string. (VBOX_LOG_DEST)
  *                              By prefixing the string with \"release:\" the
@@ -153,30 +177,10 @@
  *                              is also recognized.
  */
-VMMR3DECL(int) DBGFR3LogModifyDestinations(PVM pVM, const char *pszDestSettings)
+VMMR3DECL(int) DBGFR3LogModifyDestinations(PUVM pUVM, const char *pszDestSettings)
 {
-    AssertReturn(VALID_PTR(pVM), VERR_INVALID_POINTER);
-    AssertReturn(VALID_PTR(pszDestSettings), VERR_INVALID_POINTER);
+    UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE);
+    AssertPtrReturn(pszDestSettings, VERR_INVALID_POINTER);
 
-    return VMR3ReqPriorityCallWait(pVM, VMCPUID_ANY, (PFNRT)dbgfR3LogModifyDestinations, 2, pVM, pszDestSettings);
+    return VMR3ReqPriorityCallWaitU(pUVM, VMCPUID_ANY, (PFNRT)dbgfR3LogModifyDestinations, 2, pUVM, pszDestSettings);
 }
 
-
-/**
- * EMT worker for DBGFR3LogModifyFlags.
- *
- * @returns VBox status code.
- * @param   pVM                 Pointer to the VM.
- * @param   pszDestSettings     The destination settings string. (VBOX_LOG_DEST)
- */
-static DECLCALLBACK(int) dbgfR3LogModifyDestinations(PVM pVM, const char *pszDestSettings)
-{
-    PRTLOGGER pLogger = dbgfR3LogResolvedLogger(&pszDestSettings);
-    if (!pLogger)
-        return VINF_SUCCESS;
-
-    int rc = RTLogDestinations(NULL, pszDestSettings);
-    if (RT_SUCCESS(rc))
-        rc = VMMR3UpdateLoggers(pVM);
-    return rc;
-}
-
Index: trunk/src/VBox/VMM/VMMR3/DBGFMem.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMR3/DBGFMem.cpp	(revision 44398)
+++ trunk/src/VBox/VMM/VMMR3/DBGFMem.cpp	(revision 44399)
@@ -27,4 +27,5 @@
 #include "DBGFInternal.h"
 #include <VBox/vmm/vm.h>
+#include <VBox/vmm/uvm.h>
 #include <VBox/err.h>
 #include <VBox/log.h>
@@ -37,5 +38,5 @@
  *
  * @returns VBox status code.
- * @param   pVM         Pointer to the VM.
+ * @param   pUVM        The user mode VM handle.
  * @param   idCpu       The ID of the CPU context to search in.
  * @param   pAddress    Where to store the mixed address.
@@ -47,7 +48,9 @@
  * @param   pHitAddress Where to put the address of the first hit.
  */
-static DECLCALLBACK(int) dbgfR3MemScan(PVM pVM, VMCPUID idCpu, PCDBGFADDRESS pAddress, PCRTGCUINTPTR pcbRange, RTGCUINTPTR *puAlign,
-                                       const uint8_t *pabNeedle, size_t cbNeedle, PDBGFADDRESS pHitAddress)
-{
+static DECLCALLBACK(int) dbgfR3MemScan(PUVM pUVM, VMCPUID idCpu, PCDBGFADDRESS pAddress, PCRTGCUINTPTR pcbRange,
+                                       RTGCUINTPTR *puAlign, const uint8_t *pabNeedle, size_t cbNeedle, PDBGFADDRESS pHitAddress)
+{
+    PVM pVM = pUVM->pVM;
+    VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
     Assert(idCpu == VMMGetCpuId(pVM));
 
@@ -56,5 +59,5 @@
      */
     RTGCUINTPTR cbRange = *pcbRange;
-    if (!DBGFR3AddrIsValid(pVM, pAddress))
+    if (!DBGFR3AddrIsValid(pUVM, pAddress))
         return VERR_INVALID_POINTER;
     if (!VALID_PTR(pHitAddress))
@@ -80,5 +83,5 @@
         rc = PGMR3DbgScanPhysical(pVM, pAddress->FlatPtr, cbRange, GCPhysAlign, pabNeedle, cbNeedle, &PhysHit);
         if (RT_SUCCESS(rc))
-            DBGFR3AddrFromPhys(pVM, pHitAddress, PhysHit);
+            DBGFR3AddrFromPhys(pUVM, pHitAddress, PhysHit);
     }
     else
@@ -94,5 +97,5 @@
         rc = PGMR3DbgScanVirtual(pVM, pVCpu, pAddress->FlatPtr, cbRange, *puAlign, pabNeedle, cbNeedle, &GCPtrHit);
         if (RT_SUCCESS(rc))
-            DBGFR3AddrFromFlat(pVM, pHitAddress, GCPtrHit);
+            DBGFR3AddrFromFlat(pUVM, pHitAddress, GCPtrHit);
     }
 
@@ -110,5 +113,5 @@
  * @retval  VERR_INVALID_ARGUMENT if any other arguments are invalid.
  *
- * @param   pVM         Pointer to the VM.
+ * @param   pUVM        The user mode VM handle.
  * @param   idCpu       The ID of the CPU context to search in.
  * @param   pAddress    Where to store the mixed address.
@@ -122,26 +125,28 @@
  * @thread  Any thread.
  */
-VMMR3DECL(int) DBGFR3MemScan(PVM pVM, VMCPUID idCpu, PCDBGFADDRESS pAddress, RTGCUINTPTR cbRange, RTGCUINTPTR uAlign,
+VMMR3DECL(int) DBGFR3MemScan(PUVM pUVM, VMCPUID idCpu, PCDBGFADDRESS pAddress, RTGCUINTPTR cbRange, RTGCUINTPTR uAlign,
                              const void *pvNeedle, size_t cbNeedle, PDBGFADDRESS pHitAddress)
 {
+    UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE);
+    AssertReturn(idCpu < pUVM->cCpus, VERR_INVALID_CPU_ID);
+    return VMR3ReqPriorityCallWaitU(pUVM, idCpu, (PFNRT)dbgfR3MemScan, 8,
+                                    pUVM, idCpu, pAddress, &cbRange, &uAlign, pvNeedle, cbNeedle, pHitAddress);
+
+}
+
+
+/**
+ * Read guest memory.
+ *
+ * @returns VBox status code.
+ * @param   pUVM        The user mode VM handle.
+ * @param   pAddress    Where to start reading.
+ * @param   pvBuf       Where to store the data we've read.
+ * @param   cbRead      The number of bytes to read.
+ */
+static DECLCALLBACK(int) dbgfR3MemRead(PUVM pUVM, VMCPUID idCpu, PCDBGFADDRESS pAddress, void *pvBuf, size_t cbRead)
+{
+    PVM pVM = pUVM->pVM;
     VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
-    AssertReturn(idCpu < pVM->cCpus, VERR_INVALID_CPU_ID);
-    return VMR3ReqPriorityCallWait(pVM, idCpu, (PFNRT)dbgfR3MemScan, 8,
-                                   pVM, idCpu, pAddress, &cbRange, &uAlign, pvNeedle, cbNeedle, pHitAddress);
-
-}
-
-
-/**
- * Read guest memory.
- *
- * @returns VBox status code.
- * @param   pVM             Pointer to the VM.
- * @param   pAddress        Where to start reading.
- * @param   pvBuf           Where to store the data we've read.
- * @param   cbRead          The number of bytes to read.
- */
-static DECLCALLBACK(int) dbgfR3MemRead(PVM pVM, VMCPUID idCpu, PCDBGFADDRESS pAddress, void *pvBuf, size_t cbRead)
-{
     Assert(idCpu == VMMGetCpuId(pVM));
 
@@ -149,5 +154,5 @@
      * Validate the input we use, PGM does the rest.
      */
-    if (!DBGFR3AddrIsValid(pVM, pAddress))
+    if (!DBGFR3AddrIsValid(pUVM, pAddress))
         return VERR_INVALID_POINTER;
     if (!VALID_PTR(pvBuf))
@@ -197,20 +202,22 @@
  * @returns VBox status code.
  *
- * @param   pVM             Pointer to the VM.
- * @param   idCpu           The ID of the source CPU context (for the address).
- * @param   pAddress        Where to start reading.
- * @param   pvBuf           Where to store the data we've read.
- * @param   cbRead          The number of bytes to read.
- */
-VMMR3DECL(int) DBGFR3MemRead(PVM pVM, VMCPUID idCpu, PCDBGFADDRESS pAddress, void *pvBuf, size_t cbRead)
-{
-    VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
-    AssertReturn(idCpu < pVM->cCpus, VERR_INVALID_CPU_ID);
+ * @param   pUVM        The user mode VM handle.
+ * @param   idCpu       The ID of the source CPU context (for the address).
+ * @param   pAddress    Where to start reading.
+ * @param   pvBuf       Where to store the data we've read.
+ * @param   cbRead      The number of bytes to read.
+ */
+VMMR3DECL(int) DBGFR3MemRead(PUVM pUVM, VMCPUID idCpu, PCDBGFADDRESS pAddress, void *pvBuf, size_t cbRead)
+{
+    UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE);
+    AssertReturn(idCpu < pUVM->cCpus, VERR_INVALID_CPU_ID);
+
     if ((pAddress->fFlags & DBGFADDRESS_FLAGS_TYPE_MASK) == DBGFADDRESS_FLAGS_RING0)
     {
         AssertCompile(sizeof(RTHCUINTPTR) <= sizeof(pAddress->FlatPtr));
-        return VMMR3ReadR0Stack(pVM, idCpu, (RTHCUINTPTR)pAddress->FlatPtr, pvBuf, cbRead);
-    }
-    return VMR3ReqPriorityCallWait(pVM, idCpu, (PFNRT)dbgfR3MemRead, 5, pVM, idCpu, pAddress, pvBuf, cbRead);
+        VM_ASSERT_VALID_EXT_RETURN(pUVM->pVM, VERR_INVALID_VM_HANDLE);
+        return VMMR3ReadR0Stack(pUVM->pVM, idCpu, (RTHCUINTPTR)pAddress->FlatPtr, pvBuf, cbRead);
+    }
+    return VMR3ReqPriorityCallWaitU(pUVM, idCpu, (PFNRT)dbgfR3MemRead, 5, pUVM, idCpu, pAddress, pvBuf, cbRead);
 }
 
@@ -221,16 +228,16 @@
  * @returns VBox status code.
  *
- * @param   pVM             Pointer to the VM.
- * @param   idCpu           The ID of the source CPU context (for the address).
- * @param   pAddress        Where to start reading.
- * @param   pszBuf          Where to store the string.
- * @param   cchBuf          The size of the buffer.
- */
-static DECLCALLBACK(int) dbgfR3MemReadString(PVM pVM, VMCPUID idCpu, PCDBGFADDRESS pAddress, char *pszBuf, size_t cchBuf)
+ * @param   pUVM        The user mode VM handle.
+ * @param   idCpu       The ID of the source CPU context (for the address).
+ * @param   pAddress    Where to start reading.
+ * @param   pszBuf      Where to store the string.
+ * @param   cchBuf      The size of the buffer.
+ */
+static DECLCALLBACK(int) dbgfR3MemReadString(PUVM pUVM, VMCPUID idCpu, PCDBGFADDRESS pAddress, char *pszBuf, size_t cchBuf)
 {
     /*
      * Validate the input we use, PGM does the rest.
      */
-    if (!DBGFR3AddrIsValid(pVM, pAddress))
+    if (!DBGFR3AddrIsValid(pUVM, pAddress))
         return VERR_INVALID_POINTER;
     if (!VALID_PTR(pszBuf))
@@ -240,5 +247,5 @@
      * Let dbgfR3MemRead do the job.
      */
-    int rc = dbgfR3MemRead(pVM, idCpu, pAddress, pszBuf, cchBuf);
+    int rc = dbgfR3MemRead(pUVM, idCpu, pAddress, pszBuf, cchBuf);
 
     /*
@@ -269,11 +276,11 @@
  * @returns VBox status code.
  *
- * @param   pVM             Pointer to the VM.
- * @param   idCpu           The ID of the source CPU context (for the address).
- * @param   pAddress        Where to start reading.
- * @param   pszBuf          Where to store the string.
- * @param   cchBuf          The size of the buffer.
- */
-VMMR3DECL(int) DBGFR3MemReadString(PVM pVM, VMCPUID idCpu, PCDBGFADDRESS pAddress, char *pszBuf, size_t cchBuf)
+ * @param   pUVM        The user mode VM handle.
+ * @param   idCpu       The ID of the source CPU context (for the address).
+ * @param   pAddress    Where to start reading.
+ * @param   pszBuf      Where to store the string.
+ * @param   cchBuf      The size of the buffer.
+ */
+VMMR3DECL(int) DBGFR3MemReadString(PUVM pUVM, VMCPUID idCpu, PCDBGFADDRESS pAddress, char *pszBuf, size_t cchBuf)
 {
     /*
@@ -285,34 +292,36 @@
         return VERR_INVALID_PARAMETER;
     memset(pszBuf, 0, cchBuf);
+    UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE);
+    AssertReturn(idCpu < pUVM->cCpus, VERR_INVALID_CPU_ID);
+
+    /*
+     * Pass it on to the EMT.
+     */
+    return VMR3ReqPriorityCallWaitU(pUVM, idCpu, (PFNRT)dbgfR3MemReadString, 5, pUVM, idCpu, pAddress, pszBuf, cchBuf);
+}
+
+
+/**
+ * Writes guest memory.
+ *
+ * @returns VBox status code.
+ *
+ * @param   pUVM        The user mode VM handle.
+ * @param   idCpu       The ID of the target CPU context (for the address).
+ * @param   pAddress    Where to start writing.
+ * @param   pvBuf       The data to write.
+ * @param   cbWrite     The number of bytes to write.
+ */
+static DECLCALLBACK(int) dbgfR3MemWrite(PUVM pUVM, VMCPUID idCpu, PCDBGFADDRESS pAddress, void const *pvBuf, size_t cbWrite)
+{
+    /*
+     * Validate the input we use, PGM does the rest.
+     */
+    if (!DBGFR3AddrIsValid(pUVM, pAddress))
+        return VERR_INVALID_POINTER;
+    if (!VALID_PTR(pvBuf))
+        return VERR_INVALID_POINTER;
+    PVM pVM = pUVM->pVM;
     VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
-    AssertReturn(idCpu < pVM->cCpus, VERR_INVALID_CPU_ID);
-
-    /*
-     * Pass it on to the EMT.
-     */
-    return VMR3ReqPriorityCallWait(pVM, idCpu, (PFNRT)dbgfR3MemReadString, 5, pVM, idCpu, pAddress, pszBuf, cchBuf);
-}
-
-
-/**
- * Writes guest memory.
- *
- * @returns VBox status code.
- *
- * @param   pVM             Pointer to the VM.
- * @param   idCpu           The ID of the target CPU context (for the address).
- * @param   pAddress        Where to start writing.
- * @param   pvBuf           The data to write.
- * @param   cbWrite         The number of bytes to write.
- */
-static DECLCALLBACK(int) dbgfR3MemWrite(PVM pVM, VMCPUID idCpu, PCDBGFADDRESS pAddress, void const *pvBuf, size_t cbWrite)
-{
-    /*
-     * Validate the input we use, PGM does the rest.
-     */
-    if (!DBGFR3AddrIsValid(pVM, pAddress))
-        return VERR_INVALID_POINTER;
-    if (!VALID_PTR(pvBuf))
-        return VERR_INVALID_POINTER;
 
     /*
@@ -357,23 +366,26 @@
  * @returns VBox status code.
  *
- * @param   pVM             Pointer to the VM.
- * @param   idCpu           The ID of the target CPU context (for the address).
- * @param   pAddress        Where to start writing.
- * @param   pvBuf           The data to write.
- * @param   cbRead          The number of bytes to write.
- */
-VMMR3DECL(int) DBGFR3MemWrite(PVM pVM, VMCPUID idCpu, PCDBGFADDRESS pAddress, void const *pvBuf, size_t cbWrite)
-{
+ * @param   pUVM        The user mode VM handle.
+ * @param   idCpu       The ID of the target CPU context (for the address).
+ * @param   pAddress    Where to start writing.
+ * @param   pvBuf       The data to write.
+ * @param   cbRead      The number of bytes to write.
+ */
+VMMR3DECL(int) DBGFR3MemWrite(PUVM pUVM, VMCPUID idCpu, PCDBGFADDRESS pAddress, void const *pvBuf, size_t cbWrite)
+{
+    UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE);
+    AssertReturn(idCpu < pUVM->cCpus, VERR_INVALID_CPU_ID);
+    return VMR3ReqPriorityCallWaitU(pUVM, idCpu, (PFNRT)dbgfR3MemWrite, 5, pUVM, idCpu, pAddress, pvBuf, cbWrite);
+}
+
+
+/**
+ * Worker for DBGFR3SelQueryInfo that calls into SELM.
+ */
+static DECLCALLBACK(int) dbgfR3SelQueryInfo(PUVM pUVM, VMCPUID idCpu, RTSEL Sel, uint32_t fFlags, PDBGFSELINFO pSelInfo)
+{
+    PVM pVM = pUVM->pVM;
     VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
-    AssertReturn(idCpu < pVM->cCpus, VERR_INVALID_CPU_ID);
-    return VMR3ReqPriorityCallWait(pVM, idCpu, (PFNRT)dbgfR3MemWrite, 5, pVM, idCpu, pAddress, pvBuf, cbWrite);
-}
-
-
-/**
- * Worker for DBGFR3SelQueryInfo that calls into SELM.
- */
-static DECLCALLBACK(int) dbgfR3SelQueryInfo(PVM pVM, VMCPUID idCpu, RTSEL Sel, uint32_t fFlags, PDBGFSELINFO pSelInfo)
-{
+
     /*
      * Make the query.
@@ -446,5 +458,5 @@
  *          pagetable or page backing the selector table wasn't present.
  *
- * @param   pVM         Pointer to the VM.
+ * @param   pUVM        The user mode VM handle.
  * @param   idCpu       The ID of the virtual CPU context.
  * @param   Sel         The selector to get info about.
@@ -456,8 +468,8 @@
  *          SELMR3GetShadowSelectorInfo.
  */
-VMMR3DECL(int) DBGFR3SelQueryInfo(PVM pVM, VMCPUID idCpu, RTSEL Sel, uint32_t fFlags, PDBGFSELINFO pSelInfo)
-{
-    VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
-    AssertReturn(idCpu < pVM->cCpus, VERR_INVALID_CPU_ID);
+VMMR3DECL(int) DBGFR3SelQueryInfo(PUVM pUVM, VMCPUID idCpu, RTSEL Sel, uint32_t fFlags, PDBGFSELINFO pSelInfo)
+{
+    UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE);
+    AssertReturn(idCpu < pUVM->cCpus, VERR_INVALID_CPU_ID);
     AssertReturn(!(fFlags & ~(DBGFSELQI_FLAGS_DT_GUEST | DBGFSELQI_FLAGS_DT_SHADOW | DBGFSELQI_FLAGS_DT_ADJ_64BIT_MODE)), VERR_INVALID_PARAMETER);
     AssertReturn(    (fFlags & (DBGFSELQI_FLAGS_DT_SHADOW | DBGFSELQI_FLAGS_DT_ADJ_64BIT_MODE))
@@ -470,5 +482,5 @@
      * Dispatch the request to a worker running on the target CPU.
      */
-    return VMR3ReqPriorityCallWait(pVM, idCpu, (PFNRT)dbgfR3SelQueryInfo, 5, pVM, idCpu, Sel, fFlags, pSelInfo);
+    return VMR3ReqPriorityCallWaitU(pUVM, idCpu, (PFNRT)dbgfR3SelQueryInfo, 5, pUVM, idCpu, Sel, fFlags, pSelInfo);
 }
 
@@ -545,5 +557,5 @@
  *
  * @returns VBox status code.
- * @param   pVM             Pointer to the VM.
+ * @param   pUVM            The shared VM handle.
  * @param   idCpu           The current CPU ID.
  * @param   fFlags          The flags, DBGFPGDMP_FLAGS_XXX.  Valid.
@@ -555,5 +567,5 @@
  * @param   pHlp            The output callbacks.
  */
-static DECLCALLBACK(int) dbgfR3PagingDumpEx(PVM pVM, VMCPUID idCpu, uint32_t fFlags, uint64_t *pcr3,
+static DECLCALLBACK(int) dbgfR3PagingDumpEx(PUVM pUVM, VMCPUID idCpu, uint32_t fFlags, uint64_t *pcr3,
                                             uint64_t *pu64FirstAddr, uint64_t *pu64LastAddr,
                                             uint32_t cMaxDepth, PCDBGFINFOHLP pHlp)
@@ -564,10 +576,13 @@
     if ((fFlags & (DBGFPGDMP_FLAGS_GUEST | DBGFPGDMP_FLAGS_SHADOW)) == (DBGFPGDMP_FLAGS_GUEST | DBGFPGDMP_FLAGS_SHADOW))
     {
-        int rc1 = dbgfR3PagingDumpEx(pVM, idCpu, fFlags & ~DBGFPGDMP_FLAGS_GUEST,
+        int rc1 = dbgfR3PagingDumpEx(pUVM, idCpu, fFlags & ~DBGFPGDMP_FLAGS_GUEST,
                                      pcr3, pu64FirstAddr, pu64LastAddr, cMaxDepth, pHlp);
-        int rc2 = dbgfR3PagingDumpEx(pVM, idCpu, fFlags & ~DBGFPGDMP_FLAGS_SHADOW,
+        int rc2 = dbgfR3PagingDumpEx(pUVM, idCpu, fFlags & ~DBGFPGDMP_FLAGS_SHADOW,
                                      pcr3, pu64FirstAddr, pu64LastAddr, cMaxDepth, pHlp);
         return RT_FAILURE(rc1) ? rc1 : rc2;
     }
+
+    PVM pVM = pUVM->pVM;
+    VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
 
     /*
@@ -626,5 +641,5 @@
  *
  * @returns VBox status code.
- * @param   pVM             Pointer to the VM.
+ * @param   pUVM            The user mode VM handle.
  * @param   idCpu           The current CPU ID.
  * @param   fFlags          The flags, DBGFPGDMP_FLAGS_XXX.
@@ -637,5 +652,5 @@
  *                          NULL.
  */
-VMMDECL(int) DBGFR3PagingDumpEx(PVM pVM, VMCPUID idCpu, uint32_t fFlags, uint64_t cr3, uint64_t u64FirstAddr,
+VMMDECL(int) DBGFR3PagingDumpEx(PUVM pUVM, VMCPUID idCpu, uint32_t fFlags, uint64_t cr3, uint64_t u64FirstAddr,
                                 uint64_t u64LastAddr, uint32_t cMaxDepth, PCDBGFINFOHLP pHlp)
 {
@@ -643,6 +658,6 @@
      * Input validation.
      */
-    VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
-    AssertReturn(idCpu < pVM->cCpus, VERR_INVALID_CPU_ID);
+    UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE);
+    AssertReturn(idCpu < pUVM->cCpus, VERR_INVALID_CPU_ID);
     AssertReturn(!(fFlags & ~DBGFPGDMP_FLAGS_VALID_MASK), VERR_INVALID_PARAMETER);
     AssertReturn(fFlags & (DBGFPGDMP_FLAGS_SHADOW | DBGFPGDMP_FLAGS_GUEST), VERR_INVALID_PARAMETER);
@@ -657,6 +672,6 @@
      * Forward the request to the target CPU.
      */
-    return VMR3ReqPriorityCallWait(pVM, idCpu, (PFNRT)dbgfR3PagingDumpEx, 8,
-                                   pVM, idCpu, fFlags, &cr3, &u64FirstAddr, &u64LastAddr, cMaxDepth, pHlp);
-}
-
+    return VMR3ReqPriorityCallWaitU(pUVM, idCpu, (PFNRT)dbgfR3PagingDumpEx, 8,
+                                    pUVM, idCpu, fFlags, &cr3, &u64FirstAddr, &u64LastAddr, cMaxDepth, pHlp);
+}
+
Index: trunk/src/VBox/VMM/VMMR3/DBGFOS.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMR3/DBGFOS.cpp	(revision 44398)
+++ trunk/src/VBox/VMM/VMMR3/DBGFOS.cpp	(revision 44399)
@@ -5,5 +5,5 @@
 
 /*
- * Copyright (C) 2008 Oracle Corporation
+ * Copyright (C) 2008-2013 Oracle Corporation
  *
  * This file is part of VirtualBox Open Source Edition (OSE), as
@@ -24,5 +24,5 @@
 #include <VBox/vmm/mm.h>
 #include "DBGFInternal.h"
-#include <VBox/vmm/vm.h>
+#include <VBox/vmm/uvm.h>
 #include <VBox/err.h>
 #include <VBox/log.h>
@@ -36,9 +36,9 @@
 *   Defined Constants And Macros                                               *
 *******************************************************************************/
-#define DBGF_OS_READ_LOCK(pVM)      do { } while (0)
-#define DBGF_OS_READ_UNLOCK(pVM)    do { } while (0)
-
-#define DBGF_OS_WRITE_LOCK(pVM)     do { } while (0)
-#define DBGF_OS_WRITE_UNLOCK(pVM)   do { } while (0)
+#define DBGF_OS_READ_LOCK(pUVM)      do { } while (0)
+#define DBGF_OS_READ_UNLOCK(pUVM)    do { } while (0)
+
+#define DBGF_OS_WRITE_LOCK(pUVM)     do { } while (0)
+#define DBGF_OS_WRITE_UNLOCK(pUVM)   do { } while (0)
 
 
@@ -46,15 +46,15 @@
  * Internal cleanup routine called by DBGFR3Term().
  *
- * @param   pVM     Pointer to the VM.
- */
-void dbgfR3OSTerm(PVM pVM)
+ * @param   pUVM    The user mode VM handle.
+ */
+void dbgfR3OSTerm(PUVM pUVM)
 {
     /*
      * Terminate the current one.
      */
-    if (pVM->dbgf.s.pCurOS)
-    {
-        pVM->dbgf.s.pCurOS->pReg->pfnTerm(pVM, pVM->dbgf.s.pCurOS->abData);
-        pVM->dbgf.s.pCurOS = NULL;
+    if (pUVM->dbgf.s.pCurOS)
+    {
+        pUVM->dbgf.s.pCurOS->pReg->pfnTerm(pUVM, pUVM->dbgf.s.pCurOS->abData);
+        pUVM->dbgf.s.pCurOS = NULL;
     }
 
@@ -62,10 +62,10 @@
      * Destroy all the instances.
      */
-    while (pVM->dbgf.s.pOSHead)
-    {
-        PDBGFOS pOS = pVM->dbgf.s.pOSHead;
-        pVM->dbgf.s.pOSHead = pOS->pNext;
+    while (pUVM->dbgf.s.pOSHead)
+    {
+        PDBGFOS pOS = pUVM->dbgf.s.pOSHead;
+        pUVM->dbgf.s.pOSHead = pOS->pNext;
         if (pOS->pReg->pfnDestruct)
-            pOS->pReg->pfnDestruct(pVM, pOS->abData);
+            pOS->pReg->pfnDestruct(pUVM, pOS->abData);
         MMR3HeapFree(pOS);
     }
@@ -77,16 +77,16 @@
  *
  * @returns VBox status code.
- * @param   pVM     Pointer to the VM.
+ * @param   pUVM    The user mode VM handle.
  * @param   pReg    The registration structure.
  */
-static DECLCALLBACK(int) dbgfR3OSRegister(PVM pVM, PDBGFOSREG pReg)
+static DECLCALLBACK(int) dbgfR3OSRegister(PUVM pUVM, PDBGFOSREG pReg)
 {
     /* more validations. */
-    DBGF_OS_READ_LOCK(pVM);
+    DBGF_OS_READ_LOCK(pUVM);
     PDBGFOS pOS;
-    for (pOS = pVM->dbgf.s.pOSHead; pOS; pOS = pOS->pNext)
+    for (pOS = pUVM->dbgf.s.pOSHead; pOS; pOS = pOS->pNext)
         if (!strcmp(pOS->pReg->szName, pReg->szName))
         {
-            DBGF_OS_READ_UNLOCK(pVM);
+            DBGF_OS_READ_UNLOCK(pUVM);
             Log(("dbgfR3OSRegister: %s -> VERR_ALREADY_LOADED\n", pReg->szName));
             return VERR_ALREADY_LOADED;
@@ -96,20 +96,20 @@
      * Allocate a new structure, call the constructor and link it into the list.
      */
-    pOS = (PDBGFOS)MMR3HeapAllocZ(pVM, MM_TAG_DBGF_OS, RT_OFFSETOF(DBGFOS, abData[pReg->cbData]));
+    pOS = (PDBGFOS)MMR3HeapAllocZU(pUVM, MM_TAG_DBGF_OS, RT_OFFSETOF(DBGFOS, abData[pReg->cbData]));
     AssertReturn(pOS, VERR_NO_MEMORY);
     pOS->pReg = pReg;
 
-    int rc = pOS->pReg->pfnConstruct(pVM, pOS->abData);
+    int rc = pOS->pReg->pfnConstruct(pUVM, pOS->abData);
     if (RT_SUCCESS(rc))
     {
-        DBGF_OS_WRITE_LOCK(pVM);
-        pOS->pNext = pVM->dbgf.s.pOSHead;
-        pVM->dbgf.s.pOSHead = pOS;
-        DBGF_OS_WRITE_UNLOCK(pVM);
+        DBGF_OS_WRITE_LOCK(pUVM);
+        pOS->pNext = pUVM->dbgf.s.pOSHead;
+        pUVM->dbgf.s.pOSHead = pOS;
+        DBGF_OS_WRITE_UNLOCK(pUVM);
     }
     else
     {
         if (pOS->pReg->pfnDestruct)
-            pOS->pReg->pfnDestruct(pVM, pOS->abData);
+            pOS->pReg->pfnDestruct(pUVM, pOS->abData);
         MMR3HeapFree(pOS);
     }
@@ -126,14 +126,14 @@
  *
  * @returns VBox status code.
- * @param   pVM     Pointer to the VM.
+ * @param   pUVM    The user mode VM handle.
  * @param   pReg    The registration structure.
  * @thread  Any.
  */
-VMMR3DECL(int) DBGFR3OSRegister(PVM pVM, PCDBGFOSREG pReg)
+VMMR3DECL(int) DBGFR3OSRegister(PUVM pUVM, PCDBGFOSREG pReg)
 {
     /*
      * Validate intput.
      */
-    VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
+    UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE);
 
     AssertPtrReturn(pReg, VERR_INVALID_POINTER);
@@ -156,5 +156,5 @@
      * Pass it on to EMT(0).
      */
-    return VMR3ReqPriorityCallWait(pVM, 0 /*idDstCpu*/, (PFNRT)dbgfR3OSRegister, 2, pVM, pReg);
+    return VMR3ReqPriorityCallWaitU(pUVM, 0 /*idDstCpu*/, (PFNRT)dbgfR3OSRegister, 2, pUVM, pReg);
 }
 
@@ -164,8 +164,8 @@
  *
  * @returns VBox status code.
- * @param   pVM     Pointer to the VM.
+ * @param   pUVM    The user mode VM handle.
  * @param   pReg    The registration structure.
  */
-static DECLCALLBACK(int) dbgfR3OSDeregister(PVM pVM, PDBGFOSREG pReg)
+static DECLCALLBACK(int) dbgfR3OSDeregister(PUVM pUVM, PDBGFOSREG pReg)
 {
     /*
@@ -175,6 +175,6 @@
     PDBGFOS pOSPrev   = NULL;
     PDBGFOS pOS;
-    DBGF_OS_WRITE_LOCK(pVM);
-    for (pOS = pVM->dbgf.s.pOSHead; pOS; pOSPrev = pOS, pOS = pOS->pNext)
+    DBGF_OS_WRITE_LOCK(pUVM);
+    for (pOS = pUVM->dbgf.s.pOSHead; pOS; pOSPrev = pOS, pOS = pOS->pNext)
         if (pOS->pReg == pReg)
         {
@@ -182,13 +182,13 @@
                 pOSPrev->pNext = pOS->pNext;
             else
-                pVM->dbgf.s.pOSHead = pOS->pNext;
-            if (pVM->dbgf.s.pCurOS == pOS)
+                pUVM->dbgf.s.pOSHead = pOS->pNext;
+            if (pUVM->dbgf.s.pCurOS == pOS)
             {
-                pVM->dbgf.s.pCurOS = NULL;
+                pUVM->dbgf.s.pCurOS = NULL;
                 fWasCurOS = true;
             }
             break;
         }
-    DBGF_OS_WRITE_UNLOCK(pVM);
+    DBGF_OS_WRITE_UNLOCK(pUVM);
     if (!pOS)
     {
@@ -202,7 +202,7 @@
      */
     if (fWasCurOS)
-        pOS->pReg->pfnTerm(pVM, pOS->abData);
+        pOS->pReg->pfnTerm(pUVM, pOS->abData);
     if (pOS->pReg->pfnDestruct)
-        pOS->pReg->pfnDestruct(pVM, pOS->abData);
+        pOS->pReg->pfnDestruct(pUVM, pOS->abData);
     MMR3HeapFree(pOS);
 
@@ -216,14 +216,14 @@
  * @returns VBox status code.
  *
- * @param   pVM     Pointer to the VM.
+ * @param   pUVM    The user mode VM handle.
  * @param   pReg    The registration structure.
  * @thread  Any.
  */
-VMMR3DECL(int)  DBGFR3OSDeregister(PVM pVM, PCDBGFOSREG pReg)
+VMMR3DECL(int)  DBGFR3OSDeregister(PUVM pUVM, PCDBGFOSREG pReg)
 {
     /*
      * Validate input.
      */
-    VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
+    UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE);
     AssertPtrReturn(pReg, VERR_INVALID_POINTER);
     AssertReturn(pReg->u32Magic == DBGFOSREG_MAGIC, VERR_INVALID_MAGIC);
@@ -231,10 +231,10 @@
     AssertReturn(RTStrEnd(&pReg->szName[0], sizeof(pReg->szName)), VERR_INVALID_NAME);
 
-    DBGF_OS_READ_LOCK(pVM);
+    DBGF_OS_READ_LOCK(pUVM);
     PDBGFOS pOS;
-    for (pOS = pVM->dbgf.s.pOSHead; pOS; pOS = pOS->pNext)
+    for (pOS = pUVM->dbgf.s.pOSHead; pOS; pOS = pOS->pNext)
         if (pOS->pReg == pReg)
             break;
-    DBGF_OS_READ_LOCK(pVM);
+    DBGF_OS_READ_LOCK(pUVM);
 
     if (!pOS)
@@ -247,5 +247,5 @@
      * Pass it on to EMT(0).
      */
-    return VMR3ReqPriorityCallWait(pVM, 0 /*idDstCpu*/, (PFNRT)dbgfR3OSDeregister, 2, pVM, pReg);
+    return VMR3ReqPriorityCallWaitU(pUVM, 0 /*idDstCpu*/, (PFNRT)dbgfR3OSDeregister, 2, pUVM, pReg);
 }
 
@@ -258,28 +258,28 @@
  * @retval  VINF_DBGF_OS_NOT_DETCTED if we cannot figure it out.
  *
- * @param   pVM         Pointer to the VM.
+ * @param   pUVM        The user mode VM handle.
  * @param   pszName     Where to store the OS name. Empty string if not detected.
  * @param   cchName     Size of the buffer.
  */
-static DECLCALLBACK(int) dbgfR3OSDetect(PVM pVM, char *pszName, size_t cchName)
+static DECLCALLBACK(int) dbgfR3OSDetect(PUVM pUVM, char *pszName, size_t cchName)
 {
     /*
      * Cycle thru the detection routines.
      */
-    PDBGFOS const pOldOS = pVM->dbgf.s.pCurOS;
-    pVM->dbgf.s.pCurOS = NULL;
-
-    for (PDBGFOS pNewOS = pVM->dbgf.s.pOSHead; pNewOS; pNewOS = pNewOS->pNext)
-        if (pNewOS->pReg->pfnProbe(pVM, pNewOS->abData))
+    PDBGFOS const pOldOS = pUVM->dbgf.s.pCurOS;
+    pUVM->dbgf.s.pCurOS = NULL;
+
+    for (PDBGFOS pNewOS = pUVM->dbgf.s.pOSHead; pNewOS; pNewOS = pNewOS->pNext)
+        if (pNewOS->pReg->pfnProbe(pUVM, pNewOS->abData))
         {
             int rc;
-            pVM->dbgf.s.pCurOS = pNewOS;
+            pUVM->dbgf.s.pCurOS = pNewOS;
             if (pOldOS == pNewOS)
-                rc = pNewOS->pReg->pfnRefresh(pVM, pNewOS->abData);
+                rc = pNewOS->pReg->pfnRefresh(pUVM, pNewOS->abData);
             else
             {
                 if (pOldOS)
-                    pOldOS->pReg->pfnTerm(pVM, pNewOS->abData);
-                rc = pNewOS->pReg->pfnInit(pVM, pNewOS->abData);
+                    pOldOS->pReg->pfnTerm(pUVM, pNewOS->abData);
+                rc = pNewOS->pReg->pfnInit(pUVM, pNewOS->abData);
             }
             if (pszName && cchName)
@@ -290,5 +290,5 @@
     /* not found */
     if (pOldOS)
-        pOldOS->pReg->pfnTerm(pVM, pOldOS->abData);
+        pOldOS->pReg->pfnTerm(pUVM, pOldOS->abData);
     return VINF_DBGF_OS_NOT_DETCTED;
 }
@@ -305,19 +305,20 @@
  * @retval  VINF_DBGF_OS_NOT_DETCTED if we cannot figure it out.
  *
- * @param   pVM         Pointer to the VM.
+ * @param   pUVM        The user mode VM handle.
  * @param   pszName     Where to store the OS name. Empty string if not detected.
  * @param   cchName     Size of the buffer.
  * @thread  Any.
  */
-VMMR3DECL(int) DBGFR3OSDetect(PVM pVM, char *pszName, size_t cchName)
+VMMR3DECL(int) DBGFR3OSDetect(PUVM pUVM, char *pszName, size_t cchName)
 {
     AssertPtrNullReturn(pszName, VERR_INVALID_POINTER);
     if (pszName && cchName)
         *pszName = '\0';
+    UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE);
 
     /*
      * Pass it on to EMT(0).
      */
-    return VMR3ReqPriorityCallWait(pVM, 0 /*idDstCpu*/, (PFNRT)dbgfR3OSDetect, 3, pVM, pszName, cchName);
+    return VMR3ReqPriorityCallWaitU(pUVM, 0 /*idDstCpu*/, (PFNRT)dbgfR3OSDetect, 3, pUVM, pszName, cchName);
 }
 
@@ -327,5 +328,5 @@
  *
  * @returns VBox status code.
- * @param   pVM             Pointer to the VM.
+ * @param   pUVM            The user mode VM handle.
  * @param   pszName         Where to store the OS name. Optional.
  * @param   cchName         The size of the name buffer.
@@ -333,20 +334,20 @@
  * @param   cchVersion      The size of the version buffer.
  */
-static DECLCALLBACK(int) dbgfR3OSQueryNameAndVersion(PVM pVM, char *pszName, size_t cchName, char *pszVersion, size_t cchVersion)
+static DECLCALLBACK(int) dbgfR3OSQueryNameAndVersion(PUVM pUVM, char *pszName, size_t cchName, char *pszVersion, size_t cchVersion)
 {
     /*
      * Any known OS?
      */
-    if (pVM->dbgf.s.pCurOS)
+    if (pUVM->dbgf.s.pCurOS)
     {
         int rc = VINF_SUCCESS;
         if (pszName && cchName)
         {
-            size_t cch = strlen(pVM->dbgf.s.pCurOS->pReg->szName);
+            size_t cch = strlen(pUVM->dbgf.s.pCurOS->pReg->szName);
             if (cchName > cch)
-                memcpy(pszName, pVM->dbgf.s.pCurOS->pReg->szName, cch + 1);
+                memcpy(pszName, pUVM->dbgf.s.pCurOS->pReg->szName, cch + 1);
             else
             {
-                memcpy(pszName, pVM->dbgf.s.pCurOS->pReg->szName, cchName - 1);
+                memcpy(pszName, pUVM->dbgf.s.pCurOS->pReg->szName, cchName - 1);
                 pszName[cchName - 1] = '\0';
                 rc = VINF_BUFFER_OVERFLOW;
@@ -356,5 +357,5 @@
         if (pszVersion && cchVersion)
         {
-            int rc2 = pVM->dbgf.s.pCurOS->pReg->pfnQueryVersion(pVM, pVM->dbgf.s.pCurOS->abData, pszVersion, cchVersion);
+            int rc2 = pUVM->dbgf.s.pCurOS->pReg->pfnQueryVersion(pUVM, pUVM->dbgf.s.pCurOS->abData, pszVersion, cchVersion);
             if (RT_FAILURE(rc2) || rc == VINF_SUCCESS)
                 rc = rc2;
@@ -374,5 +375,5 @@
  *
  * @returns VBox status code.
- * @param   pVM             Pointer to the VM.
+ * @param   pUVM            The user mode VM handle.
  * @param   pszName         Where to store the OS name. Optional.
  * @param   cchName         The size of the name buffer.
@@ -381,6 +382,7 @@
  * @thread  Any.
  */
-VMMR3DECL(int) DBGFR3OSQueryNameAndVersion(PVM pVM, char *pszName, size_t cchName, char *pszVersion, size_t cchVersion)
-{
+VMMR3DECL(int) DBGFR3OSQueryNameAndVersion(PUVM pUVM, char *pszName, size_t cchName, char *pszVersion, size_t cchVersion)
+{
+    UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE);
     AssertPtrNullReturn(pszName, VERR_INVALID_POINTER);
     AssertPtrNullReturn(pszVersion, VERR_INVALID_POINTER);
@@ -397,6 +399,6 @@
      * Pass it on to EMT(0).
      */
-    return VMR3ReqPriorityCallWait(pVM, 0 /*idDstCpu*/,
-                                   (PFNRT)dbgfR3OSQueryNameAndVersion, 5, pVM, pszName, cchName, pszVersion, cchVersion);
+    return VMR3ReqPriorityCallWaitU(pUVM, 0 /*idDstCpu*/,
+                                   (PFNRT)dbgfR3OSQueryNameAndVersion, 5, pUVM, pszName, cchName, pszVersion, cchVersion);
 }
 
@@ -405,13 +407,13 @@
  * EMT worker for DBGFR3OSQueryInterface.
  *
- * @param   pVM         Pointer to the VM.
- * @param   enmIf       The interface identifier.
- * @param   ppvIf       Where to store the interface pointer on success.
- */
-static DECLCALLBACK(void) dbgfR3OSQueryInterface(PVM pVM, DBGFOSINTERFACE enmIf, void **ppvIf)
-{
-    if (pVM->dbgf.s.pCurOS)
-    {
-        *ppvIf = pVM->dbgf.s.pCurOS->pReg->pfnQueryInterface(pVM, pVM->dbgf.s.pCurOS->abData, enmIf);
+ * @param   pUVM            The user mode VM handle.
+ * @param   enmIf           The interface identifier.
+ * @param   ppvIf           Where to store the interface pointer on success.
+ */
+static DECLCALLBACK(void) dbgfR3OSQueryInterface(PUVM pUVM, DBGFOSINTERFACE enmIf, void **ppvIf)
+{
+    if (pUVM->dbgf.s.pCurOS)
+    {
+        *ppvIf = pUVM->dbgf.s.pCurOS->pReg->pfnQueryInterface(pUVM, pUVM->dbgf.s.pCurOS->abData, enmIf);
         if (*ppvIf)
         {
@@ -430,9 +432,9 @@
  * @returns Pointer to the digger interface on success, NULL if the interfaces isn't
  *          available or no active guest OS digger.
- * @param   pVM         Pointer to the VM.
- * @param   enmIf       The interface identifier.
+ * @param   pUVM            The user mode VM handle.
+ * @param   enmIf           The interface identifier.
  * @thread  Any.
  */
-VMMR3DECL(void *) DBGFR3OSQueryInterface(PVM pVM, DBGFOSINTERFACE enmIf)
+VMMR3DECL(void *) DBGFR3OSQueryInterface(PUVM pUVM, DBGFOSINTERFACE enmIf)
 {
     AssertMsgReturn(enmIf > DBGFOSINTERFACE_INVALID && enmIf < DBGFOSINTERFACE_END, ("%d\n", enmIf), NULL);
@@ -442,5 +444,5 @@
      */
     void *pvIf = NULL;
-    VMR3ReqPriorityCallVoidWaitU(pVM->pUVM, VMCPUID_ANY, (PFNRT)dbgfR3OSQueryInterface, 3, pVM, enmIf, &pvIf);
+    VMR3ReqPriorityCallVoidWaitU(pUVM, VMCPUID_ANY, (PFNRT)dbgfR3OSQueryInterface, 3, pUVM, enmIf, &pvIf);
     return pvIf;
 }
Index: trunk/src/VBox/VMM/VMMR3/DBGFReg.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMR3/DBGFReg.cpp	(revision 44398)
+++ trunk/src/VBox/VMM/VMMR3/DBGFReg.cpp	(revision 44399)
@@ -25,4 +25,5 @@
 #include <VBox/vmm/mm.h>
 #include <VBox/vmm/vm.h>
+#include <VBox/vmm/uvm.h>
 #include <VBox/param.h>
 #include <VBox/err.h>
@@ -37,28 +38,28 @@
 *******************************************************************************/
 /** Locks the register database for writing. */
-#define DBGF_REG_DB_LOCK_WRITE(pVM) \
+#define DBGF_REG_DB_LOCK_WRITE(pUVM) \
     do { \
-        int rcSem = RTSemRWRequestWrite((pVM)->dbgf.s.hRegDbLock, RT_INDEFINITE_WAIT); \
+        int rcSem = RTSemRWRequestWrite((pUVM)->dbgf.s.hRegDbLock, RT_INDEFINITE_WAIT); \
         AssertRC(rcSem); \
     } while (0)
 
 /** Unlocks the register database after writing. */
-#define DBGF_REG_DB_UNLOCK_WRITE(pVM) \
+#define DBGF_REG_DB_UNLOCK_WRITE(pUVM) \
     do { \
-        int rcSem = RTSemRWReleaseWrite((pVM)->dbgf.s.hRegDbLock); \
+        int rcSem = RTSemRWReleaseWrite((pUVM)->dbgf.s.hRegDbLock); \
         AssertRC(rcSem); \
     } while (0)
 
 /** Locks the register database for reading. */
-#define DBGF_REG_DB_LOCK_READ(pVM) \
+#define DBGF_REG_DB_LOCK_READ(pUVM) \
     do { \
-        int rcSem = RTSemRWRequestRead((pVM)->dbgf.s.hRegDbLock, RT_INDEFINITE_WAIT); \
+        int rcSem = RTSemRWRequestRead((pUVM)->dbgf.s.hRegDbLock, RT_INDEFINITE_WAIT); \
         AssertRC(rcSem); \
     } while (0)
 
 /** Unlocks the register database after reading. */
-#define DBGF_REG_DB_UNLOCK_READ(pVM) \
+#define DBGF_REG_DB_UNLOCK_READ(pUVM) \
     do { \
-        int rcSem = RTSemRWReleaseRead((pVM)->dbgf.s.hRegDbLock); \
+        int rcSem = RTSemRWReleaseRead((pUVM)->dbgf.s.hRegDbLock); \
         AssertRC(rcSem); \
     } while (0)
@@ -161,5 +162,6 @@
     /** The number of entries in the output array. */
     size_t          cRegs;
-    /** The current register number when enumerating the string space. */
+    /** The current register number when enumerating the string space.
+     * @remarks Only used by EMT(0). */
     size_t          iReg;
 } DBGFR3REGNMQUERYALLARGS;
@@ -174,6 +176,6 @@
 typedef struct DBGFR3REGPRINTFARGS
 {
-    /** Pointer to the VM. */
-    PVM         pVM;
+    /** The user mode VM handle. */
+    PUVM        pUVM;
     /** The target CPU. */
     VMCPUID     idCpu;
@@ -204,13 +206,13 @@
  *
  * @returns VBox status code.
- * @param   pVM                 Pointer to the VM.
- */
-int dbgfR3RegInit(PVM pVM)
-{
-    int rc = VINF_SUCCESS;
-    if (!pVM->dbgf.s.fRegDbInitialized)
-    {
-        rc = RTSemRWCreate(&pVM->dbgf.s.hRegDbLock);
-        pVM->dbgf.s.fRegDbInitialized = RT_SUCCESS(rc);
+ * @param   pUVM                The user mode VM handle.
+ */
+int dbgfR3RegInit(PUVM pUVM)
+{
+    int  rc   = VINF_SUCCESS;
+    if (!pUVM->dbgf.s.fRegDbInitialized)
+    {
+        rc = RTSemRWCreate(&pUVM->dbgf.s.hRegDbLock);
+        pUVM->dbgf.s.fRegDbInitialized = RT_SUCCESS(rc);
     }
     return rc;
@@ -221,11 +223,11 @@
  * Terminates the register database.
  *
- * @param   pVM                 Pointer to the VM.
- */
-void dbgfR3RegTerm(PVM pVM)
-{
-    RTSemRWDestroy(pVM->dbgf.s.hRegDbLock);
-    pVM->dbgf.s.hRegDbLock = NIL_RTSEMRW;
-    pVM->dbgf.s.fRegDbInitialized = false;
+ * @param   pUVM                The user mode VM handle.
+ */
+void dbgfR3RegTerm(PUVM pUVM)
+{
+    RTSemRWDestroy(pUVM->dbgf.s.hRegDbLock);
+    pUVM->dbgf.s.hRegDbLock = NIL_RTSEMRW;
+    pUVM->dbgf.s.fRegDbInitialized = false;
 }
 
@@ -262,5 +264,5 @@
  *
  * @returns VBox status code.
- * @param   pVM                 Pointer to the VM.
+ * @param   pUVM                The user mode VM handle.
  * @param   paRegisters         The register descriptors.
  * @param   enmType             The set type.
@@ -270,5 +272,5 @@
  *                              pszPrefix when creating the set name.
  */
-static int dbgfR3RegRegisterCommon(PVM pVM, PCDBGFREGDESC paRegisters, DBGFREGSETTYPE enmType, void *pvUserArg,
+static int dbgfR3RegRegisterCommon(PUVM pUVM, PCDBGFREGDESC paRegisters, DBGFREGSETTYPE enmType, void *pvUserArg,
                                    const char *pszPrefix, uint32_t iInstance)
 {
@@ -338,5 +340,5 @@
 
     /* Check the instance number of the CPUs. */
-    AssertReturn(enmType != DBGFREGSETTYPE_CPU || iInstance < pVM->cCpus, VERR_INVALID_CPU_ID);
+    AssertReturn(enmType != DBGFREGSETTYPE_CPU || iInstance < pUVM->cCpus, VERR_INVALID_CPU_ID);
 
     /*
@@ -348,5 +350,5 @@
     cbRegSet += cLookupRecs * sizeof(DBGFREGLOOKUP);
 
-    PDBGFREGSET pRegSet = (PDBGFREGSET)MMR3HeapAllocZ(pVM, MM_TAG_DBGF_REG, cbRegSet);
+    PDBGFREGSET pRegSet = (PDBGFREGSET)MMR3HeapAllocZU(pUVM, MM_TAG_DBGF_REG, cbRegSet);
     if (!pRegSet)
         return VERR_NO_MEMORY;
@@ -382,5 +384,5 @@
     {
         strcpy(pszReg, paRegisters[iDesc].pszName);
-        pLookupRec->Core.pszString = MMR3HeapStrDup(pVM, MM_TAG_DBGF_REG, szName);
+        pLookupRec->Core.pszString = MMR3HeapStrDupU(pUVM, MM_TAG_DBGF_REG, szName);
         if (!pLookupRec->Core.pszString)
             rc = VERR_NO_STR_MEMORY;
@@ -411,5 +413,5 @@
                 {
                     strcpy(pszSub, paSubFields[iSubField].pszName);
-                    pLookupRec->Core.pszString = MMR3HeapStrDup(pVM, MM_TAG_DBGF_REG, szName);
+                    pLookupRec->Core.pszString = MMR3HeapStrDupU(pUVM, MM_TAG_DBGF_REG, szName);
                     if (!pLookupRec->Core.pszString)
                         rc = VERR_NO_STR_MEMORY;
@@ -432,5 +434,5 @@
             /* The alias record. */
             strcpy(pszReg, pszRegName);
-            pLookupRec->Core.pszString = MMR3HeapStrDup(pVM, MM_TAG_DBGF_REG, szName);
+            pLookupRec->Core.pszString = MMR3HeapStrDupU(pUVM, MM_TAG_DBGF_REG, szName);
             if (!pLookupRec->Core.pszString)
                 rc = VERR_NO_STR_MEMORY;
@@ -450,18 +452,18 @@
          * the CPU register set cache.
          */
-        DBGF_REG_DB_LOCK_WRITE(pVM);
-
-        bool fInserted = RTStrSpaceInsert(&pVM->dbgf.s.RegSetSpace, &pRegSet->Core);
+        DBGF_REG_DB_LOCK_WRITE(pUVM);
+
+        bool fInserted = RTStrSpaceInsert(&pUVM->dbgf.s.RegSetSpace, &pRegSet->Core);
         if (fInserted)
         {
-            pVM->dbgf.s.cRegs += pRegSet->cDescs;
+            pUVM->dbgf.s.cRegs += pRegSet->cDescs;
             if (enmType == DBGFREGSETTYPE_CPU)
             {
                 if (pRegSet->cDescs > DBGFREG_ALL_COUNT)
-                    pVM->dbgf.s.cRegs -= pRegSet->cDescs - DBGFREG_ALL_COUNT;
+                    pUVM->dbgf.s.cRegs -= pRegSet->cDescs - DBGFREG_ALL_COUNT;
                 if (!strcmp(pszPrefix, "cpu"))
-                    pVM->aCpus[iInstance].dbgf.s.pGuestRegSet = pRegSet;
+                    pUVM->aCpus[iInstance].dbgf.s.pGuestRegSet = pRegSet;
                 else
-                    pVM->aCpus[iInstance].dbgf.s.pHyperRegSet = pRegSet;
+                    pUVM->aCpus[iInstance].dbgf.s.pHyperRegSet = pRegSet;
             }
 
@@ -470,13 +472,13 @@
             while (iLookupRec-- > 0)
             {
-                bool fInserted2 = RTStrSpaceInsert(&pVM->dbgf.s.RegSpace, &paLookupRecs[iLookupRec].Core);
+                bool fInserted2 = RTStrSpaceInsert(&pUVM->dbgf.s.RegSpace, &paLookupRecs[iLookupRec].Core);
                 AssertMsg(fInserted2, ("'%s'", paLookupRecs[iLookupRec].Core.pszString)); NOREF(fInserted2);
             }
 
-            DBGF_REG_DB_UNLOCK_WRITE(pVM);
+            DBGF_REG_DB_UNLOCK_WRITE(pUVM);
             return VINF_SUCCESS;
         }
 
-        DBGF_REG_DB_UNLOCK_WRITE(pVM);
+        DBGF_REG_DB_UNLOCK_WRITE(pUVM);
         rc = VERR_DUPLICATE;
     }
@@ -505,12 +507,14 @@
 VMMR3_INT_DECL(int) DBGFR3RegRegisterCpu(PVM pVM, PVMCPU pVCpu, PCDBGFREGDESC paRegisters, bool fGuestRegs)
 {
-    if (!pVM->dbgf.s.fRegDbInitialized)
-    {
-        int rc = dbgfR3RegInit(pVM);
+    PUVM pUVM = pVM->pUVM;
+    if (!pUVM->dbgf.s.fRegDbInitialized)
+    {
+        int rc = dbgfR3RegInit(pUVM);
         if (RT_FAILURE(rc))
             return rc;
     }
 
-    return dbgfR3RegRegisterCommon(pVM, paRegisters, DBGFREGSETTYPE_CPU, pVCpu, fGuestRegs ? "cpu" : "hypercpu", pVCpu->idCpu);
+    return dbgfR3RegRegisterCommon(pUVM, paRegisters, DBGFREGSETTYPE_CPU, pVCpu,
+                                   fGuestRegs ? "cpu" : "hypercpu", pVCpu->idCpu);
 }
 
@@ -525,12 +529,12 @@
  *                              the standard name.
  */
-VMMR3DECL(int) DBGFR3RegRegisterDevice(PVM pVM, PCDBGFREGDESC paRegisters, PPDMDEVINS pDevIns, const char *pszPrefix, uint32_t iInstance)
-{
-    VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
+VMMR3_INT_DECL(int) DBGFR3RegRegisterDevice(PVM pVM, PCDBGFREGDESC paRegisters, PPDMDEVINS pDevIns, const char *pszPrefix,
+                                            uint32_t iInstance)
+{
     AssertPtrReturn(paRegisters, VERR_INVALID_POINTER);
     AssertPtrReturn(pDevIns, VERR_INVALID_POINTER);
     AssertPtrReturn(pszPrefix, VERR_INVALID_POINTER);
 
-    return dbgfR3RegRegisterCommon(pVM, paRegisters, DBGFREGSETTYPE_DEVICE, pDevIns, pszPrefix, iInstance);
+    return dbgfR3RegRegisterCommon(pVM->pUVM, paRegisters, DBGFREGSETTYPE_DEVICE, pDevIns, pszPrefix, iInstance);
 }
 
@@ -782,5 +786,5 @@
  * @retval  VINF_DBGF_ZERO_EXTENDED_REGISTER
  *
- * @param   pVM                 Pointer to the VM.
+ * @param   pUVM                The user mode VM handle.
  * @param   idCpu               The virtual CPU ID.
  * @param   enmReg              The register to query.
@@ -790,9 +794,9 @@
  * @param   pValue              Where to return the register value.
  */
-static DECLCALLBACK(int) dbgfR3RegCpuQueryWorkerOnCpu(PVM pVM, VMCPUID idCpu, DBGFREG enmReg, DBGFREGVALTYPE enmType,
+static DECLCALLBACK(int) dbgfR3RegCpuQueryWorkerOnCpu(PUVM pUVM, VMCPUID idCpu, DBGFREG enmReg, DBGFREGVALTYPE enmType,
                                                       bool fGuestRegs, PDBGFREGVAL pValue)
 {
     int rc = VINF_SUCCESS;
-    DBGF_REG_DB_LOCK_READ(pVM);
+    DBGF_REG_DB_LOCK_READ(pUVM);
 
     /*
@@ -800,6 +804,6 @@
      */
     PDBGFREGSET pSet = fGuestRegs
-                     ? pVM->aCpus[idCpu].dbgf.s.pGuestRegSet
-                     : pVM->aCpus[idCpu].dbgf.s.pHyperRegSet;
+                     ? pUVM->aCpus[idCpu].dbgf.s.pGuestRegSet
+                     : pUVM->aCpus[idCpu].dbgf.s.pHyperRegSet;
     if (RT_LIKELY(pSet))
     {
@@ -831,5 +835,5 @@
         rc = VERR_INVALID_CPU_ID;
 
-    DBGF_REG_DB_UNLOCK_READ(pVM);
+    DBGF_REG_DB_UNLOCK_READ(pUVM);
     return rc;
 }
@@ -848,5 +852,5 @@
  * @retval  VINF_DBGF_ZERO_EXTENDED_REGISTER
  *
- * @param   pVM                 Pointer to the VM.
+ * @param   pUVM                The user mode VM handle.
  * @param   idCpu               The virtual CPU ID.  Can be OR'ed with
  *                              DBGFREG_HYPER_VMCPUID.
@@ -855,15 +859,16 @@
  * @param   pValue              Where to return the register value.
  */
-static int dbgfR3RegCpuQueryWorker(PVM pVM, VMCPUID idCpu, DBGFREG enmReg, DBGFREGVALTYPE enmType, PDBGFREGVAL pValue)
-{
-    VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
+static int dbgfR3RegCpuQueryWorker(PUVM pUVM, VMCPUID idCpu, DBGFREG enmReg, DBGFREGVALTYPE enmType, PDBGFREGVAL pValue)
+{
+    UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE);
+    VM_ASSERT_VALID_EXT_RETURN(pUVM->pVM, VERR_INVALID_VM_HANDLE);
     AssertMsgReturn(enmReg >= DBGFREG_AL && enmReg <= DBGFREG_END, ("%d\n", enmReg), VERR_INVALID_PARAMETER);
 
     bool const fGuestRegs = !(idCpu & DBGFREG_HYPER_VMCPUID);
     idCpu &= ~DBGFREG_HYPER_VMCPUID;
-    AssertReturn(idCpu < pVM->cCpus, VERR_INVALID_CPU_ID);
-
-    return VMR3ReqPriorityCallWait(pVM, idCpu, (PFNRT)dbgfR3RegCpuQueryWorkerOnCpu, 6,
-                                   pVM, idCpu, enmReg, enmType, fGuestRegs, pValue);
+    AssertReturn(idCpu < pUVM->cCpus, VERR_INVALID_CPU_ID);
+
+    return VMR3ReqPriorityCallWaitU(pUVM, idCpu, (PFNRT)dbgfR3RegCpuQueryWorkerOnCpu, 6,
+                                    pUVM, idCpu, enmReg, enmType, fGuestRegs, pValue);
 }
 
@@ -879,5 +884,5 @@
  * @retval  VINF_DBGF_TRUNCATED_REGISTER
  *
- * @param   pVM                 Pointer to the VM.
+ * @param   pUVM                The user mode VM handle.
  * @param   idCpu               The target CPU ID. Can be OR'ed with
  *                              DBGFREG_HYPER_VMCPUID.
@@ -885,8 +890,8 @@
  * @param   pu8                 Where to store the register value.
  */
-VMMR3DECL(int) DBGFR3RegCpuQueryU8(PVM pVM, VMCPUID idCpu, DBGFREG enmReg, uint8_t *pu8)
+VMMR3DECL(int) DBGFR3RegCpuQueryU8(PUVM pUVM, VMCPUID idCpu, DBGFREG enmReg, uint8_t *pu8)
 {
     DBGFREGVAL Value;
-    int rc = dbgfR3RegCpuQueryWorker(pVM, idCpu, enmReg, DBGFREGVALTYPE_U8, &Value);
+    int rc = dbgfR3RegCpuQueryWorker(pUVM, idCpu, enmReg, DBGFREGVALTYPE_U8, &Value);
     if (RT_SUCCESS(rc))
         *pu8 = Value.u8;
@@ -908,5 +913,5 @@
  * @retval  VINF_DBGF_ZERO_EXTENDED_REGISTER
  *
- * @param   pVM                 Pointer to the VM.
+ * @param   pUVM                The user mode VM handle.
  * @param   idCpu               The target CPU ID.  Can be OR'ed with
  *                              DBGFREG_HYPER_VMCPUID.
@@ -914,8 +919,8 @@
  * @param   pu16                Where to store the register value.
  */
-VMMR3DECL(int) DBGFR3RegCpuQueryU16(PVM pVM, VMCPUID idCpu, DBGFREG enmReg, uint16_t *pu16)
+VMMR3DECL(int) DBGFR3RegCpuQueryU16(PUVM pUVM, VMCPUID idCpu, DBGFREG enmReg, uint16_t *pu16)
 {
     DBGFREGVAL Value;
-    int rc = dbgfR3RegCpuQueryWorker(pVM, idCpu, enmReg, DBGFREGVALTYPE_U16, &Value);
+    int rc = dbgfR3RegCpuQueryWorker(pUVM, idCpu, enmReg, DBGFREGVALTYPE_U16, &Value);
     if (RT_SUCCESS(rc))
         *pu16 = Value.u16;
@@ -937,5 +942,5 @@
  * @retval  VINF_DBGF_ZERO_EXTENDED_REGISTER
  *
- * @param   pVM                 Pointer to the VM.
+ * @param   pUVM                The user mode VM handle.
  * @param   idCpu               The target CPU ID.  Can be OR'ed with
  *                              DBGFREG_HYPER_VMCPUID.
@@ -943,8 +948,8 @@
  * @param   pu32                Where to store the register value.
  */
-VMMR3DECL(int) DBGFR3RegCpuQueryU32(PVM pVM, VMCPUID idCpu, DBGFREG enmReg, uint32_t *pu32)
+VMMR3DECL(int) DBGFR3RegCpuQueryU32(PUVM pUVM, VMCPUID idCpu, DBGFREG enmReg, uint32_t *pu32)
 {
     DBGFREGVAL Value;
-    int rc = dbgfR3RegCpuQueryWorker(pVM, idCpu, enmReg, DBGFREGVALTYPE_U32, &Value);
+    int rc = dbgfR3RegCpuQueryWorker(pUVM, idCpu, enmReg, DBGFREGVALTYPE_U32, &Value);
     if (RT_SUCCESS(rc))
         *pu32 = Value.u32;
@@ -966,5 +971,5 @@
  * @retval  VINF_DBGF_ZERO_EXTENDED_REGISTER
  *
- * @param   pVM                 Pointer to the VM.
+ * @param   pUVM                The user mode VM handle.
  * @param   idCpu               The target CPU ID.  Can be OR'ed with
  *                              DBGFREG_HYPER_VMCPUID.
@@ -972,8 +977,8 @@
  * @param   pu64                Where to store the register value.
  */
-VMMR3DECL(int) DBGFR3RegCpuQueryU64(PVM pVM, VMCPUID idCpu, DBGFREG enmReg, uint64_t *pu64)
+VMMR3DECL(int) DBGFR3RegCpuQueryU64(PUVM pUVM, VMCPUID idCpu, DBGFREG enmReg, uint64_t *pu64)
 {
     DBGFREGVAL Value;
-    int rc = dbgfR3RegCpuQueryWorker(pVM, idCpu, enmReg, DBGFREGVALTYPE_U64, &Value);
+    int rc = dbgfR3RegCpuQueryWorker(pUVM, idCpu, enmReg, DBGFREGVALTYPE_U64, &Value);
     if (RT_SUCCESS(rc))
         *pu64 = Value.u64;
@@ -1008,8 +1013,8 @@
 
 
-static DECLCALLBACK(int) dbgfR3RegCpuQueryBatchWorker(PVM pVM, VMCPUID idCpu, PDBGFREGENTRY paRegs, size_t cRegs)
+static DECLCALLBACK(int) dbgfR3RegCpuQueryBatchWorker(PUVM pUVM, VMCPUID idCpu, PDBGFREGENTRY paRegs, size_t cRegs)
 {
 #if 0
-    PVMCPU    pVCpu = &pVM->aCpus[idCpu];
+    PVMCPU    pVCpu = &pUVM->pVM->aCpus[idCpu];
     PCCPUMCTX pCtx  = CPUMQueryGuestCtxPtr(pVCpu);
 
@@ -1071,5 +1076,5 @@
  * @retval  VERR_DBGF_REGISTER_NOT_FOUND
  *
- * @param   pVM                 Pointer to the VM.
+ * @param   pUVM                The user mode VM handle.
  * @param   idCpu               The target CPU ID.  Can be OR'ed with
  *                              DBGFREG_HYPER_VMCPUID.
@@ -1081,8 +1086,9 @@
  * @param   cRegs               The number of entries in @a paRegs.
  */
-VMMR3DECL(int) DBGFR3RegCpuQueryBatch(PVM pVM, VMCPUID idCpu, PDBGFREGENTRY paRegs, size_t cRegs)
-{
-    VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
-    AssertReturn(idCpu < pVM->cCpus, VERR_INVALID_CPU_ID);
+VMMR3DECL(int) DBGFR3RegCpuQueryBatch(PUVM pUVM, VMCPUID idCpu, PDBGFREGENTRY paRegs, size_t cRegs)
+{
+    UVM_ASSERT_VALID_EXT_RETURN(pUVM, NULL);
+    VM_ASSERT_VALID_EXT_RETURN(pUVM->pVM, NULL);
+    AssertReturn(idCpu < pUVM->cCpus, VERR_INVALID_CPU_ID);
     if (!cRegs)
         return VINF_SUCCESS;
@@ -1096,5 +1102,5 @@
     }
 
-    return VMR3ReqCallWait(pVM, idCpu, (PFNRT)dbgfR3RegCpuQueryBatchWorker, 4, pVM, idCpu, paRegs, cRegs);
+    return VMR3ReqCallWaitU(pUVM, idCpu, (PFNRT)dbgfR3RegCpuQueryBatchWorker, 4, pUVM, idCpu, paRegs, cRegs);
 }
 
@@ -1107,5 +1113,5 @@
  * @retval  VERR_INVALID_CPU_ID
  *
- * @param   pVM                 Pointer to the VM.
+ * @param   pUVM                The user mode VM handle.
  * @param   idCpu               The target CPU ID.  Can be OR'ed with
  *                              DBGFREG_HYPER_VMCPUID.
@@ -1118,11 +1124,12 @@
  *                              recommended value is DBGFREG_ALL_COUNT.
  */
-VMMR3DECL(int) DBGFR3RegCpuQueryAll(PVM pVM, VMCPUID idCpu, PDBGFREGENTRY paRegs, size_t cRegs)
+VMMR3DECL(int) DBGFR3RegCpuQueryAll(PUVM pUVM, VMCPUID idCpu, PDBGFREGENTRY paRegs, size_t cRegs)
 {
     /*
      * Validate input.
      */
-    VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
-    AssertReturn(idCpu < pVM->cCpus, VERR_INVALID_CPU_ID);
+    UVM_ASSERT_VALID_EXT_RETURN(pUVM, NULL);
+    VM_ASSERT_VALID_EXT_RETURN(pUVM->pVM, NULL);
+    AssertReturn(idCpu < pUVM->cCpus, VERR_INVALID_CPU_ID);
     if (!cRegs)
         return VINF_SUCCESS;
@@ -1142,5 +1149,5 @@
         paRegs[iReg++].enmReg = DBGFREG_END;
 
-    return VMR3ReqCallWait(pVM, idCpu, (PFNRT)dbgfR3RegCpuQueryBatchWorker, 4, pVM, idCpu, paRegs, cRegs);
+    return VMR3ReqCallWaitU(pUVM, idCpu, (PFNRT)dbgfR3RegCpuQueryBatchWorker, 4, pUVM, idCpu, paRegs, cRegs);
 }
 
@@ -1153,5 +1160,5 @@
  *          parameters are invalid.
  *
- * @param   pVM                 Pointer to the VM.
+ * @param   pUVM                The user mode VM handle.
  * @param   enmReg              The register identifier.
  * @param   enmType             The register type.  This is for sort out
@@ -1159,11 +1166,12 @@
  *                              the standard name.
  */
-VMMR3DECL(const char *) DBGFR3RegCpuName(PVM pVM, DBGFREG enmReg, DBGFREGVALTYPE enmType)
+VMMR3DECL(const char *) DBGFR3RegCpuName(PUVM pUVM, DBGFREG enmReg, DBGFREGVALTYPE enmType)
 {
     AssertReturn(enmReg >= DBGFREG_AL && enmReg < DBGFREG_END, NULL);
     AssertReturn(enmType >= DBGFREGVALTYPE_INVALID && enmType < DBGFREGVALTYPE_END, NULL);
-    VM_ASSERT_VALID_EXT_RETURN(pVM, NULL);
-
-    PCDBGFREGSET    pSet    = pVM->aCpus[0].dbgf.s.pGuestRegSet;
+    UVM_ASSERT_VALID_EXT_RETURN(pUVM, NULL);
+    VM_ASSERT_VALID_EXT_RETURN(pUVM->pVM, NULL);
+
+    PCDBGFREGSET    pSet    = pUVM->aCpus[0].dbgf.s.pGuestRegSet;
     if (RT_UNLIKELY(!pSet))
         return NULL;
@@ -1221,5 +1229,5 @@
  *
  * @returns Lookup record.
- * @param   pVM                 Pointer to the VM.
+ * @param   pUVM                The user mode VM handle.
  * @param   idDefCpu            The default CPU ID set.
  * @param   pszReg              The register name.
@@ -1227,10 +1235,11 @@
  *                              hypervisor CPU registers if clear.
  */
-static PCDBGFREGLOOKUP dbgfR3RegResolve(PVM pVM, VMCPUID idDefCpu, const char *pszReg, bool fGuestRegs)
-{
-    DBGF_REG_DB_LOCK_READ(pVM);
+static PCDBGFREGLOOKUP dbgfR3RegResolve(PUVM pUVM, VMCPUID idDefCpu, const char *pszReg, bool fGuestRegs)
+{
+    DBGF_REG_DB_LOCK_READ(pUVM);
 
     /* Try looking up the name without any case folding or cpu prefixing. */
-    PCDBGFREGLOOKUP pLookupRec = (PCDBGFREGLOOKUP)RTStrSpaceGet(&pVM->dbgf.s.RegSpace, pszReg);
+    PRTSTRSPACE pRegSpace = &pUVM->dbgf.s.RegSpace;
+    PCDBGFREGLOOKUP pLookupRec = (PCDBGFREGLOOKUP)RTStrSpaceGet(pRegSpace, pszReg);
     if (!pLookupRec)
     {
@@ -1240,5 +1249,5 @@
         ssize_t cchFolded = dbgfR3RegCopyToLower(pszReg, RTSTR_MAX, szName, sizeof(szName) - DBGF_REG_MAX_NAME);
         if (cchFolded > 0)
-            pLookupRec = (PCDBGFREGLOOKUP)RTStrSpaceGet(&pVM->dbgf.s.RegSpace, szName);
+            pLookupRec = (PCDBGFREGLOOKUP)RTStrSpaceGet(pRegSpace, szName);
         if (   !pLookupRec
             && cchFolded >= 0
@@ -1248,9 +1257,9 @@
             size_t cchCpuSet = RTStrPrintf(szName, sizeof(szName), fGuestRegs ? "cpu%u." : "hypercpu%u.", idDefCpu);
             dbgfR3RegCopyToLower(pszReg, RTSTR_MAX, &szName[cchCpuSet], sizeof(szName) - cchCpuSet);
-            pLookupRec = (PCDBGFREGLOOKUP)RTStrSpaceGet(&pVM->dbgf.s.RegSpace, szName);
+            pLookupRec = (PCDBGFREGLOOKUP)RTStrSpaceGet(pRegSpace, szName);
         }
     }
 
-    DBGF_REG_DB_UNLOCK_READ(pVM);
+    DBGF_REG_DB_UNLOCK_READ(pUVM);
     return pLookupRec;
 }
@@ -1264,15 +1273,16 @@
  * @retval  VERR_DBGF_REGISTER_NOT_FOUND if not found.
  *
- * @param   pVM                 Pointer to the VM.
+ * @param   pUVM                The user mode VM handle.
  * @param   idDefCpu            The default CPU.
  * @param   pszReg              The registe name.
  */
-VMMR3DECL(int) DBGFR3RegNmValidate(PVM pVM, VMCPUID idDefCpu, const char *pszReg)
+VMMR3DECL(int) DBGFR3RegNmValidate(PUVM pUVM, VMCPUID idDefCpu, const char *pszReg)
 {
     /*
      * Validate input.
      */
-    VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
-    AssertReturn((idDefCpu & ~DBGFREG_HYPER_VMCPUID) < pVM->cCpus || idDefCpu == VMCPUID_ANY, VERR_INVALID_CPU_ID);
+    UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE);
+    VM_ASSERT_VALID_EXT_RETURN(pUVM->pVM, VERR_INVALID_VM_HANDLE);
+    AssertReturn((idDefCpu & ~DBGFREG_HYPER_VMCPUID) < pUVM->cCpus || idDefCpu == VMCPUID_ANY, VERR_INVALID_CPU_ID);
     AssertPtrReturn(pszReg, VERR_INVALID_POINTER);
 
@@ -1281,5 +1291,5 @@
      */
     bool const fGuestRegs = !(idDefCpu & DBGFREG_HYPER_VMCPUID) && idDefCpu != VMCPUID_ANY;
-    PCDBGFREGLOOKUP pLookupRec = dbgfR3RegResolve(pVM, idDefCpu, pszReg, fGuestRegs);
+    PCDBGFREGLOOKUP pLookupRec = dbgfR3RegResolve(pUVM, idDefCpu, pszReg, fGuestRegs);
     if (!pLookupRec)
         return VERR_DBGF_REGISTER_NOT_FOUND;
@@ -1294,5 +1304,5 @@
  * @returns VBox status code.
  *
- * @param   pVM                 Pointer to the VM.
+ * @param   pUVM                The user mode VM handle.
  * @param   pLookupRec          The register lookup record.
  * @param   enmType             The desired return type.
@@ -1301,5 +1311,5 @@
  *                              Optional.
  */
-static DECLCALLBACK(int) dbgfR3RegNmQueryWorkerOnCpu(PVM pVM, PCDBGFREGLOOKUP pLookupRec, DBGFREGVALTYPE enmType,
+static DECLCALLBACK(int) dbgfR3RegNmQueryWorkerOnCpu(PUVM pUVM, PCDBGFREGLOOKUP pLookupRec, DBGFREGVALTYPE enmType,
                                                      PDBGFREGVAL pValue, PDBGFREGVALTYPE penmType)
 {
@@ -1310,5 +1320,5 @@
     int                 rc;
 
-    NOREF(pVM);
+    NOREF(pUVM);
 
     /*
@@ -1409,5 +1419,5 @@
  * @retval  VINF_DBGF_ZERO_EXTENDED_REGISTER
  *
- * @param   pVM                 Pointer to the VM.
+ * @param   pUVM                The user mode VM handle.
  * @param   idDefCpu            The virtual CPU ID for the default CPU register
  *                              set.  Can be OR'ed with DBGFREG_HYPER_VMCPUID.
@@ -1418,5 +1428,5 @@
  *                              Optional.
  */
-static int dbgfR3RegNmQueryWorker(PVM pVM, VMCPUID idDefCpu, const char *pszReg, DBGFREGVALTYPE enmType,
+static int dbgfR3RegNmQueryWorker(PUVM pUVM, VMCPUID idDefCpu, const char *pszReg, DBGFREGVALTYPE enmType,
                                   PDBGFREGVAL pValue, PDBGFREGVALTYPE penmType)
 {
@@ -1424,6 +1434,7 @@
      * Validate input.
      */
-    VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
-    AssertReturn((idDefCpu & ~DBGFREG_HYPER_VMCPUID) < pVM->cCpus || idDefCpu == VMCPUID_ANY, VERR_INVALID_CPU_ID);
+    UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE);
+    VM_ASSERT_VALID_EXT_RETURN(pUVM->pVM, VERR_INVALID_VM_HANDLE);
+    AssertReturn((idDefCpu & ~DBGFREG_HYPER_VMCPUID) < pUVM->cCpus || idDefCpu == VMCPUID_ANY, VERR_INVALID_CPU_ID);
     AssertPtrReturn(pszReg, VERR_INVALID_POINTER);
 
@@ -1435,5 +1446,5 @@
      */
     bool const fGuestRegs = !(idDefCpu & DBGFREG_HYPER_VMCPUID) && idDefCpu != VMCPUID_ANY;
-    PCDBGFREGLOOKUP pLookupRec = dbgfR3RegResolve(pVM, idDefCpu, pszReg, fGuestRegs);
+    PCDBGFREGLOOKUP pLookupRec = dbgfR3RegResolve(pUVM, idDefCpu, pszReg, fGuestRegs);
     if (pLookupRec)
     {
@@ -1442,5 +1453,6 @@
         else if (idDefCpu != VMCPUID_ANY)
             idDefCpu &= ~DBGFREG_HYPER_VMCPUID;
-        return VMR3ReqPriorityCallWait(pVM, idDefCpu, (PFNRT)dbgfR3RegNmQueryWorkerOnCpu, 5, pVM, pLookupRec, enmType, pValue, penmType);
+        return VMR3ReqPriorityCallWaitU(pUVM, idDefCpu, (PFNRT)dbgfR3RegNmQueryWorkerOnCpu, 5,
+                                        pUVM, pLookupRec, enmType, pValue, penmType);
     }
     return VERR_DBGF_REGISTER_NOT_FOUND;
@@ -1456,5 +1468,5 @@
  * @retval  VERR_DBGF_REGISTER_NOT_FOUND
  *
- * @param   pVM                 Pointer to the VM.
+ * @param   pUVM                The user mode VM handle.
  * @param   idDefCpu            The default target CPU ID, VMCPUID_ANY if not
  *                              applicable. Can be OR'ed with
@@ -1466,7 +1478,7 @@
  * @param   penmType            Where to store the register value type.
  */
-VMMR3DECL(int) DBGFR3RegNmQuery(PVM pVM, VMCPUID idDefCpu, const char *pszReg, PDBGFREGVAL pValue, PDBGFREGVALTYPE penmType)
-{
-    return dbgfR3RegNmQueryWorker(pVM, idDefCpu, pszReg, DBGFREGVALTYPE_END, pValue, penmType);
+VMMR3DECL(int) DBGFR3RegNmQuery(PUVM pUVM, VMCPUID idDefCpu, const char *pszReg, PDBGFREGVAL pValue, PDBGFREGVALTYPE penmType)
+{
+    return dbgfR3RegNmQueryWorker(pUVM, idDefCpu, pszReg, DBGFREGVALTYPE_END, pValue, penmType);
 }
 
@@ -1482,5 +1494,5 @@
  * @retval  VINF_DBGF_TRUNCATED_REGISTER
  *
- * @param   pVM                 Pointer to the VM.
+ * @param   pUVM                The user mode VM handle.
  * @param   idDefCpu            The default target CPU ID, VMCPUID_ANY if not
  *                              applicable. Can be OR'ed with
@@ -1491,8 +1503,8 @@
  * @param   pu8                 Where to store the register value.
  */
-VMMR3DECL(int) DBGFR3RegNmQueryU8(PVM pVM, VMCPUID idDefCpu, const char *pszReg, uint8_t *pu8)
+VMMR3DECL(int) DBGFR3RegNmQueryU8(PUVM pUVM, VMCPUID idDefCpu, const char *pszReg, uint8_t *pu8)
 {
     DBGFREGVAL Value;
-    int rc = dbgfR3RegNmQueryWorker(pVM, idDefCpu, pszReg, DBGFREGVALTYPE_U8, &Value, NULL);
+    int rc = dbgfR3RegNmQueryWorker(pUVM, idDefCpu, pszReg, DBGFREGVALTYPE_U8, &Value, NULL);
     if (RT_SUCCESS(rc))
         *pu8 = Value.u8;
@@ -1514,5 +1526,5 @@
  * @retval  VINF_DBGF_ZERO_EXTENDED_REGISTER
  *
- * @param   pVM                 Pointer to the VM.
+ * @param   pUVM                The user mode VM handle.
  * @param   idDefCpu            The default target CPU ID, VMCPUID_ANY if not
  *                              applicable.  Can be OR'ed with
@@ -1523,8 +1535,8 @@
  * @param   pu16                Where to store the register value.
  */
-VMMR3DECL(int) DBGFR3RegNmQueryU16(PVM pVM, VMCPUID idDefCpu, const char *pszReg, uint16_t *pu16)
+VMMR3DECL(int) DBGFR3RegNmQueryU16(PUVM pUVM, VMCPUID idDefCpu, const char *pszReg, uint16_t *pu16)
 {
     DBGFREGVAL Value;
-    int rc = dbgfR3RegNmQueryWorker(pVM, idDefCpu, pszReg, DBGFREGVALTYPE_U16, &Value, NULL);
+    int rc = dbgfR3RegNmQueryWorker(pUVM, idDefCpu, pszReg, DBGFREGVALTYPE_U16, &Value, NULL);
     if (RT_SUCCESS(rc))
         *pu16 = Value.u16;
@@ -1546,5 +1558,5 @@
  * @retval  VINF_DBGF_ZERO_EXTENDED_REGISTER
  *
- * @param   pVM                 Pointer to the VM.
+ * @param   pUVM                The user mode VM handle.
  * @param   idDefCpu            The default target CPU ID, VMCPUID_ANY if not
  *                              applicable.  Can be OR'ed with
@@ -1555,8 +1567,8 @@
  * @param   pu32                Where to store the register value.
  */
-VMMR3DECL(int) DBGFR3RegNmQueryU32(PVM pVM, VMCPUID idDefCpu, const char *pszReg, uint32_t *pu32)
+VMMR3DECL(int) DBGFR3RegNmQueryU32(PUVM pUVM, VMCPUID idDefCpu, const char *pszReg, uint32_t *pu32)
 {
     DBGFREGVAL Value;
-    int rc = dbgfR3RegNmQueryWorker(pVM, idDefCpu, pszReg, DBGFREGVALTYPE_U32, &Value, NULL);
+    int rc = dbgfR3RegNmQueryWorker(pUVM, idDefCpu, pszReg, DBGFREGVALTYPE_U32, &Value, NULL);
     if (RT_SUCCESS(rc))
         *pu32 = Value.u32;
@@ -1578,5 +1590,5 @@
  * @retval  VINF_DBGF_ZERO_EXTENDED_REGISTER
  *
- * @param   pVM                 Pointer to the VM.
+ * @param   pUVM                The user mode VM handle.
  * @param   idDefCpu            The default target CPU ID, VMCPUID_ANY if not
  *                              applicable.  Can be OR'ed with
@@ -1587,8 +1599,8 @@
  * @param   pu64                Where to store the register value.
  */
-VMMR3DECL(int) DBGFR3RegNmQueryU64(PVM pVM, VMCPUID idDefCpu, const char *pszReg, uint64_t *pu64)
+VMMR3DECL(int) DBGFR3RegNmQueryU64(PUVM pUVM, VMCPUID idDefCpu, const char *pszReg, uint64_t *pu64)
 {
     DBGFREGVAL Value;
-    int rc = dbgfR3RegNmQueryWorker(pVM, idDefCpu, pszReg, DBGFREGVALTYPE_U64, &Value, NULL);
+    int rc = dbgfR3RegNmQueryWorker(pUVM, idDefCpu, pszReg, DBGFREGVALTYPE_U64, &Value, NULL);
     if (RT_SUCCESS(rc))
         *pu64 = Value.u64;
@@ -1610,5 +1622,5 @@
  * @retval  VINF_DBGF_ZERO_EXTENDED_REGISTER
  *
- * @param   pVM                 Pointer to the VM.
+ * @param   pUVM                The user mode VM handle.
  * @param   idDefCpu            The default target CPU ID, VMCPUID_ANY if not
  *                              applicable.  Can be OR'ed with
@@ -1619,8 +1631,8 @@
  * @param   pu128               Where to store the register value.
  */
-VMMR3DECL(int) DBGFR3RegNmQueryU128(PVM pVM, VMCPUID idDefCpu, const char *pszReg, PRTUINT128U pu128)
+VMMR3DECL(int) DBGFR3RegNmQueryU128(PUVM pUVM, VMCPUID idDefCpu, const char *pszReg, PRTUINT128U pu128)
 {
     DBGFREGVAL Value;
-    int rc = dbgfR3RegNmQueryWorker(pVM, idDefCpu, pszReg, DBGFREGVALTYPE_U128, &Value, NULL);
+    int rc = dbgfR3RegNmQueryWorker(pUVM, idDefCpu, pszReg, DBGFREGVALTYPE_U128, &Value, NULL);
     if (RT_SUCCESS(rc))
         *pu128 = Value.u128;
@@ -1643,5 +1655,5 @@
  * @retval  VINF_DBGF_ZERO_EXTENDED_REGISTER
  *
- * @param   pVM                 Pointer to the VM.
+ * @param   pUVM                The user mode VM handle.
  * @param   idDefCpu            The default target CPU ID, VMCPUID_ANY if not
  *                              applicable.  Can be OR'ed with
@@ -1652,8 +1664,8 @@
  * @param   plrd                Where to store the register value.
  */
-VMMR3DECL(int) DBGFR3RegNmQueryLrd(PVM pVM, VMCPUID idDefCpu, const char *pszReg, long double *plrd)
+VMMR3DECL(int) DBGFR3RegNmQueryLrd(PUVM pUVM, VMCPUID idDefCpu, const char *pszReg, long double *plrd)
 {
     DBGFREGVAL Value;
-    int rc = dbgfR3RegNmQueryWorker(pVM, idDefCpu, pszReg, DBGFREGVALTYPE_R80, &Value, NULL);
+    int rc = dbgfR3RegNmQueryWorker(pUVM, idDefCpu, pszReg, DBGFREGVALTYPE_R80, &Value, NULL);
     if (RT_SUCCESS(rc))
         *plrd = Value.lrd;
@@ -1676,5 +1688,5 @@
  * @retval  VINF_DBGF_ZERO_EXTENDED_REGISTER
  *
- * @param   pVM                 Pointer to the VM.
+ * @param   pUVM                The user mode VM handle.
  * @param   idDefCpu            The default target CPU ID, VMCPUID_ANY if not
  *                              applicable.  Can be OR'ed with
@@ -1686,8 +1698,8 @@
  * @param   pu32Limit           Where to store the register limit value.
  */
-VMMR3DECL(int) DBGFR3RegNmQueryXdtr(PVM pVM, VMCPUID idDefCpu, const char *pszReg, uint64_t *pu64Base, uint32_t *pu32Limit)
+VMMR3DECL(int) DBGFR3RegNmQueryXdtr(PUVM pUVM, VMCPUID idDefCpu, const char *pszReg, uint64_t *pu64Base, uint32_t *pu32Limit)
 {
     DBGFREGVAL Value;
-    int rc = dbgfR3RegNmQueryWorker(pVM, idDefCpu, pszReg, DBGFREGVALTYPE_DTR, &Value, NULL);
+    int rc = dbgfR3RegNmQueryWorker(pUVM, idDefCpu, pszReg, DBGFREGVALTYPE_DTR, &Value, NULL);
     if (RT_SUCCESS(rc))
     {
@@ -1704,5 +1716,5 @@
 
 
-/// @todo VMMR3DECL(int) DBGFR3RegNmQueryBatch(PVM pVM,VMCPUID idDefCpu, DBGFREGENTRYNM paRegs, size_t cRegs);
+/// @todo VMMR3DECL(int) DBGFR3RegNmQueryBatch(PUVM pUVM,VMCPUID idDefCpu, DBGFREGENTRYNM paRegs, size_t cRegs);
 
 
@@ -1711,11 +1723,11 @@
  *
  * @returns VBox status code.
- * @param   pVM                 Pointer to the VM.
+ * @param   pUVM                The user mode VM handle.
  * @param   pcRegs              Where to return the register count.
  */
-VMMR3DECL(int) DBGFR3RegNmQueryAllCount(PVM pVM, size_t *pcRegs)
-{
-    VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
-    *pcRegs = pVM->dbgf.s.cRegs;
+VMMR3DECL(int) DBGFR3RegNmQueryAllCount(PUVM pUVM, size_t *pcRegs)
+{
+    UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE);
+    *pcRegs = pUVM->dbgf.s.cRegs;
     return VINF_SUCCESS;
 }
@@ -1803,6 +1815,8 @@
     PDBGFREGENTRYNM             paRegs = pArgs->paRegs;
     size_t const                cRegs  = pArgs->cRegs;
-
-    DBGF_REG_DB_LOCK_READ(pVM);
+    PUVM                        pUVM   = pVM->pUVM;
+    PUVMCPU                     pUVCpu = pVCpu->pUVCpu;
+
+    DBGF_REG_DB_LOCK_READ(pUVM);
 
     /*
@@ -1810,8 +1824,8 @@
      */
     size_t iCpuReg = pVCpu->idCpu * DBGFREG_ALL_COUNT;
-    if (pVCpu->dbgf.s.pGuestRegSet)
+    if (pUVCpu->dbgf.s.pGuestRegSet)
     {
         if (iCpuReg < cRegs)
-            dbgfR3RegNmQueryAllInSet(pVCpu->dbgf.s.pGuestRegSet, DBGFREG_ALL_COUNT, &paRegs[iCpuReg], cRegs - iCpuReg);
+            dbgfR3RegNmQueryAllInSet(pUVCpu->dbgf.s.pGuestRegSet, DBGFREG_ALL_COUNT, &paRegs[iCpuReg], cRegs - iCpuReg);
     }
     else
@@ -1821,9 +1835,9 @@
      * My hypervisor CPU registers.
      */
-    iCpuReg = pVM->cCpus * DBGFREG_ALL_COUNT + pVCpu->idCpu * DBGFREG_ALL_COUNT;
-    if (pVCpu->dbgf.s.pHyperRegSet)
+    iCpuReg = pUVM->cCpus * DBGFREG_ALL_COUNT + pUVCpu->idCpu * DBGFREG_ALL_COUNT;
+    if (pUVCpu->dbgf.s.pHyperRegSet)
     {
         if (iCpuReg < cRegs)
-            dbgfR3RegNmQueryAllInSet(pVCpu->dbgf.s.pHyperRegSet, DBGFREG_ALL_COUNT, &paRegs[iCpuReg], cRegs - iCpuReg);
+            dbgfR3RegNmQueryAllInSet(pUVCpu->dbgf.s.pHyperRegSet, DBGFREG_ALL_COUNT, &paRegs[iCpuReg], cRegs - iCpuReg);
     }
     else
@@ -1833,12 +1847,12 @@
      * The primary CPU does all the other registers.
      */
-    if (pVCpu->idCpu == 0)
-    {
-        pArgs->iReg = pVM->cCpus * DBGFREG_ALL_COUNT * 2;
-        RTStrSpaceEnumerate(&pVM->dbgf.s.RegSetSpace, dbgfR3RegNmQueryAllEnum, pArgs);
+    if (pUVCpu->idCpu == 0)
+    {
+        pArgs->iReg = pUVM->cCpus * DBGFREG_ALL_COUNT * 2;
+        RTStrSpaceEnumerate(&pUVM->dbgf.s.RegSetSpace, dbgfR3RegNmQueryAllEnum, pArgs);
         dbgfR3RegNmQueryAllPadEntries(paRegs, cRegs, pArgs->iReg, cRegs);
     }
 
-    DBGF_REG_DB_UNLOCK_READ(pVM);
+    DBGF_REG_DB_UNLOCK_READ(pUVM);
     return VINF_SUCCESS; /* Ignore errors. */
 }
@@ -1849,5 +1863,5 @@
  *
  * @returns VBox status code.
- * @param   pVM                 Pointer to the VM.
+ * @param   pUVM                The user mode VM handle.
  * @param   paRegs              The output register value array.  The register
  *                              name string is read only and shall not be freed
@@ -1857,6 +1871,8 @@
  *                              DBGFR3RegNmQueryAllCount.
  */
-VMMR3DECL(int) DBGFR3RegNmQueryAll(PVM pVM, PDBGFREGENTRYNM paRegs, size_t cRegs)
-{
+VMMR3DECL(int) DBGFR3RegNmQueryAll(PUVM pUVM, PDBGFREGENTRYNM paRegs, size_t cRegs)
+{
+    UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE);
+    PVM pVM = pUVM->pVM;
     VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
     AssertPtrReturn(paRegs, VERR_INVALID_POINTER);
@@ -1871,7 +1887,7 @@
 
 
-VMMR3DECL(int) DBGFR3RegNmSet(PVM pVM, VMCPUID idDefCpu, const char *pszReg, PCDBGFREGVAL pValue, DBGFREGVALTYPE enmType)
-{
-    NOREF(pVM); NOREF(idDefCpu); NOREF(pszReg); NOREF(pValue); NOREF(enmType);
+VMMR3DECL(int) DBGFR3RegNmSet(PUVM pUVM, VMCPUID idDefCpu, const char *pszReg, PCDBGFREGVAL pValue, DBGFREGVALTYPE enmType)
+{
+    NOREF(pUVM); NOREF(idDefCpu); NOREF(pszReg); NOREF(pValue); NOREF(enmType);
     return VERR_NOT_IMPLEMENTED;
 }
@@ -1923,5 +1939,4 @@
 
 
-
 /**
  * Format a register value, extended version.
@@ -1939,6 +1954,6 @@
  * @param   fFlags          String formatting flags, RTSTR_F_XXX.
  */
-VMMDECL(ssize_t) DBGFR3RegFormatValueEx(char *pszBuf, size_t cbBuf, PCDBGFREGVAL pValue, DBGFREGVALTYPE enmType,
-                                        unsigned uBase, signed int cchWidth, signed int cchPrecision, uint32_t fFlags)
+VMMR3DECL(ssize_t) DBGFR3RegFormatValueEx(char *pszBuf, size_t cbBuf, PCDBGFREGVAL pValue, DBGFREGVALTYPE enmType,
+                                          unsigned uBase, signed int cchWidth, signed int cchPrecision, uint32_t fFlags)
 {
     /*
@@ -1976,5 +1991,5 @@
  * @param   fSpecial        Same as RTSTR_F_SPECIAL.
  */
-VMMDECL(ssize_t) DBGFR3RegFormatValue(char *pszBuf, size_t cbBuf, PCDBGFREGVAL pValue, DBGFREGVALTYPE enmType, bool fSpecial)
+VMMR3DECL(ssize_t) DBGFR3RegFormatValue(char *pszBuf, size_t cbBuf, PCDBGFREGVAL pValue, DBGFREGVALTYPE enmType, bool fSpecial)
 {
     int cchWidth = 0;
@@ -2021,5 +2036,5 @@
     DBGFREGVAL      Value;
     DBGFREGVALTYPE  enmType;
-    int rc = dbgfR3RegNmQueryWorkerOnCpu(pThis->pVM, pLookupRec, DBGFREGVALTYPE_END, &Value, &enmType);
+    int rc = dbgfR3RegNmQueryWorkerOnCpu(pThis->pUVM, pLookupRec, DBGFREGVALTYPE_END, &Value, &enmType);
     if (RT_FAILURE(rc))
     {
@@ -2114,5 +2129,5 @@
     DBGFREGVAL      Value;
     DBGFREGVALTYPE  enmType;
-    int rc = dbgfR3RegNmQueryWorkerOnCpu(pThis->pVM, pLookupRec, DBGFREGVALTYPE_END, &Value, &enmType);
+    int rc = dbgfR3RegNmQueryWorkerOnCpu(pThis->pUVM, pLookupRec, DBGFREGVALTYPE_END, &Value, &enmType);
     if (RT_FAILURE(rc))
     {
@@ -2177,6 +2192,7 @@
      * input string termination.
      */
+    PRTSTRSPACE pRegSpace = &pThis->pUVM->dbgf.s.RegSpace;
     /* Try looking up the name without any case folding or cpu prefixing. */
-    PCDBGFREGLOOKUP pLookupRec = (PCDBGFREGLOOKUP)RTStrSpaceGetN(&pThis->pVM->dbgf.s.RegSpace, pachReg, cchReg);
+    PCDBGFREGLOOKUP pLookupRec = (PCDBGFREGLOOKUP)RTStrSpaceGetN(pRegSpace, pachReg, cchReg);
     if (!pLookupRec)
     {
@@ -2185,5 +2201,5 @@
         ssize_t cchFolded = dbgfR3RegCopyToLower(pachReg, cchReg, szName, sizeof(szName) - DBGF_REG_MAX_NAME);
         if (cchFolded > 0)
-            pLookupRec = (PCDBGFREGLOOKUP)RTStrSpaceGet(&pThis->pVM->dbgf.s.RegSpace, szName);
+            pLookupRec = (PCDBGFREGLOOKUP)RTStrSpaceGet(pRegSpace, szName);
         if (   !pLookupRec
             && cchFolded >= 0
@@ -2193,5 +2209,5 @@
             size_t cchCpuSet = RTStrPrintf(szName, sizeof(szName), pThis->fGuestRegs ? "cpu%u." : "hypercpu%u.", pThis->idCpu);
             dbgfR3RegCopyToLower(pachReg, cchReg, &szName[cchCpuSet], sizeof(szName) - cchCpuSet);
-            pLookupRec = (PCDBGFREGLOOKUP)RTStrSpaceGet(&pThis->pVM->dbgf.s.RegSpace, szName);
+            pLookupRec = (PCDBGFREGLOOKUP)RTStrSpaceGet(pRegSpace, szName);
         }
     }
@@ -2270,7 +2286,7 @@
 static DECLCALLBACK(int) dbgfR3RegPrintfWorkerOnCpu(PDBGFR3REGPRINTFARGS pArgs)
 {
-    DBGF_REG_DB_LOCK_READ(pArgs->pVM);
+    DBGF_REG_DB_LOCK_READ(pArgs->pUVM);
     RTStrFormatV(dbgfR3RegPrintfCbOutput, pArgs, dbgfR3RegPrintfCbFormat, pArgs, pArgs->pszFormat, pArgs->va);
-    DBGF_REG_DB_UNLOCK_READ(pArgs->pVM);
+    DBGF_REG_DB_UNLOCK_READ(pArgs->pUVM);
     return pArgs->rc;
 }
@@ -2283,5 +2299,5 @@
  *
  * @returns VBox status code.
- * @param   pVM                 Pointer to the VM.
+ * @param   pUVM                The user mode VM handle.
  * @param   idCpu               The CPU ID of any CPU registers that may be
  *                              printed, pass VMCPUID_ANY if not applicable.
@@ -2292,5 +2308,5 @@
  * @param   va                  Other format arguments.
  */
-VMMR3DECL(int) DBGFR3RegPrintfV(PVM pVM, VMCPUID idCpu, char *pszBuf, size_t cbBuf, const char *pszFormat, va_list va)
+VMMR3DECL(int) DBGFR3RegPrintfV(PUVM pUVM, VMCPUID idCpu, char *pszBuf, size_t cbBuf, const char *pszFormat, va_list va)
 {
     AssertPtrReturn(pszBuf, VERR_INVALID_POINTER);
@@ -2298,6 +2314,6 @@
     *pszBuf = '\0';
 
-    VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
-    AssertReturn((idCpu & ~DBGFREG_HYPER_VMCPUID) < pVM->cCpus || idCpu == VMCPUID_ANY, VERR_INVALID_CPU_ID);
+    UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE);
+    AssertReturn((idCpu & ~DBGFREG_HYPER_VMCPUID) < pUVM->cCpus || idCpu == VMCPUID_ANY, VERR_INVALID_CPU_ID);
     AssertPtrReturn(pszFormat, VERR_INVALID_POINTER);
 
@@ -2307,5 +2323,5 @@
      */
     DBGFR3REGPRINTFARGS Args;
-    Args.pVM        = pVM;
+    Args.pUVM       = pUVM;
     Args.idCpu      = idCpu != VMCPUID_ANY ? idCpu & ~DBGFREG_HYPER_VMCPUID : idCpu;
     Args.fGuestRegs = idCpu != VMCPUID_ANY && !(idCpu & DBGFREG_HYPER_VMCPUID);
@@ -2316,5 +2332,5 @@
     Args.cchLeftBuf = cbBuf - 1;
     Args.rc         = VINF_SUCCESS;
-    int rc = VMR3ReqPriorityCallWait(pVM, Args.idCpu, (PFNRT)dbgfR3RegPrintfWorkerOnCpu, 1, &Args);
+    int rc = VMR3ReqPriorityCallWaitU(pUVM, Args.idCpu, (PFNRT)dbgfR3RegPrintfWorkerOnCpu, 1, &Args);
     va_end(Args.va);
     return rc;
@@ -2328,5 +2344,5 @@
  *
  * @returns VBox status code.
- * @param   pVM                 Pointer to the VM.
+ * @param   pUVM                The user mode VM handle.
  * @param   idCpu               The CPU ID of any CPU registers that may be
  *                              printed, pass VMCPUID_ANY if not applicable.
@@ -2340,9 +2356,9 @@
  * @param   ...                 Other format arguments.
  */
-VMMR3DECL(int) DBGFR3RegPrintf(PVM pVM, VMCPUID idCpu, char *pszBuf, size_t cbBuf, const char *pszFormat, ...)
+VMMR3DECL(int) DBGFR3RegPrintf(PUVM pUVM, VMCPUID idCpu, char *pszBuf, size_t cbBuf, const char *pszFormat, ...)
 {
     va_list va;
     va_start(va, pszFormat);
-    int rc = DBGFR3RegPrintfV(pVM, idCpu, pszBuf, cbBuf, pszFormat, va);
+    int rc = DBGFR3RegPrintfV(pUVM, idCpu, pszBuf, cbBuf, pszFormat, va);
     va_end(va);
     return rc;
Index: trunk/src/VBox/VMM/VMMR3/DBGFStack.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMR3/DBGFStack.cpp	(revision 44398)
+++ trunk/src/VBox/VMM/VMMR3/DBGFStack.cpp	(revision 44399)
@@ -26,4 +26,5 @@
 #include "DBGFInternal.h"
 #include <VBox/vmm/vm.h>
+#include <VBox/vmm/uvm.h>
 #include <VBox/err.h>
 #include <VBox/log.h>
@@ -38,7 +39,7 @@
  * Read stack memory.
  */
-DECLINLINE(int) dbgfR3Read(PVM pVM, VMCPUID idCpu, void *pvBuf, PCDBGFADDRESS pSrcAddr, size_t cb, size_t *pcbRead)
-{
-    int rc = DBGFR3MemRead(pVM, idCpu, pSrcAddr, pvBuf, cb);
+DECLINLINE(int) dbgfR3Read(PUVM pUVM, VMCPUID idCpu, void *pvBuf, PCDBGFADDRESS pSrcAddr, size_t cb, size_t *pcbRead)
+{
+    int rc = DBGFR3MemRead(pUVM, idCpu, pSrcAddr, pvBuf, cb);
     if (RT_FAILURE(rc))
     {
@@ -48,5 +49,5 @@
         {
             DBGFADDRESS Addr = *pSrcAddr;
-            rc = DBGFR3MemRead(pVM, idCpu, DBGFR3AddrAdd(&Addr, cbRead), (uint8_t *)pvBuf + cbRead, 1);
+            rc = DBGFR3MemRead(pUVM, idCpu, DBGFR3AddrAdd(&Addr, cbRead), (uint8_t *)pvBuf + cbRead, 1);
             if (RT_FAILURE(rc))
                 break;
@@ -77,5 +78,5 @@
  *       unwind tables).
  */
-static int dbgfR3StackWalk(PVM pVM, VMCPUID idCpu, RTDBGAS hAs, PDBGFSTACKFRAME pFrame)
+static int dbgfR3StackWalk(PUVM pUVM, VMCPUID idCpu, RTDBGAS hAs, PDBGFSTACKFRAME pFrame)
 {
     /*
@@ -136,5 +137,5 @@
 
     Assert(DBGFADDRESS_IS_VALID(&pFrame->AddrFrame));
-    int rc = dbgfR3Read(pVM, idCpu, u.pv,
+    int rc = dbgfR3Read(pUVM, idCpu, u.pv,
                         pFrame->fFlags & DBGFSTACKFRAME_FLAGS_ALL_VALID
                         ? &pFrame->AddrReturnFrame
@@ -156,6 +157,6 @@
         if (DBGFADDRESS_IS_VALID(&pFrame->AddrPC))
         {
-            pFrame->pSymPC  = DBGFR3AsSymbolByAddrA(pVM, hAs, &pFrame->AddrPC, NULL /*offDisp*/, NULL /*phMod*/);
-            pFrame->pLinePC = DBGFR3LineByAddrAlloc(pVM, pFrame->AddrPC.FlatPtr, NULL);
+            pFrame->pSymPC  = DBGFR3AsSymbolByAddrA(pUVM, hAs, &pFrame->AddrPC, NULL /*offDisp*/, NULL /*phMod*/);
+            pFrame->pLinePC = DBGFR3LineByAddrAlloc(pUVM, pFrame->AddrPC.FlatPtr, NULL);
         }
     }
@@ -203,5 +204,5 @@
             }
             else
-                DBGFR3AddrFromFlat(pVM, &pFrame->AddrReturnPC, *uRet.pu16);
+                DBGFR3AddrFromFlat(pUVM, &pFrame->AddrReturnPC, *uRet.pu16);
             break;
         case DBGFRETURNTYPE_NEAR32:
@@ -212,5 +213,5 @@
             }
             else
-                DBGFR3AddrFromFlat(pVM, &pFrame->AddrReturnPC, *uRet.pu32);
+                DBGFR3AddrFromFlat(pUVM, &pFrame->AddrReturnPC, *uRet.pu32);
             break;
         case DBGFRETURNTYPE_NEAR64:
@@ -221,29 +222,29 @@
             }
             else
-                DBGFR3AddrFromFlat(pVM, &pFrame->AddrReturnPC, *uRet.pu64);
+                DBGFR3AddrFromFlat(pUVM, &pFrame->AddrReturnPC, *uRet.pu64);
             break;
         case DBGFRETURNTYPE_FAR16:
-            DBGFR3AddrFromSelOff(pVM, idCpu, &pFrame->AddrReturnPC, uRet.pu16[1], uRet.pu16[0]);
+            DBGFR3AddrFromSelOff(pUVM, idCpu, &pFrame->AddrReturnPC, uRet.pu16[1], uRet.pu16[0]);
             break;
         case DBGFRETURNTYPE_FAR32:
-            DBGFR3AddrFromSelOff(pVM, idCpu, &pFrame->AddrReturnPC, uRet.pu16[2], uRet.pu32[0]);
+            DBGFR3AddrFromSelOff(pUVM, idCpu, &pFrame->AddrReturnPC, uRet.pu16[2], uRet.pu32[0]);
             break;
         case DBGFRETURNTYPE_FAR64:
-            DBGFR3AddrFromSelOff(pVM, idCpu, &pFrame->AddrReturnPC, uRet.pu16[4], uRet.pu64[0]);
+            DBGFR3AddrFromSelOff(pUVM, idCpu, &pFrame->AddrReturnPC, uRet.pu16[4], uRet.pu64[0]);
             break;
         case DBGFRETURNTYPE_IRET16:
-            DBGFR3AddrFromSelOff(pVM, idCpu, &pFrame->AddrReturnPC, uRet.pu16[1], uRet.pu16[0]);
+            DBGFR3AddrFromSelOff(pUVM, idCpu, &pFrame->AddrReturnPC, uRet.pu16[1], uRet.pu16[0]);
             break;
         case DBGFRETURNTYPE_IRET32:
-            DBGFR3AddrFromSelOff(pVM, idCpu, &pFrame->AddrReturnPC, uRet.pu16[2], uRet.pu32[0]);
+            DBGFR3AddrFromSelOff(pUVM, idCpu, &pFrame->AddrReturnPC, uRet.pu16[2], uRet.pu32[0]);
             break;
         case DBGFRETURNTYPE_IRET32_PRIV:
-            DBGFR3AddrFromSelOff(pVM, idCpu, &pFrame->AddrReturnPC, uRet.pu16[2], uRet.pu32[0]);
+            DBGFR3AddrFromSelOff(pUVM, idCpu, &pFrame->AddrReturnPC, uRet.pu16[2], uRet.pu32[0]);
             break;
         case DBGFRETURNTYPE_IRET32_V86:
-            DBGFR3AddrFromSelOff(pVM, idCpu, &pFrame->AddrReturnPC, uRet.pu16[2], uRet.pu32[0]);
+            DBGFR3AddrFromSelOff(pUVM, idCpu, &pFrame->AddrReturnPC, uRet.pu16[2], uRet.pu32[0]);
             break;
         case DBGFRETURNTYPE_IRET64:
-            DBGFR3AddrFromSelOff(pVM, idCpu, &pFrame->AddrReturnPC, uRet.pu16[4], uRet.pu64[0]);
+            DBGFR3AddrFromSelOff(pUVM, idCpu, &pFrame->AddrReturnPC, uRet.pu16[4], uRet.pu64[0]);
             break;
         default:
@@ -252,6 +253,6 @@
     }
 
-    pFrame->pSymReturnPC  = DBGFR3AsSymbolByAddrA(pVM, hAs, &pFrame->AddrReturnPC, NULL /*offDisp*/, NULL /*phMod*/);
-    pFrame->pLineReturnPC = DBGFR3LineByAddrAlloc(pVM, pFrame->AddrReturnPC.FlatPtr, NULL);
+    pFrame->pSymReturnPC  = DBGFR3AsSymbolByAddrA(pUVM, hAs, &pFrame->AddrReturnPC, NULL /*offDisp*/, NULL /*phMod*/);
+    pFrame->pLineReturnPC = DBGFR3LineByAddrAlloc(pUVM, pFrame->AddrReturnPC.FlatPtr, NULL);
 
     /*
@@ -278,5 +279,5 @@
  * Walks the entire stack allocating memory as we walk.
  */
-static DECLCALLBACK(int) dbgfR3StackWalkCtxFull(PVM pVM, VMCPUID idCpu, PCCPUMCTXCORE pCtxCore, RTDBGAS hAs,
+static DECLCALLBACK(int) dbgfR3StackWalkCtxFull(PUVM pUVM, VMCPUID idCpu, PCCPUMCTXCORE pCtxCore, RTDBGAS hAs,
                                                 DBGFCODETYPE enmCodeType,
                                                 PCDBGFADDRESS pAddrFrame,
@@ -287,5 +288,5 @@
 {
     /* alloc first frame. */
-    PDBGFSTACKFRAME pCur = (PDBGFSTACKFRAME)MMR3HeapAllocZ(pVM, MM_TAG_DBGF_STACK, sizeof(*pCur));
+    PDBGFSTACKFRAME pCur = (PDBGFSTACKFRAME)MMR3HeapAllocZU(pUVM, MM_TAG_DBGF_STACK, sizeof(*pCur));
     if (!pCur)
         return VERR_NO_MEMORY;
@@ -301,7 +302,7 @@
         pCur->AddrPC = *pAddrPC;
     else if (enmCodeType != DBGFCODETYPE_GUEST)
-        DBGFR3AddrFromFlat(pVM, &pCur->AddrPC, pCtxCore->rip);
+        DBGFR3AddrFromFlat(pUVM, &pCur->AddrPC, pCtxCore->rip);
     else
-        rc = DBGFR3AddrFromSelOff(pVM, idCpu, &pCur->AddrPC, pCtxCore->cs.Sel, pCtxCore->rip);
+        rc = DBGFR3AddrFromSelOff(pUVM, idCpu, &pCur->AddrPC, pCtxCore->cs.Sel, pCtxCore->rip);
     if (RT_SUCCESS(rc))
     {
@@ -329,5 +330,5 @@
         else
         {
-            PVMCPU pVCpu = VMMGetCpuById(pVM, idCpu);
+            PVMCPU pVCpu = VMMGetCpuById(pUVM->pVM, idCpu);
             CPUMMODE CpuMode = CPUMGetGuestMode(pVCpu);
             if (CpuMode == CPUMMODE_REAL)
@@ -343,14 +344,14 @@
             pCur->AddrStack = *pAddrStack;
         else if (enmCodeType != DBGFCODETYPE_GUEST)
-            DBGFR3AddrFromFlat(pVM, &pCur->AddrStack, pCtxCore->rsp & fAddrMask);
+            DBGFR3AddrFromFlat(pUVM, &pCur->AddrStack, pCtxCore->rsp & fAddrMask);
         else
-            rc = DBGFR3AddrFromSelOff(pVM, idCpu, &pCur->AddrStack, pCtxCore->ss.Sel, pCtxCore->rsp & fAddrMask);
+            rc = DBGFR3AddrFromSelOff(pUVM, idCpu, &pCur->AddrStack, pCtxCore->ss.Sel, pCtxCore->rsp & fAddrMask);
 
         if (pAddrFrame)
             pCur->AddrFrame = *pAddrFrame;
         else if (enmCodeType != DBGFCODETYPE_GUEST)
-            DBGFR3AddrFromFlat(pVM, &pCur->AddrFrame, pCtxCore->rbp & fAddrMask);
+            DBGFR3AddrFromFlat(pUVM, &pCur->AddrFrame, pCtxCore->rbp & fAddrMask);
         else if (RT_SUCCESS(rc))
-            rc = DBGFR3AddrFromSelOff(pVM, idCpu, &pCur->AddrFrame, pCtxCore->ss.Sel, pCtxCore->rbp & fAddrMask);
+            rc = DBGFR3AddrFromSelOff(pUVM, idCpu, &pCur->AddrFrame, pCtxCore->ss.Sel, pCtxCore->rbp & fAddrMask);
     }
     else
@@ -361,5 +362,5 @@
      */
     if (RT_SUCCESS(rc))
-        rc = dbgfR3StackWalk(pVM, idCpu, hAs, pCur);
+        rc = dbgfR3StackWalk(pUVM, idCpu, hAs, pCur);
     if (RT_FAILURE(rc))
     {
@@ -375,10 +376,10 @@
     {
         /* try walk. */
-        rc = dbgfR3StackWalk(pVM, idCpu, hAs, &Next);
+        rc = dbgfR3StackWalk(pUVM, idCpu, hAs, &Next);
         if (RT_FAILURE(rc))
             break;
 
         /* add the next frame to the chain. */
-        PDBGFSTACKFRAME pNext = (PDBGFSTACKFRAME)MMR3HeapAlloc(pVM, MM_TAG_DBGF_STACK, sizeof(*pNext));
+        PDBGFSTACKFRAME pNext = (PDBGFSTACKFRAME)MMR3HeapAllocU(pUVM, MM_TAG_DBGF_STACK, sizeof(*pNext));
         if (!pNext)
         {
@@ -415,5 +416,5 @@
  * DBGFR3StackWalkBeginGuest and DBGFR3StackWalkBeginHyper.
  */
-static int dbgfR3StackWalkBeginCommon(PVM pVM,
+static int dbgfR3StackWalkBeginCommon(PUVM pUVM,
                                       VMCPUID idCpu,
                                       DBGFCODETYPE enmCodeType,
@@ -428,12 +429,14 @@
      */
     *ppFirstFrame = NULL;
+    UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE);
+    PVM pVM = pUVM->pVM;
     VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
     AssertReturn(idCpu < pVM->cCpus, VERR_INVALID_CPU_ID);
     if (pAddrFrame)
-        AssertReturn(DBGFR3AddrIsValid(pVM, pAddrFrame), VERR_INVALID_PARAMETER);
+        AssertReturn(DBGFR3AddrIsValid(pUVM, pAddrFrame), VERR_INVALID_PARAMETER);
     if (pAddrStack)
-        AssertReturn(DBGFR3AddrIsValid(pVM, pAddrStack), VERR_INVALID_PARAMETER);
+        AssertReturn(DBGFR3AddrIsValid(pUVM, pAddrStack), VERR_INVALID_PARAMETER);
     if (pAddrPC)
-        AssertReturn(DBGFR3AddrIsValid(pVM, pAddrPC), VERR_INVALID_PARAMETER);
+        AssertReturn(DBGFR3AddrIsValid(pUVM, pAddrPC), VERR_INVALID_PARAMETER);
     AssertReturn(enmReturnType >= DBGFRETURNTYPE_INVALID && enmReturnType < DBGFRETURNTYPE_END, VERR_INVALID_PARAMETER);
 
@@ -460,7 +463,7 @@
             AssertFailedReturn(VERR_INVALID_PARAMETER);
     }
-    return VMR3ReqPriorityCallWait(pVM, idCpu, (PFNRT)dbgfR3StackWalkCtxFull, 10,
-                                   pVM, idCpu, pCtxCore, hAs, enmCodeType,
-                                   pAddrFrame, pAddrStack, pAddrPC, enmReturnType, ppFirstFrame);
+    return VMR3ReqPriorityCallWaitU(pUVM, idCpu, (PFNRT)dbgfR3StackWalkCtxFull, 10,
+                                    pUVM, idCpu, pCtxCore, hAs, enmCodeType,
+                                    pAddrFrame, pAddrStack, pAddrPC, enmReturnType, ppFirstFrame);
 }
 
@@ -476,5 +479,5 @@
  * @returns VERR_NO_MEMORY if we're out of memory.
  *
- * @param   pVM             Pointer to the VM.
+ * @param   pUVM            The user mode VM handle.
  * @param   idCpu           The ID of the virtual CPU which stack we want to walk.
  * @param   enmCodeType     Code type
@@ -485,5 +488,5 @@
  * @param   ppFirstFrame    Where to return the pointer to the first info frame.
  */
-VMMR3DECL(int) DBGFR3StackWalkBeginEx(PVM pVM,
+VMMR3DECL(int) DBGFR3StackWalkBeginEx(PUVM pUVM,
                                       VMCPUID idCpu,
                                       DBGFCODETYPE enmCodeType,
@@ -494,5 +497,5 @@
                                       PCDBGFSTACKFRAME *ppFirstFrame)
 {
-    return dbgfR3StackWalkBeginCommon(pVM, idCpu, enmCodeType, pAddrFrame, pAddrStack, pAddrPC, enmReturnType, ppFirstFrame);
+    return dbgfR3StackWalkBeginCommon(pUVM, idCpu, enmCodeType, pAddrFrame, pAddrStack, pAddrPC, enmReturnType, ppFirstFrame);
 }
 
@@ -508,12 +511,12 @@
  * @returns VERR_NO_MEMORY if we're out of memory.
  *
- * @param   pVM             Pointer to the VM.
+ * @param   pUVM            The user mode VM handle.
  * @param   idCpu           The ID of the virtual CPU which stack we want to walk.
  * @param   enmCodeType     Code type
  * @param   ppFirstFrame    Where to return the pointer to the first info frame.
  */
-VMMR3DECL(int) DBGFR3StackWalkBegin(PVM pVM, VMCPUID idCpu, DBGFCODETYPE enmCodeType, PCDBGFSTACKFRAME *ppFirstFrame)
-{
-    return dbgfR3StackWalkBeginCommon(pVM, idCpu, enmCodeType, NULL, NULL, NULL, DBGFRETURNTYPE_INVALID, ppFirstFrame);
+VMMR3DECL(int) DBGFR3StackWalkBegin(PUVM pUVM, VMCPUID idCpu, DBGFCODETYPE enmCodeType, PCDBGFSTACKFRAME *ppFirstFrame)
+{
+    return dbgfR3StackWalkBeginCommon(pUVM, idCpu, enmCodeType, NULL, NULL, NULL, DBGFRETURNTYPE_INVALID, ppFirstFrame);
 }
 
Index: trunk/src/VBox/VMM/VMMR3/DBGFSym.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMR3/DBGFSym.cpp	(revision 44398)
+++ trunk/src/VBox/VMM/VMMR3/DBGFSym.cpp	(revision 44399)
@@ -33,4 +33,5 @@
 #include "DBGFInternal.h"
 #include <VBox/vmm/vm.h>
+#include <VBox/vmm/uvm.h>
 #include <VBox/err.h>
 #include <VBox/log.h>
@@ -321,5 +322,5 @@
              * Execute the command.
              */
-            rc = DBGFR3ModuleLoad(pVM, pszFilename, offDelta, pszModule, ModuleAddress, cbModule);
+            rc = DBGFR3ModuleLoad(pVM->pUVM, pszFilename, offDelta, pszModule, ModuleAddress, cbModule);
             AssertMsgRCReturn(rc, ("pszFilename=%s offDelta=%RGv pszModule=%s ModuleAddress=%RGv cbModule=%RGv\n",
                                    pszFilename, offDelta, pszModule, ModuleAddress, cbModule), rc);
@@ -356,5 +357,5 @@
             AssertMsgRCReturn(rc, ("rc=%Rrc querying the 'Address' attribute of '/DBGF/loadsyms/%s'!\n", rc, szCmdName), rc);
             DBGFADDRESS ModAddr;
-            DBGFR3AddrFromFlat(pVM, &ModAddr, GCPtrAddr);
+            DBGFR3AddrFromFlat(pVM->pUVM, &ModAddr, GCPtrAddr);
 
             /* Name (optional) */
@@ -376,5 +377,5 @@
              * Execute the command.
              */
-            rc = DBGFR3AsLoadMap(pVM, DBGF_AS_GLOBAL, pszFilename, pszModName, &ModAddr,
+            rc = DBGFR3AsLoadMap(pVM->pUVM, DBGF_AS_GLOBAL, pszFilename, pszModName, &ModAddr,
                                  iSeg == UINT32_MAX ? NIL_RTDBGSEGIDX : iSeg, offSubtrahend, 0 /*fFlags*/);
             AssertMsgRCReturn(rc, ("pszFilename=%s pszModName=%s ModAddr=%RGv offSubtrahend=%#x iSeg=%#x\n",
@@ -690,5 +691,5 @@
  *
  * @returns VBox status.
- * @param   pVM             Pointer to the VM.
+ * @param   pUVM            The user mode VM handle.
  * @param   pszFilename     Path to the file containing the symbol information.
  *                          This can be the executable image, a flat symbol file of some kind or stripped debug info.
@@ -700,5 +701,5 @@
  *                          Ignored when pszName is NULL.
  */
-VMMR3DECL(int) DBGFR3ModuleLoad(PVM pVM, const char *pszFilename, RTGCUINTPTR AddressDelta, const char *pszName,
+VMMR3DECL(int) DBGFR3ModuleLoad(PUVM pUVM, const char *pszFilename, RTGCUINTPTR AddressDelta, const char *pszName,
                                 RTGCUINTPTR ModuleAddress, unsigned cbImage)
 {
@@ -708,4 +709,7 @@
      * Lazy init.
      */
+    UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE);
+    PVM pVM = pUVM->pVM;
+    VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
     if (!pVM->dbgf.s.fSymInited)
     {
@@ -807,6 +811,6 @@
  * @param   pszName         The module name.
  */
-VMMR3DECL(void) DBGFR3ModuleRelocate(PVM pVM, RTGCUINTPTR OldImageBase, RTGCUINTPTR NewImageBase, RTGCUINTPTR cbImage,
-                                      const char *pszFilename, const char *pszName)
+VMMR3_INT_DECL(void) DBGFR3ModuleRelocate(PVM pVM, RTGCUINTPTR OldImageBase, RTGCUINTPTR NewImageBase, RTGCUINTPTR cbImage,
+                                          const char *pszFilename, const char *pszName)
 {
 #ifdef HAVE_DBGHELP
@@ -839,6 +843,6 @@
  * @param   pszSymbol       Symbol name.
  */
-VMMR3DECL(int) DBGFR3SymbolAdd(PVM pVM, RTGCUINTPTR ModuleAddress, RTGCUINTPTR SymbolAddress, RTUINT cbSymbol,
-                               const char *pszSymbol)
+VMMR3_INT_DECL(int) DBGFR3SymbolAdd(PVM pVM, RTGCUINTPTR ModuleAddress, RTGCUINTPTR SymbolAddress, RTUINT cbSymbol,
+                                    const char *pszSymbol)
 {
     /*
@@ -881,5 +885,5 @@
  * @param   pSymbol             Where to store the symbol info.
  */
-VMMR3DECL(int) DBGFR3SymbolByAddr(PVM pVM, RTGCUINTPTR Address, PRTGCINTPTR poffDisplacement, PDBGFSYMBOL pSymbol)
+VMMR3_INT_DECL(int) DBGFR3SymbolByAddr(PVM pVM, RTGCUINTPTR Address, PRTGCINTPTR poffDisplacement, PDBGFSYMBOL pSymbol)
 {
     /*
@@ -969,5 +973,5 @@
  * @param   pSymbol             Where to store the symbol info.
  */
-VMMR3DECL(int) DBGFR3SymbolByName(PVM pVM, const char *pszSymbol, PDBGFSYMBOL pSymbol)
+VMMR3_INT_DECL(int) DBGFR3SymbolByName(PVM pVM, const char *pszSymbol, PDBGFSYMBOL pSymbol)
 {
     /*
@@ -1021,14 +1025,17 @@
  *
  * @returns VBox status.
- * @param   pVM                 Pointer to the VM.
+ * @param   pUVM                The user mode VM handle.
  * @param   Address             Address.
  * @param   poffDisplacement    Where to store the line displacement from Address.
  * @param   pLine               Where to store the line info.
  */
-VMMR3DECL(int) DBGFR3LineByAddr(PVM pVM, RTGCUINTPTR Address, PRTGCINTPTR poffDisplacement, PDBGFLINE pLine)
+VMMR3DECL(int) DBGFR3LineByAddr(PUVM pUVM, RTGCUINTPTR Address, PRTGCINTPTR poffDisplacement, PDBGFLINE pLine)
 {
     /*
      * Lazy init.
      */
+    UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE);
+    PVM pVM = pUVM->pVM;
+    VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
     if (!pVM->dbgf.s.fSymInited)
     {
@@ -1067,11 +1074,11 @@
  *
  * @returns VBox status code.
- * @param   pVM             Pointer to the VM.
+ * @param   pUVM            The user mode VM handle.
  * @param   pLine           The line to duplicate.
  */
-static PDBGFLINE dbgfR3LineDup(PVM pVM, PCDBGFLINE pLine)
+static PDBGFLINE dbgfR3LineDup(PUVM pUVM, PCDBGFLINE pLine)
 {
     size_t cb = strlen(pLine->szFilename) + RT_OFFSETOF(DBGFLINE, szFilename[1]);
-    PDBGFLINE pDup = (PDBGFLINE)MMR3HeapAlloc(pVM, MM_TAG_DBGF_LINE_DUP, cb);
+    PDBGFLINE pDup = (PDBGFLINE)MMR3HeapAllocU(pUVM, MM_TAG_DBGF_LINE_DUP, cb);
     if (pDup)
         memcpy(pDup, pLine, cb);
@@ -1085,15 +1092,15 @@
  * @returns Pointer to the line. Must be freed using DBGFR3LineFree().
  * @returns NULL if the line was not found or if we're out of memory.
- * @param   pVM                 Pointer to the VM.
+ * @param   pUVM                The user mode VM handle.
  * @param   Address             Address.
  * @param   poffDisplacement    Where to store the line displacement from Address.
  */
-VMMR3DECL(PDBGFLINE) DBGFR3LineByAddrAlloc(PVM pVM, RTGCUINTPTR Address, PRTGCINTPTR poffDisplacement)
+VMMR3DECL(PDBGFLINE) DBGFR3LineByAddrAlloc(PUVM pUVM, RTGCUINTPTR Address, PRTGCINTPTR poffDisplacement)
 {
     DBGFLINE Line;
-    int rc = DBGFR3LineByAddr(pVM, Address, poffDisplacement, &Line);
+    int rc = DBGFR3LineByAddr(pUVM, Address, poffDisplacement, &Line);
     if (RT_FAILURE(rc))
         return NULL;
-    return dbgfR3LineDup(pVM, &Line);
+    return dbgfR3LineDup(pUVM, &Line);
 }
 
@@ -1104,5 +1111,5 @@
  * @param   pLine           Pointer to the line.
  */
-VMMR3DECL(void) DBGFR3LineFree(PDBGFLINE pLine)
+VMMR3_INT_DECL(void) DBGFR3LineFree(PDBGFLINE pLine)
 {
     if (pLine)
Index: trunk/src/VBox/VMM/VMMR3/EM.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMR3/EM.cpp	(revision 44398)
+++ trunk/src/VBox/VMM/VMMR3/EM.cpp	(revision 44399)
@@ -1182,5 +1182,5 @@
     {
         DBGFR3PrgStep(pVCpu);
-        DBGFR3DisasInstrCurrentLog(pVCpu, "RSS: ");
+        DBGFR3_DISAS_INSTR_CUR_LOG(pVCpu, "RSS: ");
         emR3RemStep(pVM, pVCpu);
         if (emR3Reschedule(pVM, pVCpu, pVCpu->em.s.pCtx) != EMSTATE_REM)
Index: trunk/src/VBox/VMM/VMMR3/EMHM.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMR3/EMHM.cpp	(revision 44398)
+++ trunk/src/VBox/VMM/VMMR3/EMHM.cpp	(revision 44399)
@@ -137,5 +137,5 @@
     {
         DBGFR3PrgStep(pVCpu);
-        DBGFR3DisasInstrCurrentLog(pVCpu, "RSS: ");
+        DBGFR3_DISAS_INSTR_CUR_LOG(pVCpu, "RSS: ");
         rc = emR3HmStep(pVM, pVCpu);
         if (    rc != VINF_SUCCESS
@@ -189,6 +189,6 @@
     if (pszPrefix)
     {
-        DBGFR3InfoLog(pVM, "cpumguest", pszPrefix);
-        DBGFR3DisasInstrCurrentLog(pVCpu, pszPrefix);
+        DBGFR3_INFO_LOG(pVM, "cpumguest", pszPrefix);
+        DBGFR3_DISAS_INSTR_CUR_LOG(pVCpu, pszPrefix);
     }
 #endif /* LOG_ENABLED */
Index: trunk/src/VBox/VMM/VMMR3/EMRaw.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMR3/EMRaw.cpp	(revision 44398)
+++ trunk/src/VBox/VMM/VMMR3/EMRaw.cpp	(revision 44399)
@@ -237,5 +237,5 @@
     {
         DBGFR3PrgStep(pVCpu);
-        DBGFR3DisasInstrCurrentLog(pVCpu, "RSS: ");
+        DBGFR3_DISAS_INSTR_CUR_LOG(pVCpu, "RSS: ");
         rc = emR3RawStep(pVM, pVCpu);
         if (rc != VINF_SUCCESS)
@@ -285,6 +285,6 @@
     if (pszPrefix)
     {
-        DBGFR3InfoLog(pVM, "cpumguest", pszPrefix);
-        DBGFR3DisasInstrCurrentLog(pVCpu, pszPrefix);
+        DBGFR3_INFO_LOG(pVM, "cpumguest", pszPrefix);
+        DBGFR3_DISAS_INSTR_CUR_LOG(pVCpu, pszPrefix);
     }
 #endif /* LOG_ENABLED */
@@ -634,6 +634,6 @@
 
 #ifdef LOG_ENABLED
-    DBGFR3InfoLog(pVM, "cpumguest", "Guest trap");
-    DBGFR3DisasInstrCurrentLog(pVCpu, "Guest trap");
+    DBGFR3_INFO_LOG(pVM, "cpumguest", "Guest trap");
+    DBGFR3_DISAS_INSTR_CUR_LOG(pVCpu, "Guest trap");
 
     /* Get guest page information. */
@@ -687,5 +687,5 @@
                 if (RT_SUCCESS(rc))
                 {
-                    DBGFR3DisasInstrCurrentLog(pVCpu, "Patched sysenter instruction");
+                    DBGFR3_DISAS_INSTR_CUR_LOG(pVCpu, "Patched sysenter instruction");
                     return VINF_EM_RESCHEDULE_RAW;
                 }
@@ -770,6 +770,6 @@
     {
 #ifdef LOG_ENABLED
-        DBGFR3InfoLog(pVM, "cpumguest", "Trap in patch code");
-        DBGFR3DisasInstrCurrentLog(pVCpu, "Patch code");
+        DBGFR3_INFO_LOG(pVM, "cpumguest", "Trap in patch code");
+        DBGFR3_DISAS_INSTR_CUR_LOG(pVCpu, "Patch code");
 
         DISCPUSTATE Cpu;
@@ -924,5 +924,5 @@
         {
 #ifdef LOG_ENABLED
-            DBGFR3InfoLog(pVM, "cpumguest", "PRIV");
+            DBGFR3_INFO_LOG(pVM, "cpumguest", "PRIV");
 #endif
             AssertMsgFailed(("FATAL ERROR: executing random instruction inside generated patch jump %08x\n", pCtx->eip));
@@ -938,7 +938,7 @@
             {
 #ifdef LOG_ENABLED
-                DBGFR3InfoLog(pVM, "cpumguest", "PRIV");
+                DBGFR3_INFO_LOG(pVM, "cpumguest", "PRIV");
 #endif
-                DBGFR3DisasInstrCurrentLog(pVCpu, "Patched privileged instruction");
+                DBGFR3_DISAS_INSTR_CUR_LOG(pVCpu, "Patched privileged instruction");
                 return VINF_SUCCESS;
             }
@@ -949,6 +949,6 @@
     if (!PATMIsPatchGCAddr(pVM, pCtx->eip))
     {
-        DBGFR3InfoLog(pVM, "cpumguest", "PRIV");
-        DBGFR3DisasInstrCurrentLog(pVCpu, "Privileged instr: ");
+        DBGFR3_INFO_LOG(pVM, "cpumguest", "PRIV");
+        DBGFR3_DISAS_INSTR_CUR_LOG(pVCpu, "Privileged instr: ");
     }
 #endif
@@ -1089,6 +1089,6 @@
                     if (PATMIsPatchGCAddr(pVM, pCtx->eip))
                     {
-                        DBGFR3InfoLog(pVM, "cpumguest", "PRIV");
-                        DBGFR3DisasInstrCurrentLog(pVCpu, "Privileged instr: ");
+                        DBGFR3_INFO_LOG(pVM, "cpumguest", "PRIV");
+                        DBGFR3_DISAS_INSTR_CUR_LOG(pVCpu, "Privileged instr: ");
                     }
 #endif
Index: trunk/src/VBox/VMM/VMMR3/HM.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMR3/HM.cpp	(revision 44398)
+++ trunk/src/VBox/VMM/VMMR3/HM.cpp	(revision 44399)
@@ -1765,5 +1765,5 @@
         char            szOutput[256];
 
-        rc = DBGFR3DisasInstrEx(pVM, pVCpu->idCpu, CPUMGetGuestCS(pVCpu), pInstrGC, DBGF_DISAS_FLAGS_DEFAULT_MODE,
+        rc = DBGFR3DisasInstrEx(pVM->pUVM, pVCpu->idCpu, CPUMGetGuestCS(pVCpu), pInstrGC, DBGF_DISAS_FLAGS_DEFAULT_MODE,
                                 szOutput, sizeof(szOutput), NULL);
         if (RT_SUCCESS(rc))
@@ -1789,5 +1789,5 @@
 
 #ifdef LOG_ENABLED
-        rc = DBGFR3DisasInstrEx(pVM, pVCpu->idCpu, CPUMGetGuestCS(pVCpu), pInstrGC, DBGF_DISAS_FLAGS_DEFAULT_MODE,
+        rc = DBGFR3DisasInstrEx(pVM->pUVM, pVCpu->idCpu, CPUMGetGuestCS(pVCpu), pInstrGC, DBGF_DISAS_FLAGS_DEFAULT_MODE,
                                 szOutput, sizeof(szOutput), NULL);
         if (RT_SUCCESS(rc))
@@ -1920,5 +1920,5 @@
      * Disassembler the instruction and get cracking.
      */
-    DBGFR3DisasInstrCurrentLog(pVCpu, "hmR3ReplaceTprInstr");
+    DBGFR3_DISAS_INSTR_CUR_LOG(pVCpu, "hmR3ReplaceTprInstr");
     PDISCPUSTATE    pDis = &pVCpu->hm.s.DisState;
     uint32_t        cbOp;
@@ -1976,5 +1976,5 @@
             pCtx->rip += cbOp;
             rc = EMInterpretDisasCurrent(pVM, pVCpu, pDis, &cbOp);
-            DBGFR3DisasInstrCurrentLog(pVCpu, "Following read");
+            DBGFR3_DISAS_INSTR_CUR_LOG(pVCpu, "Following read");
             pCtx->rip = uSavedRip;
 
@@ -2089,5 +2089,5 @@
 
     Log(("hmR3PatchTprInstr: rip=%RGv idxPatch=%u\n", pCtx->rip, idx));
-    DBGFR3DisasInstrCurrentLog(pVCpu, "hmR3PatchTprInstr");
+    DBGFR3_DISAS_INSTR_CUR_LOG(pVCpu, "hmR3PatchTprInstr");
 
     /*
@@ -2231,5 +2231,5 @@
             {
                 char     szOutput[256];
-                rc = DBGFR3DisasInstrEx(pVM, pVCpu->idCpu, pCtx->cs.Sel, GCPtrInstr, DBGF_DISAS_FLAGS_DEFAULT_MODE,
+                rc = DBGFR3DisasInstrEx(pVM->pUVM, pVCpu->idCpu, pCtx->cs.Sel, GCPtrInstr, DBGF_DISAS_FLAGS_DEFAULT_MODE,
                                         szOutput, sizeof(szOutput), &cbCurInstr);
                 if (RT_SUCCESS(rc))
@@ -2247,5 +2247,5 @@
             AssertRC(rc);
 
-            DBGFR3DisasInstrCurrentLog(pVCpu, "Jump");
+            DBGFR3_DISAS_INSTR_CUR_LOG(pVCpu, "Jump");
 
             pVM->hm.s.pFreeGuestPatchMem += off;
Index: trunk/src/VBox/VMM/VMMR3/IOM.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMR3/IOM.cpp	(revision 44398)
+++ trunk/src/VBox/VMM/VMMR3/IOM.cpp	(revision 44399)
@@ -577,5 +577,5 @@
 
         /* conflict. */
-        DBGFR3Info(pVM, "ioport", NULL, NULL);
+        DBGFR3Info(pVM->pUVM, "ioport", NULL, NULL);
         AssertMsgFailed(("Port range %#x-%#x (%s) conflicts with existing range(s)!\n", PortStart, (unsigned)PortStart + cPorts - 1, pszDesc));
         MMHyperFree(pVM, pRange);
@@ -1487,5 +1487,5 @@
             /* bail out */
             IOM_UNLOCK(pVM);
-            DBGFR3Info(pVM, "mmio", NULL, NULL);
+            DBGFR3Info(pVM->pUVM, "mmio", NULL, NULL);
             AssertMsgFailed(("This cannot happen!\n"));
             rc = VERR_IOM_IOPORT_IPE_3;
Index: trunk/src/VBox/VMM/VMMR3/PATM.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMR3/PATM.cpp	(revision 44398)
+++ trunk/src/VBox/VMM/VMMR3/PATM.cpp	(revision 44399)
@@ -114,6 +114,6 @@
 #ifdef VBOX_WITH_DEBUGGER
 static DECLCALLBACK(int) DisableAllPatches(PAVLOU32NODECORE pNode, void *pVM);
-static DECLCALLBACK(int) patmr3CmdOn(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
-static DECLCALLBACK(int) patmr3CmdOff(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
+static FNDBGCCMD    patmr3CmdOn;
+static FNDBGCCMD    patmr3CmdOff;
 
 /** Command descriptors. */
@@ -6142,5 +6142,5 @@
 #ifdef DEBUG
         char szBuf[256];
-        DBGFR3DisasInstrEx(pVM, pVCpu->idCpu, pCtx->cs.Sel, pCurPatchInstrGC, DBGF_DISAS_FLAGS_DEFAULT_MODE,
+        DBGFR3DisasInstrEx(pVM->pUVM, pVCpu->idCpu, pCtx->cs.Sel, pCurPatchInstrGC, DBGF_DISAS_FLAGS_DEFAULT_MODE,
                            szBuf, sizeof(szBuf), NULL);
         Log(("DIRTY: %s\n", szBuf));
@@ -6205,5 +6205,5 @@
 #ifdef DEBUG
                 char szBuf[256];
-                DBGFR3DisasInstrEx(pVM, pVCpu->idCpu, pCtx->cs.Sel, pCurInstrGC, DBGF_DISAS_FLAGS_DEFAULT_MODE,
+                DBGFR3DisasInstrEx(pVM->pUVM, pVCpu->idCpu, pCtx->cs.Sel, pCurInstrGC, DBGF_DISAS_FLAGS_DEFAULT_MODE,
                                    szBuf, sizeof(szBuf), NULL);
                 Log(("NEW:   %s\n", szBuf));
@@ -6221,5 +6221,5 @@
 #ifdef DEBUG
                 char szBuf[256];
-                DBGFR3DisasInstrEx(pVM, pVCpu->idCpu, pCtx->cs.Sel, pCurInstrGC, DBGF_DISAS_FLAGS_DEFAULT_MODE,
+                DBGFR3DisasInstrEx(pVM->pUVM, pVCpu->idCpu, pCtx->cs.Sel, pCurInstrGC, DBGF_DISAS_FLAGS_DEFAULT_MODE,
                                    szBuf, sizeof(szBuf), NULL);
                 Log(("NEW:   %s (FAILED)\n", szBuf));
@@ -6258,6 +6258,6 @@
 #ifdef DEBUG
                             char szBuf[256];
-                            DBGFR3DisasInstrEx(pVM, pVCpu->idCpu, pCtx->cs.Sel, pCurPatchInstrGC, DBGF_DISAS_FLAGS_DEFAULT_MODE,
-                                               szBuf, sizeof(szBuf), NULL);
+                            DBGFR3DisasInstrEx(pVM->pUVM, pVCpu->idCpu, pCtx->cs.Sel, pCurPatchInstrGC,
+                                               DBGF_DISAS_FLAGS_DEFAULT_MODE, szBuf, sizeof(szBuf), NULL);
                             Log(("FILL:  %s\n", szBuf));
 #endif
@@ -6270,5 +6270,5 @@
 #ifdef DEBUG
                                 char szBuf[256];
-                                DBGFR3DisasInstrEx(pVM, pVCpu->idCpu, pCtx->cs.Sel, pCurPatchInstrGC + i,
+                                DBGFR3DisasInstrEx(pVM->pUVM, pVCpu->idCpu, pCtx->cs.Sel, pCurPatchInstrGC + i,
                                                    DBGF_DISAS_FLAGS_DEFAULT_MODE, szBuf, sizeof(szBuf), NULL);
                                 Log(("FILL:  %s\n", szBuf));
@@ -6462,5 +6462,5 @@
 
         char szBuf[256];
-        DBGFR3DisasInstrEx(pVM, pVCpu->idCpu, pCtx->cs.Sel, pEip, DBGF_DISAS_FLAGS_DEFAULT_MODE, szBuf, sizeof(szBuf), NULL);
+        DBGFR3DisasInstrEx(pVM->pUVM, pVCpu->idCpu, pCtx->cs.Sel, pEip, DBGF_DISAS_FLAGS_DEFAULT_MODE, szBuf, sizeof(szBuf), NULL);
 
         /* Very bad. We crashed in emitted code. Probably stack? */
@@ -6579,5 +6579,5 @@
 
     Log2(("pPatchBlockGC %RRv - pEip %RRv corresponding GC address %RRv\n", PATCHCODE_PTR_GC(&pPatch->patch), pEip, pNewEip));
-    DBGFR3DisasInstrLog(pVCpu, pCtx->cs.Sel, pNewEip, "PATCHRET: ");
+    DBGFR3_DISAS_INSTR_LOG(pVCpu, pCtx->cs.Sel, pNewEip, "PATCHRET: ");
     if (pNewEip >= pPatch->patch.pPrivInstrGC && pNewEip < pPatch->patch.pPrivInstrGC + pPatch->patch.cbPatchJump)
     {
@@ -6765,6 +6765,6 @@
 
 #endif /* VBOX_WITH_STATISTICS */
-
 #ifdef VBOX_WITH_DEBUGGER
+
 /**
  * The '.patmoff' command.
@@ -6777,12 +6777,13 @@
  * @param   cArgs       Number of arguments in the array.
  */
-static DECLCALLBACK(int) patmr3CmdOff(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
+static DECLCALLBACK(int) patmr3CmdOff(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
 {
     /*
      * Validate input.
      */
-    NOREF(pCmd); NOREF(cArgs); NOREF(paArgs);
-    if (!pVM)
-        return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "error: The command requires VM to be selected.\n");
+    NOREF(cArgs); NOREF(paArgs);
+    DBGC_CMDHLP_REQ_UVM_RET(pCmdHlp, pCmd, pUVM);
+    PVM pVM = pUVM->pVM;
+    VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
 
     RTAvloU32DoWithAll(&pVM->patm.s.PatchLookupTreeHC->PatchTree, true, DisableAllPatches, pVM);
@@ -6801,12 +6802,13 @@
  * @param   cArgs       Number of arguments in the array.
  */
-static DECLCALLBACK(int) patmr3CmdOn(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
+static DECLCALLBACK(int) patmr3CmdOn(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
 {
     /*
      * Validate input.
      */
-    NOREF(pCmd); NOREF(cArgs); NOREF(paArgs);
-    if (!pVM)
-        return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "error: The command requires VM to be selected.\n");
+    NOREF(cArgs); NOREF(paArgs);
+    DBGC_CMDHLP_REQ_UVM_RET(pCmdHlp, pCmd, pUVM);
+    PVM pVM = pUVM->pVM;
+    VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
 
     PATMR3AllowPatching(pVM->pUVM, true);
@@ -6814,3 +6816,4 @@
     return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "Patching enabled\n");
 }
-#endif
+
+#endif /* VBOX_WITH_DEBUGGER */
Index: trunk/src/VBox/VMM/VMMR3/PDM.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMR3/PDM.cpp	(revision 44398)
+++ trunk/src/VBox/VMM/VMMR3/PDM.cpp	(revision 44399)
@@ -659,12 +659,13 @@
 
         TMR3TimerDestroyDevice(pVM, pDevIns);
-        //SSMR3DeregisterDriver(pVM, pDevIns, NULL, 0);
+        SSMR3DeregisterDevice(pVM, pDevIns, NULL, 0);
         pdmR3CritSectDeleteDevice(pVM, pDevIns);
-        //pdmR3ThreadDestroyDevice(pVM, pDevIns);
-        //PDMR3QueueDestroyDevice(pVM, pDevIns);
+        pdmR3ThreadDestroyDevice(pVM, pDevIns);
+        PDMR3QueueDestroyDevice(pVM, pDevIns);
         PGMR3PhysMMIO2Deregister(pVM, pDevIns, UINT32_MAX);
 #ifdef VBOX_WITH_PDM_ASYNC_COMPLETION
         pdmR3AsyncCompletionTemplateDestroyDevice(pVM, pDevIns);
 #endif
+        DBGFR3InfoDeregisterDevice(pVM, pDevIns, NULL);
     }
 
Index: trunk/src/VBox/VMM/VMMR3/PDMAsyncCompletionFile.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMR3/PDMAsyncCompletionFile.cpp	(revision 44398)
+++ trunk/src/VBox/VMM/VMMR3/PDMAsyncCompletionFile.cpp	(revision 44399)
@@ -49,7 +49,7 @@
 *******************************************************************************/
 #ifdef VBOX_WITH_DEBUGGER
-static DECLCALLBACK(int) pdmacEpFileErrorInject(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR pArgs, unsigned cArgs);
+static FNDBGCCMD pdmacEpFileErrorInject;
 # ifdef PDM_ASYNC_COMPLETION_FILE_WITH_DELAY
-static DECLCALLBACK(int) pdmacEpFileDelayInject(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR pArgs, unsigned cArgs);
+static FNDBGCCMD pdmacEpFileDelayInject;
 # endif
 #endif
@@ -611,12 +611,12 @@
 
 /**
- * Error inject callback.
+ * @callback_method_impl{FNDBGCCMD, The '.injecterror' command.}
  */
-static DECLCALLBACK(int) pdmacEpFileErrorInject(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR pArgs, unsigned cArgs)
+static DECLCALLBACK(int) pdmacEpFileErrorInject(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR pArgs, unsigned cArgs)
 {
     /*
      * Validate input.
      */
-    DBGC_CMDHLP_REQ_VM_RET(pCmdHlp, pCmd, pVM);
+    DBGC_CMDHLP_REQ_UVM_RET(pCmdHlp, pCmd, pUVM);
     DBGC_CMDHLP_ASSERT_PARSER_RET(pCmdHlp, pCmd, -1, cArgs == 3);
     DBGC_CMDHLP_ASSERT_PARSER_RET(pCmdHlp, pCmd, 0, pArgs[0].enmType == DBGCVAR_TYPE_STRING);
@@ -625,5 +625,5 @@
 
     PPDMASYNCCOMPLETIONEPCLASSFILE pEpClassFile;
-    pEpClassFile = (PPDMASYNCCOMPLETIONEPCLASSFILE)pVM->pUVM->pdm.s.apAsyncCompletionEndpointClass[PDMASYNCCOMPLETIONEPCLASSTYPE_FILE];
+    pEpClassFile = (PPDMASYNCCOMPLETIONEPCLASSFILE)pUVM->pdm.s.apAsyncCompletionEndpointClass[PDMASYNCCOMPLETIONEPCLASSTYPE_FILE];
 
     /* Syntax is "read|write <filename> <status code>" */
@@ -640,5 +640,4 @@
         return DBGCCmdHlpFail(pCmdHlp, pCmd, "The status code '%lld' is out of range", pArgs[0].u.u64Number);
 
-
     /*
      * Search for the matching endpoint.
@@ -677,12 +676,12 @@
 # ifdef PDM_ASYNC_COMPLETION_FILE_WITH_DELAY
 /**
- * Delay inject callback.
+ * @callback_method_impl{FNDBGCCMD, The '.injectdelay' command.}
  */
-static DECLCALLBACK(int) pdmacEpFileDelayInject(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR pArgs, unsigned cArgs)
+static DECLCALLBACK(int) pdmacEpFileDelayInject(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR pArgs, unsigned cArgs)
 {
     /*
      * Validate input.
      */
-    DBGC_CMDHLP_REQ_VM_RET(pCmdHlp, pCmd, pVM);
+    DBGC_CMDHLP_REQ_UVM_RET(pCmdHlp, pCmd, pUVM);
     DBGC_CMDHLP_ASSERT_PARSER_RET(pCmdHlp, pCmd, -1, cArgs >= 3);
     DBGC_CMDHLP_ASSERT_PARSER_RET(pCmdHlp, pCmd, 0, pArgs[0].enmType == DBGCVAR_TYPE_STRING);
@@ -691,5 +690,5 @@
 
     PPDMASYNCCOMPLETIONEPCLASSFILE pEpClassFile;
-    pEpClassFile = (PPDMASYNCCOMPLETIONEPCLASSFILE)pVM->pUVM->pdm.s.apAsyncCompletionEndpointClass[PDMASYNCCOMPLETIONEPCLASSTYPE_FILE];
+    pEpClassFile = (PPDMASYNCCOMPLETIONEPCLASSFILE)pUVM->pdm.s.apAsyncCompletionEndpointClass[PDMASYNCCOMPLETIONEPCLASSTYPE_FILE];
 
     /* Syntax is "read|write|flush|any <filename> <delay> [reqs]" */
Index: trunk/src/VBox/VMM/VMMR3/PGM.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMR3/PGM.cpp	(revision 44398)
+++ trunk/src/VBox/VMM/VMMR3/PGM.cpp	(revision 44399)
@@ -661,13 +661,11 @@
 
 #ifdef VBOX_WITH_DEBUGGER
-/** @todo Convert the first two commands to 'info' items. */
-static DECLCALLBACK(int)  pgmR3CmdRam(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
-static DECLCALLBACK(int)  pgmR3CmdError(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
-static DECLCALLBACK(int)  pgmR3CmdSync(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
-static DECLCALLBACK(int)  pgmR3CmdSyncAlways(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
+static FNDBGCCMD          pgmR3CmdError;
+static FNDBGCCMD          pgmR3CmdSync;
+static FNDBGCCMD          pgmR3CmdSyncAlways;
 # ifdef VBOX_STRICT
-static DECLCALLBACK(int)  pgmR3CmdAssertCR3(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
+static FNDBGCCMD          pgmR3CmdAssertCR3;
 # endif
-static DECLCALLBACK(int)  pgmR3CmdPhysToFile(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
+static FNDBGCCMD          pgmR3CmdPhysToFile;
 #endif
 
@@ -704,5 +702,4 @@
 {
     /* pszCmd,  cArgsMin, cArgsMax, paArgDesc,                cArgDescs, fFlags, pfnHandler          pszSyntax,          ....pszDescription */
-    { "pgmram",        0, 0,        NULL,                     0,         0,      pgmR3CmdRam,        "",                     "Display the ram ranges." },
     { "pgmsync",       0, 0,        NULL,                     0,         0,      pgmR3CmdSync,       "",                     "Sync the CR3 page." },
     { "pgmerror",      0, 1,        &g_aPgmErrorArgs[0],      1,         0,      pgmR3CmdError,      "",                     "Enables inject runtime of errors into parts of PGM." },
@@ -2535,6 +2532,6 @@
 
 #ifdef DEBUG
-    DBGFR3InfoLog(pVM, "mappings", NULL);
-    DBGFR3InfoLog(pVM, "handlers", "all nostat");
+    DBGFR3_INFO_LOG(pVM, "mappings", NULL);
+    DBGFR3_INFO_LOG(pVM, "handlers", "all nostat");
 #endif
 
@@ -2720,4 +2717,5 @@
                         pCur->pszDesc);
 }
+
 
 /**
@@ -3697,61 +3695,14 @@
 
 /**
- * The '.pgmram' command.
- *
- * @returns VBox status.
- * @param   pCmd        Pointer to the command descriptor (as registered).
- * @param   pCmdHlp     Pointer to command helper functions.
- * @param   pVM         Pointer to the current VM (if any).
- * @param   paArgs      Pointer to (readonly) array of arguments.
- * @param   cArgs       Number of arguments in the array.
- */
-static DECLCALLBACK(int) pgmR3CmdRam(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
+ * @callback_method_impl{FNDBGCCMD, The '.pgmerror' and '.pgmerroroff' commands.}
+ */
+static DECLCALLBACK(int)  pgmR3CmdError(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
 {
     /*
      * Validate input.
      */
-    NOREF(pCmd); NOREF(paArgs); NOREF(cArgs);
-    if (!pVM)
-        return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "error: The command requires a VM to be selected.\n");
-    if (!pVM->pgm.s.pRamRangesXR3)
-        return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "Sorry, no Ram is registered.\n");
-
-    /*
-     * Dump the ranges.
-     */
-    int rc = pCmdHlp->pfnPrintf(pCmdHlp, NULL, "From     - To (incl) pvHC\n");
-    PPGMRAMRANGE pRam;
-    for (pRam = pVM->pgm.s.pRamRangesXR3; pRam; pRam = pRam->pNextR3)
-    {
-        rc = pCmdHlp->pfnPrintf(pCmdHlp, NULL,
-            "%RGp - %RGp  %p\n",
-            pRam->GCPhys, pRam->GCPhysLast, pRam->pvR3);
-        if (RT_FAILURE(rc))
-            return rc;
-    }
-
-    return VINF_SUCCESS;
-}
-
-
-/**
- * The '.pgmerror' and '.pgmerroroff' commands.
- *
- * @returns VBox status.
- * @param   pCmd        Pointer to the command descriptor (as registered).
- * @param   pCmdHlp     Pointer to command helper functions.
- * @param   pVM         Pointer to the current VM (if any).
- * @param   paArgs      Pointer to (readonly) array of arguments.
- * @param   cArgs       Number of arguments in the array.
- */
-static DECLCALLBACK(int)  pgmR3CmdError(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
-{
-    /*
-     * Validate input.
-     */
-    if (!pVM)
-        return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "error: The command requires a VM to be selected.\n");
-    AssertReturn(cArgs == 0 || (cArgs == 1 && paArgs[0].enmType == DBGCVAR_TYPE_STRING),
-                 pCmdHlp->pfnPrintf(pCmdHlp, NULL, "error: Hit bug in the parser.\n"));
+    DBGC_CMDHLP_REQ_UVM_RET(pCmdHlp, pCmd, pUVM);
+    PVM pVM = pUVM->pVM;
+    DBGC_CMDHLP_ASSERT_PARSER_RET(pCmdHlp, pCmd, 0, cArgs == 0 || (cArgs == 1 && paArgs[0].enmType == DBGCVAR_TYPE_STRING));
 
     if (!cArgs)
@@ -3760,10 +3711,9 @@
          * Print the list of error injection locations with status.
          */
-        pCmdHlp->pfnPrintf(pCmdHlp, NULL, "PGM error inject locations:\n");
-        pCmdHlp->pfnPrintf(pCmdHlp, NULL, "  handy - %RTbool\n", pVM->pgm.s.fErrInjHandyPages);
+        DBGCCmdHlpPrintf(pCmdHlp, "PGM error inject locations:\n");
+        DBGCCmdHlpPrintf(pCmdHlp, "  handy - %RTbool\n", pVM->pgm.s.fErrInjHandyPages);
     }
     else
     {
-
         /*
          * String switch on where to inject the error.
@@ -3774,6 +3724,6 @@
             ASMAtomicWriteBool(&pVM->pgm.s.fErrInjHandyPages, fNewState);
         else
-            return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "error: Invalid 'where' value: %s.\n", pszWhere);
-        pCmdHlp->pfnPrintf(pCmdHlp, NULL, "done\n");
+            return DBGCCmdHlpPrintf(pCmdHlp, "error: Invalid 'where' value: %s.\n", pszWhere);
+        DBGCCmdHlpPrintf(pCmdHlp, "done\n");
     }
     return VINF_SUCCESS;
@@ -3782,25 +3732,16 @@
 
 /**
- * The '.pgmsync' command.
- *
- * @returns VBox status.
- * @param   pCmd        Pointer to the command descriptor (as registered).
- * @param   pCmdHlp     Pointer to command helper functions.
- * @param   pVM         Pointer to the current VM (if any).
- * @param   paArgs      Pointer to (readonly) array of arguments.
- * @param   cArgs       Number of arguments in the array.
- */
-static DECLCALLBACK(int) pgmR3CmdSync(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
-{
-    /** @todo SMP support */
-
+ * @callback_method_impl{FNDBGCCMD, The '.pgmsync' command.}
+ */
+static DECLCALLBACK(int) pgmR3CmdSync(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
+{
     /*
      * Validate input.
      */
     NOREF(pCmd); NOREF(paArgs); NOREF(cArgs);
-    if (!pVM)
-        return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "error: The command requires a VM to be selected.\n");
-
-    PVMCPU pVCpu = &pVM->aCpus[0];
+    DBGC_CMDHLP_REQ_UVM_RET(pCmdHlp, pCmd, pUVM);
+    PVMCPU pVCpu = VMMR3GetCpuByIdU(pUVM, DBGCCmdHlpGetCurrentCpu(pCmdHlp));
+    if (!pVCpu)
+        return DBGCCmdHlpFail(pCmdHlp, pCmd, "Invalid CPU ID");
 
     /*
@@ -3809,5 +3750,5 @@
     VMCPU_FF_SET(pVCpu, VMCPU_FF_PGM_SYNC_CR3);
 
-    int rc = pCmdHlp->pfnPrintf(pCmdHlp, NULL, "Forcing page directory sync.\n");
+    int rc = DBGCCmdHlpPrintf(pCmdHlp, "Forcing page directory sync.\n");
     if (RT_FAILURE(rc))
         return rc;
@@ -3816,69 +3757,73 @@
 }
 
-
 #ifdef VBOX_STRICT
+
 /**
- * The '.pgmassertcr3' command.
- *
- * @returns VBox status.
- * @param   pCmd        Pointer to the command descriptor (as registered).
- * @param   pCmdHlp     Pointer to command helper functions.
- * @param   pVM         Pointer to the current VM (if any).
- * @param   paArgs      Pointer to (readonly) array of arguments.
- * @param   cArgs       Number of arguments in the array.
- */
-static DECLCALLBACK(int) pgmR3CmdAssertCR3(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
-{
-    /** @todo SMP support!! */
-
+ * EMT callback for pgmR3CmdAssertCR3.
+ *
+ * @returns VBox status code.
+ * @param   pUVM        The user mode VM handle.
+ * @param   pcErrors    Where to return the error count.
+ */
+static DECLCALLBACK(int) pgmR3CmdAssertCR3EmtWorker(PUVM pUVM, unsigned *pcErrors)
+{
+    PVM     pVM   = pUVM->pVM;
+    VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
+    PVMCPU  pVCpu = VMMGetCpu(pVM);
+
+    *pcErrors = PGMAssertCR3(pVM, pVCpu, CPUMGetGuestCR3(pVCpu), CPUMGetGuestCR4(pVCpu));
+
+    return VINF_SUCCESS;
+}
+
+
+/**
+ * @callback_method_impl{FNDBGCCMD, The '.pgmassertcr3' command.}
+ */
+static DECLCALLBACK(int) pgmR3CmdAssertCR3(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
+{
     /*
      * Validate input.
      */
     NOREF(pCmd); NOREF(paArgs); NOREF(cArgs);
-    if (!pVM)
-        return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "error: The command requires a VM to be selected.\n");
-
-    PVMCPU pVCpu = &pVM->aCpus[0];
-
-    int rc = pCmdHlp->pfnPrintf(pCmdHlp, NULL, "Checking shadow CR3 page tables for consistency.\n");
+    DBGC_CMDHLP_REQ_UVM_RET(pCmdHlp, pCmd, pUVM);
+
+    int rc = DBGCCmdHlpPrintf(pCmdHlp, "Checking shadow CR3 page tables for consistency.\n");
     if (RT_FAILURE(rc))
         return rc;
 
-    PGMAssertCR3(pVM, pVCpu, CPUMGetGuestCR3(pVCpu), CPUMGetGuestCR4(pVCpu));
-
-    return VINF_SUCCESS;
+    unsigned cErrors = 0;
+    rc = VMR3ReqCallWaitU(pUVM, DBGCCmdHlpGetCurrentCpu(pCmdHlp), (PFNRT)pgmR3CmdAssertCR3EmtWorker, 2, pUVM, &cErrors);
+    if (RT_FAILURE(rc))
+        return DBGCCmdHlpFail(pCmdHlp, pCmd, "VMR3ReqCallWaitU failed: %Rrc", rc);
+    if (cErrors > 0)
+        return DBGCCmdHlpFail(pCmdHlp, pCmd, "PGMAssertCR3: %u error(s)", cErrors);
+    return DBGCCmdHlpPrintf(pCmdHlp, "PGMAssertCR3: OK\n");
 }
+
 #endif /* VBOX_STRICT */
 
-
 /**
- * The '.pgmsyncalways' command.
- *
- * @returns VBox status.
- * @param   pCmd        Pointer to the command descriptor (as registered).
- * @param   pCmdHlp     Pointer to command helper functions.
- * @param   pVM         Pointer to the current VM (if any).
- * @param   paArgs      Pointer to (readonly) array of arguments.
- * @param   cArgs       Number of arguments in the array.
- */
-static DECLCALLBACK(int) pgmR3CmdSyncAlways(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
-{
-    /** @todo SMP support!! */
-    PVMCPU pVCpu = &pVM->aCpus[0];
-
+ * @callback_method_impl{FNDBGCCMD, The '.pgmsyncalways' command.}
+ */
+static DECLCALLBACK(int) pgmR3CmdSyncAlways(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
+{
     /*
      * Validate input.
      */
     NOREF(pCmd); NOREF(paArgs); NOREF(cArgs);
-    if (!pVM)
-        return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "error: The command requires a VM to be selected.\n");
+    DBGC_CMDHLP_REQ_UVM_RET(pCmdHlp, pCmd, pUVM);
+    PVMCPU pVCpu = VMMR3GetCpuByIdU(pUVM, DBGCCmdHlpGetCurrentCpu(pCmdHlp));
+    if (!pVCpu)
+        return DBGCCmdHlpFail(pCmdHlp, pCmd, "Invalid CPU ID");
 
     /*
      * Force page directory sync.
      */
+    int rc;
     if (pVCpu->pgm.s.fSyncFlags & PGM_SYNC_ALWAYS)
     {
         ASMAtomicAndU32(&pVCpu->pgm.s.fSyncFlags, ~PGM_SYNC_ALWAYS);
-        return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "Disabled permanent forced page directory syncing.\n");
+        rc = DBGCCmdHlpPrintf(pCmdHlp, "Disabled permanent forced page directory syncing.\n");
     }
     else
@@ -3886,20 +3831,14 @@
         ASMAtomicOrU32(&pVCpu->pgm.s.fSyncFlags, PGM_SYNC_ALWAYS);
         VMCPU_FF_SET(pVCpu, VMCPU_FF_PGM_SYNC_CR3);
-        return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "Enabled permanent forced page directory syncing.\n");
-    }
+        rc = DBGCCmdHlpPrintf(pCmdHlp, "Enabled permanent forced page directory syncing.\n");
+    }
+    return rc;
 }
 
 
 /**
- * The '.pgmphystofile' command.
- *
- * @returns VBox status.
- * @param   pCmd        Pointer to the command descriptor (as registered).
- * @param   pCmdHlp     Pointer to command helper functions.
- * @param   pVM         Pointer to the current VM (if any).
- * @param   paArgs      Pointer to (readonly) array of arguments.
- * @param   cArgs       Number of arguments in the array.
- */
-static DECLCALLBACK(int) pgmR3CmdPhysToFile(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
+ * @callback_method_impl{FNDBGCCMD, The '.pgmphystofile' command.}
+ */
+static DECLCALLBACK(int) pgmR3CmdPhysToFile(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
 {
     /*
@@ -3907,15 +3846,14 @@
      */
     NOREF(pCmd);
-    if (!pVM)
-        return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "error: The command requires a VM to be selected.\n");
-    if (    cArgs < 1
-        ||  cArgs > 2
-        ||  paArgs[0].enmType != DBGCVAR_TYPE_STRING
-        ||  (   cArgs > 1
-             && paArgs[1].enmType != DBGCVAR_TYPE_STRING))
-        return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "error: parser error, invalid arguments.\n");
-    if (    cArgs >= 2
-        &&  strcmp(paArgs[1].u.pszString, "nozero"))
-        return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "error: Invalid 2nd argument '%s', must be 'nozero'.\n", paArgs[1].u.pszString);
+    DBGC_CMDHLP_REQ_UVM_RET(pCmdHlp, pCmd, pUVM);
+    PVM pVM = pUVM->pVM;
+    DBGC_CMDHLP_ASSERT_PARSER_RET(pCmdHlp, pCmd, 0, cArgs == 1 || cArgs == 2);
+    DBGC_CMDHLP_ASSERT_PARSER_RET(pCmdHlp, pCmd, 0, paArgs[0].enmType != DBGCVAR_TYPE_STRING);
+    if (cArgs == 2)
+    {
+        DBGC_CMDHLP_ASSERT_PARSER_RET(pCmdHlp, pCmd, 1, paArgs[2].enmType != DBGCVAR_TYPE_STRING);
+        if (strcmp(paArgs[1].u.pszString, "nozero"))
+            return DBGCCmdHlpFail(pCmdHlp, pCmd, "Invalid 2nd argument '%s', must be 'nozero'.\n", paArgs[1].u.pszString);
+    }
     bool fIncZeroPgs = cArgs < 2;
 
@@ -3926,10 +3864,10 @@
     int rc = RTFileOpen(&hFile, paArgs[0].u.pszString, RTFILE_O_WRITE | RTFILE_O_CREATE_REPLACE | RTFILE_O_DENY_WRITE);
     if (RT_FAILURE(rc))
-        return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "error: RTFileOpen(,'%s',) -> %Rrc.\n", paArgs[0].u.pszString, rc);
+        return DBGCCmdHlpPrintf(pCmdHlp, "error: RTFileOpen(,'%s',) -> %Rrc.\n", paArgs[0].u.pszString, rc);
 
     uint32_t cbRamHole = 0;
-    CFGMR3QueryU32Def(CFGMR3GetRoot(pVM), "RamHoleSize", &cbRamHole, MM_RAM_HOLE_SIZE_DEFAULT);
+    CFGMR3QueryU32Def(CFGMR3GetRootU(pUVM), "RamHoleSize", &cbRamHole, MM_RAM_HOLE_SIZE_DEFAULT);
     uint64_t cbRam     = 0;
-    CFGMR3QueryU64Def(CFGMR3GetRoot(pVM), "RamSize", &cbRam, 0);
+    CFGMR3QueryU64Def(CFGMR3GetRootU(pUVM), "RamSize", &cbRam, 0);
     RTGCPHYS GCPhysEnd = cbRam + cbRamHole;
 
@@ -3966,5 +3904,5 @@
                     rc = RTFileWrite(hFile, abZeroPg, PAGE_SIZE, NULL);
                     if (RT_FAILURE(rc))
-                        pCmdHlp->pfnPrintf(pCmdHlp, NULL, "error: RTFileWrite -> %Rrc at GCPhys=%RGp.\n", rc, GCPhys);
+                        DBGCCmdHlpPrintf(pCmdHlp, "error: RTFileWrite -> %Rrc at GCPhys=%RGp.\n", rc, GCPhys);
                 }
             }
@@ -3986,8 +3924,8 @@
                             PGMPhysReleasePageMappingLock(pVM, &Lock);
                             if (RT_FAILURE(rc))
-                                pCmdHlp->pfnPrintf(pCmdHlp, NULL, "error: RTFileWrite -> %Rrc at GCPhys=%RGp.\n", rc, GCPhys);
+                                DBGCCmdHlpPrintf(pCmdHlp, "error: RTFileWrite -> %Rrc at GCPhys=%RGp.\n", rc, GCPhys);
                         }
                         else
-                            pCmdHlp->pfnPrintf(pCmdHlp, NULL, "error: PGMPhysGCPhys2CCPtrReadOnly -> %Rrc at GCPhys=%RGp.\n", rc, GCPhys);
+                            DBGCCmdHlpPrintf(pCmdHlp, "error: PGMPhysGCPhys2CCPtrReadOnly -> %Rrc at GCPhys=%RGp.\n", rc, GCPhys);
                         break;
                     }
@@ -4001,5 +3939,5 @@
                             rc = RTFileWrite(hFile, abZeroPg, PAGE_SIZE, NULL);
                             if (RT_FAILURE(rc))
-                                pCmdHlp->pfnPrintf(pCmdHlp, NULL, "error: RTFileWrite -> %Rrc at GCPhys=%RGp.\n", rc, GCPhys);
+                                DBGCCmdHlpPrintf(pCmdHlp, "error: RTFileWrite -> %Rrc at GCPhys=%RGp.\n", rc, GCPhys);
                         }
                         break;
@@ -4017,5 +3955,5 @@
     RTFileClose(hFile);
     if (RT_SUCCESS(rc))
-        return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "Successfully saved physical memory to '%s'.\n", paArgs[0].u.pszString);
+        return DBGCCmdHlpPrintf(pCmdHlp, "Successfully saved physical memory to '%s'.\n", paArgs[0].u.pszString);
     return VINF_SUCCESS;
 }
Index: trunk/src/VBox/VMM/VMMR3/PGMDbg.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMR3/PGMDbg.cpp	(revision 44398)
+++ trunk/src/VBox/VMM/VMMR3/PGMDbg.cpp	(revision 44399)
@@ -5,5 +5,5 @@
 
 /*
- * Copyright (C) 2006-2010 Oracle Corporation
+ * Copyright (C) 2006-2013 Oracle Corporation
  *
  * This file is part of VirtualBox Open Source Edition (OSE), as
@@ -24,4 +24,5 @@
 #include "PGMInternal.h"
 #include <VBox/vmm/vm.h>
+#include <VBox/vmm/uvm.h>
 #include "PGMInline.h"
 #include <iprt/assert.h>
@@ -103,11 +104,11 @@
  * @retval  VERR_INVALID_POINTER if the pointer is not within the GC physical memory.
  *
- * @param   pVM         Pointer to the VM.
+ * @param   pUVM        The user mode VM handle.
  * @param   R3Ptr       The R3 pointer to convert.
  * @param   pGCPhys     Where to store the GC physical address on success.
  */
-VMMR3DECL(int) PGMR3DbgR3Ptr2GCPhys(PVM pVM, RTR3PTR R3Ptr, PRTGCPHYS pGCPhys)
-{
-    NOREF(pVM); NOREF(R3Ptr);
+VMMR3DECL(int) PGMR3DbgR3Ptr2GCPhys(PUVM pUVM, RTR3PTR R3Ptr, PRTGCPHYS pGCPhys)
+{
+    NOREF(pUVM); NOREF(R3Ptr);
     *pGCPhys = NIL_RTGCPHYS;
     return VERR_NOT_IMPLEMENTED;
@@ -125,11 +126,11 @@
  * @retval  VERR_INVALID_POINTER if the pointer is not within the GC physical memory.
  *
- * @param   pVM         Pointer to the VM.
+ * @param   pUVM        The user mode VM handle.
  * @param   R3Ptr       The R3 pointer to convert.
  * @param   pHCPhys     Where to store the HC physical address on success.
  */
-VMMR3DECL(int) PGMR3DbgR3Ptr2HCPhys(PVM pVM, RTR3PTR R3Ptr, PRTHCPHYS pHCPhys)
-{
-    NOREF(pVM); NOREF(R3Ptr);
+VMMR3DECL(int) PGMR3DbgR3Ptr2HCPhys(PUVM pUVM, RTR3PTR R3Ptr, PRTHCPHYS pHCPhys)
+{
+    NOREF(pUVM); NOREF(R3Ptr);
     *pHCPhys = NIL_RTHCPHYS;
     return VERR_NOT_IMPLEMENTED;
@@ -146,10 +147,13 @@
  * @retval  VERR_INVALID_POINTER if the HC physical address is not within the GC physical memory.
  *
- * @param   pVM     Pointer to the VM.
+ * @param   pUVM        The user mode VM handle.
  * @param   HCPhys  The HC physical address to convert.
  * @param   pGCPhys Where to store the GC physical address on success.
  */
-VMMR3DECL(int) PGMR3DbgHCPhys2GCPhys(PVM pVM, RTHCPHYS HCPhys, PRTGCPHYS pGCPhys)
-{
+VMMR3DECL(int) PGMR3DbgHCPhys2GCPhys(PUVM pUVM, RTHCPHYS HCPhys, PRTGCPHYS pGCPhys)
+{
+    UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE);
+    VM_ASSERT_VALID_EXT_RETURN(pUVM->pVM, VERR_INVALID_VM_HANDLE);
+
     /*
      * Validate and adjust the input a bit.
@@ -162,5 +166,5 @@
         return VERR_INVALID_POINTER;
 
-    for (PPGMRAMRANGE pRam = pVM->pgm.s.CTX_SUFF(pRamRangesX);
+    for (PPGMRAMRANGE pRam = pUVM->pVM->pgm.s.CTX_SUFF(pRamRangesX);
          pRam;
          pRam = pRam->CTX_SUFF(pNext))
@@ -193,5 +197,5 @@
  * @todo    Unused?
  */
-VMMR3DECL(int) PGMR3DbgReadGCPhys(PVM pVM, void *pvDst, RTGCPHYS GCPhysSrc, size_t cb, uint32_t fFlags, size_t *pcbRead)
+VMMR3_INT_DECL(int) PGMR3DbgReadGCPhys(PVM pVM, void *pvDst, RTGCPHYS GCPhysSrc, size_t cb, uint32_t fFlags, size_t *pcbRead)
 {
     /* validate */
@@ -244,5 +248,5 @@
  * @todo    Unused?
  */
-VMMR3DECL(int) PGMR3DbgWriteGCPhys(PVM pVM, RTGCPHYS GCPhysDst, const void *pvSrc, size_t cb, uint32_t fFlags, size_t *pcbWritten)
+VMMR3_INT_DECL(int) PGMR3DbgWriteGCPhys(PVM pVM, RTGCPHYS GCPhysDst, const void *pvSrc, size_t cb, uint32_t fFlags, size_t *pcbWritten)
 {
     /* validate */
@@ -295,5 +299,5 @@
  * @todo    Unused?
  */
-VMMR3DECL(int) PGMR3DbgReadGCPtr(PVM pVM, void *pvDst, RTGCPTR GCPtrSrc, size_t cb, uint32_t fFlags, size_t *pcbRead)
+VMMR3_INT_DECL(int) PGMR3DbgReadGCPtr(PVM pVM, void *pvDst, RTGCPTR GCPtrSrc, size_t cb, uint32_t fFlags, size_t *pcbRead)
 {
     /* validate */
@@ -351,5 +355,5 @@
  * @todo    Unused?
  */
-VMMR3DECL(int) PGMR3DbgWriteGCPtr(PVM pVM, RTGCPTR GCPtrDst, void const *pvSrc, size_t cb, uint32_t fFlags, size_t *pcbWritten)
+VMMR3_INT_DECL(int) PGMR3DbgWriteGCPtr(PVM pVM, RTGCPTR GCPtrDst, void const *pvSrc, size_t cb, uint32_t fFlags, size_t *pcbWritten)
 {
     /* validate */
@@ -570,6 +574,6 @@
  * @param   pGCPhysHit      Where to store the address of the first occurrence on success.
  */
-VMMR3DECL(int) PGMR3DbgScanPhysical(PVM pVM, RTGCPHYS GCPhys, RTGCPHYS cbRange, RTGCPHYS GCPhysAlign,
-                                    const uint8_t *pabNeedle, size_t cbNeedle, PRTGCPHYS pGCPhysHit)
+VMMR3_INT_DECL(int) PGMR3DbgScanPhysical(PVM pVM, RTGCPHYS GCPhys, RTGCPHYS cbRange, RTGCPHYS GCPhysAlign,
+                                         const uint8_t *pabNeedle, size_t cbNeedle, PRTGCPHYS pGCPhysHit)
 {
     /*
@@ -730,6 +734,6 @@
  * @param   pGCPtrHit       Where to store the address of the first occurrence on success.
  */
-VMMR3DECL(int) PGMR3DbgScanVirtual(PVM pVM, PVMCPU pVCpu, RTGCPTR GCPtr, RTGCPTR cbRange, RTGCPTR GCPtrAlign,
-                                   const uint8_t *pabNeedle, size_t cbNeedle, PRTGCUINTPTR pGCPtrHit)
+VMMR3_INT_DECL(int) PGMR3DbgScanVirtual(PVM pVM, PVMCPU pVCpu, RTGCPTR GCPtr, RTGCPTR cbRange, RTGCPTR GCPtrAlign,
+                                        const uint8_t *pabNeedle, size_t cbNeedle, PRTGCUINTPTR pGCPtrHit)
 {
     VMCPU_ASSERT_EMT(pVCpu);
@@ -1038,5 +1042,5 @@
     char        szPage[80];
     RTGCPHYS    GCPhys;
-    int rc = PGMR3DbgHCPhys2GCPhys(pState->pVM, HCPhys, &GCPhys);
+    int rc = PGMR3DbgHCPhys2GCPhys(pState->pVM->pUVM, HCPhys, &GCPhys);
     if (RT_SUCCESS(rc))
     {
@@ -1681,5 +1685,5 @@
         fFlags |= DBGFPGDMP_FLAGS_LME;
 
-    return DBGFR3PagingDumpEx(pVM, pVCpu->idCpu, fFlags, cr3, 0, fLongMode ? UINT64_MAX : UINT32_MAX, cMaxDepth, pHlp);
+    return DBGFR3PagingDumpEx(pVM->pUVM, pVCpu->idCpu, fFlags, cr3, 0, fLongMode ? UINT64_MAX : UINT32_MAX, cMaxDepth, pHlp);
 }
 
Index: trunk/src/VBox/VMM/VMMR3/PGMPool.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMR3/PGMPool.cpp	(revision 44398)
+++ trunk/src/VBox/VMM/VMMR3/PGMPool.cpp	(revision 44399)
@@ -5,5 +5,5 @@
 
 /*
- * Copyright (C) 2006-2007 Oracle Corporation
+ * Copyright (C) 2006-2013 Oracle Corporation
  *
  * This file is part of VirtualBox Open Source Edition (OSE), as
@@ -101,4 +101,5 @@
 #include "PGMInternal.h"
 #include <VBox/vmm/vm.h>
+#include <VBox/vmm/uvm.h>
 #include "PGMInline.h"
 
@@ -115,5 +116,5 @@
 static DECLCALLBACK(int) pgmR3PoolAccessHandler(PVM pVM, RTGCPHYS GCPhys, void *pvPhys, void *pvBuf, size_t cbBuf, PGMACCESSTYPE enmAccessType, void *pvUser);
 #ifdef VBOX_WITH_DEBUGGER
-static DECLCALLBACK(int)  pgmR3PoolCmdCheck(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
+static FNDBGCCMD pgmR3PoolCmdCheck;
 #endif
 
@@ -978,16 +979,11 @@
 #ifdef VBOX_WITH_DEBUGGER
 /**
- * The '.pgmpoolcheck' command.
- *
- * @returns VBox status.
- * @param   pCmd        Pointer to the command descriptor (as registered).
- * @param   pCmdHlp     Pointer to command helper functions.
- * @param   pVM         Pointer to the current VM (if any).
- * @param   paArgs      Pointer to (readonly) array of arguments.
- * @param   cArgs       Number of arguments in the array.
- */
-static DECLCALLBACK(int) pgmR3PoolCmdCheck(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
+ * @callback_method_impl{FNDBGCCMD, The '.pgmpoolcheck' command.}
+ */
+static DECLCALLBACK(int) pgmR3PoolCmdCheck(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
 {
-    DBGC_CMDHLP_REQ_VM_RET(pCmdHlp, pCmd, pVM);
+    DBGC_CMDHLP_REQ_UVM_RET(pCmdHlp, pCmd, pUVM);
+    PVM pVM = pUVM->pVM;
+    VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
     DBGC_CMDHLP_ASSERT_PARSER_RET(pCmdHlp, pCmd, -1, cArgs == 0);
     uint32_t cErrors = 0;
Index: trunk/src/VBox/VMM/VMMR3/SELM.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMR3/SELM.cpp	(revision 44398)
+++ trunk/src/VBox/VMM/VMMR3/SELM.cpp	(revision 44399)
@@ -2641,5 +2641,5 @@
 VMMR3DECL(void) SELMR3DumpHyperGDT(PVM pVM)
 {
-    DBGFR3Info(pVM, "gdt", NULL, NULL);
+    DBGFR3Info(pVM->pUVM, "gdt", NULL, NULL);
 }
 
@@ -2652,5 +2652,5 @@
 VMMR3DECL(void) SELMR3DumpHyperLDT(PVM pVM)
 {
-    DBGFR3Info(pVM, "ldt", NULL, NULL);
+    DBGFR3Info(pVM->pUVM, "ldt", NULL, NULL);
 }
 
@@ -2663,5 +2663,5 @@
 VMMR3DECL(void) SELMR3DumpGuestGDT(PVM pVM)
 {
-    DBGFR3Info(pVM, "gdtguest", NULL, NULL);
+    DBGFR3Info(pVM->pUVM, "gdtguest", NULL, NULL);
 }
 
@@ -2674,5 +2674,5 @@
 VMMR3DECL(void) SELMR3DumpGuestLDT(PVM pVM)
 {
-    DBGFR3Info(pVM, "ldtguest", NULL, NULL);
-}
-
+    DBGFR3Info(pVM->pUVM, "ldtguest", NULL, NULL);
+}
+
Index: trunk/src/VBox/VMM/VMMR3/STAM.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMR3/STAM.cpp	(revision 44398)
+++ trunk/src/VBox/VMM/VMMR3/STAM.cpp	(revision 44399)
@@ -5,5 +5,5 @@
 
 /*
- * Copyright (C) 2006-2007 Oracle Corporation
+ * Copyright (C) 2006-2013 Oracle Corporation
  *
  * This file is part of VirtualBox Open Source Edition (OSE), as
@@ -72,6 +72,6 @@
 typedef struct STAMR3PRINTONEARGS
 {
-    PVM pVM;
-    void *pvArg;
+    PUVM        pUVM;
+    void       *pvArg;
     DECLCALLBACKMEMBER(void, pfnPrintf)(struct STAMR3PRINTONEARGS *pvArg, const char *pszFormat, ...);
 } STAMR3PRINTONEARGS, *PSTAMR3PRINTONEARGS;
@@ -151,7 +151,7 @@
 
 #ifdef VBOX_WITH_DEBUGGER
-static DECLCALLBACK(int)    stamR3CmdStats(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
+static FNDBGCCMD            stamR3CmdStats;
 static DECLCALLBACK(void)   stamR3EnumDbgfPrintf(PSTAMR3PRINTONEARGS pArgs, const char *pszFormat, ...);
-static DECLCALLBACK(int)    stamR3CmdStatsReset(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
+static FNDBGCCMD            stamR3CmdStatsReset;
 #endif
 
@@ -1281,5 +1281,5 @@
 
     STAMR3PRINTONEARGS Args;
-    Args.pVM = pUVM->pVM;
+    Args.pUVM = pUVM;
     Args.pvArg = NULL;
     Args.pfnPrintf = stamR3EnumLogPrintf;
@@ -1321,5 +1321,5 @@
 
     STAMR3PRINTONEARGS Args;
-    Args.pVM = pUVM->pVM;
+    Args.pUVM = pUVM;
     Args.pvArg = NULL;
     Args.pfnPrintf = stamR3EnumRelLogPrintf;
@@ -1360,5 +1360,5 @@
 
     STAMR3PRINTONEARGS Args;
-    Args.pVM = pUVM->pVM;
+    Args.pUVM = pUVM;
     Args.pvArg = NULL;
     Args.pfnPrintf = stamR3EnumPrintf;
@@ -1431,5 +1431,5 @@
         {
             char szBuf[512];
-            pDesc->u.Callback.pfnPrint(pArgs->pVM, pDesc->u.Callback.pvSample, szBuf, sizeof(szBuf));
+            pDesc->u.Callback.pfnPrint(pArgs->pUVM->pVM, pDesc->u.Callback.pvSample, szBuf, sizeof(szBuf));
             pArgs->pfnPrintf(pArgs, "%-32s %s %s\n", pDesc->pszName, szBuf, STAMR3GetUnit(pDesc->enmUnit));
             break;
@@ -1914,20 +1914,12 @@
 
 /**
- * The '.stats' command.
- *
- * @returns VBox status.
- * @param   pCmd        Pointer to the command descriptor (as registered).
- * @param   pCmdHlp     Pointer to command helper functions.
- * @param   pVM         Pointer to the current VM (if any).
- * @param   paArgs      Pointer to (readonly) array of arguments.
- * @param   cArgs       Number of arguments in the array.
- */
-static DECLCALLBACK(int) stamR3CmdStats(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
+ * @callback_method_impl{FNDBGCCMD, The '.stats' command.}
+ */
+static DECLCALLBACK(int) stamR3CmdStats(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
 {
     /*
      * Validate input.
      */
-    DBGC_CMDHLP_REQ_VM_RET(pCmdHlp, pCmd, pVM);
-    PUVM pUVM = pVM->pUVM;
+    DBGC_CMDHLP_REQ_UVM_RET(pCmdHlp, pCmd, pUVM);
     if (!pUVM->stam.s.pHead)
         return DBGCCmdHlpFail(pCmdHlp, pCmd, "No statistics present");
@@ -1937,5 +1929,5 @@
      */
     STAMR3PRINTONEARGS Args;
-    Args.pVM        = pVM;
+    Args.pUVM       = pUVM;
     Args.pvArg      = pCmdHlp;
     Args.pfnPrintf  = stamR3EnumDbgfPrintf;
@@ -1965,20 +1957,12 @@
 
 /**
- * The '.statsreset' command.
- *
- * @returns VBox status.
- * @param   pCmd        Pointer to the command descriptor (as registered).
- * @param   pCmdHlp     Pointer to command helper functions.
- * @param   pVM         Pointer to the current VM (if any).
- * @param   paArgs      Pointer to (readonly) array of arguments.
- * @param   cArgs       Number of arguments in the array.
- */
-static DECLCALLBACK(int) stamR3CmdStatsReset(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
+ * @callback_method_impl{FNDBGCCMD, The '.statsreset' command.}
+ */
+static DECLCALLBACK(int) stamR3CmdStatsReset(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
 {
     /*
      * Validate input.
      */
-    DBGC_CMDHLP_REQ_VM_RET(pCmdHlp, pCmd, pVM);
-    PUVM pUVM = pVM->pUVM;
+    DBGC_CMDHLP_REQ_UVM_RET(pCmdHlp, pCmd, pUVM);
     if (!pUVM->stam.s.pHead)
         return DBGCCmdHlpFail(pCmdHlp, pCmd, "No statistics present");
Index: trunk/src/VBox/VMM/VMMR3/TRPM.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMR3/TRPM.cpp	(revision 44398)
+++ trunk/src/VBox/VMM/VMMR3/TRPM.cpp	(revision 44399)
@@ -1510,6 +1510,6 @@
 
 # ifdef LOG_ENABLED
-        DBGFR3InfoLog(pVM, "cpumguest", "TRPMInject");
-        DBGFR3DisasInstrCurrentLog(pVCpu, "TRPMInject");
+        DBGFR3_INFO_LOG(pVM, "cpumguest", "TRPMInject");
+        DBGFR3_DISAS_INSTR_CUR_LOG(pVCpu, "TRPMInject");
 # endif
 
Index: trunk/src/VBox/VMM/VMMR3/VM.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMR3/VM.cpp	(revision 44398)
+++ trunk/src/VBox/VMM/VMMR3/VM.cpp	(revision 44399)
@@ -730,5 +730,5 @@
                              */
                             void *pvUser = NULL;
-                            rc = DBGCTcpCreate(pVM, &pvUser);
+                            rc = DBGCTcpCreate(pUVM, &pvUser);
                             if (    RT_SUCCESS(rc)
                                 ||  rc == VERR_NET_ADDRESS_IN_USE)
@@ -760,5 +760,5 @@
                                 }
 #ifdef VBOX_WITH_DEBUGGER
-                                DBGCTcpTerminate(pVM, pUVM->vm.s.pvDBGC);
+                                DBGCTcpTerminate(pUVM, pUVM->vm.s.pvDBGC);
                                 pUVM->vm.s.pvDBGC = NULL;
                             }
@@ -2201,11 +2201,11 @@
             bool fOldBuffered = RTLogRelSetBuffering(true /*fBuffered*/);
             RTLogRelPrintf("****************** Guest state at power off ******************\n");
-            DBGFR3Info(pVM, "cpumguest", "verbose", DBGFR3InfoLogRelHlp());
+            DBGFR3Info(pVM->pUVM, "cpumguest", "verbose", DBGFR3InfoLogRelHlp());
             RTLogRelPrintf("***\n");
-            DBGFR3Info(pVM, "mode", NULL, DBGFR3InfoLogRelHlp());
+            DBGFR3Info(pVM->pUVM, "mode", NULL, DBGFR3InfoLogRelHlp());
             RTLogRelPrintf("***\n");
-            DBGFR3Info(pVM, "activetimers", NULL, DBGFR3InfoLogRelHlp());
+            DBGFR3Info(pVM->pUVM, "activetimers", NULL, DBGFR3InfoLogRelHlp());
             RTLogRelPrintf("***\n");
-            DBGFR3Info(pVM, "gdt", NULL, DBGFR3InfoLogRelHlp());
+            DBGFR3Info(pVM->pUVM, "gdt", NULL, DBGFR3InfoLogRelHlp());
             /** @todo dump guest call stack. */
 #if 1 // "temporary" while debugging #1589
@@ -2397,5 +2397,5 @@
         AssertRC(rc);
 #ifdef VBOX_WITH_DEBUGGER
-        rc = DBGCTcpTerminate(pVM, pUVM->vm.s.pvDBGC);
+        rc = DBGCTcpTerminate(pUVM, pUVM->vm.s.pvDBGC);
         pUVM->vm.s.pvDBGC = NULL;
 #endif
@@ -2716,5 +2716,5 @@
          */
         RTLogPrintf("\n\nThe VM was reset:\n");
-        DBGFR3Info(pVM, "cpum", "verbose", NULL);
+        DBGFR3Info(pVM->pUVM, "cpum", "verbose", NULL);
 #endif
 
@@ -3784,4 +3784,51 @@
 
 /**
+ * Sets the error message.
+ *
+ * @returns rc. Meaning you can do:
+ *    @code
+ *    return VM_SET_ERROR_U(pUVM, VERR_OF_YOUR_CHOICE, "descriptive message");
+ *    @endcode
+ * @param   pUVM            The user mode VM handle.
+ * @param   rc              VBox status code.
+ * @param   RT_SRC_POS_DECL Use RT_SRC_POS.
+ * @param   pszFormat       Error message format string.
+ * @param   ...             Error message arguments.
+ * @thread  Any
+ */
+VMMR3DECL(int) VMR3SetError(PUVM pUVM, int rc, RT_SRC_POS_DECL, const char *pszFormat, ...)
+{
+    va_list va;
+    va_start(va, pszFormat);
+    int rcRet = VMR3SetErrorV(pUVM, rc, pszFile, iLine, pszFunction, pszFormat, va);
+    va_end(va);
+    return rcRet;
+}
+
+
+/**
+ * Sets the error message.
+ *
+ * @returns rc. Meaning you can do:
+ *    @code
+ *    return VM_SET_ERROR_U(pUVM, VERR_OF_YOUR_CHOICE, "descriptive message");
+ *    @endcode
+ * @param   pUVM            The user mode VM handle.
+ * @param   rc              VBox status code.
+ * @param   RT_SRC_POS_DECL Use RT_SRC_POS.
+ * @param   pszFormat       Error message format string.
+ * @param   va              Error message arguments.
+ * @thread  Any
+ */
+VMMR3DECL(int) VMR3SetErrorV(PUVM pUVM, int rc, RT_SRC_POS_DECL, const char *pszFormat, va_list va)
+{
+    UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE);
+    VM_ASSERT_VALID_EXT_RETURN(pUVM->pVM, VERR_INVALID_VM_HANDLE);
+    return VMSetErrorV(pUVM->pVM, rc, pszFile, iLine, pszFunction, pszFormat, va);
+}
+
+
+
+/**
  * Registers a VM runtime error callback.
  *
Index: trunk/src/VBox/VMM/VMMR3/VMMGuruMeditation.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMR3/VMMGuruMeditation.cpp	(revision 44398)
+++ trunk/src/VBox/VMM/VMMR3/VMMGuruMeditation.cpp	(revision 44399)
@@ -415,5 +415,5 @@
 
                     PCDBGFSTACKFRAME pFirstFrame;
-                    rc2 = DBGFR3StackWalkBeginEx(pVM, pVCpu->idCpu, DBGFCODETYPE_RING0, &ebp, &esp, &pc,
+                    rc2 = DBGFR3StackWalkBeginEx(pVM->pUVM, pVCpu->idCpu, DBGFCODETYPE_RING0, &ebp, &esp, &pc,
                                                  DBGFRETURNTYPE_INVALID, &pFirstFrame);
                     if (RT_SUCCESS(rc2))
@@ -527,5 +527,6 @@
                 /* Disassemble the instruction. */
                 char szInstr[256];
-                rc2 = DBGFR3DisasInstrEx(pVM, pVCpu->idCpu, 0, 0, DBGF_DISAS_FLAGS_CURRENT_HYPER | DBGF_DISAS_FLAGS_DEFAULT_MODE,
+                rc2 = DBGFR3DisasInstrEx(pVM->pUVM, pVCpu->idCpu, 0, 0,
+                                         DBGF_DISAS_FLAGS_CURRENT_HYPER | DBGF_DISAS_FLAGS_DEFAULT_MODE,
                                          &szInstr[0], sizeof(szInstr), NULL);
                 if (RT_SUCCESS(rc2))
@@ -538,10 +539,10 @@
                                 "!!\n"
                                 "!!\n");
-                rc2 = DBGFR3Info(pVM, "cpumhyper", "verbose", pHlp);
+                rc2 = DBGFR3Info(pVM->pUVM, "cpumhyper", "verbose", pHlp);
                 fDoneHyper = true;
 
                 /* Callstack. */
                 PCDBGFSTACKFRAME pFirstFrame;
-                rc2 = DBGFR3StackWalkBegin(pVM, pVCpu->idCpu, DBGFCODETYPE_HYPER, &pFirstFrame);
+                rc2 = DBGFR3StackWalkBegin(pVM->pUVM, pVCpu->idCpu, DBGFCODETYPE_HYPER, &pFirstFrame);
                 if (RT_SUCCESS(rc2))
                 {
@@ -599,6 +600,6 @@
         case VERR_IEM_ASPECT_NOT_IMPLEMENTED:
         {
-            DBGFR3Info(pVM, "cpumguest", NULL, pHlp);
-            DBGFR3Info(pVM, "cpumguestinstr", NULL, pHlp);
+            DBGFR3Info(pVM->pUVM, "cpumguest", NULL, pHlp);
+            DBGFR3Info(pVM->pUVM, "cpumguestinstr", NULL, pHlp);
             break;
         }
@@ -643,5 +644,5 @@
                         "!!\n",
                         aInfo[i].pszInfo, aInfo[i].pszArgs);
-        DBGFR3Info(pVM, aInfo[i].pszInfo, aInfo[i].pszArgs, pHlp);
+        DBGFR3Info(pVM->pUVM, aInfo[i].pszInfo, aInfo[i].pszArgs, pHlp);
     }
 
Index: trunk/src/VBox/VMM/VMMR3/VMMTests.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMR3/VMMTests.cpp	(revision 44398)
+++ trunk/src/VBox/VMM/VMMR3/VMMTests.cpp	(revision 44399)
@@ -189,4 +189,5 @@
 #ifdef VBOX_WITH_RAW_MODE
     PVMCPU pVCpu = &pVM->aCpus[0];
+    PUVM   pUVM  = pVM->pUVM;
 
 # ifdef NO_SUPCALLR0VMM
@@ -251,7 +252,7 @@
         RTPrintf("VMM: testing hardware bp at 0x10000 (not hit)\n");
         DBGFADDRESS Addr;
-        DBGFR3AddrFromFlat(pVM, &Addr, 0x10000);
+        DBGFR3AddrFromFlat(pUVM, &Addr, 0x10000);
         RTUINT iBp0;
-        rc = DBGFR3BpSetReg(pVM, &Addr, 0,  ~(uint64_t)0, X86_DR7_RW_EO, 1, &iBp0);
+        rc = DBGFR3BpSetReg(pUVM, &Addr, 0,  ~(uint64_t)0, X86_DR7_RW_EO, 1, &iBp0);
         AssertReleaseRC(rc);
         rc = vmmR3DoGCTest(pVM, VMMGC_DO_TESTCASE_NOP, 0);
@@ -264,7 +265,7 @@
         /* a bad one at VMMGCEntry */
         RTPrintf("VMM: testing hardware bp at VMMGCEntry (hit)\n");
-        DBGFR3AddrFromFlat(pVM, &Addr, RCPtrEP);
+        DBGFR3AddrFromFlat(pUVM, &Addr, RCPtrEP);
         RTUINT iBp1;
-        rc = DBGFR3BpSetReg(pVM, &Addr, 0,  ~(uint64_t)0, X86_DR7_RW_EO, 1, &iBp1);
+        rc = DBGFR3BpSetReg(pUVM, &Addr, 0,  ~(uint64_t)0, X86_DR7_RW_EO, 1, &iBp1);
         AssertReleaseRC(rc);
         rc = vmmR3DoGCTest(pVM, VMMGC_DO_TESTCASE_NOP, 0);
@@ -318,6 +319,6 @@
 
         /* done, clear it */
-        if (    RT_FAILURE(DBGFR3BpClear(pVM, iBp0))
-            ||  RT_FAILURE(DBGFR3BpClear(pVM, iBp1)))
+        if (    RT_FAILURE(DBGFR3BpClear(pUVM, iBp0))
+            ||  RT_FAILURE(DBGFR3BpClear(pUVM, iBp1)))
         {
             RTPrintf("VMM: Failed to clear breakpoints!\n");
Index: trunk/src/VBox/VMM/VMMRZ/DBGFRZ.cpp
===================================================================
--- trunk/src/VBox/VMM/VMMRZ/DBGFRZ.cpp	(revision 44398)
+++ trunk/src/VBox/VMM/VMMRZ/DBGFRZ.cpp	(revision 44399)
@@ -43,5 +43,5 @@
  * @param   uDr6        The DR6 register value.
  */
-VMMRZDECL(int) DBGFRZTrap01Handler(PVM pVM, PVMCPU pVCpu, PCPUMCTXCORE pRegFrame, RTGCUINTREG uDr6)
+VMMRZ_INT_DECL(int) DBGFRZTrap01Handler(PVM pVM, PVMCPU pVCpu, PCPUMCTXCORE pRegFrame, RTGCUINTREG uDr6)
 {
 #ifdef IN_RC
@@ -110,5 +110,5 @@
  * @param   pRegFrame   Pointer to the register frame for the trap.
  */
-VMMRZDECL(int) DBGFRZTrap03Handler(PVM pVM, PVMCPU pVCpu, PCPUMCTXCORE pRegFrame)
+VMMRZ_INT_DECL(int) DBGFRZTrap03Handler(PVM pVM, PVMCPU pVCpu, PCPUMCTXCORE pRegFrame)
 {
 #ifdef IN_RC
Index: trunk/src/VBox/VMM/include/DBGFInternal.h
===================================================================
--- trunk/src/VBox/VMM/include/DBGFInternal.h	(revision 44398)
+++ trunk/src/VBox/VMM/include/DBGFInternal.h	(revision 44399)
@@ -233,9 +233,4 @@
     DBGFCMDDATA                 VMMCmdData;
 
-    /** List of registered info handlers. */
-    R3PTRTYPE(PDBGFINFO)        pInfoFirst;
-    /** Critical section protecting the above list. */
-    RTCRITSECT                  InfoCritSect;
-
     /** Range tree containing the loaded symbols of the a VM.
      * This tree will never have blind spots. */
@@ -259,5 +254,43 @@
      * @remark This is currently a fixed size array for reasons of simplicity. */
     DBGFBP                      aBreakpoints[32];
-
+} DBGF;
+/** Pointer to DBGF Data. */
+typedef DBGF *PDBGF;
+
+
+/** Converts a DBGFCPU pointer into a VM pointer. */
+#define DBGFCPU_2_VM(pDbgfCpu) ((PVM)((uint8_t *)(pDbgfCpu) + (pDbgfCpu)->offVM))
+
+/**
+ * The per CPU data for DBGF.
+ */
+typedef struct DBGFCPU
+{
+    /** The offset into the VM structure.
+     * @see DBGFCPU_2_VM(). */
+    uint32_t                offVM;
+
+    /** Current active breakpoint (id).
+     * This is ~0U if not active. It is set when a execution engine
+     * encounters a breakpoint and returns VINF_EM_DBG_BREAKPOINT. This is
+     * currently not used for REM breakpoints because of the lazy coupling
+     * between VBox and REM. */
+    uint32_t                iActiveBp;
+    /** Set if we're singlestepping in raw mode.
+     * This is checked and cleared in the \#DB handler. */
+    bool                    fSingleSteppingRaw;
+
+    /** Padding the structure to 16 bytes. */
+    bool                    afReserved[7];
+} DBGFCPU;
+/** Pointer to DBGFCPU data. */
+typedef DBGFCPU *PDBGFCPU;
+
+
+/**
+ * The DBGF data kept in the UVM.
+ */
+typedef struct DBGFUSERPERVM
+{
     /** The address space database lock. */
     RTSEMRW                     hAsDbLock;
@@ -293,52 +326,33 @@
     /** The head of the Guest OS digger instances. */
     R3PTRTYPE(PDBGFOS)          pOSHead;
-} DBGF;
-/** Pointer to DBGF Data. */
-typedef DBGF *PDBGF;
-
-
-/** Converts a DBGFCPU pointer into a VM pointer. */
-#define DBGFCPU_2_VM(pDbgfCpu) ((PVM)((uint8_t *)(pDbgfCpu) + (pDbgfCpu)->offVM))
-
-/**
- * The per CPU data for DBGF.
- */
-typedef struct DBGFCPU
-{
-    /** The offset into the VM structure.
-     * @see DBGFCPU_2_VM(). */
-    uint32_t                offVM;
-
-    /** Current active breakpoint (id).
-     * This is ~0U if not active. It is set when a execution engine
-     * encounters a breakpoint and returns VINF_EM_DBG_BREAKPOINT. This is
-     * currently not used for REM breakpoints because of the lazy coupling
-     * between VBox and REM. */
-    uint32_t                iActiveBp;
-    /** Set if we're singlestepping in raw mode.
-     * This is checked and cleared in the \#DB handler. */
-    bool                    fSingleSteppingRaw;
-
-    /** Padding the structure to 16 bytes. */
-    bool                    afReserved[7];
-
+
+    /** List of registered info handlers. */
+    R3PTRTYPE(PDBGFINFO)        pInfoFirst;
+    /** Critical section protecting the above list. */
+    RTCRITSECT                  InfoCritSect;
+
+} DBGFUSERPERVM;
+
+/**
+ * The per-CPU DBGF data kept in the UVM.
+ */
+typedef struct DBGFUSERPERVMCPU
+{
     /** The guest register set for this CPU.  Can be NULL. */
     R3PTRTYPE(struct DBGFREGSET *) pGuestRegSet;
     /** The hypervisor register set for this CPU.  Can be NULL. */
     R3PTRTYPE(struct DBGFREGSET *) pHyperRegSet;
-} DBGFCPU;
-/** Pointer to DBGFCPU data. */
-typedef DBGFCPU *PDBGFCPU;
-
-
-int  dbgfR3AsInit(PVM pVM);
-void dbgfR3AsTerm(PVM pVM);
-void dbgfR3AsRelocate(PVM pVM, RTGCUINTPTR offDelta);
+} DBGFUSERPERVMCPU;
+
+
+int  dbgfR3AsInit(PUVM pUVM);
+void dbgfR3AsTerm(PUVM pUVM);
+void dbgfR3AsRelocate(PUVM pUVM, RTGCUINTPTR offDelta);
 int  dbgfR3BpInit(PVM pVM);
-int  dbgfR3InfoInit(PVM pVM);
-int  dbgfR3InfoTerm(PVM pVM);
-void dbgfR3OSTerm(PVM pVM);
-int  dbgfR3RegInit(PVM pVM);
-void dbgfR3RegTerm(PVM pVM);
+int  dbgfR3InfoInit(PUVM pUVM);
+int  dbgfR3InfoTerm(PUVM pUVM);
+void dbgfR3OSTerm(PUVM pUVM);
+int  dbgfR3RegInit(PUVM pUVM);
+void dbgfR3RegTerm(PUVM pUVM);
 int  dbgfR3SymInit(PVM pVM);
 int  dbgfR3SymTerm(PVM pVM);
Index: trunk/src/VBox/VMM/testcase/tstAnimate.cpp
===================================================================
--- trunk/src/VBox/VMM/testcase/tstAnimate.cpp	(revision 44398)
+++ trunk/src/VBox/VMM/testcase/tstAnimate.cpp	(revision 44399)
@@ -881,5 +881,5 @@
                         rc = EMR3SetExecutionPolicy(pUVM, EMEXECPOLICY_RECOMPILE_RING0, true); AssertReleaseRC(rc);
                         rc = EMR3SetExecutionPolicy(pUVM, EMEXECPOLICY_RECOMPILE_RING3, true); AssertReleaseRC(rc);
-                        DBGFR3Info(pVM, "cpumguest", "verbose", NULL);
+                        DBGFR3Info(pUVM, "cpumguest", "verbose", NULL);
                         if (fPowerOn)
                             rc = VMR3PowerOn(pUVM);
@@ -903,5 +903,5 @@
                      */
                     RTPrintf("info: entering debugger...\n");
-                    DBGFR3Info(pVM, "cpumguest", "verbose", NULL);
+                    DBGFR3Info(pUVM, "cpumguest", "verbose", NULL);
                     signal(SIGINT, SigInterrupt);
                     while (!g_fSignaled)
Index: trunk/src/VBox/VMM/testcase/tstMicro.cpp
===================================================================
--- trunk/src/VBox/VMM/testcase/tstMicro.cpp	(revision 44398)
+++ trunk/src/VBox/VMM/testcase/tstMicro.cpp	(revision 44399)
@@ -255,5 +255,5 @@
         return rc;
     }
-    DBGFR3PagingDumpEx(pVM, 0 /*idCpu*/, DBGFPGDMP_FLAGS_CURRENT_CR3 | DBGFPGDMP_FLAGS_CURRENT_MODE
+    DBGFR3PagingDumpEx(pVM->pUVM, 0 /*idCpu*/, DBGFPGDMP_FLAGS_CURRENT_CR3 | DBGFPGDMP_FLAGS_CURRENT_MODE
                        | DBGFPGDMP_FLAGS_SHADOW | DBGFPGDMP_FLAGS_HEADER | DBGFPGDMP_FLAGS_PRINT_CR3,
                        0 /*cr3*/, 0 /*u64FirstAddr*/, UINT64_MAX /*u64LastAddr*/, 99 /*cMaxDepth*/, NULL);
Index: trunk/src/VBox/VMM/testcase/tstVMStruct.h
===================================================================
--- trunk/src/VBox/VMM/testcase/tstVMStruct.h	(revision 44398)
+++ trunk/src/VBox/VMM/testcase/tstVMStruct.h	(revision 44399)
@@ -219,6 +219,6 @@
     GEN_CHECK_OFF(DBGF, enmVMMCmd);
     GEN_CHECK_OFF(DBGF, VMMCmdData);
-    GEN_CHECK_OFF(DBGF, pInfoFirst);
-    GEN_CHECK_OFF(DBGF, InfoCritSect);
+    //GEN_CHECK_OFF(DBGF, pInfoFirst);
+    //GEN_CHECK_OFF(DBGF, InfoCritSect);
     GEN_CHECK_OFF(DBGF, SymbolTree);
     GEN_CHECK_OFF(DBGF, pSymbolSpace);
@@ -228,8 +228,8 @@
     GEN_CHECK_OFF(DBGF, aHwBreakpoints);
     GEN_CHECK_OFF(DBGF, aBreakpoints);
-    GEN_CHECK_OFF(DBGF, hAsDbLock);
-    GEN_CHECK_OFF(DBGF, hRegDbLock);
-    GEN_CHECK_OFF(DBGF, RegSetSpace);
-    GEN_CHECK_OFF(DBGF, pCurOS);
+    //GEN_CHECK_OFF(DBGF, hAsDbLock);
+    //GEN_CHECK_OFF(DBGF, hRegDbLock);
+    //GEN_CHECK_OFF(DBGF, RegSetSpace);
+    //GEN_CHECK_OFF(DBGF, pCurOS);
     GEN_CHECK_SIZE(DBGFEVENT);
 
@@ -237,6 +237,6 @@
     GEN_CHECK_OFF(DBGFCPU, iActiveBp);
     GEN_CHECK_OFF(DBGFCPU, fSingleSteppingRaw);
-    GEN_CHECK_OFF(DBGFCPU, pGuestRegSet);
-    GEN_CHECK_OFF(DBGFCPU, pHyperRegSet);
+    //GEN_CHECK_OFF(DBGFCPU, pGuestRegSet);
+    //GEN_CHECK_OFF(DBGFCPU, pHyperRegSet);
 
     GEN_CHECK_SIZE(EM);
Index: trunk/src/recompiler/VBoxREMWrapper.cpp
===================================================================
--- trunk/src/recompiler/VBoxREMWrapper.cpp	(revision 44398)
+++ trunk/src/recompiler/VBoxREMWrapper.cpp	(revision 44399)
@@ -615,5 +615,5 @@
 static const REMPARMDESC g_aArgsDBGFR3DisasInstrEx[] =
 {
-    { REMPARMDESC_FLAGS_INT,        sizeof(PVM),                NULL },
+    { REMPARMDESC_FLAGS_INT,        sizeof(PUVM),               NULL },
     { REMPARMDESC_FLAGS_INT,        sizeof(VMCPUID),            NULL },
     { REMPARMDESC_FLAGS_INT,        sizeof(RTSEL),              NULL },
@@ -631,5 +631,5 @@
 static const REMPARMDESC g_aArgsDBGFR3Info[] =
 {
-    { REMPARMDESC_FLAGS_INT,        sizeof(PVM),                NULL },
+    { REMPARMDESC_FLAGS_INT,        sizeof(PUVM),               NULL },
     { REMPARMDESC_FLAGS_INT,        sizeof(const char *),       NULL },
     { REMPARMDESC_FLAGS_INT,        sizeof(const char *),       NULL },
@@ -638,5 +638,5 @@
 static const REMPARMDESC g_aArgsDBGFR3AsSymbolByAddr[] =
 {
-    { REMPARMDESC_FLAGS_INT,        sizeof(PVM),                NULL },
+    { REMPARMDESC_FLAGS_INT,        sizeof(PUVM),               NULL },
     { REMPARMDESC_FLAGS_INT,        sizeof(RTDBGAS),            NULL },
     { REMPARMDESC_FLAGS_INT,        sizeof(PCDBGFADDRESS),      NULL },
@@ -647,5 +647,5 @@
 static const REMPARMDESC g_aArgsDBGFR3AddrFromFlat[] =
 {
-    { REMPARMDESC_FLAGS_INT,        sizeof(PVM),                NULL },
+    { REMPARMDESC_FLAGS_INT,        sizeof(PUVM),               NULL },
     { REMPARMDESC_FLAGS_INT,        sizeof(PDBGFADDRESS),       NULL },
     { REMPARMDESC_FLAGS_INT,        sizeof(RTGCUINTPTR),        NULL }
Index: trunk/src/recompiler/VBoxRecompiler.c
===================================================================
--- trunk/src/recompiler/VBoxRecompiler.c	(revision 44398)
+++ trunk/src/recompiler/VBoxRecompiler.c	(revision 44399)
@@ -45,4 +45,5 @@
 #include "REMInternal.h"
 #include <VBox/vmm/vm.h>
+#include <VBox/vmm/uvm.h>
 #include <VBox/param.h>
 #include <VBox/err.h>
@@ -193,5 +194,5 @@
  * Debugger commands.
  */
-static DECLCALLBACK(int) remR3CmdDisasEnableStepping(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
+static FNDBGCCMD remR3CmdDisasEnableStepping;;
 
 /** '.remstep' arguments. */
@@ -1121,7 +1122,7 @@
          */
         remR3StateUpdate(pVM, pVCpu);
-        DBGFR3Info(pVM, "cpumguest", NULL, NULL);
+        DBGFR3Info(pVM->pUVM, "cpumguest", NULL, NULL);
         szBuf[0] = '\0';
-        rc = DBGFR3DisasInstrEx(pVM,
+        rc = DBGFR3DisasInstrEx(pVM->pUVM,
                                 pVCpu->idCpu,
                                 0, /* Sel */
@@ -3490,9 +3491,9 @@
             "*** handlers\n",
             (RTGCPTR)pTLBEntry->addr_code, (RTGCPHYS)pTLBEntry->addend, (RTGCPTR)addr, pVM->rem.s.iHandlerMemType, pVM->rem.s.iMMIOMemType, (RTGCPHYS)ioTLBEntry));
-    DBGFR3Info(pVM, "handlers", NULL, DBGFR3InfoLogRelHlp());
+    DBGFR3Info(pVM->pUVM, "handlers", NULL, DBGFR3InfoLogRelHlp());
     LogRel(("*** mmio\n"));
-    DBGFR3Info(pVM, "mmio", NULL, DBGFR3InfoLogRelHlp());
+    DBGFR3Info(pVM->pUVM, "mmio", NULL, DBGFR3InfoLogRelHlp());
     LogRel(("*** phys\n"));
-    DBGFR3Info(pVM, "phys", NULL, DBGFR3InfoLogRelHlp());
+    DBGFR3Info(pVM->pUVM, "phys", NULL, DBGFR3InfoLogRelHlp());
     cpu_abort(env, "Trying to execute code with memory type addr_code=%RGv addend=%RGp at %RGv. (iHandlerMemType=%#x iMMIOMemType=%#x)\n",
               (RTGCPTR)pTLBEntry->addr_code, (RTGCPHYS)pTLBEntry->addend, (RTGCPTR)addr, pVM->rem.s.iHandlerMemType, pVM->rem.s.iMMIOMemType);
@@ -3923,7 +3924,8 @@
  * External Debugger Command: .remstep [on|off|1|0]
  */
-static DECLCALLBACK(int) remR3CmdDisasEnableStepping(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
+static DECLCALLBACK(int) remR3CmdDisasEnableStepping(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
 {
     int rc;
+    PVM pVM = pUVM->pVM;
 
     if (cArgs == 0)
@@ -3988,5 +3990,5 @@
      */
     if (fLog2)
-        DBGFR3InfoLog(pVM, "cpumguest", pszPrefix);
+        DBGFR3_INFO_LOG(pVM, "cpumguest", pszPrefix);
 
     /*
@@ -3998,5 +4000,5 @@
         char    szBuf[256];
         szBuf[0] = '\0';
-        int rc = DBGFR3DisasInstrEx(pVCpu->pVMR3,
+        int rc = DBGFR3DisasInstrEx(pVCpu->pVMR3->pUVM,
                                     pVCpu->idCpu,
                                     0, /* Sel */
@@ -4092,5 +4094,5 @@
             char        szBuf[256];
             uint32_t    cbInstr;
-            int rc = DBGFR3DisasInstrEx(pVM,
+            int rc = DBGFR3DisasInstrEx(pVM->pUVM,
                                         pVCpu->idCpu,
                                         cs,
@@ -4131,5 +4133,6 @@
     DBGFADDRESS Addr;
 
-    int rc = DBGFR3AsSymbolByAddr(pVM, DBGF_AS_GLOBAL, DBGFR3AddrFromFlat(pVM, &Addr, orig_addr), &off, &Sym, NULL /*phMod*/);
+    int rc = DBGFR3AsSymbolByAddr(pVM->pUVM, DBGF_AS_GLOBAL, DBGFR3AddrFromFlat(pVM->pUVM, &Addr, orig_addr),
+                                  &off, &Sym, NULL /*phMod*/);
     if (RT_SUCCESS(rc))
     {
