VirtualBox

Changeset 44399 in vbox for trunk


Ignore:
Timestamp:
Jan 27, 2013 9:12:53 PM (12 years ago)
Author:
vboxsync
Message:

DBGF,DBGC,++: PVM -> PUVM. Some refactoring and cleanup as well.

Location:
trunk
Files:
72 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/dbg.h

    r41573 r44399  
    88
    99/*
    10  * Copyright (C) 2006-2007 Oracle Corporation
     10 * Copyright (C) 2006-2013 Oracle Corporation
    1111 *
    1212 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    478478     * @returns VBox status code appropriate to return from a command.
    479479     * @param   pCmdHlp     Pointer to the command callback structure.
    480      * @param   pVM         VM handle if GC or physical HC address.
    481480     * @param   pvBuffer    Where to store the read data.
    482481     * @param   cbRead      Number of bytes to read.
     
    488487     *                      will cause failure.
    489488     */
    490     DECLCALLBACKMEMBER(int, pfnMemRead)(PDBGCCMDHLP pCmdHlp, PVM pVM, void *pvBuffer, size_t cbRead, PCDBGCVAR pVarPointer, size_t *pcbRead);
     489    DECLCALLBACKMEMBER(int, pfnMemRead)(PDBGCCMDHLP pCmdHlp, void *pvBuffer, size_t cbRead, PCDBGCVAR pVarPointer, size_t *pcbRead);
    491490
    492491    /**
     
    495494     * @returns VBox status code appropriate to return from a command.
    496495     * @param   pCmdHlp     Pointer to the command callback structure.
    497      * @param   pVM         VM handle if GC or physical HC address.
    498496     * @param   pvBuffer    What to write.
    499497     * @param   cbWrite     Number of bytes to write.
     
    503501     *                      might have been written to the specified address.
    504502     */
    505     DECLCALLBACKMEMBER(int, pfnMemWrite)(PDBGCCMDHLP pCmdHlp, PVM pVM, const void *pvBuffer, size_t cbWrite, PCDBGCVAR pVarPointer, size_t *pcbWritten);
     503    DECLCALLBACKMEMBER(int, pfnMemWrite)(PDBGCCMDHLP pCmdHlp, const void *pvBuffer, size_t cbWrite, PCDBGCVAR pVarPointer, size_t *pcbWritten);
    506504
    507505    /**
     
    721719 * @copydoc FNDBGCHLPMEMREAD
    722720 */
    723 DECLINLINE(int) DBGCCmdHlpMemRead(PDBGCCMDHLP pCmdHlp, PVM pVM, void *pvBuffer, size_t cbRead, PCDBGCVAR pVarPointer, size_t *pcbRead)
    724 {
    725     return pCmdHlp->pfnMemRead(pCmdHlp, pVM, pvBuffer, cbRead, pVarPointer, pcbRead);
     721DECLINLINE(int) DBGCCmdHlpMemRead(PDBGCCMDHLP pCmdHlp, void *pvBuffer, size_t cbRead, PCDBGCVAR pVarPointer, size_t *pcbRead)
     722{
     723    return pCmdHlp->pfnMemRead(pCmdHlp, pvBuffer, cbRead, pVarPointer, pcbRead);
    726724}
    727725
     
    818816/** Assert+return like macro that the VM handle is present.
    819817 * Returns with failure if the VM handle is NIL.  */
    820 #define DBGC_CMDHLP_REQ_VM_RET(pCmdHlp, pCmd, pVM) \
     818#define DBGC_CMDHLP_REQ_UVM_RET(pCmdHlp, pCmd, pUVM) \
    821819    do { \
    822         if (!(pVM)) \
     820        if (!(pUVM)) \
    823821            return DBGCCmdHlpFail(pCmdHlp, pCmd, "No VM selected"); \
    824822    } while (0)
     
    927925 * @param   pCmd        Pointer to the command descriptor (as registered).
    928926 * @param   pCmdHlp     Pointer to command helper functions.
    929  * @param   pVM         Pointer to the current VM (if any).
     927 * @param   pUVM        The user mode VM handle, can in theory be NULL.
    930928 * @param   paArgs      Pointer to (readonly) array of arguments.
    931929 * @param   cArgs       Number of arguments in the array.
    932930 */
    933 typedef DECLCALLBACK(int) FNDBGCCMD(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
     931typedef DECLCALLBACK(int) FNDBGCCMD(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs);
    934932/** Pointer to a FNDBGCCMD() function. */
    935933typedef FNDBGCCMD *PFNDBGCCMD;
     
    976974 * @param   pCmd        Pointer to the command descriptor (as registered).
    977975 * @param   pCmdHlp     Pointer to command helper functions.
    978  * @param   pVM         Pointer to the current VM (if any).
     976 * @param   pUVM        The user mode VM handle, can in theory be NULL.
    979977 * @param   paArgs      Pointer to (readonly) array of arguments.
    980978 * @param   cArgs       Number of arguments in the array.
    981979 * @param   pResult     Where to return the result.
    982980 */
    983 typedef DECLCALLBACK(int) FNDBGCFUNC(PCDBGCFUNC pFunc, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs,
     981typedef DECLCALLBACK(int) FNDBGCFUNC(PCDBGCFUNC pFunc, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs,
    984982                                     PDBGCVAR pResult);
    985983/** Pointer to a FNDBGCFUNC() function. */
     
    10921090} DBGCBACK;
    10931091
    1094 
    1095 /**
    1096  * Make a console instance.
    1097  *
    1098  * This will not return until either an 'exit' command is issued or a error code
    1099  * indicating connection loss is encountered.
    1100  *
    1101  * @returns VINF_SUCCESS if console termination caused by the 'exit' command.
    1102  * @returns The VBox status code causing the console termination.
    1103  *
    1104  * @param   pVM         VM Handle.
    1105  * @param   pBack       Pointer to the backend structure. This must contain
    1106  *                      a full set of function pointers to service the console.
    1107  * @param   fFlags      Reserved, must be zero.
    1108  * @remark  A forced termination of the console is easiest done by forcing the
    1109  *          callbacks to return fatal failures.
    1110  */
    1111 DBGDECL(int)    DBGCCreate(PVM pVM, PDBGCBACK pBack, unsigned fFlags);
    1112 
    1113 
    1114 /**
    1115  * Register one or more external commands.
    1116  *
    1117  * @returns VBox status.
    1118  * @param   paCommands      Pointer to an array of command descriptors.
    1119  *                          The commands must be unique. It's not possible
    1120  *                          to register the same commands more than once.
    1121  * @param   cCommands       Number of commands.
    1122  */
     1092DBGDECL(int)    DBGCCreate(PUVM pUVM, PDBGCBACK pBack, unsigned fFlags);
    11231093DBGDECL(int)    DBGCRegisterCommands(PCDBGCCMD paCommands, unsigned cCommands);
    1124 
    1125 
    1126 /**
    1127  * Deregister one or more external commands previously registered by
    1128  * DBGCRegisterCommands().
    1129  *
    1130  * @returns VBox status.
    1131  * @param   paCommands      Pointer to an array of command descriptors
    1132  *                          as given to DBGCRegisterCommands().
    1133  * @param   cCommands       Number of commands.
    1134  */
    11351094DBGDECL(int)    DBGCDeregisterCommands(PCDBGCCMD paCommands, unsigned cCommands);
    1136 
    1137 
    1138 /**
    1139  * Spawns a new thread with a TCP based debugging console service.
    1140  *
    1141  * @returns VBox status.
    1142  * @param   pVM         VM handle.
    1143  * @param   ppvData     Where to store the pointer to instance data.
    1144  */
    1145 DBGDECL(int)    DBGCTcpCreate(PVM pVM, void **ppvUser);
    1146 
    1147 /**
    1148  * Terminates any running TCP base debugger console service.
    1149  *
    1150  * @returns VBox status.
    1151  * @param   pVM         VM handle.
    1152  * @param   pvData      Instance data set by DBGCTcpCreate().
    1153  */
    1154 DBGDECL(int)    DBGCTcpTerminate(PVM pVM, void *pvData);
     1095DBGDECL(int)    DBGCTcpCreate(PUVM pUVM, void **ppvUser);
     1096DBGDECL(int)    DBGCTcpTerminate(PUVM pUVM, void *pvData);
    11551097
    11561098
     
    11901132 *
    11911133 * @param   enmOperation    The operation.
    1192  * @param   pVM             The VM handle. This may be NULL.
     1134 * @param   pUVM            The user mode VM handle. This may be NULL.
    11931135 * @param   uArg            Extra argument.
    11941136 */
    1195 typedef DECLCALLBACK(int) FNDBGCPLUGIN(DBGCPLUGINOP enmOperation, PVM pVM, uintptr_t uArg);
     1137typedef DECLCALLBACK(int) FNDBGCPLUGIN(DBGCPLUGINOP enmOperation, PUVM pUVM, uintptr_t uArg);
    11961138/** Pointer to a FNDBGCPLUGIN. */
    11971139typedef FNDBGCPLUGIN *PFNDBGCPLUGIN;
    11981140
    11991141/** @copydoc FNDBGCPLUGIN */
    1200 DECLEXPORT(int) DBGCPlugInEntry(DBGCPLUGINOP enmOperation, PVM pVM, uintptr_t uArg);
     1142DECLEXPORT(int) DBGCPlugInEntry(DBGCPLUGINOP enmOperation, PUVM pUVM, uintptr_t uArg);
    12011143
    12021144#endif /* IN_RING3 */
  • trunk/include/VBox/vmm/dbgf.h

    r44373 r44399  
    4747 * @{
    4848 */
    49 VMMRZDECL(int) DBGFRZTrap01Handler(PVM pVM, PVMCPU pVCpu, PCPUMCTXCORE pRegFrame, RTGCUINTREG uDr6);
    50 VMMRZDECL(int) DBGFRZTrap03Handler(PVM pVM, PVMCPU pVCpu, PCPUMCTXCORE pRegFrame);
     49VMMRZ_INT_DECL(int) DBGFRZTrap01Handler(PVM pVM, PVMCPU pVCpu, PCPUMCTXCORE pRegFrame, RTGCUINTREG uDr6);
     50VMMRZ_INT_DECL(int) DBGFRZTrap03Handler(PVM pVM, PVMCPU pVCpu, PCPUMCTXCORE pRegFrame);
    5151/** @} */
    5252#endif
     
    115115/** @} */
    116116
    117 VMMR3DECL(int)          DBGFR3AddrFromSelOff(PVM pVM, VMCPUID idCpu, PDBGFADDRESS pAddress, RTSEL Sel, RTUINTPTR off);
    118 VMMR3DECL(int)          DBGFR3AddrFromSelInfoOff(PVM pVM, PDBGFADDRESS pAddress, PCDBGFSELINFO pSelInfo, RTUINTPTR off);
    119 VMMR3DECL(PDBGFADDRESS) DBGFR3AddrFromFlat(PVM pVM, PDBGFADDRESS pAddress, RTGCUINTPTR FlatPtr);
    120 VMMR3DECL(PDBGFADDRESS) DBGFR3AddrFromPhys(PVM pVM, PDBGFADDRESS pAddress, RTGCPHYS PhysAddr);
    121 VMMR3DECL(bool)         DBGFR3AddrIsValid(PVM pVM, PCDBGFADDRESS pAddress);
    122 VMMR3DECL(int)          DBGFR3AddrToPhys(PVM pVM, VMCPUID idCpu, PDBGFADDRESS pAddress, PRTGCPHYS pGCPhys);
    123 VMMR3DECL(int)          DBGFR3AddrToHostPhys(PVM pVM, VMCPUID idCpu, PDBGFADDRESS pAddress, PRTHCPHYS pHCPhys);
    124 VMMR3DECL(int)          DBGFR3AddrToVolatileR3Ptr(PVM pVM, VMCPUID idCpu, PDBGFADDRESS pAddress, bool fReadOnly, void **ppvR3Ptr);
     117VMMR3DECL(int)          DBGFR3AddrFromSelOff(PUVM pUVM, VMCPUID idCpu, PDBGFADDRESS pAddress, RTSEL Sel, RTUINTPTR off);
     118VMMR3DECL(int)          DBGFR3AddrFromSelInfoOff(PUVM pUVM, PDBGFADDRESS pAddress, PCDBGFSELINFO pSelInfo, RTUINTPTR off);
     119VMMR3DECL(PDBGFADDRESS) DBGFR3AddrFromFlat(PUVM pUVM, PDBGFADDRESS pAddress, RTGCUINTPTR FlatPtr);
     120VMMR3DECL(PDBGFADDRESS) DBGFR3AddrFromPhys(PUVM pUVM, PDBGFADDRESS pAddress, RTGCPHYS PhysAddr);
     121VMMR3DECL(bool)         DBGFR3AddrIsValid(PUVM pUVM, PCDBGFADDRESS pAddress);
     122VMMR3DECL(int)          DBGFR3AddrToPhys(PUVM pUVM, VMCPUID idCpu, PDBGFADDRESS pAddress, PRTGCPHYS pGCPhys);
     123VMMR3DECL(int)          DBGFR3AddrToHostPhys(PUVM pUVM, VMCPUID idCpu, PDBGFADDRESS pAddress, PRTHCPHYS pHCPhys);
     124VMMR3DECL(int)          DBGFR3AddrToVolatileR3Ptr(PUVM pUVM, VMCPUID idCpu, PDBGFADDRESS pAddress, bool fReadOnly, void **ppvR3Ptr);
    125125VMMR3DECL(PDBGFADDRESS) DBGFR3AddrAdd(PDBGFADDRESS pAddress, RTGCUINTPTR uAddend);
    126126VMMR3DECL(PDBGFADDRESS) DBGFR3AddrSub(PDBGFADDRESS pAddress, RTGCUINTPTR uSubtrahend);
     
    282282# endif
    283283
    284 VMMR3DECL(int)  DBGFR3Init(PVM pVM);
    285 VMMR3DECL(int)  DBGFR3Term(PVM pVM);
    286 VMMR3DECL(void) DBGFR3Relocate(PVM pVM, RTGCINTPTR offDelta);
    287 VMMR3DECL(int)  DBGFR3VMMForcedAction(PVM pVM);
    288 VMMR3DECL(int)  DBGFR3Event(PVM pVM, DBGFEVENTTYPE enmEvent);
    289 VMMR3DECL(int)  DBGFR3EventSrc(PVM pVM, DBGFEVENTTYPE enmEvent, const char *pszFile, unsigned uLine, const char *pszFunction, const char *pszFormat, ...);
    290 VMMR3DECL(int)  DBGFR3EventSrcV(PVM pVM, DBGFEVENTTYPE enmEvent, const char *pszFile, unsigned uLine, const char *pszFunction, const char *pszFormat, va_list args);
    291 VMMR3DECL(int)  DBGFR3EventAssertion(PVM pVM, DBGFEVENTTYPE enmEvent, const char *pszMsg1, const char *pszMsg2);
    292 VMMR3DECL(int)  DBGFR3EventBreakpoint(PVM pVM, DBGFEVENTTYPE enmEvent);
    293 VMMR3DECL(int)  DBGFR3Attach(PVM pVM);
    294 VMMR3DECL(int)  DBGFR3Detach(PVM pVM);
    295 VMMR3DECL(int)  DBGFR3EventWait(PVM pVM, RTMSINTERVAL cMillies, PCDBGFEVENT *ppEvent);
    296 VMMR3DECL(int)  DBGFR3Halt(PVM pVM);
    297 VMMR3DECL(bool) DBGFR3IsHalted(PVM pVM);
    298 VMMR3DECL(bool) DBGFR3CanWait(PVM pVM);
    299 VMMR3DECL(int)  DBGFR3Resume(PVM pVM);
    300 VMMR3DECL(int)  DBGFR3Step(PVM pVM, VMCPUID idCpu);
    301 VMMR3DECL(int)  DBGFR3PrgStep(PVMCPU pVCpu);
    302 VMMR3DECL(int)  DBGFR3InjectNMI(PUVM pUVM, VMCPUID idCpu);
     284VMMR3_INT_DECL(int)     DBGFR3Init(PVM pVM);
     285VMMR3_INT_DECL(int)     DBGFR3Term(PVM pVM);
     286VMMR3_INT_DECL(void)    DBGFR3Relocate(PVM pVM, RTGCINTPTR offDelta);
     287VMMR3_INT_DECL(int)     DBGFR3VMMForcedAction(PVM pVM);
     288VMMR3DECL(int)          DBGFR3Event(PVM pVM, DBGFEVENTTYPE enmEvent);
     289VMMR3DECL(int)          DBGFR3EventSrc(PVM pVM, DBGFEVENTTYPE enmEvent, const char *pszFile, unsigned uLine,
     290                                       const char *pszFunction, const char *pszFormat, ...);
     291VMMR3DECL(int)          DBGFR3EventSrcV(PVM pVM, DBGFEVENTTYPE enmEvent, const char *pszFile, unsigned uLine,
     292                                        const char *pszFunction, const char *pszFormat, va_list args);
     293VMMR3_INT_DECL(int)     DBGFR3EventAssertion(PVM pVM, DBGFEVENTTYPE enmEvent, const char *pszMsg1, const char *pszMsg2);
     294VMMR3_INT_DECL(int)     DBGFR3EventBreakpoint(PVM pVM, DBGFEVENTTYPE enmEvent);
     295VMMR3_INT_DECL(int)     DBGFR3PrgStep(PVMCPU pVCpu);
     296
     297VMMR3DECL(int)          DBGFR3Attach(PUVM pUVM);
     298VMMR3DECL(int)          DBGFR3Detach(PUVM pUVM);
     299VMMR3DECL(int)          DBGFR3EventWait(PUVM pUVM, RTMSINTERVAL cMillies, PCDBGFEVENT *ppEvent);
     300VMMR3DECL(int)          DBGFR3Halt(PUVM pUVM);
     301VMMR3DECL(bool)         DBGFR3IsHalted(PUVM pUVM);
     302VMMR3DECL(bool)         DBGFR3CanWait(PUVM pUVM);
     303VMMR3DECL(int)          DBGFR3Resume(PUVM pUVM);
     304VMMR3DECL(int)          DBGFR3Step(PUVM pUVM, VMCPUID idCpu);
     305VMMR3DECL(int)          DBGFR3InjectNMI(PUVM pUVM, VMCPUID idCpu);
    303306
    304307#endif /* IN_RING3 */
     
    386389
    387390#ifdef IN_RING3 /* The breakpoint management API is only available in ring-3. */
    388 VMMR3DECL(int)  DBGFR3BpSet(PVM pVM, PCDBGFADDRESS pAddress, uint64_t iHitTrigger, uint64_t iHitDisable, uint32_t *piBp);
    389 VMMR3DECL(int)  DBGFR3BpSetReg(PVM pVM, PCDBGFADDRESS pAddress, uint64_t iHitTrigger, uint64_t iHitDisable,
     391VMMR3DECL(int)  DBGFR3BpSet(PUVM pUVM, PCDBGFADDRESS pAddress, uint64_t iHitTrigger, uint64_t iHitDisable, uint32_t *piBp);
     392VMMR3DECL(int)  DBGFR3BpSetReg(PUVM pUVM, PCDBGFADDRESS pAddress, uint64_t iHitTrigger, uint64_t iHitDisable,
    390393                               uint8_t fType, uint8_t cb, uint32_t *piBp);
    391 VMMR3DECL(int)  DBGFR3BpSetREM(PVM pVM, PCDBGFADDRESS pAddress, uint64_t iHitTrigger, uint64_t iHitDisable, uint32_t *piBp);
    392 VMMR3DECL(int)  DBGFR3BpClear(PVM pVM, uint32_t iBp);
    393 VMMR3DECL(int)  DBGFR3BpEnable(PVM pVM, uint32_t iBp);
    394 VMMR3DECL(int)  DBGFR3BpDisable(PVM pVM, uint32_t iBp);
     394VMMR3DECL(int)  DBGFR3BpSetREM(PUVM pUVM, PCDBGFADDRESS pAddress, uint64_t iHitTrigger, uint64_t iHitDisable, uint32_t *piBp);
     395VMMR3DECL(int)  DBGFR3BpClear(PUVM pUVM, uint32_t iBp);
     396VMMR3DECL(int)  DBGFR3BpEnable(PUVM pUVM, uint32_t iBp);
     397VMMR3DECL(int)  DBGFR3BpDisable(PUVM pUVM, uint32_t iBp);
    395398
    396399/**
     
    398401 *
    399402 * @returns VBox status code. Any failure will stop the enumeration.
    400  * @param   pVM         The VM handle.
     403 * @param   pUVM        The user mode VM handle.
    401404 * @param   pvUser      The user argument.
    402405 * @param   pBp         Pointer to the breakpoint information. (readonly)
    403406 */
    404 typedef DECLCALLBACK(int) FNDBGFBPENUM(PVM pVM, void *pvUser, PCDBGFBP pBp);
     407typedef DECLCALLBACK(int) FNDBGFBPENUM(PUVM pUVM, void *pvUser, PCDBGFBP pBp);
    405408/** Pointer to a breakpoint enumeration callback function. */
    406409typedef FNDBGFBPENUM *PFNDBGFBPENUM;
    407410
    408 VMMR3DECL(int)          DBGFR3BpEnum(PVM pVM, PFNDBGFBPENUM pfnCallback, void *pvUser);
     411VMMR3DECL(int)              DBGFR3BpEnum(PUVM pUVM, PFNDBGFBPENUM pfnCallback, void *pvUser);
    409412#endif /* IN_RING3 */
    410413
    411 VMMDECL(RTGCUINTREG)    DBGFBpGetDR7(PVM pVM);
    412 VMMDECL(RTGCUINTREG)    DBGFBpGetDR0(PVM pVM);
    413 VMMDECL(RTGCUINTREG)    DBGFBpGetDR1(PVM pVM);
    414 VMMDECL(RTGCUINTREG)    DBGFBpGetDR2(PVM pVM);
    415 VMMDECL(RTGCUINTREG)    DBGFBpGetDR3(PVM pVM);
    416 VMMDECL(bool)           DBGFIsStepping(PVMCPU pVCpu);
     414VMM_INT_DECL(RTGCUINTREG)   DBGFBpGetDR7(PVM pVM);
     415VMM_INT_DECL(RTGCUINTREG)   DBGFBpGetDR0(PVM pVM);
     416VMM_INT_DECL(RTGCUINTREG)   DBGFBpGetDR1(PVM pVM);
     417VMM_INT_DECL(RTGCUINTREG)   DBGFBpGetDR2(PVM pVM);
     418VMM_INT_DECL(RTGCUINTREG)   DBGFBpGetDR3(PVM pVM);
     419VMM_INT_DECL(bool)          DBGFIsStepping(PVMCPU pVCpu);
    417420
    418421
    419422#ifdef IN_RING3 /* The CPU mode API only works in ring-3. */
    420 VMMR3DECL(CPUMMODE)     DBGFR3CpuGetMode(PVM pVM, VMCPUID idCpu);
     423VMMR3DECL(CPUMMODE)         DBGFR3CpuGetMode(PUVM pUVM, VMCPUID idCpu);
     424VMMR3DECL(VMCPUID)          DBGFR3CpuGetCount(PUVM pUVM);
    421425#endif
    422426
     
    512516/** @} */
    513517
    514 VMMR3DECL(int) DBGFR3InfoRegisterDevice(PVM pVM, const char *pszName, const char *pszDesc, PFNDBGFHANDLERDEV pfnHandler, PPDMDEVINS pDevIns);
    515 VMMR3DECL(int) DBGFR3InfoRegisterDriver(PVM pVM, const char *pszName, const char *pszDesc, PFNDBGFHANDLERDRV pfnHandler, PPDMDRVINS pDrvIns);
    516 VMMR3DECL(int) DBGFR3InfoRegisterInternal(PVM pVM, const char *pszName, const char *pszDesc, PFNDBGFHANDLERINT pfnHandler);
    517 VMMR3DECL(int) DBGFR3InfoRegisterInternalEx(PVM pVM, const char *pszName, const char *pszDesc, PFNDBGFHANDLERINT pfnHandler, uint32_t fFlags);
    518 VMMR3DECL(int) DBGFR3InfoRegisterExternal(PVM pVM, const char *pszName, const char *pszDesc, PFNDBGFHANDLEREXT pfnHandler, void *pvUser);
    519 VMMR3DECL(int) DBGFR3InfoDeregisterDevice(PVM pVM, PPDMDEVINS pDevIns, const char *pszName);
    520 VMMR3DECL(int) DBGFR3InfoDeregisterDriver(PVM pVM, PPDMDRVINS pDrvIns, const char *pszName);
    521 VMMR3DECL(int) DBGFR3InfoDeregisterInternal(PVM pVM, const char *pszName);
    522 VMMR3DECL(int) DBGFR3InfoDeregisterExternal(PVM pVM, const char *pszName);
    523 VMMR3DECL(int) DBGFR3Info(PVM pVM, const char *pszName, const char *pszArgs, PCDBGFINFOHLP pHlp);
    524 VMMR3DECL(int) DBGFR3InfoEx(PVM pVM, VMCPUID idCpu, const char *pszName, const char *pszArgs, PCDBGFINFOHLP pHlp);
    525 VMMR3DECL(int) DBGFR3InfoLogRel(PVM pVM, const char *pszName, const char *pszArgs);
    526 VMMR3DECL(int) DBGFR3InfoStdErr(PVM pVM, const char *pszName, const char *pszArgs);
    527 VMMR3DECL(int) DBGFR3InfoMulti(PVM pVM, const char *pszIncludePat, const char *pszExcludePat,
    528                                const char *pszSepFmt, PCDBGFINFOHLP pHlp);
     518VMMR3_INT_DECL(int) DBGFR3InfoRegisterDevice(PVM pVM, const char *pszName, const char *pszDesc, PFNDBGFHANDLERDEV pfnHandler, PPDMDEVINS pDevIns);
     519VMMR3_INT_DECL(int) DBGFR3InfoRegisterDriver(PVM pVM, const char *pszName, const char *pszDesc, PFNDBGFHANDLERDRV pfnHandler, PPDMDRVINS pDrvIns);
     520VMMR3_INT_DECL(int) DBGFR3InfoRegisterInternal(PVM pVM, const char *pszName, const char *pszDesc, PFNDBGFHANDLERINT pfnHandler);
     521VMMR3_INT_DECL(int) DBGFR3InfoRegisterInternalEx(PVM pVM, const char *pszName, const char *pszDesc, PFNDBGFHANDLERINT pfnHandler, uint32_t fFlags);
     522VMMR3DECL(int)      DBGFR3InfoRegisterExternal(PUVM pUVM, const char *pszName, const char *pszDesc, PFNDBGFHANDLEREXT pfnHandler, void *pvUser);
     523VMMR3_INT_DECL(int) DBGFR3InfoDeregisterDevice(PVM pVM, PPDMDEVINS pDevIns, const char *pszName);
     524VMMR3_INT_DECL(int) DBGFR3InfoDeregisterDriver(PVM pVM, PPDMDRVINS pDrvIns, const char *pszName);
     525VMMR3_INT_DECL(int) DBGFR3InfoDeregisterInternal(PVM pVM, const char *pszName);
     526VMMR3DECL(int)      DBGFR3InfoDeregisterExternal(PUVM pUVM, const char *pszName);
     527VMMR3DECL(int)      DBGFR3Info(PUVM pUVM, const char *pszName, const char *pszArgs, PCDBGFINFOHLP pHlp);
     528VMMR3DECL(int)      DBGFR3InfoEx(PUVM pUVM, VMCPUID idCpu, const char *pszName, const char *pszArgs, PCDBGFINFOHLP pHlp);
     529VMMR3DECL(int)      DBGFR3InfoLogRel(PUVM pUVM, const char *pszName, const char *pszArgs);
     530VMMR3DECL(int)      DBGFR3InfoStdErr(PUVM pUVM, const char *pszName, const char *pszArgs);
     531VMMR3_INT_DECL(int) DBGFR3InfoMulti(PVM pVM, const char *pszIncludePat, const char *pszExcludePat,
     532                                    const char *pszSepFmt, PCDBGFINFOHLP pHlp);
    529533
    530534/** @def DBGFR3InfoLog
    531535 * Display a piece of info writing to the log if enabled.
    532536 *
    533  * @param   pVM        VM handle.
    534  * @param   pszName     The identifier of the info to display.
    535  * @param   pszArgs     Arguments to the info handler.
     537 * @param   a_pVM       The shared VM handle.
     538 * @param   a_pszName   The identifier of the info to display.
     539 * @param   a_pszArgs   Arguments to the info handler.
    536540 */
    537541#ifdef LOG_ENABLED
    538 #define DBGFR3InfoLog(pVM, pszName, pszArgs) \
     542# define DBGFR3_INFO_LOG(a_pVM, a_pszName, a_pszArgs) \
    539543    do { \
    540544        if (LogIsEnabled()) \
    541             DBGFR3Info(pVM, pszName, pszArgs, NULL); \
     545            DBGFR3Info((a_pVM)->pUVM, a_pszName, a_pszArgs, NULL); \
    542546    } while (0)
    543547#else
    544 #define DBGFR3InfoLog(pVM, pszName, pszArgs) do { } while (0)
     548# define DBGFR3_INFO_LOG(a_pVM, a_pszName, a_pszArgs) do { } while (0)
    545549#endif
    546550
     
    551555 *          A status code indicating failure will end the enumeration
    552556 *          and DBGFR3InfoEnum will return with that status code.
    553  * @param   pVM        VM handle.
     557 * @param   pUVM        The user mode VM handle.
    554558 * @param   pszName     Info identifier name.
    555559 * @param   pszDesc     The description.
    556560 */
    557 typedef DECLCALLBACK(int) FNDBGFINFOENUM(PVM pVM, const char *pszName, const char *pszDesc, void *pvUser);
     561typedef DECLCALLBACK(int) FNDBGFINFOENUM(PUVM pUVM, const char *pszName, const char *pszDesc, void *pvUser);
    558562/** Pointer to a FNDBGFINFOENUM function. */
    559563typedef FNDBGFINFOENUM *PFNDBGFINFOENUM;
    560564
    561 VMMR3DECL(int)              DBGFR3InfoEnum(PVM pVM, PFNDBGFINFOENUM pfnCallback, void *pvUser);
     565VMMR3DECL(int)              DBGFR3InfoEnum(PUVM pUVM, PFNDBGFINFOENUM pfnCallback, void *pvUser);
    562566VMMR3DECL(PCDBGFINFOHLP)    DBGFR3InfoLogHlp(void);
    563567VMMR3DECL(PCDBGFINFOHLP)    DBGFR3InfoLogRelHlp(void);
     
    567571
    568572#ifdef IN_RING3 /* The log contrl API only works in ring-3. */
    569 VMMR3DECL(int) DBGFR3LogModifyGroups(PVM pVM, const char *pszGroupSettings);
    570 VMMR3DECL(int) DBGFR3LogModifyFlags(PVM pVM, const char *pszFlagSettings);
    571 VMMR3DECL(int) DBGFR3LogModifyDestinations(PVM pVM, const char *pszDestSettings);
     573VMMR3DECL(int) DBGFR3LogModifyGroups(PUVM pUVM, const char *pszGroupSettings);
     574VMMR3DECL(int) DBGFR3LogModifyFlags(PUVM pUVM, const char *pszFlagSettings);
     575VMMR3DECL(int) DBGFR3LogModifyDestinations(PUVM pUVM, const char *pszDestSettings);
    572576#endif /* IN_RING3 */
    573577
     
    652656/** @} */
    653657
    654 VMMR3DECL(int)          DBGFR3AsAdd(PVM pVM, RTDBGAS hDbgAs, RTPROCESS ProcId);
    655 VMMR3DECL(int)          DBGFR3AsDelete(PVM pVM, RTDBGAS hDbgAs);
    656 VMMR3DECL(int)          DBGFR3AsSetAlias(PVM pVM, RTDBGAS hAlias, RTDBGAS hAliasFor);
    657 VMMR3DECL(RTDBGAS)      DBGFR3AsResolve(PVM pVM, RTDBGAS hAlias);
    658 VMMR3DECL(RTDBGAS)      DBGFR3AsResolveAndRetain(PVM pVM, RTDBGAS hAlias);
    659 VMMR3DECL(RTDBGAS)      DBGFR3AsQueryByName(PVM pVM, const char *pszName);
    660 VMMR3DECL(RTDBGAS)      DBGFR3AsQueryByPid(PVM pVM, RTPROCESS ProcId);
    661 
    662 VMMR3DECL(int)          DBGFR3AsLoadImage(PVM pVM, RTDBGAS hDbgAs, const char *pszFilename, const char *pszModName, PCDBGFADDRESS pModAddress, RTDBGSEGIDX iModSeg, uint32_t fFlags);
    663 VMMR3DECL(int)          DBGFR3AsLoadMap(PVM pVM, RTDBGAS hDbgAs, const char *pszFilename, const char *pszModName, PCDBGFADDRESS pModAddress, RTDBGSEGIDX iModSeg, RTGCUINTPTR uSubtrahend, uint32_t fFlags);
    664 VMMR3DECL(int)          DBGFR3AsLinkModule(PVM pVM, RTDBGAS hDbgAs, RTDBGMOD hMod, PCDBGFADDRESS pModAddress, RTDBGSEGIDX iModSeg, uint32_t fFlags);
    665 
    666 VMMR3DECL(int)          DBGFR3AsSymbolByAddr(PVM pVM, RTDBGAS hDbgAs, PCDBGFADDRESS pAddress, PRTGCINTPTR poffDisp, PRTDBGSYMBOL pSymbol, PRTDBGMOD phMod);
    667 VMMR3DECL(PRTDBGSYMBOL) DBGFR3AsSymbolByAddrA(PVM pVM, RTDBGAS hDbgAs, PCDBGFADDRESS pAddress, PRTGCINTPTR poffDisp, PRTDBGMOD phMod);
    668 VMMR3DECL(int)          DBGFR3AsSymbolByName(PVM pVM, RTDBGAS hDbgAs, const char *pszSymbol, PRTDBGSYMBOL pSymbol, PRTDBGMOD phMod);
     658VMMR3DECL(int)          DBGFR3AsAdd(PUVM pUVM, RTDBGAS hDbgAs, RTPROCESS ProcId);
     659VMMR3DECL(int)          DBGFR3AsDelete(PUVM pUVM, RTDBGAS hDbgAs);
     660VMMR3DECL(int)          DBGFR3AsSetAlias(PUVM pUVM, RTDBGAS hAlias, RTDBGAS hAliasFor);
     661VMMR3DECL(RTDBGAS)      DBGFR3AsResolve(PUVM pUVM, RTDBGAS hAlias);
     662VMMR3DECL(RTDBGAS)      DBGFR3AsResolveAndRetain(PUVM pUVM, RTDBGAS hAlias);
     663VMMR3DECL(RTDBGAS)      DBGFR3AsQueryByName(PUVM pUVM, const char *pszName);
     664VMMR3DECL(RTDBGAS)      DBGFR3AsQueryByPid(PUVM pUVM, RTPROCESS ProcId);
     665
     666VMMR3DECL(int)          DBGFR3AsLoadImage(PUVM pUVM, RTDBGAS hDbgAs, const char *pszFilename, const char *pszModName, PCDBGFADDRESS pModAddress, RTDBGSEGIDX iModSeg, uint32_t fFlags);
     667VMMR3DECL(int)          DBGFR3AsLoadMap(PUVM pUVM, RTDBGAS hDbgAs, const char *pszFilename, const char *pszModName, PCDBGFADDRESS pModAddress, RTDBGSEGIDX iModSeg, RTGCUINTPTR uSubtrahend, uint32_t fFlags);
     668VMMR3DECL(int)          DBGFR3AsLinkModule(PUVM pUVM, RTDBGAS hDbgAs, RTDBGMOD hMod, PCDBGFADDRESS pModAddress, RTDBGSEGIDX iModSeg, uint32_t fFlags);
     669
     670VMMR3DECL(int)          DBGFR3AsSymbolByAddr(PUVM pUVM, RTDBGAS hDbgAs, PCDBGFADDRESS pAddress, PRTGCINTPTR poffDisp, PRTDBGSYMBOL pSymbol, PRTDBGMOD phMod);
     671VMMR3DECL(PRTDBGSYMBOL) DBGFR3AsSymbolByAddrA(PUVM pUVM, RTDBGAS hDbgAs, PCDBGFADDRESS pAddress, PRTGCINTPTR poffDisp, PRTDBGMOD phMod);
     672VMMR3DECL(int)          DBGFR3AsSymbolByName(PUVM pUVM, RTDBGAS hDbgAs, const char *pszSymbol, PRTDBGSYMBOL pSymbol, PRTDBGMOD phMod);
    669673
    670674/* The following are soon to be obsoleted: */
    671 VMMR3DECL(int)          DBGFR3ModuleLoad(PVM pVM, const char *pszFilename, RTGCUINTPTR AddressDelta, const char *pszName, RTGCUINTPTR ModuleAddress, unsigned cbImage);
    672 VMMR3DECL(void)         DBGFR3ModuleRelocate(PVM pVM, RTGCUINTPTR OldImageBase, RTGCUINTPTR NewImageBase, RTGCUINTPTR cbImage,
     675VMMR3DECL(int)          DBGFR3ModuleLoad(PUVM pUVM, const char *pszFilename, RTGCUINTPTR AddressDelta, const char *pszName, RTGCUINTPTR ModuleAddress, unsigned cbImage);
     676VMMR3_INT_DECL(void)    DBGFR3ModuleRelocate(PVM pVM, RTGCUINTPTR OldImageBase, RTGCUINTPTR NewImageBase, RTGCUINTPTR cbImage,
    673677                                             const char *pszFilename, const char *pszName);
    674 VMMR3DECL(int)          DBGFR3SymbolAdd(PVM pVM, RTGCUINTPTR ModuleAddress, RTGCUINTPTR SymbolAddress, RTUINT cbSymbol, const char *pszSymbol);
    675 VMMR3DECL(int)          DBGFR3SymbolByAddr(PVM pVM, RTGCUINTPTR Address, PRTGCINTPTR poffDisplacement, PDBGFSYMBOL pSymbol);
    676 VMMR3DECL(int)          DBGFR3SymbolByName(PVM pVM, const char *pszSymbol, PDBGFSYMBOL pSymbol);
    677 
    678 VMMR3DECL(int)          DBGFR3LineByAddr(PVM pVM, RTGCUINTPTR Address, PRTGCINTPTR poffDisplacement, PDBGFLINE pLine);
    679 VMMR3DECL(PDBGFLINE)    DBGFR3LineByAddrAlloc(PVM pVM, RTGCUINTPTR Address, PRTGCINTPTR poffDisplacement);
    680 VMMR3DECL(void)         DBGFR3LineFree(PDBGFLINE pLine);
     678VMMR3_INT_DECL(int)     DBGFR3SymbolAdd(PVM pVM, RTGCUINTPTR ModuleAddress, RTGCUINTPTR SymbolAddress, RTUINT cbSymbol, const char *pszSymbol);
     679VMMR3_INT_DECL(int)     DBGFR3SymbolByAddr(PVM pVM, RTGCUINTPTR Address, PRTGCINTPTR poffDisplacement, PDBGFSYMBOL pSymbol);
     680VMMR3_INT_DECL(int)     DBGFR3SymbolByName(PVM pVM, const char *pszSymbol, PDBGFSYMBOL pSymbol);
     681
     682VMMR3DECL(int)          DBGFR3LineByAddr(PUVM pUVM, RTGCUINTPTR Address, PRTGCINTPTR poffDisplacement, PDBGFLINE pLine);
     683VMMR3DECL(PDBGFLINE)    DBGFR3LineByAddrAlloc(PUVM pUVM, RTGCUINTPTR Address, PRTGCINTPTR poffDisplacement);
     684VMMR3_INT_DECL(void)    DBGFR3LineFree(PDBGFLINE pLine);
    681685
    682686#endif /* IN_RING3 */
     
    848852/** @} */
    849853
    850 VMMR3DECL(int)              DBGFR3StackWalkBegin(PVM pVM, VMCPUID idCpu, DBGFCODETYPE enmCodeType, PCDBGFSTACKFRAME *ppFirstFrame);
    851 VMMR3DECL(int)              DBGFR3StackWalkBeginEx(PVM pVM, VMCPUID idCpu, DBGFCODETYPE enmCodeType, PCDBGFADDRESS pAddrFrame,
     854VMMR3DECL(int)              DBGFR3StackWalkBegin(PUVM pUVM, VMCPUID idCpu, DBGFCODETYPE enmCodeType,
     855                                                 PCDBGFSTACKFRAME *ppFirstFrame);
     856VMMR3DECL(int)              DBGFR3StackWalkBeginEx(PUVM pUVM, VMCPUID idCpu, DBGFCODETYPE enmCodeType, PCDBGFADDRESS pAddrFrame,
    852857                                                   PCDBGFADDRESS pAddrStack,PCDBGFADDRESS pAddrPC,
    853858                                                   DBGFRETURNTYPE enmReturnType, PCDBGFSTACKFRAME *ppFirstFrame);
     
    893898#define DBGF_SEL_FLAT                       1
    894899
    895 VMMR3DECL(int) DBGFR3DisasInstrEx(PVM pVM, VMCPUID idCpu, RTSEL Sel, RTGCPTR GCPtr, uint32_t fFlags,
    896                                   char *pszOutput, uint32_t cbOutput, uint32_t *pcbInstr);
    897 VMMR3DECL(int) DBGFR3DisasInstrCurrent(PVMCPU pVCpu, char *pszOutput, uint32_t cbOutput);
    898 VMMR3DECL(int) DBGFR3DisasInstrCurrentLogInternal(PVMCPU pVCpu, const char *pszPrefix);
     900VMMR3DECL(int)      DBGFR3DisasInstrEx(PUVM pUVM, VMCPUID idCpu, RTSEL Sel, RTGCPTR GCPtr, uint32_t fFlags,
     901                                       char *pszOutput, uint32_t cbOutput, uint32_t *pcbInstr);
     902VMMR3_INT_DECL(int) DBGFR3DisasInstrCurrent(PVMCPU pVCpu, char *pszOutput, uint32_t cbOutput);
     903VMMR3DECL(int)      DBGFR3DisasInstrCurrentLogInternal(PVMCPU pVCpu, const char *pszPrefix);
    899904
    900905/** @def DBGFR3DisasInstrCurrentLog
     
    903908 */
    904909#ifdef LOG_ENABLED
    905 # define DBGFR3DisasInstrCurrentLog(pVCpu, pszPrefix) \
     910# define DBGFR3_DISAS_INSTR_CUR_LOG(pVCpu, pszPrefix) \
    906911    do { \
    907912        if (LogIsEnabled()) \
     
    909914    } while (0)
    910915#else
    911 # define DBGFR3DisasInstrCurrentLog(pVCpu, pszPrefix) do { } while (0)
     916# define DBGFR3_DISAS_INSTR_CUR_LOG(pVCpu, pszPrefix) do { } while (0)
    912917#endif
    913918
     
    920925 */
    921926# ifdef LOG_ENABLED
    922 #  define DBGFR3DisasInstrLog(pVCpu, Sel, GCPtr, pszPrefix) \
     927#  define DBGFR3_DISAS_INSTR_LOG(pVCpu, Sel, GCPtr, pszPrefix) \
    923928    do { \
    924929        if (LogIsEnabled()) \
     
    926931    } while (0)
    927932# else
    928 #  define DBGFR3DisasInstrLog(pVCpu, Sel, GCPtr, pszPrefix) do { } while (0)
     933#  define DBGFR3_DISAS_INSTR_LOG(pVCpu, Sel, GCPtr, pszPrefix) do { } while (0)
    929934# endif
    930935#endif
     
    932937
    933938#ifdef IN_RING3
    934 VMMR3DECL(int) DBGFR3MemScan(PVM pVM, VMCPUID idCpu, PCDBGFADDRESS pAddress, RTGCUINTPTR cbRange, RTGCUINTPTR uAlign,
     939VMMR3DECL(int) DBGFR3MemScan(PUVM pUVM, VMCPUID idCpu, PCDBGFADDRESS pAddress, RTGCUINTPTR cbRange, RTGCUINTPTR uAlign,
    935940                             const void *pvNeedle, size_t cbNeedle, PDBGFADDRESS pHitAddress);
    936 VMMR3DECL(int) DBGFR3MemRead(PVM pVM, VMCPUID idCpu, PCDBGFADDRESS pAddress, void *pvBuf, size_t cbRead);
    937 VMMR3DECL(int) DBGFR3MemReadString(PVM pVM, VMCPUID idCpu, PCDBGFADDRESS pAddress, char *pszBuf, size_t cbBuf);
    938 VMMR3DECL(int) DBGFR3MemWrite(PVM pVM, VMCPUID idCpu, PCDBGFADDRESS pAddress, void const *pvBuf, size_t cbRead);
     941VMMR3DECL(int) DBGFR3MemRead(PUVM pUVM, VMCPUID idCpu, PCDBGFADDRESS pAddress, void *pvBuf, size_t cbRead);
     942VMMR3DECL(int) DBGFR3MemReadString(PUVM pUVM, VMCPUID idCpu, PCDBGFADDRESS pAddress, char *pszBuf, size_t cbBuf);
     943VMMR3DECL(int) DBGFR3MemWrite(PUVM pUVM, VMCPUID idCpu, PCDBGFADDRESS pAddress, void const *pvBuf, size_t cbRead);
    939944#endif
    940945
     
    981986#define DBGFPGDMP_FLAGS_MODE_MASK       UINT32_C(0x00000f32)
    982987/** @}  */
    983 VMMDECL(int) DBGFR3PagingDumpEx(PVM pVM, VMCPUID idCpu, uint32_t fFlags, uint64_t cr3, uint64_t u64FirstAddr,
     988VMMDECL(int) DBGFR3PagingDumpEx(PUVM pUVM, VMCPUID idCpu, uint32_t fFlags, uint64_t cr3, uint64_t u64FirstAddr,
    984989                                uint64_t u64LastAddr, uint32_t cMaxDepth, PCDBGFINFOHLP pHlp);
    985990
     
    9951000#define DBGFSELQI_FLAGS_DT_ADJ_64BIT_MODE   UINT32_C(2)
    9961001/** @} */
    997 VMMR3DECL(int) DBGFR3SelQueryInfo(PVM pVM, VMCPUID idCpu, RTSEL Sel, uint32_t fFlags, PDBGFSELINFO pSelInfo);
     1002VMMR3DECL(int) DBGFR3SelQueryInfo(PUVM pUVM, VMCPUID idCpu, RTSEL Sel, uint32_t fFlags, PDBGFSELINFO pSelInfo);
    9981003
    9991004
     
    14321437#define DBGFREG_HYPER_VMCPUID       UINT32_C(0x01000000)
    14331438
    1434 VMMR3DECL(int) DBGFR3RegCpuQueryU8(  PVM pVM, VMCPUID idCpu, DBGFREG enmReg, uint8_t     *pu8);
    1435 VMMR3DECL(int) DBGFR3RegCpuQueryU16( PVM pVM, VMCPUID idCpu, DBGFREG enmReg, uint16_t    *pu16);
    1436 VMMR3DECL(int) DBGFR3RegCpuQueryU32( PVM pVM, VMCPUID idCpu, DBGFREG enmReg, uint32_t    *pu32);
    1437 VMMR3DECL(int) DBGFR3RegCpuQueryU64( PVM pVM, VMCPUID idCpu, DBGFREG enmReg, uint64_t    *pu64);
    1438 VMMR3DECL(int) DBGFR3RegCpuQueryU128(PVM pVM, VMCPUID idCpu, DBGFREG enmReg, uint128_t   *pu128);
    1439 VMMR3DECL(int) DBGFR3RegCpuQueryLrd( PVM pVM, VMCPUID idCpu, DBGFREG enmReg, long double *plrd);
    1440 VMMR3DECL(int) DBGFR3RegCpuQueryXdtr(PVM pVM, VMCPUID idCpu, DBGFREG enmReg, uint64_t *pu64Base, uint16_t *pu16Limit);
     1439VMMR3DECL(int) DBGFR3RegCpuQueryU8(  PUVM pUVM, VMCPUID idCpu, DBGFREG enmReg, uint8_t     *pu8);
     1440VMMR3DECL(int) DBGFR3RegCpuQueryU16( PUVM pUVM, VMCPUID idCpu, DBGFREG enmReg, uint16_t    *pu16);
     1441VMMR3DECL(int) DBGFR3RegCpuQueryU32( PUVM pUVM, VMCPUID idCpu, DBGFREG enmReg, uint32_t    *pu32);
     1442VMMR3DECL(int) DBGFR3RegCpuQueryU64( PUVM pUVM, VMCPUID idCpu, DBGFREG enmReg, uint64_t    *pu64);
     1443VMMR3DECL(int) DBGFR3RegCpuQueryU128(PUVM pUVM, VMCPUID idCpu, DBGFREG enmReg, uint128_t   *pu128);
     1444VMMR3DECL(int) DBGFR3RegCpuQueryLrd( PUVM pUVM, VMCPUID idCpu, DBGFREG enmReg, long double *plrd);
     1445VMMR3DECL(int) DBGFR3RegCpuQueryXdtr(PUVM pUVM, VMCPUID idCpu, DBGFREG enmReg, uint64_t *pu64Base, uint16_t *pu16Limit);
    14411446#if 0
    1442 VMMR3DECL(int) DBGFR3RegCpuQueryBatch(PVM pVM,VMCPUID idCpu, PDBGFREGENTRY paRegs, size_t cRegs);
    1443 VMMR3DECL(int) DBGFR3RegCpuQueryAll( PVM pVM, VMCPUID idCpu, PDBGFREGENTRY paRegs, size_t cRegs);
    1444 
    1445 VMMR3DECL(int) DBGFR3RegCpuSetU8(    PVM pVM, VMCPUID idCpu, DBGFREG enmReg, uint8_t     u8);
    1446 VMMR3DECL(int) DBGFR3RegCpuSetU16(   PVM pVM, VMCPUID idCpu, DBGFREG enmReg, uint16_t    u16);
    1447 VMMR3DECL(int) DBGFR3RegCpuSetU32(   PVM pVM, VMCPUID idCpu, DBGFREG enmReg, uint32_t    u32);
    1448 VMMR3DECL(int) DBGFR3RegCpuSetU64(   PVM pVM, VMCPUID idCpu, DBGFREG enmReg, uint64_t    u64);
    1449 VMMR3DECL(int) DBGFR3RegCpuSetU128(  PVM pVM, VMCPUID idCpu, DBGFREG enmReg, uint128_t   u128);
    1450 VMMR3DECL(int) DBGFR3RegCpuSetLrd(   PVM pVM, VMCPUID idCpu, DBGFREG enmReg, long double lrd);
    1451 VMMR3DECL(int) DBGFR3RegCpuSetBatch( PVM pVM, VMCPUID idCpu, PCDBGFREGENTRY paRegs, size_t cRegs);
     1447VMMR3DECL(int) DBGFR3RegCpuQueryBatch(PUVM pUVM,VMCPUID idCpu, PDBGFREGENTRY paRegs, size_t cRegs);
     1448VMMR3DECL(int) DBGFR3RegCpuQueryAll( PUVM pUVM, VMCPUID idCpu, PDBGFREGENTRY paRegs, size_t cRegs);
     1449
     1450VMMR3DECL(int) DBGFR3RegCpuSetU8(    PUVM pUVM, VMCPUID idCpu, DBGFREG enmReg, uint8_t     u8);
     1451VMMR3DECL(int) DBGFR3RegCpuSetU16(   PUVM pUVM, VMCPUID idCpu, DBGFREG enmReg, uint16_t    u16);
     1452VMMR3DECL(int) DBGFR3RegCpuSetU32(   PUVM pUVM, VMCPUID idCpu, DBGFREG enmReg, uint32_t    u32);
     1453VMMR3DECL(int) DBGFR3RegCpuSetU64(   PUVM pUVM, VMCPUID idCpu, DBGFREG enmReg, uint64_t    u64);
     1454VMMR3DECL(int) DBGFR3RegCpuSetU128(  PUVM pUVM, VMCPUID idCpu, DBGFREG enmReg, uint128_t   u128);
     1455VMMR3DECL(int) DBGFR3RegCpuSetLrd(   PUVM pUVM, VMCPUID idCpu, DBGFREG enmReg, long double lrd);
     1456VMMR3DECL(int) DBGFR3RegCpuSetBatch( PUVM pUVM, VMCPUID idCpu, PCDBGFREGENTRY paRegs, size_t cRegs);
    14521457#endif
    14531458
    1454 VMMR3DECL(const char *) DBGFR3RegCpuName(PVM pVM, DBGFREG enmReg, DBGFREGVALTYPE enmType);
     1459VMMR3DECL(const char *) DBGFR3RegCpuName(PUVM pUVM, DBGFREG enmReg, DBGFREGVALTYPE enmType);
    14551460
    14561461VMMR3_INT_DECL(int) DBGFR3RegRegisterCpu(PVM pVM, PVMCPU pVCpu, PCDBGFREGDESC paRegisters, bool fGuestRegs);
    1457 VMMR3DECL(int)      DBGFR3RegRegisterDevice(PVM pVM, PCDBGFREGDESC paRegisters, PPDMDEVINS pDevIns, const char *pszPrefix, uint32_t iInstance);
     1462VMMR3_INT_DECL(int) DBGFR3RegRegisterDevice(PVM pVM, PCDBGFREGDESC paRegisters, PPDMDEVINS pDevIns, const char *pszPrefix, uint32_t iInstance);
    14581463
    14591464/**
     
    14741479typedef DBGFREGENTRYNM const *PCDBGFREGENTRYNM;
    14751480
    1476 VMMR3DECL(int) DBGFR3RegNmValidate( PVM pVM, VMCPUID idDefCpu, const char *pszReg);
    1477 
    1478 VMMR3DECL(int) DBGFR3RegNmQuery(    PVM pVM, VMCPUID idDefCpu, const char *pszReg, PDBGFREGVAL pValue, PDBGFREGVALTYPE penmType);
    1479 VMMR3DECL(int) DBGFR3RegNmQueryU8(  PVM pVM, VMCPUID idDefCpu, const char *pszReg, uint8_t     *pu8);
    1480 VMMR3DECL(int) DBGFR3RegNmQueryU16( PVM pVM, VMCPUID idDefCpu, const char *pszReg, uint16_t    *pu16);
    1481 VMMR3DECL(int) DBGFR3RegNmQueryU32( PVM pVM, VMCPUID idDefCpu, const char *pszReg, uint32_t    *pu32);
    1482 VMMR3DECL(int) DBGFR3RegNmQueryU64( PVM pVM, VMCPUID idDefCpu, const char *pszReg, uint64_t    *pu64);
    1483 VMMR3DECL(int) DBGFR3RegNmQueryU128(PVM pVM, VMCPUID idDefCpu, const char *pszReg, PRTUINT128U  pu128);
    1484 /*VMMR3DECL(int) DBGFR3RegNmQueryLrd( PVM pVM, VMCPUID idDefCpu, const char *pszReg, long double *plrd);*/
    1485 VMMR3DECL(int) DBGFR3RegNmQueryXdtr(PVM pVM, VMCPUID idDefCpu, const char *pszReg, uint64_t *pu64Base, uint16_t *pu16Limit);
    1486 VMMR3DECL(int) DBGFR3RegNmQueryBatch(PVM pVM,VMCPUID idDefCpu, PDBGFREGENTRYNM paRegs, size_t cRegs);
    1487 VMMR3DECL(int) DBGFR3RegNmQueryAllCount(PVM pVM, size_t *pcRegs);
    1488 VMMR3DECL(int) DBGFR3RegNmQueryAll( PVM pVM,                   PDBGFREGENTRYNM paRegs, size_t cRegs);
    1489 
    1490 VMMR3DECL(int) DBGFR3RegNmSet(      PVM pVM, VMCPUID idDefCpu, const char *pszReg, PCDBGFREGVAL pValue, DBGFREGVALTYPE enmType);
    1491 VMMR3DECL(int) DBGFR3RegNmSetU8(    PVM pVM, VMCPUID idDefCpu, const char *pszReg, uint8_t     u8);
    1492 VMMR3DECL(int) DBGFR3RegNmSetU16(   PVM pVM, VMCPUID idDefCpu, const char *pszReg, uint16_t    u16);
    1493 VMMR3DECL(int) DBGFR3RegNmSetU32(   PVM pVM, VMCPUID idDefCpu, const char *pszReg, uint32_t    u32);
    1494 VMMR3DECL(int) DBGFR3RegNmSetU64(   PVM pVM, VMCPUID idDefCpu, const char *pszReg, uint64_t    u64);
    1495 VMMR3DECL(int) DBGFR3RegNmSetU128(  PVM pVM, VMCPUID idDefCpu, const char *pszReg, RTUINT128U  u128);
    1496 VMMR3DECL(int) DBGFR3RegNmSetLrd(   PVM pVM, VMCPUID idDefCpu, const char *pszReg, long double lrd);
    1497 VMMR3DECL(int) DBGFR3RegNmSetBatch( PVM pVM, VMCPUID idDefCpu, PCDBGFREGENTRYNM paRegs, size_t cRegs);
     1481VMMR3DECL(int) DBGFR3RegNmValidate( PUVM pUVM, VMCPUID idDefCpu, const char *pszReg);
     1482
     1483VMMR3DECL(int) DBGFR3RegNmQuery(    PUVM pUVM, VMCPUID idDefCpu, const char *pszReg, PDBGFREGVAL pValue, PDBGFREGVALTYPE penmType);
     1484VMMR3DECL(int) DBGFR3RegNmQueryU8(  PUVM pUVM, VMCPUID idDefCpu, const char *pszReg, uint8_t     *pu8);
     1485VMMR3DECL(int) DBGFR3RegNmQueryU16( PUVM pUVM, VMCPUID idDefCpu, const char *pszReg, uint16_t    *pu16);
     1486VMMR3DECL(int) DBGFR3RegNmQueryU32( PUVM pUVM, VMCPUID idDefCpu, const char *pszReg, uint32_t    *pu32);
     1487VMMR3DECL(int) DBGFR3RegNmQueryU64( PUVM pUVM, VMCPUID idDefCpu, const char *pszReg, uint64_t    *pu64);
     1488VMMR3DECL(int) DBGFR3RegNmQueryU128(PUVM pUVM, VMCPUID idDefCpu, const char *pszReg, PRTUINT128U  pu128);
     1489/*VMMR3DECL(int) DBGFR3RegNmQueryLrd( PUVM pUVM, VMCPUID idDefCpu, const char *pszReg, long double *plrd);*/
     1490VMMR3DECL(int) DBGFR3RegNmQueryXdtr(PUVM pUVM, VMCPUID idDefCpu, const char *pszReg, uint64_t *pu64Base, uint16_t *pu16Limit);
     1491VMMR3DECL(int) DBGFR3RegNmQueryBatch(PUVM pUVM,VMCPUID idDefCpu, PDBGFREGENTRYNM paRegs, size_t cRegs);
     1492VMMR3DECL(int) DBGFR3RegNmQueryAllCount(PUVM pUVM, size_t *pcRegs);
     1493VMMR3DECL(int) DBGFR3RegNmQueryAll( PUVM pUVM,                   PDBGFREGENTRYNM paRegs, size_t cRegs);
     1494
     1495VMMR3DECL(int) DBGFR3RegNmSet(      PUVM pUVM, VMCPUID idDefCpu, const char *pszReg, PCDBGFREGVAL pValue, DBGFREGVALTYPE enmType);
     1496VMMR3DECL(int) DBGFR3RegNmSetU8(    PUVM pUVM, VMCPUID idDefCpu, const char *pszReg, uint8_t     u8);
     1497VMMR3DECL(int) DBGFR3RegNmSetU16(   PUVM pUVM, VMCPUID idDefCpu, const char *pszReg, uint16_t    u16);
     1498VMMR3DECL(int) DBGFR3RegNmSetU32(   PUVM pUVM, VMCPUID idDefCpu, const char *pszReg, uint32_t    u32);
     1499VMMR3DECL(int) DBGFR3RegNmSetU64(   PUVM pUVM, VMCPUID idDefCpu, const char *pszReg, uint64_t    u64);
     1500VMMR3DECL(int) DBGFR3RegNmSetU128(  PUVM pUVM, VMCPUID idDefCpu, const char *pszReg, RTUINT128U  u128);
     1501VMMR3DECL(int) DBGFR3RegNmSetLrd(   PUVM pUVM, VMCPUID idDefCpu, const char *pszReg, long double lrd);
     1502VMMR3DECL(int) DBGFR3RegNmSetBatch( PUVM pUVM, VMCPUID idDefCpu, PCDBGFREGENTRYNM paRegs, size_t cRegs);
    14981503
    14991504/** @todo add enumeration methods.  */
    15001505
    1501 VMMR3DECL(int) DBGFR3RegPrintf( PVM pVM, VMCPUID idDefCpu, char *pszBuf, size_t cbBuf, const char *pszFormat, ...);
    1502 VMMR3DECL(int) DBGFR3RegPrintfV(PVM pVM, VMCPUID idDefCpu, char *pszBuf, size_t cbBuf, const char *pszFormat, va_list va);
     1506VMMR3DECL(int) DBGFR3RegPrintf( PUVM pUVM, VMCPUID idDefCpu, char *pszBuf, size_t cbBuf, const char *pszFormat, ...);
     1507VMMR3DECL(int) DBGFR3RegPrintfV(PUVM pUVM, VMCPUID idDefCpu, char *pszBuf, size_t cbBuf, const char *pszFormat, va_list va);
    15031508
    15041509
     
    15481553     *
    15491554     * @returns VBox status code.
    1550      * @param   pVM     Pointer to the shared VM structure.
     1555     * @param   pUVM    The user mode VM handle.
    15511556     * @param   pvData  Pointer to the instance data.
    15521557     */
    1553     DECLCALLBACKMEMBER(int, pfnConstruct)(PVM pVM, void *pvData);
     1558    DECLCALLBACKMEMBER(int, pfnConstruct)(PUVM pUVM, void *pvData);
    15541559
    15551560    /**
    15561561     * Destroys the instance.
    15571562     *
    1558      * @param   pVM     Pointer to the shared VM structure.
     1563     * @param   pUVM    The user mode VM handle.
    15591564     * @param   pvData  Pointer to the instance data.
    15601565     */
    1561     DECLCALLBACKMEMBER(void, pfnDestruct)(PVM pVM, void *pvData);
     1566    DECLCALLBACKMEMBER(void, pfnDestruct)(PUVM pUVM, void *pvData);
    15621567
    15631568    /**
     
    15681573     *
    15691574     * @returns true if is an OS handled by this module, otherwise false.
    1570      * @param   pVM     Pointer to the shared VM structure.
     1575     * @param   pUVM    The user mode VM handle.
    15711576     * @param   pvData  Pointer to the instance data.
    15721577     */
    1573     DECLCALLBACKMEMBER(bool, pfnProbe)(PVM pVM, void *pvData);
     1578    DECLCALLBACKMEMBER(bool, pfnProbe)(PUVM pUVM, void *pvData);
    15741579
    15751580    /**
     
    15791584     *
    15801585     * @returns VBox status code.
    1581      * @param   pVM     Pointer to the shared VM structure.
     1586     * @param   pUVM    The user mode VM handle.
    15821587     * @param   pvData  Pointer to the instance data.
    15831588     */
    1584     DECLCALLBACKMEMBER(int, pfnInit)(PVM pVM, void *pvData);
     1589    DECLCALLBACKMEMBER(int, pfnInit)(PUVM pUVM, void *pvData);
    15851590
    15861591    /**
     
    15901595     *
    15911596     * @returns VBox status code.
    1592      * @param   pVM     Pointer to the shared VM structure.
     1597     * @param   pUVM    The user mode VM handle.
    15931598     * @param   pvData  Pointer to the instance data.
    15941599     */
    1595     DECLCALLBACKMEMBER(int, pfnRefresh)(PVM pVM, void *pvData);
     1600    DECLCALLBACKMEMBER(int, pfnRefresh)(PUVM pUVM, void *pvData);
    15961601
    15971602    /**
     
    16011606     * This is called after pfnProbe and if needed before pfnDestruct.
    16021607     *
    1603      * @param   pVM     Pointer to the shared VM structure.
     1608     * @param   pUVM    The user mode VM handle.
    16041609     * @param   pvData  Pointer to the instance data.
    16051610     */
    1606     DECLCALLBACKMEMBER(void, pfnTerm)(PVM pVM, void *pvData);
     1611    DECLCALLBACKMEMBER(void, pfnTerm)(PUVM pUVM, void *pvData);
    16071612
    16081613    /**
     
    16121617     *
    16131618     * @returns VBox status code.
    1614      * @param   pVM         Pointer to the shared VM structure.
     1619     * @param   pUVM    The user mode VM handle.
    16151620     * @param   pvData      Pointer to the instance data.
    16161621     * @param   pszVersion  Where to store the version string.
    16171622     * @param   cchVersion  The size of the version string buffer.
    16181623     */
    1619     DECLCALLBACKMEMBER(int, pfnQueryVersion)(PVM pVM, void *pvData, char *pszVersion, size_t cchVersion);
     1624    DECLCALLBACKMEMBER(int, pfnQueryVersion)(PUVM pUVM, void *pvData, char *pszVersion, size_t cchVersion);
    16201625
    16211626    /**
     
    16251630     *
    16261631     * @returns Pointer to the interface if available, NULL if not available.
    1627      * @param   pVM     Pointer to the shared VM structure.
     1632     * @param   pUVM    The user mode VM handle.
    16281633     * @param   pvData  Pointer to the instance data.
    16291634     * @param   enmIf   The interface identifier.
    16301635     */
    1631     DECLCALLBACKMEMBER(void *, pfnQueryInterface)(PVM pVM, void *pvData, DBGFOSINTERFACE enmIf);
     1636    DECLCALLBACKMEMBER(void *, pfnQueryInterface)(PUVM pUVM, void *pvData, DBGFOSINTERFACE enmIf);
    16321637
    16331638    /** Trailing magic (DBGFOSREG_MAGIC). */
     
    16421647#define DBGFOSREG_MAGIC     0x19830808
    16431648
    1644 VMMR3DECL(int)      DBGFR3OSRegister(PVM pVM, PCDBGFOSREG pReg);
    1645 VMMR3DECL(int)      DBGFR3OSDeregister(PVM pVM, PCDBGFOSREG pReg);
    1646 VMMR3DECL(int)      DBGFR3OSDetect(PVM pVM, char *pszName, size_t cchName);
    1647 VMMR3DECL(int)      DBGFR3OSQueryNameAndVersion(PVM pVM, char *pszName, size_t cchName, char *pszVersion, size_t cchVersion);
    1648 VMMR3DECL(void *)   DBGFR3OSQueryInterface(PVM pVM, DBGFOSINTERFACE enmIf);
    1649 
    1650 
    1651 VMMR3DECL(int)      DBGFR3CoreWrite(PVM pVM, const char *pszFilename, bool fReplaceFile);
     1649VMMR3DECL(int)      DBGFR3OSRegister(PUVM pUVM, PCDBGFOSREG pReg);
     1650VMMR3DECL(int)      DBGFR3OSDeregister(PUVM pUVM, PCDBGFOSREG pReg);
     1651VMMR3DECL(int)      DBGFR3OSDetect(PUVM pUVM, char *pszName, size_t cchName);
     1652VMMR3DECL(int)      DBGFR3OSQueryNameAndVersion(PUVM pUVM, char *pszName, size_t cchName, char *pszVersion, size_t cchVersion);
     1653VMMR3DECL(void *)   DBGFR3OSQueryInterface(PUVM pUVM, DBGFOSINTERFACE enmIf);
     1654
     1655
     1656VMMR3DECL(int)      DBGFR3CoreWrite(PUVM pUVM, const char *pszFilename, bool fReplaceFile);
    16521657
    16531658/** @} */
  • trunk/include/VBox/vmm/pgm.h

    r44347 r44399  
    44
    55/*
    6  * Copyright (C) 2006-2010 Oracle Corporation
     6 * Copyright (C) 2006-2013 Oracle Corporation
    77 *
    88 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    555555VMMR3DECL(int)      PGMR3CheckIntegrity(PVM pVM);
    556556
    557 VMMR3DECL(int)      PGMR3DbgR3Ptr2GCPhys(PVM pVM, RTR3PTR R3Ptr, PRTGCPHYS pGCPhys);
    558 VMMR3DECL(int)      PGMR3DbgR3Ptr2HCPhys(PVM pVM, RTR3PTR R3Ptr, PRTHCPHYS pHCPhys);
    559 VMMR3DECL(int)      PGMR3DbgHCPhys2GCPhys(PVM pVM, RTHCPHYS HCPhys, PRTGCPHYS pGCPhys);
    560 VMMR3DECL(int)      PGMR3DbgReadGCPhys(PVM pVM, void *pvDst, RTGCPHYS GCPhysSrc, size_t cb, uint32_t fFlags, size_t *pcbRead);
    561 VMMR3DECL(int)      PGMR3DbgWriteGCPhys(PVM pVM, RTGCPHYS GCPhysDst, const void *pvSrc, size_t cb, uint32_t fFlags, size_t *pcbWritten);
    562 VMMR3DECL(int)      PGMR3DbgReadGCPtr(PVM pVM, void *pvDst, RTGCPTR GCPtrSrc, size_t cb, uint32_t fFlags, size_t *pcbRead);
    563 VMMR3DECL(int)      PGMR3DbgWriteGCPtr(PVM pVM, RTGCPTR GCPtrDst, void const *pvSrc, size_t cb, uint32_t fFlags, size_t *pcbWritten);
    564 VMMR3DECL(int)      PGMR3DbgScanPhysical(PVM pVM, RTGCPHYS GCPhys, RTGCPHYS cbRange, RTGCPHYS GCPhysAlign, const uint8_t *pabNeedle, size_t cbNeedle, PRTGCPHYS pGCPhysHit);
    565 VMMR3DECL(int)      PGMR3DbgScanVirtual(PVM pVM, PVMCPU pVCpu, RTGCPTR GCPtr, RTGCPTR cbRange, RTGCPTR GCPtrAlign, const uint8_t *pabNeedle, size_t cbNeedle, PRTGCUINTPTR pGCPhysHit);
     557VMMR3DECL(int)      PGMR3DbgR3Ptr2GCPhys(PUVM pUVM, RTR3PTR R3Ptr, PRTGCPHYS pGCPhys);
     558VMMR3DECL(int)      PGMR3DbgR3Ptr2HCPhys(PUVM pUVM, RTR3PTR R3Ptr, PRTHCPHYS pHCPhys);
     559VMMR3DECL(int)      PGMR3DbgHCPhys2GCPhys(PUVM pUVM, RTHCPHYS HCPhys, PRTGCPHYS pGCPhys);
     560VMMR3_INT_DECL(int) PGMR3DbgReadGCPhys(PVM pVM, void *pvDst, RTGCPHYS GCPhysSrc, size_t cb, uint32_t fFlags, size_t *pcbRead);
     561VMMR3_INT_DECL(int) PGMR3DbgWriteGCPhys(PVM pVM, RTGCPHYS GCPhysDst, const void *pvSrc, size_t cb, uint32_t fFlags, size_t *pcbWritten);
     562VMMR3_INT_DECL(int) PGMR3DbgReadGCPtr(PVM pVM, void *pvDst, RTGCPTR GCPtrSrc, size_t cb, uint32_t fFlags, size_t *pcbRead);
     563VMMR3_INT_DECL(int) PGMR3DbgWriteGCPtr(PVM pVM, RTGCPTR GCPtrDst, void const *pvSrc, size_t cb, uint32_t fFlags, size_t *pcbWritten);
     564VMMR3_INT_DECL(int) PGMR3DbgScanPhysical(PVM pVM, RTGCPHYS GCPhys, RTGCPHYS cbRange, RTGCPHYS GCPhysAlign, const uint8_t *pabNeedle, size_t cbNeedle, PRTGCPHYS pGCPhysHit);
     565VMMR3_INT_DECL(int) PGMR3DbgScanVirtual(PVM pVM, PVMCPU pVCpu, RTGCPTR GCPtr, RTGCPTR cbRange, RTGCPTR GCPtrAlign, const uint8_t *pabNeedle, size_t cbNeedle, PRTGCUINTPTR pGCPhysHit);
    566566VMMR3_INT_DECL(int) PGMR3DumpHierarchyShw(PVM pVM, uint64_t cr3, uint32_t fFlags, uint64_t u64FirstAddr, uint64_t u64LastAddr, uint32_t cMaxDepth, PCDBGFINFOHLP pHlp);
    567567VMMR3_INT_DECL(int) PGMR3DumpHierarchyGst(PVM pVM, uint64_t cr3, uint32_t fFlags, RTGCPTR FirstAddr, RTGCPTR LastAddr, uint32_t cMaxDepth, PCDBGFINFOHLP pHlp);
  • trunk/include/VBox/vmm/uvm.h

    r39917 r44399  
    5656        uint8_t                     padding[512];
    5757    } vm;
     58
     59    /** The DBGF data. */
     60    union
     61    {
     62#ifdef ___DBGFInternal_h
     63        struct DBGFUSERPERVMCPU     s;
     64#endif
     65        uint8_t                     padding[64];
     66    } dbgf;
     67
    5868} UVMCPU;
    5969AssertCompileMemberAlignment(UVMCPU, vm, 32);
     
    127137    } stam;
    128138
     139    /** The DBGF data. */
     140    union
     141    {
     142#ifdef ___DBGFInternal_h
     143        struct DBGFUSERPERVM    s;
     144#endif
     145        uint8_t                 padding[256];
     146    } dbgf;
     147
    129148    /** Per virtual CPU data. */
    130149    UVMCPU                      aCpus[1];
  • trunk/include/VBox/vmm/vmapi.h

    r44393 r44399  
    105105typedef FNVMATERROR *PFNVMATERROR;
    106106
    107 VMMDECL(int) VMSetError(PVM pVM, int rc, RT_SRC_POS_DECL, const char *pszFormat, ...);
    108 VMMDECL(int) VMSetErrorV(PVM pVM, int rc, RT_SRC_POS_DECL, const char *pszFormat, va_list args);
     107VMMDECL(int)    VMSetError(PVM pVM, int rc, RT_SRC_POS_DECL, const char *pszFormat, ...);
     108VMMDECL(int)    VMSetErrorV(PVM pVM, int rc, RT_SRC_POS_DECL, const char *pszFormat, va_list args);
    109109
    110110/** @def VM_SET_ERROR
     
    122122 */
    123123#define VM_SET_ERROR(pVM, rc, pszMessage)   (VMSetError(pVM, rc, RT_SRC_POS, pszMessage))
     124
     125/** @def VM_SET_ERROR
     126 * Macro for setting a simple VM error message.
     127 * Don't use '%' in the message!
     128 *
     129 * @returns rc. Meaning you can do:
     130 *    @code
     131 *    return VM_SET_ERROR(pVM, VERR_OF_YOUR_CHOICE, "descriptive message");
     132 *    @endcode
     133 * @param   pVM             VM handle.
     134 * @param   rc              VBox status code.
     135 * @param   pszMessage      Error message string.
     136 * @thread  Any
     137 */
     138#define VM_SET_ERROR_U(a_pUVM, a_rc, a_pszMessage)   (VMR3SetError(a_pUVM, a_rc, RT_SRC_POS, a_pszMessage))
    124139
    125140
     
    366381VMMR3DECL(int)          VMR3AtErrorRegister(PUVM pUVM, PFNVMATERROR pfnAtError, void *pvUser);
    367382VMMR3DECL(int)          VMR3AtErrorDeregister(PUVM pUVM, PFNVMATERROR pfnAtError, void *pvUser);
     383VMMR3DECL(int)          VMR3SetError(PUVM pUVM, int rc, RT_SRC_POS_DECL, const char *pszFormat, ...);
     384VMMR3DECL(int)          VMR3SetErrorV(PUVM pUVM, int rc, RT_SRC_POS_DECL, const char *pszFormat, va_list va);
    368385VMMR3_INT_DECL(void)    VMR3SetErrorWorker(PVM pVM);
    369386VMMR3_INT_DECL(uint32_t) VMR3GetErrorCount(PUVM pUVM);
  • trunk/src/VBox/Debugger/DBGCCmdHlp.cpp

    r41573 r44399  
    316316 * @interface_method_impl{DBGCCMDHLP,pfnMemRead}
    317317 */
    318 static DECLCALLBACK(int) dbgcHlpMemRead(PDBGCCMDHLP pCmdHlp, PVM pVM, void *pvBuffer, size_t cbRead, PCDBGCVAR pVarPointer, size_t *pcbRead)
     318static DECLCALLBACK(int) dbgcHlpMemRead(PDBGCCMDHLP pCmdHlp, void *pvBuffer, size_t cbRead, PCDBGCVAR pVarPointer, size_t *pcbRead)
    319319{
    320320    PDBGC       pDbgc = DBGC_CMDHLP2DBGC(pCmdHlp);
     
    341341        case DBGCVAR_TYPE_GC_FAR:
    342342            /* Use DBGFR3AddrFromSelOff for the conversion. */
    343             Assert(pDbgc->pVM);
    344             rc = DBGFR3AddrFromSelOff(pDbgc->pVM, pDbgc->idCpu, &Address, Var.u.GCFar.sel, Var.u.GCFar.off);
     343            Assert(pDbgc->pUVM);
     344            rc = DBGFR3AddrFromSelOff(pDbgc->pUVM, pDbgc->idCpu, &Address, Var.u.GCFar.sel, Var.u.GCFar.off);
    345345            if (RT_FAILURE(rc))
    346346                return rc;
     
    350350            {
    351351                DBGFSELINFO SelInfo;
    352                 rc = DBGFR3SelQueryInfo(pDbgc->pVM, pDbgc->idCpu, Address.Sel,
     352                rc = DBGFR3SelQueryInfo(pDbgc->pUVM, pDbgc->idCpu, Address.Sel,
    353353                                        DBGFSELQI_FLAGS_DT_GUEST | DBGFSELQI_FLAGS_DT_ADJ_64BIT_MODE, &SelInfo);
    354354                if (RT_SUCCESS(rc))
     
    419419        {
    420420            case DBGCVAR_TYPE_GC_FLAT:
    421                 rc = DBGFR3MemRead(pDbgc->pVM, pDbgc->idCpu,
    422                                    DBGFR3AddrFromFlat(pVM, &Address, Var.u.GCFlat),
     421                rc = DBGFR3MemRead(pDbgc->pUVM, pDbgc->idCpu,
     422                                   DBGFR3AddrFromFlat(pDbgc->pUVM, &Address, Var.u.GCFlat),
    423423                                   pvBuffer, cb);
    424424                break;
    425425
    426426            case DBGCVAR_TYPE_GC_PHYS:
    427                 rc = DBGFR3MemRead(pDbgc->pVM, pDbgc->idCpu,
    428                                    DBGFR3AddrFromPhys(pVM, &Address, Var.u.GCPhys),
     427                rc = DBGFR3MemRead(pDbgc->pUVM, pDbgc->idCpu,
     428                                   DBGFR3AddrFromPhys(pDbgc->pUVM, &Address, Var.u.GCPhys),
    429429                                   pvBuffer, cb);
    430430                break;
     
    488488 * @interface_method_impl{DBGCCMDHLP,pfnMemWrite}
    489489 */
    490 static DECLCALLBACK(int) dbgcHlpMemWrite(PDBGCCMDHLP pCmdHlp, PVM pVM, const void *pvBuffer, size_t cbWrite, PCDBGCVAR pVarPointer, size_t *pcbWritten)
     490static DECLCALLBACK(int) dbgcHlpMemWrite(PDBGCCMDHLP pCmdHlp, const void *pvBuffer, size_t cbWrite, PCDBGCVAR pVarPointer, size_t *pcbWritten)
    491491{
    492492    PDBGC       pDbgc = DBGC_CMDHLP2DBGC(pCmdHlp);
     
    514514        {
    515515            /* Use DBGFR3AddrFromSelOff for the conversion. */
    516             Assert(pDbgc->pVM);
    517             rc = DBGFR3AddrFromSelOff(pDbgc->pVM, pDbgc->idCpu, &Address, Var.u.GCFar.sel, Var.u.GCFar.off);
     516            Assert(pDbgc->pUVM);
     517            rc = DBGFR3AddrFromSelOff(pDbgc->pUVM, pDbgc->idCpu, &Address, Var.u.GCFar.sel, Var.u.GCFar.off);
    518518            if (RT_FAILURE(rc))
    519519                return rc;
     
    523523            {
    524524                DBGFSELINFO SelInfo;
    525                 rc = DBGFR3SelQueryInfo(pDbgc->pVM, pDbgc->idCpu, Address.Sel,
     525                rc = DBGFR3SelQueryInfo(pDbgc->pUVM, pDbgc->idCpu, Address.Sel,
    526526                                        DBGFSELQI_FLAGS_DT_GUEST | DBGFSELQI_FLAGS_DT_ADJ_64BIT_MODE, &SelInfo);
    527527                if (RT_SUCCESS(rc))
     
    556556        /* fall thru */
    557557        case DBGCVAR_TYPE_GC_FLAT:
    558             rc = DBGFR3MemWrite(pVM, pDbgc->idCpu,
    559                                 DBGFR3AddrFromFlat(pVM, &Address, Var.u.GCFlat),
     558            rc = DBGFR3MemWrite(pDbgc->pUVM, pDbgc->idCpu,
     559                                DBGFR3AddrFromFlat(pDbgc->pUVM, &Address, Var.u.GCFlat),
    560560                                pvBuffer, cbWrite);
    561561            if (pcbWritten && RT_SUCCESS(rc))
     
    564564
    565565        case DBGCVAR_TYPE_GC_PHYS:
    566             rc = DBGFR3MemWrite(pVM, pDbgc->idCpu,
    567                                 DBGFR3AddrFromPhys(pVM, &Address, Var.u.GCPhys),
     566            rc = DBGFR3MemWrite(pDbgc->pUVM, pDbgc->idCpu,
     567                                DBGFR3AddrFromPhys(pDbgc->pUVM, &Address, Var.u.GCPhys),
    568568                                pvBuffer, cbWrite);
    569569            if (pcbWritten && RT_SUCCESS(rc))
     
    734734    {
    735735        case DBGCVAR_TYPE_GC_FLAT:
    736             DBGFR3AddrFromFlat(pDbgc->pVM, pAddress, pVar->u.GCFlat);
     736            DBGFR3AddrFromFlat(pDbgc->pUVM, pAddress, pVar->u.GCFlat);
    737737            return VINF_SUCCESS;
    738738
    739739        case DBGCVAR_TYPE_NUMBER:
    740             DBGFR3AddrFromFlat(pDbgc->pVM, pAddress, (RTGCUINTPTR)pVar->u.u64Number);
     740            DBGFR3AddrFromFlat(pDbgc->pUVM, pAddress, (RTGCUINTPTR)pVar->u.u64Number);
    741741            return VINF_SUCCESS;
    742742
    743743        case DBGCVAR_TYPE_GC_FAR:
    744             return DBGFR3AddrFromSelOff(pDbgc->pVM, pDbgc->idCpu, pAddress, pVar->u.GCFar.sel, pVar->u.GCFar.off);
     744            return DBGFR3AddrFromSelOff(pDbgc->pUVM, pDbgc->idCpu, pAddress, pVar->u.GCFar.sel, pVar->u.GCFar.off);
    745745
    746746        case DBGCVAR_TYPE_GC_PHYS:
    747             DBGFR3AddrFromPhys(pDbgc->pVM, pAddress, pVar->u.GCPhys);
     747            DBGFR3AddrFromPhys(pDbgc->pUVM, pAddress, pVar->u.GCPhys);
    748748            return VINF_SUCCESS;
    749749
     
    923923    int             rc;
    924924
    925     Assert(pDbgc->pVM);
     925    Assert(pDbgc->pUVM);
    926926
    927927    *pResult = InVar;
     
    939939                case DBGCVAR_TYPE_GC_PHYS:
    940940                    pResult->enmType = DBGCVAR_TYPE_GC_PHYS;
    941                     rc = DBGFR3AddrToPhys(pDbgc->pVM, pDbgc->idCpu,
    942                                           DBGFR3AddrFromFlat(pDbgc->pVM, &Address, pArg->u.GCFlat),
     941                    rc = DBGFR3AddrToPhys(pDbgc->pUVM, pDbgc->idCpu,
     942                                          DBGFR3AddrFromFlat(pDbgc->pUVM, &Address, pArg->u.GCFlat),
    943943                                          &pResult->u.GCPhys);
    944944                    if (RT_SUCCESS(rc))
     
    948948                case DBGCVAR_TYPE_HC_FLAT:
    949949                    pResult->enmType = DBGCVAR_TYPE_HC_FLAT;
    950                     rc = DBGFR3AddrToVolatileR3Ptr(pDbgc->pVM, pDbgc->idCpu,
    951                                                    DBGFR3AddrFromFlat(pDbgc->pVM, &Address, pArg->u.GCFlat),
     950                    rc = DBGFR3AddrToVolatileR3Ptr(pDbgc->pUVM, pDbgc->idCpu,
     951                                                   DBGFR3AddrFromFlat(pDbgc->pUVM, &Address, pArg->u.GCFlat),
    952952                                                   false /*fReadOnly */,
    953953                                                   &pResult->u.pvHCFlat);
     
    958958                case DBGCVAR_TYPE_HC_PHYS:
    959959                    pResult->enmType = DBGCVAR_TYPE_HC_PHYS;
    960                     rc = DBGFR3AddrToHostPhys(pDbgc->pVM, pDbgc->idCpu,
    961                                               DBGFR3AddrFromFlat(pDbgc->pVM, &Address, pArg->u.GCFlat),
     960                    rc = DBGFR3AddrToHostPhys(pDbgc->pUVM, pDbgc->idCpu,
     961                                              DBGFR3AddrFromFlat(pDbgc->pUVM, &Address, pArg->u.GCFlat),
    962962                                              &pResult->u.GCPhys);
    963963                    if (RT_SUCCESS(rc))
     
    984984            {
    985985                case DBGCVAR_TYPE_GC_FLAT:
    986                     rc = DBGFR3AddrFromSelOff(pDbgc->pVM, pDbgc->idCpu, &Address, pArg->u.GCFar.sel, pArg->u.GCFar.off);
     986                    rc = DBGFR3AddrFromSelOff(pDbgc->pUVM, pDbgc->idCpu, &Address, pArg->u.GCFar.sel, pArg->u.GCFar.off);
    987987                    if (RT_SUCCESS(rc))
    988988                    {
     
    997997
    998998                case DBGCVAR_TYPE_GC_PHYS:
    999                     rc = DBGFR3AddrFromSelOff(pDbgc->pVM, pDbgc->idCpu, &Address, pArg->u.GCFar.sel, pArg->u.GCFar.off);
     999                    rc = DBGFR3AddrFromSelOff(pDbgc->pUVM, pDbgc->idCpu, &Address, pArg->u.GCFar.sel, pArg->u.GCFar.off);
    10001000                    if (RT_SUCCESS(rc))
    10011001                    {
    10021002                        pResult->enmType = DBGCVAR_TYPE_GC_PHYS;
    1003                         rc = DBGFR3AddrToPhys(pDbgc->pVM, pDbgc->idCpu, &Address, &pResult->u.GCPhys);
     1003                        rc = DBGFR3AddrToPhys(pDbgc->pUVM, pDbgc->idCpu, &Address, &pResult->u.GCPhys);
    10041004                        if (RT_SUCCESS(rc))
    10051005                            return VINF_SUCCESS;
     
    10081008
    10091009                case DBGCVAR_TYPE_HC_FLAT:
    1010                     rc = DBGFR3AddrFromSelOff(pDbgc->pVM, pDbgc->idCpu, &Address, pArg->u.GCFar.sel, pArg->u.GCFar.off);
     1010                    rc = DBGFR3AddrFromSelOff(pDbgc->pUVM, pDbgc->idCpu, &Address, pArg->u.GCFar.sel, pArg->u.GCFar.off);
    10111011                    if (RT_SUCCESS(rc))
    10121012                    {
    10131013                        pResult->enmType = DBGCVAR_TYPE_HC_FLAT;
    1014                         rc = DBGFR3AddrToVolatileR3Ptr(pDbgc->pVM, pDbgc->idCpu, &Address,
     1014                        rc = DBGFR3AddrToVolatileR3Ptr(pDbgc->pUVM, pDbgc->idCpu, &Address,
    10151015                                                       false /*fReadOnly*/, &pResult->u.pvHCFlat);
    10161016                        if (RT_SUCCESS(rc))
     
    10201020
    10211021                case DBGCVAR_TYPE_HC_PHYS:
    1022                     rc = DBGFR3AddrFromSelOff(pDbgc->pVM, pDbgc->idCpu, &Address, pArg->u.GCFar.sel, pArg->u.GCFar.off);
     1022                    rc = DBGFR3AddrFromSelOff(pDbgc->pUVM, pDbgc->idCpu, &Address, pArg->u.GCFar.sel, pArg->u.GCFar.off);
    10231023                    if (RT_SUCCESS(rc))
    10241024                    {
    10251025                        pResult->enmType = DBGCVAR_TYPE_HC_PHYS;
    1026                         rc = DBGFR3AddrToHostPhys(pDbgc->pVM, pDbgc->idCpu, &Address, &pResult->u.GCPhys);
     1026                        rc = DBGFR3AddrToHostPhys(pDbgc->pUVM, pDbgc->idCpu, &Address, &pResult->u.GCPhys);
    10271027                        if (RT_SUCCESS(rc))
    10281028                            return VINF_SUCCESS;
     
    10601060                case DBGCVAR_TYPE_HC_FLAT:
    10611061                    pResult->enmType = DBGCVAR_TYPE_HC_FLAT;
    1062                     rc = DBGFR3AddrToVolatileR3Ptr(pDbgc->pVM, pDbgc->idCpu,
    1063                                                    DBGFR3AddrFromPhys(pDbgc->pVM, &Address, pArg->u.GCPhys),
     1062                    rc = DBGFR3AddrToVolatileR3Ptr(pDbgc->pUVM, pDbgc->idCpu,
     1063                                                   DBGFR3AddrFromPhys(pDbgc->pUVM, &Address, pArg->u.GCPhys),
    10641064                                                   false /*fReadOnly */,
    10651065                                                   &pResult->u.pvHCFlat);
     
    10701070                case DBGCVAR_TYPE_HC_PHYS:
    10711071                    pResult->enmType = DBGCVAR_TYPE_HC_PHYS;
    1072                     rc = DBGFR3AddrToHostPhys(pDbgc->pVM, pDbgc->idCpu,
    1073                                               DBGFR3AddrFromPhys(pDbgc->pVM, &Address, pArg->u.GCPhys),
     1072                    rc = DBGFR3AddrToHostPhys(pDbgc->pUVM, pDbgc->idCpu,
     1073                                              DBGFR3AddrFromPhys(pDbgc->pUVM, &Address, pArg->u.GCPhys),
    10741074                                              &pResult->u.HCPhys);
    10751075                    if (RT_SUCCESS(rc))
     
    11031103                case DBGCVAR_TYPE_GC_PHYS:
    11041104                    pResult->enmType = DBGCVAR_TYPE_GC_PHYS;
    1105                     rc = PGMR3DbgR3Ptr2GCPhys(pDbgc->pVM, pArg->u.pvHCFlat, &pResult->u.GCPhys);
     1105                    rc = PGMR3DbgR3Ptr2GCPhys(pDbgc->pUVM, pArg->u.pvHCFlat, &pResult->u.GCPhys);
    11061106                    if (RT_SUCCESS(rc))
    11071107                        return VINF_SUCCESS;
     
    11141114                case DBGCVAR_TYPE_HC_PHYS:
    11151115                    pResult->enmType = DBGCVAR_TYPE_HC_PHYS;
    1116                     rc = PGMR3DbgR3Ptr2HCPhys(pDbgc->pVM, pArg->u.pvHCFlat, &pResult->u.HCPhys);
     1116                    rc = PGMR3DbgR3Ptr2HCPhys(pDbgc->pUVM, pArg->u.pvHCFlat, &pResult->u.HCPhys);
    11171117                    if (RT_SUCCESS(rc))
    11181118                        return VINF_SUCCESS;
     
    11461146                case DBGCVAR_TYPE_GC_PHYS:
    11471147                    pResult->enmType = DBGCVAR_TYPE_GC_PHYS;
    1148                     rc = PGMR3DbgHCPhys2GCPhys(pDbgc->pVM, pArg->u.HCPhys, &pResult->u.GCPhys);
     1148                    rc = PGMR3DbgHCPhys2GCPhys(pDbgc->pUVM, pArg->u.HCPhys, &pResult->u.GCPhys);
    11491149                    if (RT_SUCCESS(rc))
    11501150                        return VINF_SUCCESS;
     
    13101310    if (pDbgc->fRegCtxGuest)
    13111311    {
    1312         if (pDbgc->pVM)
    1313             enmMode = DBGFR3CpuGetMode(pDbgc->pVM, DBGCCmdHlpGetCurrentCpu(pCmdHlp));
     1312        if (pDbgc->pUVM)
     1313            enmMode = DBGFR3CpuGetMode(pDbgc->pUVM, DBGCCmdHlpGetCurrentCpu(pCmdHlp));
    13141314        if (enmMode == CPUMMODE_INVALID)
    13151315#if HC_ARCH_BITS == 64
  • trunk/src/VBox/Debugger/DBGCCommands.cpp

    r41938 r44399  
    4848*   Internal Functions                                                         *
    4949*******************************************************************************/
    50 static DECLCALLBACK(int) dbgcCmdHelp(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
    51 static DECLCALLBACK(int) dbgcCmdQuit(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
    52 static DECLCALLBACK(int) dbgcCmdStop(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
    53 static DECLCALLBACK(int) dbgcCmdDetect(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
    54 static DECLCALLBACK(int) dbgcCmdCpu(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
    55 static DECLCALLBACK(int) dbgcCmdInfo(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
    56 static DECLCALLBACK(int) dbgcCmdLog(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
    57 static DECLCALLBACK(int) dbgcCmdLogDest(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
    58 static DECLCALLBACK(int) dbgcCmdLogFlags(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
    59 static DECLCALLBACK(int) dbgcCmdFormat(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
    60 static DECLCALLBACK(int) dbgcCmdLoadImage(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
    61 static DECLCALLBACK(int) dbgcCmdLoadMap(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
    62 static DECLCALLBACK(int) dbgcCmdLoadSeg(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
    63 static DECLCALLBACK(int) dbgcCmdLoadSyms(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
    64 static DECLCALLBACK(int) dbgcCmdSet(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
    65 static DECLCALLBACK(int) dbgcCmdUnset(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
    66 static DECLCALLBACK(int) dbgcCmdLoadVars(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
    67 static DECLCALLBACK(int) dbgcCmdShowVars(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
    68 static DECLCALLBACK(int) dbgcCmdLoadPlugIn(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
    69 static DECLCALLBACK(int) dbgcCmdUnloadPlugIn(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
    70 static DECLCALLBACK(int) dbgcCmdShowPlugIns(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
    71 static DECLCALLBACK(int) dbgcCmdHarakiri(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
    72 static DECLCALLBACK(int) dbgcCmdEcho(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
    73 static DECLCALLBACK(int) dbgcCmdRunScript(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
    74 static DECLCALLBACK(int) dbgcCmdWriteCore(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
     50static FNDBGCCMD dbgcCmdHelp;
     51static FNDBGCCMD dbgcCmdQuit;
     52static FNDBGCCMD dbgcCmdStop;
     53static FNDBGCCMD dbgcCmdDetect;
     54static FNDBGCCMD dbgcCmdCpu;
     55static FNDBGCCMD dbgcCmdInfo;
     56static FNDBGCCMD dbgcCmdLog;
     57static FNDBGCCMD dbgcCmdLogDest;
     58static FNDBGCCMD dbgcCmdLogFlags;
     59static FNDBGCCMD dbgcCmdFormat;
     60static FNDBGCCMD dbgcCmdLoadImage;
     61static FNDBGCCMD dbgcCmdLoadMap;
     62static FNDBGCCMD dbgcCmdLoadSeg;
     63static FNDBGCCMD dbgcCmdLoadSyms;
     64static FNDBGCCMD dbgcCmdSet;
     65static FNDBGCCMD dbgcCmdUnset;
     66static FNDBGCCMD dbgcCmdLoadVars;
     67static FNDBGCCMD dbgcCmdShowVars;
     68static FNDBGCCMD dbgcCmdLoadPlugIn;
     69static FNDBGCCMD dbgcCmdUnloadPlugIn;
     70static FNDBGCCMD dbgcCmdShowPlugIns;
     71static FNDBGCCMD dbgcCmdHarakiri;
     72static FNDBGCCMD dbgcCmdEcho;
     73static FNDBGCCMD dbgcCmdRunScript;
     74static FNDBGCCMD dbgcCmdWriteCore;
    7575
    7676
     
    718718
    719719/**
    720  * The 'help' command.
    721  *
    722  * @returns VBox status.
    723  * @param   pCmd        Pointer to the command descriptor (as registered).
    724  * @param   pCmdHlp     Pointer to command helper functions.
    725  * @param   pVM         Pointer to the current VM (if any).
    726  * @param   paArgs      Pointer to (readonly) array of arguments.
    727  * @param   cArgs       Number of arguments in the array.
    728  */
    729 static DECLCALLBACK(int) dbgcCmdHelp(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
     720 * @interface_method_impl{FNDBCCMD, The 'help' command.}
     721 */
     722static DECLCALLBACK(int) dbgcCmdHelp(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
    730723{
    731724    PDBGC       pDbgc = DBGC_CMDHLP2DBGC(pCmdHlp);
     
    833826
    834827    NOREF(pCmd);
    835     NOREF(pVM);
     828    NOREF(pUVM);
    836829    return rc;
    837830}
     
    839832
    840833/**
    841  * The 'quit', 'exit' and 'bye' commands.
    842  *
    843  * @returns VBox status.
    844  * @param   pCmd        Pointer to the command descriptor (as registered).
    845  * @param   pCmdHlp     Pointer to command helper functions.
    846  * @param   pVM         Pointer to the current VM (if any).
    847  * @param   paArgs      Pointer to (readonly) array of arguments.
    848  * @param   cArgs       Number of arguments in the array.
    849  */
    850 static DECLCALLBACK(int) dbgcCmdQuit(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
    851 {
    852     pCmdHlp->pfnPrintf(pCmdHlp, NULL, "Quitting console...\n");
     834 * @interface_method_impl{FNDBCCMD, The 'quit', 'exit' and 'bye' commands. }
     835 */
     836static DECLCALLBACK(int) dbgcCmdQuit(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
     837{
     838    DBGCCmdHlpPrintf(pCmdHlp, "Quitting console...\n");
    853839    NOREF(pCmd);
    854     NOREF(pVM);
     840    NOREF(pUVM);
    855841    NOREF(paArgs);
    856842    NOREF(cArgs);
     
    860846
    861847/**
    862  * The 'stop' command.
    863  *
    864  * @returns VBox status.
    865  * @param   pCmd        Pointer to the command descriptor (as registered).
    866  * @param   pCmdHlp     Pointer to command helper functions.
    867  * @param   pVM         Pointer to the current VM (if any).
    868  * @param   paArgs      Pointer to (readonly) array of arguments.
    869  * @param   cArgs       Number of arguments in the array.
    870  */
    871 static DECLCALLBACK(int) dbgcCmdStop(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
     848 * @interface_method_impl{FNDBCCMD, The 'stop' command.}
     849 */
     850static DECLCALLBACK(int) dbgcCmdStop(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
    872851{
    873852    /*
     
    875854     */
    876855    int rc;
    877     if (DBGFR3IsHalted(pVM))
    878         rc = pCmdHlp->pfnPrintf(pCmdHlp, NULL, "warning: The VM is already halted...\n");
     856    if (DBGFR3IsHalted(pUVM))
     857        rc = DBGCCmdHlpPrintf(pCmdHlp, "warning: The VM is already halted...\n");
    879858    else
    880859    {
    881         rc = DBGFR3Halt(pVM);
     860        rc = DBGFR3Halt(pUVM);
    882861        if (RT_SUCCESS(rc))
    883862            rc = VWRN_DBGC_CMD_PENDING;
    884863        else
    885             rc = pCmdHlp->pfnVBoxError(pCmdHlp, rc, "Executing DBGFR3Halt().");
     864            rc = DBGCCmdHlpVBoxError(pCmdHlp, rc, "Executing DBGFR3Halt().");
    886865    }
    887866
     
    892871
    893872/**
    894  * The 'echo' command.
    895  *
    896  * @returns VBox status.
    897  * @param   pCmd        Pointer to the command descriptor (as registered).
    898  * @param   pCmdHlp     Pointer to command helper functions.
    899  * @param   pVM         Pointer to the current VM (if any).
    900  * @param   paArgs      Pointer to (readonly) array of arguments.
    901  * @param   cArgs       Number of arguments in the array.
    902  */
    903 static DECLCALLBACK(int) dbgcCmdEcho(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
     873 * @interface_method_impl{FNDBCCMD, The 'echo' command.}
     874 */
     875static DECLCALLBACK(int) dbgcCmdEcho(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
    904876{
    905877    /*
     
    910882    {
    911883        AssertReturn(paArgs[i].enmType == DBGCVAR_TYPE_STRING, VERR_DBGC_PARSE_BUG);
    912         rc = pCmdHlp->pfnPrintf(pCmdHlp, NULL, i ? " %s" : "%s", paArgs[i].u.pszString);
     884        rc = DBGCCmdHlpPrintf(pCmdHlp, i ? " %s" : "%s", paArgs[i].u.pszString);
    913885        if (RT_FAILURE(rc))
    914886            return rc;
    915887    }
    916     NOREF(pCmd); NOREF(pVM);
    917     return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "\n");
    918 }
    919 
    920 
    921 /**
    922  * The 'runscript' command.
    923  *
    924  * @returns VBox status.
    925  * @param   pCmd        Pointer to the command descriptor (as registered).
    926  * @param   pCmdHlp     Pointer to command helper functions.
    927  * @param   pVM         Pointer to the current VM (if any).
    928  * @param   paArgs      Pointer to (readonly) array of arguments.
    929  * @param   cArgs       Number of arguments in the array.
    930  */
    931 static DECLCALLBACK(int) dbgcCmdRunScript(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
     888    NOREF(pCmd); NOREF(pUVM);
     889    return DBGCCmdHlpPrintf(pCmdHlp, "\n");
     890}
     891
     892
     893/**
     894 * @interface_method_impl{FNDBCCMD, The 'runscript' command.}
     895 */
     896static DECLCALLBACK(int) dbgcCmdRunScript(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
    932897{
    933898    /* check that the parser did what it's supposed to do. */
    934899    if (    cArgs != 1
    935900        ||  paArgs[0].enmType != DBGCVAR_TYPE_STRING)
    936         return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "parser error\n");
     901        return DBGCCmdHlpPrintf(pCmdHlp, "parser error\n");
    937902
    938903    /** @todo Load the script here, but someone else should do the actual
     
    945910    FILE *pFile = fopen(pszFilename, "r");
    946911    if (!pFile)
    947         return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "Failed to open '%s'.\n", pszFilename);
     912        return DBGCCmdHlpPrintf(pCmdHlp, "Failed to open '%s'.\n", pszFilename);
    948913
    949914    /*
     
    959924        if (pszEnd == &szLine[sizeof(szLine) - 1])
    960925        {
    961             rc = pCmdHlp->pfnPrintf(pCmdHlp, NULL, "runscript error: Line #%u is too long\n", iLine);
     926            rc = DBGCCmdHlpPrintf(pCmdHlp, "runscript error: Line #%u is too long\n", iLine);
    962927            break;
    963928        }
     
    990955        {
    991956            if (rc == VERR_BUFFER_OVERFLOW)
    992                 rc = pCmdHlp->pfnPrintf(pCmdHlp, NULL, "runscript error: Line #%u is too long (exec overflowed)\n", iLine);
     957                rc = DBGCCmdHlpPrintf(pCmdHlp, "runscript error: Line #%u is too long (exec overflowed)\n", iLine);
    993958            break;
    994959        }
    995960        if (rc == VWRN_DBGC_CMD_PENDING)
    996961        {
    997             rc = pCmdHlp->pfnPrintf(pCmdHlp, NULL, "runscript error: VWRN_DBGC_CMD_PENDING on line #%u, script terminated\n", iLine);
     962            rc = DBGCCmdHlpPrintf(pCmdHlp, "runscript error: VWRN_DBGC_CMD_PENDING on line #%u, script terminated\n", iLine);
    998963            break;
    999964        }
     
    1002967    fclose(pFile);
    1003968
    1004     NOREF(pCmd); NOREF(pVM);
     969    NOREF(pCmd); NOREF(pUVM);
    1005970    return rc;
    1006971}
     
    1008973
    1009974/**
    1010  * The 'detect' command.
    1011  *
    1012  * @returns VBox status.
    1013  * @param   pCmd        Pointer to the command descriptor (as registered).
    1014  * @param   pCmdHlp     Pointer to command helper functions.
    1015  * @param   pVM         Pointer to the current VM (if any).
    1016  * @param   paArgs      Pointer to (readonly) array of arguments.
    1017  * @param   cArgs       Number of arguments in the array.
    1018  */
    1019 static DECLCALLBACK(int) dbgcCmdDetect(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
     975 * @interface_method_impl{FNDBCCMD, The 'detect' command.}
     976 */
     977static DECLCALLBACK(int) dbgcCmdDetect(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
    1020978{
    1021979    /* check that the parser did what it's supposed to do. */
    1022980    if (cArgs != 0)
    1023         return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "parser error\n");
     981        return DBGCCmdHlpPrintf(pCmdHlp, "parser error\n");
    1024982
    1025983    /*
     
    1027985     */
    1028986    char szName[64];
    1029     int rc = DBGFR3OSDetect(pVM, szName, sizeof(szName));
     987    int rc = DBGFR3OSDetect(pUVM, szName, sizeof(szName));
    1030988    if (RT_FAILURE(rc))
    1031         return pCmdHlp->pfnVBoxError(pCmdHlp, rc, "Executing DBGFR3OSDetect().");
     989        return DBGCCmdHlpVBoxError(pCmdHlp, rc, "Executing DBGFR3OSDetect().");
    1032990    if (rc == VINF_SUCCESS)
    1033991    {
    1034         rc = pCmdHlp->pfnPrintf(pCmdHlp, NULL, "Guest OS: %s\n", szName);
     992        rc = DBGCCmdHlpPrintf(pCmdHlp, "Guest OS: %s\n", szName);
    1035993        char szVersion[512];
    1036         int rc2 = DBGFR3OSQueryNameAndVersion(pVM, NULL, 0, szVersion, sizeof(szVersion));
     994        int rc2 = DBGFR3OSQueryNameAndVersion(pUVM, NULL, 0, szVersion, sizeof(szVersion));
    1037995        if (RT_SUCCESS(rc2))
    1038             rc = pCmdHlp->pfnPrintf(pCmdHlp, NULL, "Version : %s\n", szVersion);
     996            rc = DBGCCmdHlpPrintf(pCmdHlp, "Version : %s\n", szVersion);
    1039997    }
    1040998    else
    1041         rc = pCmdHlp->pfnPrintf(pCmdHlp, NULL, "Unable to figure out which guest OS it is, sorry.\n");
     999        rc = DBGCCmdHlpPrintf(pCmdHlp, "Unable to figure out which guest OS it is, sorry.\n");
    10421000    NOREF(pCmd); NOREF(paArgs);
    10431001    return rc;
     
    10461004
    10471005/**
    1048  * The 'cpu' command.
    1049  *
    1050  * @returns VBox status.
    1051  * @param   pCmd        Pointer to the command descriptor (as registered).
    1052  * @param   pCmdHlp     Pointer to command helper functions.
    1053  * @param   pVM         Pointer to the current VM (if any).
    1054  * @param   paArgs      Pointer to (readonly) array of arguments.
    1055  * @param   cArgs       Number of arguments in the array.
    1056  */
    1057 static DECLCALLBACK(int) dbgcCmdCpu(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
     1006 * @interface_method_impl{FNDBCCMD, The 'cpu' command.}
     1007 */
     1008static DECLCALLBACK(int) dbgcCmdCpu(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
    10581009{
    10591010    PDBGC       pDbgc = DBGC_CMDHLP2DBGC(pCmdHlp);
     
    10631014        &&  (   cArgs != 1
    10641015             || paArgs[0].enmType != DBGCVAR_TYPE_NUMBER))
    1065         return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "parser error\n");
    1066     if (!pVM)
    1067         return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "error: No VM.\n");
     1016        return DBGCCmdHlpPrintf(pCmdHlp, "parser error\n");
     1017    DBGC_CMDHLP_REQ_UVM_RET(pCmdHlp, pCmd, pUVM);
    10681018
    10691019    int rc;
    10701020    if (!cArgs)
    1071         rc = pCmdHlp->pfnPrintf(pCmdHlp, NULL, "Current CPU ID: %u\n", pDbgc->idCpu);
     1021        rc = DBGCCmdHlpPrintf(pCmdHlp, "Current CPU ID: %u\n", pDbgc->idCpu);
    10721022    else
    10731023    {
    1074 /** @todo add a DBGF getter for this. */
    1075         if (paArgs[0].u.u64Number >= pVM->cCpus)
    1076             rc = pCmdHlp->pfnPrintf(pCmdHlp, NULL, "error: idCpu %u is out of range! Highest ID is %u.\n",
    1077                                     paArgs[0].u.u64Number, pVM->cCpus);
     1024        VMCPUID cCpus = DBGFR3CpuGetCount(pUVM);
     1025        if (paArgs[0].u.u64Number >= cCpus)
     1026            rc = DBGCCmdHlpPrintf(pCmdHlp, "error: idCpu %u is out of range! Highest ID is %u.\n",
     1027                                    paArgs[0].u.u64Number, cCpus);
    10781028        else
    10791029        {
    1080             rc = pCmdHlp->pfnPrintf(pCmdHlp, NULL, "Changed CPU from %u to %u.\n",
     1030            rc = DBGCCmdHlpPrintf(pCmdHlp, "Changed CPU from %u to %u.\n",
    10811031                                    pDbgc->idCpu, (VMCPUID)paArgs[0].u.u64Number);
    10821032            pDbgc->idCpu = (VMCPUID)paArgs[0].u.u64Number;
     
    10881038
    10891039/**
    1090  * The 'info' command.
    1091  *
    1092  * @returns VBox status.
    1093  * @param   pCmd        Pointer to the command descriptor (as registered).
    1094  * @param   pCmdHlp     Pointer to command helper functions.
    1095  * @param   pVM         Pointer to the current VM (if any).
    1096  * @param   paArgs      Pointer to (readonly) array of arguments.
    1097  * @param   cArgs       Number of arguments in the array.
    1098  */
    1099 static DECLCALLBACK(int) dbgcCmdInfo(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
     1040 * @interface_method_impl{FNDBCCMD, The 'info' command.}
     1041 */
     1042static DECLCALLBACK(int) dbgcCmdInfo(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
    11001043{
    11011044    PDBGC       pDbgc = DBGC_CMDHLP2DBGC(pCmdHlp);
     
    11081051        ||  paArgs[0].enmType != DBGCVAR_TYPE_STRING
    11091052        ||  paArgs[cArgs - 1].enmType != DBGCVAR_TYPE_STRING)
    1110         return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "internal error: The parser doesn't do its job properly yet.. quote the string.\n");
    1111     if (!pVM)
    1112         return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "error: No VM.\n");
     1053        return DBGCCmdHlpPrintf(pCmdHlp, "internal error: The parser doesn't do its job properly yet.. quote the string.\n");
     1054    DBGC_CMDHLP_REQ_UVM_RET(pCmdHlp, pCmd, pUVM);
    11131055
    11141056    /*
    11151057     * Dump it.
    11161058     */
    1117     int rc = DBGFR3InfoEx(pVM, pDbgc->idCpu,
     1059    int rc = DBGFR3InfoEx(pUVM, pDbgc->idCpu,
    11181060                          paArgs[0].u.pszString,
    11191061                          cArgs == 2 ? paArgs[1].u.pszString : NULL,
    11201062                          DBGCCmdHlpGetDbgfOutputHlp(pCmdHlp));
    11211063    if (RT_FAILURE(rc))
    1122         return pCmdHlp->pfnVBoxError(pCmdHlp, rc, "DBGFR3InfoEx()\n");
     1064        return DBGCCmdHlpVBoxError(pCmdHlp, rc, "DBGFR3InfoEx()\n");
    11231065
    11241066    NOREF(pCmd);
     
    11281070
    11291071/**
    1130  * The 'log' command.
    1131  *
    1132  * @returns VBox status.
    1133  * @param   pCmd        Pointer to the command descriptor (as registered).
    1134  * @param   pCmdHlp     Pointer to command helper functions.
    1135  * @param   pVM         Pointer to the current VM (if any).
    1136  * @param   paArgs      Pointer to (readonly) array of arguments.
    1137  * @param   cArgs       Number of arguments in the array.
    1138  */
    1139 static DECLCALLBACK(int) dbgcCmdLog(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
    1140 {
    1141     int rc = DBGFR3LogModifyGroups(pVM, paArgs[0].u.pszString);
     1072 * @interface_method_impl{FNDBCCMD, The 'log' command.}
     1073 */
     1074static DECLCALLBACK(int) dbgcCmdLog(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
     1075{
     1076    int rc = DBGFR3LogModifyGroups(pUVM, paArgs[0].u.pszString);
    11421077    if (RT_SUCCESS(rc))
    11431078        return VINF_SUCCESS;
    11441079    NOREF(pCmd); NOREF(cArgs);
    1145     return pCmdHlp->pfnVBoxError(pCmdHlp, rc, "DBGFR3LogModifyGroups(%p,'%s')\n", pVM, paArgs[0].u.pszString);
    1146 }
    1147 
    1148 
    1149 /**
    1150  * The 'logdest' command.
    1151  *
    1152  * @returns VBox status.
    1153  * @param   pCmd        Pointer to the command descriptor (as registered).
    1154  * @param   pCmdHlp     Pointer to command helper functions.
    1155  * @param   pVM         Pointer to the current VM (if any).
    1156  * @param   paArgs      Pointer to (readonly) array of arguments.
    1157  * @param   cArgs       Number of arguments in the array.
    1158  */
    1159 static DECLCALLBACK(int) dbgcCmdLogDest(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
    1160 {
    1161     int rc = DBGFR3LogModifyDestinations(pVM, paArgs[0].u.pszString);
     1080    return DBGCCmdHlpVBoxError(pCmdHlp, rc, "DBGFR3LogModifyGroups(%p,'%s')\n", pUVM, paArgs[0].u.pszString);
     1081}
     1082
     1083
     1084/**
     1085 * @interface_method_impl{FNDBCCMD, The 'logdest' command.}
     1086 */
     1087static DECLCALLBACK(int) dbgcCmdLogDest(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
     1088{
     1089    int rc = DBGFR3LogModifyDestinations(pUVM, paArgs[0].u.pszString);
    11621090    if (RT_SUCCESS(rc))
    11631091        return VINF_SUCCESS;
    11641092    NOREF(pCmd); NOREF(cArgs);
    1165     return pCmdHlp->pfnVBoxError(pCmdHlp, rc, "DBGFR3LogModifyDestinations(%p,'%s')\n", pVM, paArgs[0].u.pszString);
    1166 }
    1167 
    1168 
    1169 /**
    1170  * The 'logflags' command.
    1171  *
    1172  * @returns VBox status.
    1173  * @param   pCmd        Pointer to the command descriptor (as registered).
    1174  * @param   pCmdHlp     Pointer to command helper functions.
    1175  * @param   pVM         Pointer to the current VM (if any).
    1176  * @param   paArgs      Pointer to (readonly) array of arguments.
    1177  * @param   cArgs       Number of arguments in the array.
    1178  */
    1179 static DECLCALLBACK(int) dbgcCmdLogFlags(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
    1180 {
    1181     int rc = DBGFR3LogModifyFlags(pVM, paArgs[0].u.pszString);
     1093    return DBGCCmdHlpVBoxError(pCmdHlp, rc, "DBGFR3LogModifyDestinations(%p,'%s')\n", pUVM, paArgs[0].u.pszString);
     1094}
     1095
     1096
     1097/**
     1098 * @interface_method_impl{FNDBCCMD, The 'logflags' command.}
     1099 */
     1100static DECLCALLBACK(int) dbgcCmdLogFlags(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
     1101{
     1102    int rc = DBGFR3LogModifyFlags(pUVM, paArgs[0].u.pszString);
    11821103    if (RT_SUCCESS(rc))
    11831104        return VINF_SUCCESS;
    11841105    NOREF(pCmd); NOREF(cArgs);
    1185     return pCmdHlp->pfnVBoxError(pCmdHlp, rc, "DBGFR3LogModifyFlags(%p,'%s')\n", pVM, paArgs[0].u.pszString);
    1186 }
    1187 
    1188 
    1189 /**
    1190  * The 'format' command.
    1191  *
    1192  * @returns VBox status.
    1193  * @param   pCmd        Pointer to the command descriptor (as registered).
    1194  * @param   pCmdHlp     Pointer to command helper functions.
    1195  * @param   pVM         Pointer to the current VM (if any).
    1196  * @param   paArgs      Pointer to (readonly) array of arguments.
    1197  * @param   cArgs       Number of arguments in the array.
    1198  */
    1199 static DECLCALLBACK(int) dbgcCmdFormat(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
     1106    return DBGCCmdHlpVBoxError(pCmdHlp, rc, "DBGFR3LogModifyFlags(%p,'%s')\n", pUVM, paArgs[0].u.pszString);
     1107}
     1108
     1109
     1110/**
     1111 * @interface_method_impl{FNDBCCMD, The 'format' command.}
     1112 */
     1113static DECLCALLBACK(int) dbgcCmdFormat(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
    12001114{
    12011115    LogFlow(("dbgcCmdFormat\n"));
     
    12111125        {
    12121126            case DBGCVAR_TYPE_UNKNOWN:
    1213                 rc = pCmdHlp->pfnPrintf(pCmdHlp, NULL,
     1127                rc = DBGCCmdHlpPrintf(pCmdHlp,
    12141128                    "Unknown variable type!\n");
    12151129                break;
    12161130            case DBGCVAR_TYPE_GC_FLAT:
    12171131                if (paArgs[iArg].enmRangeType != DBGCVAR_RANGE_NONE)
    1218                     rc = pCmdHlp->pfnPrintf(pCmdHlp, NULL,
     1132                    rc = DBGCCmdHlpPrintf(pCmdHlp,
    12191133                        "Guest flat address: %%%08x range %lld %s\n",
    12201134                        paArgs[iArg].u.GCFlat,
     
    12221136                        apszRangeDesc[paArgs[iArg].enmRangeType]);
    12231137                else
    1224                     rc = pCmdHlp->pfnPrintf(pCmdHlp, NULL,
     1138                    rc = DBGCCmdHlpPrintf(pCmdHlp,
    12251139                        "Guest flat address: %%%08x\n",
    12261140                        paArgs[iArg].u.GCFlat);
     
    12281142            case DBGCVAR_TYPE_GC_FAR:
    12291143                if (paArgs[iArg].enmRangeType != DBGCVAR_RANGE_NONE)
    1230                     rc = pCmdHlp->pfnPrintf(pCmdHlp, NULL,
     1144                    rc = DBGCCmdHlpPrintf(pCmdHlp,
    12311145                        "Guest far address: %04x:%08x range %lld %s\n",
    12321146                        paArgs[iArg].u.GCFar.sel,
     
    12351149                        apszRangeDesc[paArgs[iArg].enmRangeType]);
    12361150                else
    1237                     rc = pCmdHlp->pfnPrintf(pCmdHlp, NULL,
     1151                    rc = DBGCCmdHlpPrintf(pCmdHlp,
    12381152                        "Guest far address: %04x:%08x\n",
    12391153                        paArgs[iArg].u.GCFar.sel,
     
    12421156            case DBGCVAR_TYPE_GC_PHYS:
    12431157                if (paArgs[iArg].enmRangeType != DBGCVAR_RANGE_NONE)
    1244                     rc = pCmdHlp->pfnPrintf(pCmdHlp, NULL,
     1158                    rc = DBGCCmdHlpPrintf(pCmdHlp,
    12451159                        "Guest physical address: %%%%%08x range %lld %s\n",
    12461160                        paArgs[iArg].u.GCPhys,
     
    12481162                        apszRangeDesc[paArgs[iArg].enmRangeType]);
    12491163                else
    1250                     rc = pCmdHlp->pfnPrintf(pCmdHlp, NULL,
     1164                    rc = DBGCCmdHlpPrintf(pCmdHlp,
    12511165                        "Guest physical address: %%%%%08x\n",
    12521166                        paArgs[iArg].u.GCPhys);
     
    12541168            case DBGCVAR_TYPE_HC_FLAT:
    12551169                if (paArgs[iArg].enmRangeType != DBGCVAR_RANGE_NONE)
    1256                     rc = pCmdHlp->pfnPrintf(pCmdHlp, NULL,
     1170                    rc = DBGCCmdHlpPrintf(pCmdHlp,
    12571171                        "Host flat address: %%%08x range %lld %s\n",
    12581172                        paArgs[iArg].u.pvHCFlat,
     
    12601174                        apszRangeDesc[paArgs[iArg].enmRangeType]);
    12611175                else
    1262                     rc = pCmdHlp->pfnPrintf(pCmdHlp, NULL,
     1176                    rc = DBGCCmdHlpPrintf(pCmdHlp,
    12631177                        "Host flat address: %%%08x\n",
    12641178                        paArgs[iArg].u.pvHCFlat);
     
    12661180            case DBGCVAR_TYPE_HC_PHYS:
    12671181                if (paArgs[iArg].enmRangeType != DBGCVAR_RANGE_NONE)
    1268                     rc = pCmdHlp->pfnPrintf(pCmdHlp, NULL,
     1182                    rc = DBGCCmdHlpPrintf(pCmdHlp,
    12691183                        "Host physical address: %RHp range %lld %s\n",
    12701184                        paArgs[iArg].u.HCPhys,
     
    12721186                        apszRangeDesc[paArgs[iArg].enmRangeType]);
    12731187                else
    1274                     rc = pCmdHlp->pfnPrintf(pCmdHlp, NULL,
     1188                    rc = DBGCCmdHlpPrintf(pCmdHlp,
    12751189                        "Host physical address: %RHp\n",
    12761190                        paArgs[iArg].u.HCPhys);
     
    12781192
    12791193            case DBGCVAR_TYPE_STRING:
    1280                 rc = pCmdHlp->pfnPrintf(pCmdHlp, NULL,
     1194                rc = DBGCCmdHlpPrintf(pCmdHlp,
    12811195                    "String, %lld bytes long: %s\n",
    12821196                    paArgs[iArg].u64Range,
     
    12851199
    12861200            case DBGCVAR_TYPE_SYMBOL:
    1287                 rc = pCmdHlp->pfnPrintf(pCmdHlp, NULL,
     1201                rc = DBGCCmdHlpPrintf(pCmdHlp,
    12881202                    "Symbol, %lld bytes long: %s\n",
    12891203                    paArgs[iArg].u64Range,
     
    12931207            case DBGCVAR_TYPE_NUMBER:
    12941208                if (paArgs[iArg].enmRangeType != DBGCVAR_RANGE_NONE)
    1295                     rc = pCmdHlp->pfnPrintf(pCmdHlp, NULL,
     1209                    rc = DBGCCmdHlpPrintf(pCmdHlp,
    12961210                        "Number: hex %llx  dec 0i%lld  oct 0t%llo  range %lld %s\n",
    12971211                        paArgs[iArg].u.u64Number,
     
    13011215                        apszRangeDesc[paArgs[iArg].enmRangeType]);
    13021216                else
    1303                     rc = pCmdHlp->pfnPrintf(pCmdHlp, NULL,
     1217                    rc = DBGCCmdHlpPrintf(pCmdHlp,
    13041218                        "Number: hex %llx  dec 0i%lld  oct 0t%llo\n",
    13051219                        paArgs[iArg].u.u64Number,
     
    13091223
    13101224            default:
    1311                 rc = pCmdHlp->pfnPrintf(pCmdHlp, NULL,
     1225                rc = DBGCCmdHlpPrintf(pCmdHlp,
    13121226                    "Invalid argument type %d\n",
    13131227                    paArgs[iArg].enmType);
     
    13161230    } /* arg loop */
    13171231
    1318     NOREF(pCmd); NOREF(pVM);
     1232    NOREF(pCmd); NOREF(pUVM);
    13191233    return 0;
    13201234}
     
    13221236
    13231237/**
    1324  * The 'loadimage' command.
    1325  *
    1326  * @returns VBox status.
    1327  * @param   pCmd        Pointer to the command descriptor (as registered).
    1328  * @param   pCmdHlp     Pointer to command helper functions.
    1329  * @param   pVM         Pointer to the current VM (if any).
    1330  * @param   paArgs      Pointer to (readonly) array of arguments.
    1331  * @param   cArgs       Number of arguments in the array.
    1332  */
    1333 static DECLCALLBACK(int) dbgcCmdLoadImage(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
     1238 * @interface_method_impl{FNDBCCMD, The 'loadimage' command.}
     1239 */
     1240static DECLCALLBACK(int) dbgcCmdLoadImage(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
    13341241{
    13351242    /*
     
    13481255    int rc = pCmdHlp->pfnVarToDbgfAddr(pCmdHlp, &paArgs[1], &ModAddress);
    13491256    if (RT_FAILURE(rc))
    1350         return pCmdHlp->pfnVBoxError(pCmdHlp, rc, "pfnVarToDbgfAddr: %Dv\n", &paArgs[1]);
     1257        return DBGCCmdHlpVBoxError(pCmdHlp, rc, "pfnVarToDbgfAddr: %Dv\n", &paArgs[1]);
    13511258
    13521259    const char     *pszModName  = NULL;
     
    13611268     */
    13621269    PDBGC pDbgc = DBGC_CMDHLP2DBGC(pCmdHlp);
    1363     rc = DBGFR3AsLoadImage(pVM, pDbgc->hDbgAs, pszFilename, pszModName, &ModAddress, NIL_RTDBGSEGIDX, 0 /*fFlags*/);
     1270    rc = DBGFR3AsLoadImage(pUVM, pDbgc->hDbgAs, pszFilename, pszModName, &ModAddress, NIL_RTDBGSEGIDX, 0 /*fFlags*/);
    13641271    if (RT_FAILURE(rc))
    1365         return pCmdHlp->pfnVBoxError(pCmdHlp, rc, "DBGFR3ModuleLoadImage(,,'%s','%s',%Dv,)\n",
    1366                                      pszFilename, pszModName, &paArgs[1]);
     1272        return DBGCCmdHlpVBoxError(pCmdHlp, rc, "DBGFR3ModuleLoadImage(,,'%s','%s',%Dv,)\n",
     1273                                   pszFilename, pszModName, &paArgs[1]);
    13671274
    13681275    NOREF(pCmd);
     
    13721279
    13731280/**
    1374  * The 'loadmap' command.
    1375  *
    1376  * @returns VBox status.
    1377  * @param   pCmd        Pointer to the command descriptor (as registered).
    1378  * @param   pCmdHlp     Pointer to command helper functions.
    1379  * @param   pVM         Pointer to the current VM (if any).
    1380  * @param   paArgs      Pointer to (readonly) array of arguments.
    1381  * @param   cArgs       Number of arguments in the array.
    1382  */
    1383 static DECLCALLBACK(int) dbgcCmdLoadMap(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
     1281 * @interface_method_impl{FNDBCCMD, The 'loadmap' command.}
     1282 */
     1283static DECLCALLBACK(int) dbgcCmdLoadMap(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
    13841284{
    13851285    /*
     
    13981298    int rc = pCmdHlp->pfnVarToDbgfAddr(pCmdHlp, &paArgs[1], &ModAddress);
    13991299    if (RT_FAILURE(rc))
    1400         return pCmdHlp->pfnVBoxError(pCmdHlp, rc, "pfnVarToDbgfAddr: %Dv\n", &paArgs[1]);
     1300        return DBGCCmdHlpVBoxError(pCmdHlp, rc, "pfnVarToDbgfAddr: %Dv\n", &paArgs[1]);
    14011301
    14021302    const char     *pszModName  = NULL;
     
    14211321        if (    iModSeg != paArgs[4].u.u64Number
    14221322            ||  iModSeg > RTDBGSEGIDX_LAST)
    1423             return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "Segment index out of range: %Dv; range={0..%#x}\n", &paArgs[1], RTDBGSEGIDX_LAST);
     1323            return DBGCCmdHlpPrintf(pCmdHlp, "Segment index out of range: %Dv; range={0..%#x}\n", &paArgs[1], RTDBGSEGIDX_LAST);
    14241324    }
    14251325
     
    14281328     */
    14291329    PDBGC pDbgc = DBGC_CMDHLP2DBGC(pCmdHlp);
    1430     rc = DBGFR3AsLoadMap(pVM, pDbgc->hDbgAs, pszFilename, pszModName, &ModAddress, NIL_RTDBGSEGIDX, uSubtrahend, 0 /*fFlags*/);
     1330    rc = DBGFR3AsLoadMap(pUVM, pDbgc->hDbgAs, pszFilename, pszModName, &ModAddress, NIL_RTDBGSEGIDX, uSubtrahend, 0 /*fFlags*/);
    14311331    if (RT_FAILURE(rc))
    1432         return pCmdHlp->pfnVBoxError(pCmdHlp, rc, "DBGFR3AsLoadMap(,,'%s','%s',%Dv,)\n",
    1433                                      pszFilename, pszModName, &paArgs[1]);
     1332        return DBGCCmdHlpVBoxError(pCmdHlp, rc, "DBGFR3AsLoadMap(,,'%s','%s',%Dv,)\n",
     1333                                   pszFilename, pszModName, &paArgs[1]);
    14341334
    14351335    NOREF(pCmd);
     
    14391339
    14401340/**
    1441  * The 'loadseg' command.
    1442  *
    1443  * @returns VBox status.
    1444  * @param   pCmd        Pointer to the command descriptor (as registered).
    1445  * @param   pCmdHlp     Pointer to command helper functions.
    1446  * @param   pVM         Pointer to the current VM (if any).
    1447  * @param   paArgs      Pointer to (readonly) array of arguments.
    1448  * @param   cArgs       Number of arguments in the array.
    1449  */
    1450 static DECLCALLBACK(int) dbgcCmdLoadSeg(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
     1341 * @interface_method_impl{FNDBCCMD, The 'loadseg' command.}
     1342 */
     1343static DECLCALLBACK(int) dbgcCmdLoadSeg(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
    14511344{
    14521345    /*
     
    14661359    int rc = pCmdHlp->pfnVarToDbgfAddr(pCmdHlp, &paArgs[1], &ModAddress);
    14671360    if (RT_FAILURE(rc))
    1468         return pCmdHlp->pfnVBoxError(pCmdHlp, rc, "pfnVarToDbgfAddr: %Dv\n", &paArgs[1]);
     1361        return DBGCCmdHlpVBoxError(pCmdHlp, rc, "pfnVarToDbgfAddr: %Dv\n", &paArgs[1]);
    14691362
    14701363    RTDBGSEGIDX     iModSeg     = (RTDBGSEGIDX)paArgs[1].u.u64Number;
    14711364    if (    iModSeg != paArgs[2].u.u64Number
    14721365        ||  iModSeg > RTDBGSEGIDX_LAST)
    1473         return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "Segment index out of range: %Dv; range={0..%#x}\n", &paArgs[1], RTDBGSEGIDX_LAST);
     1366        return DBGCCmdHlpPrintf(pCmdHlp, "Segment index out of range: %Dv; range={0..%#x}\n", &paArgs[1], RTDBGSEGIDX_LAST);
    14741367
    14751368    const char     *pszModName  = NULL;
     
    14841377     */
    14851378    PDBGC pDbgc = DBGC_CMDHLP2DBGC(pCmdHlp);
    1486     rc = DBGFR3AsLoadImage(pVM, pDbgc->hDbgAs, pszFilename, pszModName, &ModAddress, iModSeg, 0 /*fFlags*/);
     1379    rc = DBGFR3AsLoadImage(pUVM, pDbgc->hDbgAs, pszFilename, pszModName, &ModAddress, iModSeg, 0 /*fFlags*/);
    14871380    if (RT_FAILURE(rc))
    1488         return pCmdHlp->pfnVBoxError(pCmdHlp, rc, "DBGFR3ModuleLoadImage(,,'%s','%s',%Dv,)\n",
    1489                                      pszFilename, pszModName, &paArgs[1]);
     1381        return DBGCCmdHlpVBoxError(pCmdHlp, rc, "DBGFR3ModuleLoadImage(,,'%s','%s',%Dv,)\n",
     1382                                   pszFilename, pszModName, &paArgs[1]);
    14901383
    14911384    NOREF(pCmd);
     
    14951388
    14961389/**
    1497  * The 'loadsyms' command.
    1498  *
    1499  * @returns VBox status.
    1500  * @param   pCmd        Pointer to the command descriptor (as registered).
    1501  * @param   pCmdHlp     Pointer to command helper functions.
    1502  * @param   pVM         Pointer to the current VM (if any).
    1503  * @param   paArgs      Pointer to (readonly) array of arguments.
    1504  * @param   cArgs       Number of arguments in the array.
    1505  */
    1506 static DECLCALLBACK(int) dbgcCmdLoadSyms(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
     1390 * @interface_method_impl{FNDBCCMD, The 'loadsyms' command.}
     1391 */
     1392static DECLCALLBACK(int) dbgcCmdLoadSyms(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
    15071393{
    15081394    /*
     
    15471433                int rc = DBGCCmdHlpEval(pCmdHlp, &AddrVar, "%%(%Dv)", &paArgs[iArg]);
    15481434                if (RT_FAILURE(rc))
    1549                     return pCmdHlp->pfnVBoxError(pCmdHlp, rc, "Module address cast %%(%Dv) failed.", &paArgs[iArg]);
     1435                    return DBGCCmdHlpVBoxError(pCmdHlp, rc, "Module address cast %%(%Dv) failed.", &paArgs[iArg]);
    15501436                ModuleAddress = paArgs[iArg].u.GCFlat;
    15511437                iArg++;
     
    15721458     * Call the debug info manager about this loading...
    15731459     */
    1574     int rc = DBGFR3ModuleLoad(pVM, paArgs[0].u.pszString, Delta, pszModule, ModuleAddress, cbModule);
     1460    int rc = DBGFR3ModuleLoad(pUVM, paArgs[0].u.pszString, Delta, pszModule, ModuleAddress, cbModule);
    15751461    if (RT_FAILURE(rc))
    1576         return pCmdHlp->pfnVBoxError(pCmdHlp, rc, "DBGInfoSymbolLoad(, '%s', %RGv, '%s', %RGv, 0)\n",
    1577                                      paArgs[0].u.pszString, Delta, pszModule, ModuleAddress);
     1462        return DBGCCmdHlpVBoxError(pCmdHlp, rc, "DBGInfoSymbolLoad(, '%s', %RGv, '%s', %RGv, 0)\n",
     1463                                   paArgs[0].u.pszString, Delta, pszModule, ModuleAddress);
    15781464
    15791465    NOREF(pCmd);
     
    15831469
    15841470/**
    1585  * The 'set' command.
    1586  *
    1587  * @returns VBox status.
    1588  * @param   pCmd        Pointer to the command descriptor (as registered).
    1589  * @param   pCmdHlp     Pointer to command helper functions.
    1590  * @param   pVM         Pointer to the current VM (if any).
    1591  * @param   paArgs      Pointer to (readonly) array of arguments.
    1592  * @param   cArgs       Number of arguments in the array.
    1593  */
    1594 static DECLCALLBACK(int) dbgcCmdSet(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
     1471 * @interface_method_impl{FNDBCCMD, The 'set' command.}
     1472 */
     1473static DECLCALLBACK(int) dbgcCmdSet(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
    15951474{
    15961475    PDBGC   pDbgc = DBGC_CMDHLP2DBGC(pCmdHlp);
     
    16071486    const char *pszVar = paArgs[0].u.pszString;
    16081487    if (!RT_C_IS_ALPHA(*pszVar) || *pszVar == '_')
    1609         return pCmdHlp->pfnPrintf(pCmdHlp, NULL,
     1488        return DBGCCmdHlpPrintf(pCmdHlp,
    16101489            "syntax error: Invalid variable name '%s'. Variable names must match regex '[_a-zA-Z][_a-zA-Z0-9*'!", paArgs[0].u.pszString);
    16111490
     
    16131492        *pszVar++;
    16141493    if (*pszVar)
    1615         return pCmdHlp->pfnPrintf(pCmdHlp, NULL,
     1494        return DBGCCmdHlpPrintf(pCmdHlp,
    16161495            "syntax error: Invalid variable name '%s'. Variable names must match regex '[_a-zA-Z][_a-zA-Z0-9*]'!", paArgs[0].u.pszString);
    16171496
     
    16711550    pDbgc->papVars[pDbgc->cVars++] = pVar;
    16721551
    1673     NOREF(pCmd); NOREF(pVM); NOREF(cArgs);
     1552    NOREF(pCmd); NOREF(pUVM); NOREF(cArgs);
    16741553    return 0;
    16751554}
     
    16771556
    16781557/**
    1679  * The 'unset' command.
    1680  *
    1681  * @returns VBox status.
    1682  * @param   pCmd        Pointer to the command descriptor (as registered).
    1683  * @param   pCmdHlp     Pointer to command helper functions.
    1684  * @param   pVM         Pointer to the current VM (if any).
    1685  * @param   paArgs      Pointer to (readonly) array of arguments.
    1686  * @param   cArgs       Number of arguments in the array.
    1687  */
    1688 static DECLCALLBACK(int) dbgcCmdUnset(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
     1558 * @interface_method_impl{FNDBCCMD, The 'unset' command.}
     1559 */
     1560static DECLCALLBACK(int) dbgcCmdUnset(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
    16891561{
    16901562    PDBGC   pDbgc = DBGC_CMDHLP2DBGC(pCmdHlp);
     
    17211593    } /* arg loop */
    17221594
    1723     NOREF(pCmd); NOREF(pVM);
     1595    NOREF(pCmd); NOREF(pUVM);
    17241596    return 0;
    17251597}
     
    17271599
    17281600/**
    1729  * The 'loadvars' command.
    1730  *
    1731  * @returns VBox status.
    1732  * @param   pCmd        Pointer to the command descriptor (as registered).
    1733  * @param   pCmdHlp     Pointer to command helper functions.
    1734  * @param   pVM         Pointer to the current VM (if any).
    1735  * @param   paArgs      Pointer to (readonly) array of arguments.
    1736  * @param   cArgs       Number of arguments in the array.
    1737  */
    1738 static DECLCALLBACK(int) dbgcCmdLoadVars(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
     1601 * @interface_method_impl{FNDBCCMD, The 'loadvars' command.}
     1602 */
     1603static DECLCALLBACK(int) dbgcCmdLoadVars(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
    17391604{
    17401605    /*
     
    17691634                &&  *psz != ';')
    17701635            {
    1771                 pCmdHlp->pfnPrintf(pCmdHlp, NULL, "dbg: set %s", psz);
     1636                DBGCCmdHlpPrintf(pCmdHlp, "dbg: set %s", psz);
    17721637                pCmdHlp->pfnExec(pCmdHlp, "set %s", psz);
    17731638            }
     
    17761641    }
    17771642    else
    1778         return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "Failed to open file '%s'.\n", paArgs[0].u.pszString);
    1779 
    1780     NOREF(pCmd); NOREF(pVM);
     1643        return DBGCCmdHlpPrintf(pCmdHlp, "Failed to open file '%s'.\n", paArgs[0].u.pszString);
     1644
     1645    NOREF(pCmd); NOREF(pUVM);
    17811646    return 0;
    17821647}
     
    17841649
    17851650/**
    1786  * The 'showvars' command.
    1787  *
    1788  * @returns VBox status.
    1789  * @param   pCmd        Pointer to the command descriptor (as registered).
    1790  * @param   pCmdHlp     Pointer to command helper functions.
    1791  * @param   pVM         Pointer to the current VM (if any).
    1792  * @param   paArgs      Pointer to (readonly) array of arguments.
    1793  * @param   cArgs       Number of arguments in the array.
    1794  */
    1795 static DECLCALLBACK(int) dbgcCmdShowVars(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
     1651 * @interface_method_impl{FNDBCCMD, The 'showvars' command.}
     1652 */
     1653static DECLCALLBACK(int) dbgcCmdShowVars(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
    17961654{
    17971655    PDBGC pDbgc = DBGC_CMDHLP2DBGC(pCmdHlp);
     
    17991657    for (unsigned iVar = 0; iVar < pDbgc->cVars; iVar++)
    18001658    {
    1801         int rc = pCmdHlp->pfnPrintf(pCmdHlp, NULL, "%-20s ", &pDbgc->papVars[iVar]->szName);
     1659        int rc = DBGCCmdHlpPrintf(pCmdHlp, "%-20s ", &pDbgc->papVars[iVar]->szName);
    18021660        if (!rc)
    1803             rc = dbgcCmdFormat(pCmd, pCmdHlp, pVM, &pDbgc->papVars[iVar]->Var, 1);
     1661            rc = dbgcCmdFormat(pCmd, pCmdHlp, pUVM, &pDbgc->papVars[iVar]->Var, 1);
    18041662        if (rc)
    18051663            return rc;
     
    20341892     * Try initialize it.
    20351893     */
    2036     rc = pPlugIn->pfnEntry(DBGCPLUGINOP_INIT, pDbgc->pVM, VBOX_VERSION);
     1894    rc = pPlugIn->pfnEntry(DBGCPLUGINOP_INIT, pDbgc->pUVM, VBOX_VERSION);
    20371895    if (RT_FAILURE(rc))
    20381896    {
     
    21091967
    21101968/**
    2111  * The 'loadplugin' command.
    2112  *
    2113  * @returns VBox status.
    2114  * @param   pCmd        Pointer to the command descriptor (as registered).
    2115  * @param   pCmdHlp     Pointer to command helper functions.
    2116  * @param   pVM         Pointer to the current VM (if any).
    2117  * @param   paArgs      Pointer to (readonly) array of arguments.
    2118  * @param   cArgs       Number of arguments in the array.
    2119  */
    2120 static DECLCALLBACK(int) dbgcCmdLoadPlugIn(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
     1969 * @interface_method_impl{FNDBCCMD, The 'loadplugin' command.}
     1970 */
     1971static DECLCALLBACK(int) dbgcCmdLoadPlugIn(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
    21211972{
    21221973    PDBGC pDbgc = DBGC_CMDHLP2DBGC(pCmdHlp);
     
    21652016            &&  pDbgc->pVM->enmVMState < VMSTATE_DESTROYING)
    21662017        {
    2167             pPlugIn->pfnEntry(DBGCPLUGINOP_TERM, pDbgc->pVM, 0);
     2018            pPlugIn->pfnEntry(DBGCPLUGINOP_TERM, pDbgc->pUVM, 0);
    21682019            RTLdrClose(pPlugIn->hLdrMod);
    21692020        }
     
    21762027
    21772028/**
    2178  * The 'unload' command.
    2179  *
    2180  * @returns VBox status.
    2181  * @param   pCmd        Pointer to the command descriptor (as registered).
    2182  * @param   pCmdHlp     Pointer to command helper functions.
    2183  * @param   pVM         Pointer to the current VM (if any).
    2184  * @param   paArgs      Pointer to (readonly) array of arguments.
    2185  * @param   cArgs       Number of arguments in the array.
    2186  */
    2187 static DECLCALLBACK(int) dbgcCmdUnloadPlugIn(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
     2029 * @interface_method_impl{FNDBCCMD, The 'unload' command.}
     2030 */
     2031static DECLCALLBACK(int) dbgcCmdUnloadPlugIn(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
    21882032{
    21892033    PDBGC pDbgc = DBGC_CMDHLP2DBGC(pCmdHlp);
     
    22112055         * Terminate and unload it.
    22122056         */
    2213         pPlugIn->pfnEntry(DBGCPLUGINOP_TERM, pDbgc->pVM, 0);
     2057        pPlugIn->pfnEntry(DBGCPLUGINOP_TERM, pDbgc->pUVM, 0);
    22142058        RTLdrClose(pPlugIn->hLdrMod);
    22152059        pPlugIn->hLdrMod = NIL_RTLDRMOD;
     
    22282072
    22292073/**
    2230  * The 'showplugins' command.
    2231  *
    2232  * @returns VBox status.
    2233  * @param   pCmd        Pointer to the command descriptor (as registered).
    2234  * @param   pCmdHlp     Pointer to command helper functions.
    2235  * @param   pVM         Pointer to the current VM (if any).
    2236  * @param   paArgs      Pointer to (readonly) array of arguments.
    2237  * @param   cArgs       Number of arguments in the array.
    2238  */
    2239 static DECLCALLBACK(int) dbgcCmdShowPlugIns(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
     2074 * @interface_method_impl{FNDBCCMD, The 'showplugins' command.}
     2075 */
     2076static DECLCALLBACK(int) dbgcCmdShowPlugIns(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
    22402077{
    22412078    PDBGC       pDbgc = DBGC_CMDHLP2DBGC(pCmdHlp);
     
    22582095
    22592096/**
    2260  * The 'harakiri' command.
    2261  *
    2262  * @returns VBox status.
    2263  * @param   pCmd        Pointer to the command descriptor (as registered).
    2264  * @param   pCmdHlp     Pointer to command helper functions.
    2265  * @param   pVM         Pointer to the current VM (if any).
    2266  * @param   paArgs      Pointer to (readonly) array of arguments.
    2267  * @param   cArgs       Number of arguments in the array.
    2268  */
    2269 static DECLCALLBACK(int) dbgcCmdHarakiri(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
     2097 * @interface_method_impl{FNDBCCMD, The 'harakiri' command.}
     2098 */
     2099static DECLCALLBACK(int) dbgcCmdHarakiri(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
    22702100{
    22712101    Log(("dbgcCmdHarakiri\n"));
    22722102    for (;;)
    22732103        exit(126);
    2274     NOREF(pCmd); NOREF(pCmdHlp); NOREF(pVM); NOREF(paArgs); NOREF(cArgs);
    2275 }
    2276 
    2277 
    2278 /**
    2279  * The 'writecore' command.
    2280  *
    2281  * @returns VBox status.
    2282  * @param   pCmd        Pointer to the command descriptor (as registered).
    2283  * @param   pCmdHlp     Pointer to command helper functions.
    2284  * @param   pVM         Pointer to the current VM (if any).
    2285  * @param   paArgs      Pointer to (readonly) array of arguments.
    2286  * @param   cArgs       Number of arguments in the array.
    2287  */
    2288 static DECLCALLBACK(int) dbgcCmdWriteCore(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
     2104    NOREF(pCmd); NOREF(pCmdHlp); NOREF(pUVM); NOREF(paArgs); NOREF(cArgs);
     2105}
     2106
     2107
     2108/**
     2109 * @interface_method_impl{FNDBCCMD, The 'writecore' command.}
     2110 */
     2111static DECLCALLBACK(int) dbgcCmdWriteCore(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
    22892112{
    22902113    Log(("dbgcCmdWriteCore\n"));
     
    23042127        return DBGCCmdHlpFail(pCmdHlp, pCmd, "Missing file path.\n");
    23052128
    2306     int rc = DBGFR3CoreWrite(pVM, pszDumpPath, true /*fReplaceFile*/);
     2129    int rc = DBGFR3CoreWrite(pUVM, pszDumpPath, true /*fReplaceFile*/);
    23072130    if (RT_FAILURE(rc))
    23082131        return DBGCCmdHlpFail(pCmdHlp, pCmd, "DBGFR3WriteCore failed. rc=%Rrc\n", rc);
     
    23162139 * @callback_method_impl{The randu32() function implementation.}
    23172140 */
    2318 static DECLCALLBACK(int) dbgcFuncRandU32(PCDBGCFUNC pFunc, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, uint32_t cArgs,
     2141static DECLCALLBACK(int) dbgcFuncRandU32(PCDBGCFUNC pFunc, PDBGCCMDHLP pCmdHlp, PVM pUVM, PCDBGCVAR paArgs, uint32_t cArgs,
    23192142                                         PDBGCVAR pResult)
    23202143{
     
    23222145    uint32_t u32 = RTRandU32();
    23232146    DBGCVAR_INIT_NUMBER(pResult, u32);
    2324     NOREF(pFunc); NOREF(pCmdHlp); NOREF(pVM); NOREF(paArgs);
     2147    NOREF(pFunc); NOREF(pCmdHlp); NOREF(pUVM); NOREF(paArgs);
    23252148    return VINF_SUCCESS;
    23262149}
  • trunk/src/VBox/Debugger/DBGCEmulateCodeView.cpp

    r43325 r44399  
    55
    66/*
    7  * Copyright (C) 2006-2011 Oracle Corporation
     7 * Copyright (C) 2006-2013 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    4444*   Internal Functions                                                         *
    4545*******************************************************************************/
    46 static DECLCALLBACK(int) dbgcCmdBrkAccess(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
    47 static DECLCALLBACK(int) dbgcCmdBrkClear(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
    48 static DECLCALLBACK(int) dbgcCmdBrkDisable(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
    49 static DECLCALLBACK(int) dbgcCmdBrkEnable(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
    50 static DECLCALLBACK(int) dbgcCmdBrkList(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
    51 static DECLCALLBACK(int) dbgcCmdBrkSet(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
    52 static DECLCALLBACK(int) dbgcCmdBrkREM(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
    53 static DECLCALLBACK(int) dbgcCmdDumpMem(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
    54 static DECLCALLBACK(int) dbgcCmdDumpDT(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
    55 static DECLCALLBACK(int) dbgcCmdDumpIDT(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
    56 static DECLCALLBACK(int) dbgcCmdDumpPageDir(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
    57 static DECLCALLBACK(int) dbgcCmdDumpPageDirBoth(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
    58 static DECLCALLBACK(int) dbgcCmdDumpPageHierarchy(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
    59 static DECLCALLBACK(int) dbgcCmdDumpPageTable(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
    60 static DECLCALLBACK(int) dbgcCmdDumpPageTableBoth(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
    61 static DECLCALLBACK(int) dbgcCmdDumpTSS(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
    62 static DECLCALLBACK(int) dbgcCmdEditMem(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
    63 static DECLCALLBACK(int) dbgcCmdGo(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
    64 static DECLCALLBACK(int) dbgcCmdListModules(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
    65 static DECLCALLBACK(int) dbgcCmdListNear(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
    66 static DECLCALLBACK(int) dbgcCmdListSource(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
    67 static DECLCALLBACK(int) dbgcCmdMemoryInfo(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
    68 static DECLCALLBACK(int) dbgcCmdReg(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
    69 static DECLCALLBACK(int) dbgcCmdRegGuest(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
    70 static DECLCALLBACK(int) dbgcCmdRegHyper(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
    71 static DECLCALLBACK(int) dbgcCmdRegTerse(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
    72 static DECLCALLBACK(int) dbgcCmdSearchMem(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
    73 static DECLCALLBACK(int) dbgcCmdSearchMemType(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
    74 static DECLCALLBACK(int) dbgcCmdStack(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
    75 static DECLCALLBACK(int) dbgcCmdTrace(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
    76 static DECLCALLBACK(int) dbgcCmdUnassemble(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
     46static FNDBGCCMD dbgcCmdBrkAccess;
     47static FNDBGCCMD dbgcCmdBrkClear;
     48static FNDBGCCMD dbgcCmdBrkDisable;
     49static FNDBGCCMD dbgcCmdBrkEnable;
     50static FNDBGCCMD dbgcCmdBrkList;
     51static FNDBGCCMD dbgcCmdBrkSet;
     52static FNDBGCCMD dbgcCmdBrkREM;
     53static FNDBGCCMD dbgcCmdDumpMem;
     54static FNDBGCCMD dbgcCmdDumpDT;
     55static FNDBGCCMD dbgcCmdDumpIDT;
     56static FNDBGCCMD dbgcCmdDumpPageDir;
     57static FNDBGCCMD dbgcCmdDumpPageDirBoth;
     58static FNDBGCCMD dbgcCmdDumpPageHierarchy;
     59static FNDBGCCMD dbgcCmdDumpPageTable;
     60static FNDBGCCMD dbgcCmdDumpPageTableBoth;
     61static FNDBGCCMD dbgcCmdDumpTSS;
     62static FNDBGCCMD dbgcCmdEditMem;
     63static FNDBGCCMD dbgcCmdGo;
     64static FNDBGCCMD dbgcCmdListModules;
     65static FNDBGCCMD dbgcCmdListNear;
     66static FNDBGCCMD dbgcCmdListSource;
     67static FNDBGCCMD dbgcCmdMemoryInfo;
     68static FNDBGCCMD dbgcCmdReg;
     69static FNDBGCCMD dbgcCmdRegGuest;
     70static FNDBGCCMD dbgcCmdRegHyper;
     71static FNDBGCCMD dbgcCmdRegTerse;
     72static FNDBGCCMD dbgcCmdSearchMem;
     73static FNDBGCCMD dbgcCmdSearchMemType;
     74static FNDBGCCMD dbgcCmdStack;
     75static FNDBGCCMD dbgcCmdTrace;
     76static FNDBGCCMD dbgcCmdUnassemble;
    7777
    7878
     
    374374
    375375/**
    376  * The 'go' command.
    377  *
    378  * @returns VBox status.
    379  * @param   pCmd        Pointer to the command descriptor (as registered).
    380  * @param   pCmdHlp     Pointer to command helper functions.
    381  * @param   pVM         Pointer to the current VM (if any).
    382  * @param   paArgs      Pointer to (readonly) array of arguments.
    383  * @param   cArgs       Number of arguments in the array.
    384  */
    385 static DECLCALLBACK(int) dbgcCmdGo(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
    386 {
    387     DBGC_CMDHLP_REQ_VM_RET(pCmdHlp, pCmd, pVM);
     376 * @interface_method_impl{FNDBCCMD, The 'go' command.}
     377 */
     378static DECLCALLBACK(int) dbgcCmdGo(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
     379{
     380    DBGC_CMDHLP_REQ_UVM_RET(pCmdHlp, pCmd, pUVM);
    388381
    389382    /*
    390383     * Check if the VM is halted or not before trying to resume it.
    391384     */
    392     if (!DBGFR3IsHalted(pVM))
     385    if (!DBGFR3IsHalted(pUVM))
    393386        return DBGCCmdHlpFail(pCmdHlp, pCmd, "The VM is already running");
    394387
    395     int rc = DBGFR3Resume(pVM);
     388    int rc = DBGFR3Resume(pUVM);
    396389    if (RT_FAILURE(rc))
    397390        return DBGCCmdHlpFailRc(pCmdHlp, pCmd, rc, "DBGFR3Resume");
     
    403396
    404397/**
    405  * The 'ba' command.
    406  *
    407  * @returns VBox status.
    408  * @param   pCmd        Pointer to the command descriptor (as registered).
    409  * @param   pCmdHlp     Pointer to command helper functions.
    410  * @param   pVM         Pointer to the current VM (if any).
    411  * @param   paArgs      Pointer to (readonly) array of arguments.
    412  * @param   cArgs       Number of arguments in the array.
    413  */
    414 static DECLCALLBACK(int) dbgcCmdBrkAccess(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
    415 {
    416     DBGC_CMDHLP_REQ_VM_RET(pCmdHlp, pCmd, pVM);
     398 * @interface_method_impl{FNDBCCMD, The 'ba' command.}
     399 */
     400static DECLCALLBACK(int) dbgcCmdBrkAccess(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
     401{
     402    DBGC_CMDHLP_REQ_UVM_RET(pCmdHlp, pCmd, pUVM);
    417403
    418404    /*
     
    486472     */
    487473    uint32_t iBp;
    488     rc = DBGFR3BpSetReg(pVM, &Address, iHitTrigger, iHitDisable, fType, cb, &iBp);
     474    rc = DBGFR3BpSetReg(pUVM, &Address, iHitTrigger, iHitDisable, fType, cb, &iBp);
    489475    if (RT_SUCCESS(rc))
    490476    {
     
    499485                return DBGCCmdHlpPrintf(pCmdHlp, "Updated access breakpoint %u at %RGv\n", iBp, Address.FlatPtr);
    500486        }
    501         int rc2 = DBGFR3BpClear(pDbgc->pVM, iBp);
     487        int rc2 = DBGFR3BpClear(pDbgc->pUVM, iBp);
    502488        AssertRC(rc2);
    503489    }
     
    507493
    508494/**
    509  * The 'bc' command.
    510  *
    511  * @returns VBox status.
    512  * @param   pCmd        Pointer to the command descriptor (as registered).
    513  * @param   pCmdHlp     Pointer to command helper functions.
    514  * @param   pVM         Pointer to the current VM (if any).
    515  * @param   paArgs      Pointer to (readonly) array of arguments.
    516  * @param   cArgs       Number of arguments in the array.
    517  */
    518 static DECLCALLBACK(int) dbgcCmdBrkClear(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
    519 {
    520     DBGC_CMDHLP_REQ_VM_RET(pCmdHlp, pCmd, pVM);
     495 * @interface_method_impl{FNDBCCMD, The 'bc' command.}
     496 */
     497static DECLCALLBACK(int) dbgcCmdBrkClear(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
     498{
     499    DBGC_CMDHLP_REQ_UVM_RET(pCmdHlp, pCmd, pUVM);
    521500
    522501    /*
     
    533512            if (iBp == paArgs[iArg].u.u64Number)
    534513            {
    535                 int rc2 = DBGFR3BpClear(pVM, iBp);
     514                int rc2 = DBGFR3BpClear(pUVM, iBp);
    536515                if (RT_FAILURE(rc2))
    537516                    rc = DBGCCmdHlpFailRc(pCmdHlp, pCmd, rc2, "DBGFR3BpClear(,%#x)", iBp);
     
    551530                pBp = pBp->pNext;
    552531
    553                 int rc2 = DBGFR3BpClear(pVM, iBp);
     532                int rc2 = DBGFR3BpClear(pUVM, iBp);
    554533                if (RT_FAILURE(rc2))
    555534                    rc = DBGCCmdHlpFailRc(pCmdHlp, pCmd, rc2, "DBGFR3BpClear(,%#x)", iBp);
     
    566545
    567546/**
    568  * The 'bd' command.
    569  *
    570  * @returns VBox status.
    571  * @param   pCmd        Pointer to the command descriptor (as registered).
    572  * @param   pCmdHlp     Pointer to command helper functions.
    573  * @param   pVM         Pointer to the current VM (if any).
    574  * @param   paArgs      Pointer to (readonly) array of arguments.
    575  * @param   cArgs       Number of arguments in the array.
    576  */
    577 static DECLCALLBACK(int) dbgcCmdBrkDisable(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
     547 * @interface_method_impl{FNDBCCMD, The 'bd' command.}
     548 */
     549static DECLCALLBACK(int) dbgcCmdBrkDisable(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
    578550{
    579551    /*
     
    589561            if (iBp == paArgs[iArg].u.u64Number)
    590562            {
    591                 rc = DBGFR3BpDisable(pVM, iBp);
     563                rc = DBGFR3BpDisable(pUVM, iBp);
    592564                if (RT_FAILURE(rc))
    593565                    rc = DBGCCmdHlpFailRc(pCmdHlp, pCmd, rc, "DBGFR3BpDisable failed for breakpoint %#x", iBp);
     
    602574            for (PDBGCBP pBp = pDbgc->pFirstBp; pBp; pBp = pBp->pNext)
    603575            {
    604                 int rc2 = DBGFR3BpDisable(pVM, pBp->iBp);
     576                int rc2 = DBGFR3BpDisable(pUVM, pBp->iBp);
    605577                if (RT_FAILURE(rc2))
    606578                    rc = DBGCCmdHlpFailRc(pCmdHlp, pCmd, rc2, "DBGFR3BpDisable failed for breakpoint %#x", pBp->iBp);
     
    615587
    616588/**
    617  * The 'be' command.
    618  *
    619  * @returns VBox status.
    620  * @param   pCmd        Pointer to the command descriptor (as registered).
    621  * @param   pCmdHlp     Pointer to command helper functions.
    622  * @param   pVM         Pointer to the current VM (if any).
    623  * @param   paArgs      Pointer to (readonly) array of arguments.
    624  * @param   cArgs       Number of arguments in the array.
    625  */
    626 static DECLCALLBACK(int) dbgcCmdBrkEnable(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
    627 {
    628     DBGC_CMDHLP_REQ_VM_RET(pCmdHlp, pCmd, pVM);
     589 * @interface_method_impl{FNDBCCMD, The 'be' command.}
     590 */
     591static DECLCALLBACK(int) dbgcCmdBrkEnable(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
     592{
     593    DBGC_CMDHLP_REQ_UVM_RET(pCmdHlp, pCmd, pUVM);
    629594
    630595    /*
     
    640605            if (iBp == paArgs[iArg].u.u64Number)
    641606            {
    642                 rc = DBGFR3BpEnable(pVM, iBp);
     607                rc = DBGFR3BpEnable(pUVM, iBp);
    643608                if (RT_FAILURE(rc))
    644609                    rc = DBGCCmdHlpFailRc(pCmdHlp, pCmd, rc, "DBGFR3BpEnable failed for breakpoint %#x", iBp);
     
    653618            for (PDBGCBP pBp = pDbgc->pFirstBp; pBp; pBp = pBp->pNext)
    654619            {
    655                 int rc2 = DBGFR3BpEnable(pVM, pBp->iBp);
     620                int rc2 = DBGFR3BpEnable(pUVM, pBp->iBp);
    656621                if (RT_FAILURE(rc2))
    657622                    rc = DBGCCmdHlpFailRc(pCmdHlp, pCmd, rc2, "DBGFR3BpEnable failed for breakpoint %#x", pBp->iBp);
     
    669634 *
    670635 * @returns VBox status code. Any failure will stop the enumeration.
    671  * @param   pVM         The VM handle.
     636 * @param   pUVM        The user mode VM handle.
    672637 * @param   pvUser      The user argument.
    673638 * @param   pBp         Pointer to the breakpoint information. (readonly)
    674639 */
    675 static DECLCALLBACK(int) dbgcEnumBreakpointsCallback(PVM pVM, void *pvUser, PCDBGFBP pBp)
     640static DECLCALLBACK(int) dbgcEnumBreakpointsCallback(PUVM pUVM, void *pvUser, PCDBGFBP pBp)
    676641{
    677642    PDBGC   pDbgc   = (PDBGC)pvUser;
     
    722687    RTINTPTR    off;
    723688    DBGFADDRESS Addr;
    724     int rc = DBGFR3AsSymbolByAddr(pVM, pDbgc->hDbgAs, DBGFR3AddrFromFlat(pVM, &Addr, pBp->GCPtr), &off, &Sym, NULL);
     689    int rc = DBGFR3AsSymbolByAddr(pUVM, pDbgc->hDbgAs, DBGFR3AddrFromFlat(pDbgc->pUVM, &Addr, pBp->GCPtr), &off, &Sym, NULL);
    725690    if (RT_SUCCESS(rc))
    726691    {
     
    751716
    752717/**
    753  * The 'bl' command.
    754  *
    755  * @returns VBox status.
    756  * @param   pCmd        Pointer to the command descriptor (as registered).
    757  * @param   pCmdHlp     Pointer to command helper functions.
    758  * @param   pVM         Pointer to the current VM (if any).
    759  * @param   paArgs      Pointer to (readonly) array of arguments.
    760  * @param   cArgs       Number of arguments in the array.
    761  */
    762 static DECLCALLBACK(int) dbgcCmdBrkList(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR /*paArgs*/, unsigned cArgs)
    763 {
    764     DBGC_CMDHLP_REQ_VM_RET(pCmdHlp, pCmd, pVM);
     718 * @interface_method_impl{FNDBCCMD, The 'bl' command.}
     719 */
     720static DECLCALLBACK(int) dbgcCmdBrkList(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
     721{
     722    DBGC_CMDHLP_REQ_UVM_RET(pCmdHlp, pCmd, pUVM);
    765723    DBGC_CMDHLP_ASSERT_PARSER_RET(pCmdHlp, pCmd, -1, cArgs == 0);
     724    NOREF(paArgs);
    766725
    767726    /*
     
    769728     */
    770729    PDBGC pDbgc = DBGC_CMDHLP2DBGC(pCmdHlp);
    771     int rc = DBGFR3BpEnum(pVM, dbgcEnumBreakpointsCallback, pDbgc);
     730    int rc = DBGFR3BpEnum(pUVM, dbgcEnumBreakpointsCallback, pDbgc);
    772731    if (RT_FAILURE(rc))
    773732        return DBGCCmdHlpFailRc(pCmdHlp, pCmd, rc, "DBGFR3BpEnum");
     
    777736
    778737/**
    779  * The 'bp' command.
    780  *
    781  * @returns VBox status.
    782  * @param   pCmd        Pointer to the command descriptor (as registered).
    783  * @param   pCmdHlp     Pointer to command helper functions.
    784  * @param   pVM         Pointer to the current VM (if any).
    785  * @param   paArgs      Pointer to (readonly) array of arguments.
    786  * @param   cArgs       Number of arguments in the array.
    787  */
    788 static DECLCALLBACK(int) dbgcCmdBrkSet(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
     738 * @interface_method_impl{FNDBCCMD, The 'bp' command.}
     739 */
     740static DECLCALLBACK(int) dbgcCmdBrkSet(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
    789741{
    790742    /*
     
    823775     */
    824776    uint32_t iBp;
    825     rc = DBGFR3BpSet(pVM, &Address, iHitTrigger, iHitDisable, &iBp);
     777    rc = DBGFR3BpSet(pUVM, &Address, iHitTrigger, iHitDisable, &iBp);
    826778    if (RT_SUCCESS(rc))
    827779    {
     
    836788                return DBGCCmdHlpPrintf(pCmdHlp, "Updated breakpoint %u at %RGv\n", iBp, Address.FlatPtr);
    837789        }
    838         int rc2 = DBGFR3BpClear(pDbgc->pVM, iBp);
     790        int rc2 = DBGFR3BpClear(pDbgc->pUVM, iBp);
    839791        AssertRC(rc2);
    840792    }
     
    844796
    845797/**
    846  * The 'br' command.
    847  *
    848  * @returns VBox status.
    849  * @param   pCmd        Pointer to the command descriptor (as registered).
    850  * @param   pCmdHlp     Pointer to command helper functions.
    851  * @param   pVM         Pointer to the current VM (if any).
    852  * @param   paArgs      Pointer to (readonly) array of arguments.
    853  * @param   cArgs       Number of arguments in the array.
    854  */
    855 static DECLCALLBACK(int) dbgcCmdBrkREM(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
     798 * @interface_method_impl{FNDBCCMD, The 'br' command.}
     799 */
     800static DECLCALLBACK(int) dbgcCmdBrkREM(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
    856801{
    857802    /*
     
    890835     */
    891836    uint32_t iBp;
    892     rc = DBGFR3BpSetREM(pVM, &Address, iHitTrigger, iHitDisable, &iBp);
     837    rc = DBGFR3BpSetREM(pUVM, &Address, iHitTrigger, iHitDisable, &iBp);
    893838    if (RT_SUCCESS(rc))
    894839    {
     
    903848                return DBGCCmdHlpPrintf(pCmdHlp, "Updated REM breakpoint %u at %RGv\n", iBp, Address.FlatPtr);
    904849        }
    905         int rc2 = DBGFR3BpClear(pDbgc->pVM, iBp);
     850        int rc2 = DBGFR3BpClear(pDbgc->pUVM, iBp);
    906851        AssertRC(rc2);
    907852    }
     
    911856
    912857/**
    913  * The 'u' command.
    914  *
    915  * @returns VBox status.
    916  * @param   pCmd        Pointer to the command descriptor (as registered).
    917  * @param   pCmdHlp     Pointer to command helper functions.
    918  * @param   pVM         Pointer to the current VM (if any).
    919  * @param   paArgs      Pointer to (readonly) array of arguments.
    920  * @param   cArgs       Number of arguments in the array.
    921  */
    922 static DECLCALLBACK(int) dbgcCmdUnassemble(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
     858 * @interface_method_impl{FNDBCCMD, The 'u' command.}
     859 */
     860static DECLCALLBACK(int) dbgcCmdUnassemble(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
    923861{
    924862    PDBGC pDbgc = DBGC_CMDHLP2DBGC(pCmdHlp);
     
    927865     * Validate input.
    928866     */
    929     DBGC_CMDHLP_REQ_VM_RET(pCmdHlp, pCmd, pVM);
     867    DBGC_CMDHLP_REQ_UVM_RET(pCmdHlp, pCmd, pUVM);
    930868    DBGC_CMDHLP_ASSERT_PARSER_RET(pCmdHlp, pCmd, -1, cArgs <= 1);
    931869    DBGC_CMDHLP_ASSERT_PARSER_RET(pCmdHlp, pCmd, 0, cArgs == 0 || DBGCVAR_ISPOINTER(paArgs[0].enmType));
     
    956894        {
    957895            /** @todo Batch query CS, RIP & CPU mode. */
    958             PVMCPU pVCpu = VMMGetCpuById(pVM, pDbgc->idCpu);
     896            PVMCPU pVCpu = VMMR3GetCpuByIdU(pUVM, pDbgc->idCpu);
    959897            if (    pDbgc->fRegCtxGuest
    960898                &&  CPUMIsGuestIn64BitCode(pVCpu))
     
    1053991        uint32_t    cbInstr = 1;
    1054992        if (pDbgc->DisasmPos.enmType == DBGCVAR_TYPE_GC_FLAT)
    1055             rc = DBGFR3DisasInstrEx(pVM, pDbgc->idCpu, DBGF_SEL_FLAT, pDbgc->DisasmPos.u.GCFlat, fFlags,
     993            rc = DBGFR3DisasInstrEx(pUVM, pDbgc->idCpu, DBGF_SEL_FLAT, pDbgc->DisasmPos.u.GCFlat, fFlags,
    1056994                                    &szDis[0], sizeof(szDis), &cbInstr);
    1057995        else
    1058             rc = DBGFR3DisasInstrEx(pVM, pDbgc->idCpu, pDbgc->DisasmPos.u.GCFar.sel, pDbgc->DisasmPos.u.GCFar.off, fFlags,
     996            rc = DBGFR3DisasInstrEx(pUVM, pDbgc->idCpu, pDbgc->DisasmPos.u.GCFar.sel, pDbgc->DisasmPos.u.GCFar.off, fFlags,
    1059997                                    &szDis[0], sizeof(szDis), &cbInstr);
    1060998        if (RT_SUCCESS(rc))
     
    10971035
    10981036/**
    1099  * The 'ls' command.
    1100  *
    1101  * @returns VBox status.
    1102  * @param   pCmd        Pointer to the command descriptor (as registered).
    1103  * @param   pCmdHlp     Pointer to command helper functions.
    1104  * @param   pVM         Pointer to the current VM (if any).
    1105  * @param   paArgs      Pointer to (readonly) array of arguments.
    1106  * @param   cArgs       Number of arguments in the array.
    1107  */
    1108 static DECLCALLBACK(int) dbgcCmdListSource(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
     1037 * @interface_method_impl{FNDBCCMD, The 'ls' command.}
     1038 */
     1039static DECLCALLBACK(int) dbgcCmdListSource(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
    11091040{
    11101041    PDBGC  pDbgc = DBGC_CMDHLP2DBGC(pCmdHlp);
     
    11131044     * Validate input.
    11141045     */
    1115     if (    cArgs > 1
    1116         ||  (cArgs == 1 && !DBGCVAR_ISPOINTER(paArgs[0].enmType)))
    1117         return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "internal error: The parser doesn't do its job properly yet.. It might help to use the '%%' operator.\n");
    1118     if (!pVM && !cArgs && !DBGCVAR_ISPOINTER(pDbgc->SourcePos.enmType))
    1119         return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "error: Don't know where to start disassembling...\n");
    1120     if (!pVM && cArgs && DBGCVAR_ISGCPOINTER(paArgs[0].enmType))
    1121         return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "error: GC address but no VM.\n");
     1046    DBGC_CMDHLP_ASSERT_PARSER_RET(pCmdHlp, pCmd, 0, cArgs <= 1);
     1047    if (cArgs == 1)
     1048        DBGC_CMDHLP_ASSERT_PARSER_RET(pCmdHlp, pCmd, 0, DBGCVAR_ISPOINTER(paArgs[0].enmType));
     1049    if (!pUVM && !cArgs && !DBGCVAR_ISPOINTER(pDbgc->SourcePos.enmType))
     1050        return DBGCCmdHlpFail(pCmdHlp, pCmd, "Don't know where to start listing...");
     1051    if (!pUVM && cArgs && DBGCVAR_ISGCPOINTER(paArgs[0].enmType))
     1052        return DBGCCmdHlpFail(pCmdHlp, pCmd, "GC address but no VM");
    11221053
    11231054    /*
     
    11281059        if (!DBGCVAR_ISPOINTER(pDbgc->SourcePos.enmType))
    11291060        {
    1130             PVMCPU pVCpu = VMMGetCpuById(pVM, pDbgc->idCpu);
     1061            PVMCPU pVCpu = VMMR3GetCpuByIdU(pUVM, pDbgc->idCpu);
    11311062            pDbgc->SourcePos.enmType     = DBGCVAR_TYPE_GC_FAR;
    11321063            pDbgc->SourcePos.u.GCFar.off = pDbgc->fRegCtxGuest ? CPUMGetGuestEIP(pVCpu) : CPUMGetHyperEIP(pVCpu);
     
    11981129        DBGFLINE    Line;
    11991130        RTGCINTPTR  off;
    1200         int rc = DBGFR3LineByAddr(pVM, pDbgc->SourcePos.u.GCFlat, &off, &Line);
     1131        int rc = DBGFR3LineByAddr(pUVM, pDbgc->SourcePos.u.GCFlat, &off, &Line);
    12011132        if (RT_FAILURE(rc))
    12021133            return VINF_SUCCESS;
     
    12891220
    12901221/**
    1291  * The 'r' command.
    1292  *
    1293  * @returns VBox status.
    1294  * @param   pCmd        Pointer to the command descriptor (as registered).
    1295  * @param   pCmdHlp     Pointer to command helper functions.
    1296  * @param   pVM         Pointer to the current VM (if any).
    1297  * @param   paArgs      Pointer to (readonly) array of arguments.
    1298  * @param   cArgs       Number of arguments in the array.
    1299  */
    1300 static DECLCALLBACK(int) dbgcCmdReg(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
     1222 * @interface_method_impl{FNDBCCMD, The 'r' command.}
     1223 */
     1224static DECLCALLBACK(int) dbgcCmdReg(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
    13011225{
    13021226    PDBGC pDbgc = DBGC_CMDHLP2DBGC(pCmdHlp);
    13031227    if (!pDbgc->fRegCtxGuest)
    1304         return dbgcCmdRegHyper(pCmd, pCmdHlp, pVM, paArgs, cArgs);
    1305     return dbgcCmdRegGuest(pCmd, pCmdHlp, pVM, paArgs, cArgs);
    1306 }
    1307 
    1308 
    1309 /**
    1310  * Common worker for the dbgcCmdReg*() commands.
    1311  *
    1312  * @returns VBox status.
    1313  * @param   pCmd        Pointer to the command descriptor (as registered).
    1314  * @param   pCmdHlp     Pointer to command helper functions.
    1315  * @param   pVM         Pointer to the current VM (if any).
    1316  * @param   paArgs      Pointer to (readonly) array of arguments.
    1317  * @param   cArgs       Number of arguments in the array.
    1318  * @param   pszPrefix   The symbol prefix.
    1319  */
    1320 static DECLCALLBACK(int) dbgcCmdRegCommon(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs,
     1228        return dbgcCmdRegHyper(pCmd, pCmdHlp, pUVM, paArgs, cArgs);
     1229    return dbgcCmdRegGuest(pCmd, pCmdHlp, pUVM, paArgs, cArgs);
     1230}
     1231
     1232
     1233/**
     1234 * @interface_method_impl{FNDBCCMD, Common worker for the dbgcCmdReg*()
     1235 *                       commands.}
     1236 */
     1237static DECLCALLBACK(int) dbgcCmdRegCommon(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs,
    13211238                                          const char *pszPrefix)
    13221239{
    13231240    PDBGC pDbgc = DBGC_CMDHLP2DBGC(pCmdHlp);
    1324     Assert(cArgs == 1 || cArgs == 2); /* cArgs == 0 is handled by the caller */
    1325     if (   paArgs[0].enmType != DBGCVAR_TYPE_STRING
    1326         && paArgs[0].enmType != DBGCVAR_TYPE_SYMBOL)
    1327         return DBGCCmdHlpPrintf(pCmdHlp, "internal error: The parser doesn't do its job properly yet.. Try drop the '@' or/and quote the register name\n");
     1241    Assert(cArgs == 1 || cArgs == 2); /* cArgs == 0 is handled by the caller  */
     1242    DBGC_CMDHLP_ASSERT_PARSER_RET(pCmdHlp, pCmd, 0, cArgs == 1 || cArgs == 2);
     1243    DBGC_CMDHLP_ASSERT_PARSER_RET(pCmdHlp, pCmd, 0,    paArgs[0].enmType == DBGCVAR_TYPE_STRING
     1244                                                    || paArgs[0].enmType == DBGCVAR_TYPE_SYMBOL);
    13281245
    13291246    /*
     
    13481265    DBGFREGVALTYPE  enmType;
    13491266    DBGFREGVAL      Value;
    1350     int rc = DBGFR3RegNmQuery(pVM, idCpu, pszReg, &Value, &enmType);
     1267    int rc = DBGFR3RegNmQuery(pUVM, idCpu, pszReg, &Value, &enmType);
    13511268    if (RT_FAILURE(rc))
    13521269    {
     
    13741291         * Modify the register.
    13751292         */
    1376         if (   paArgs[1].enmType == DBGCVAR_TYPE_STRING
    1377             || paArgs[1].enmType == DBGCVAR_TYPE_SYMBOL)
    1378             return DBGCCmdHlpPrintf(pCmdHlp, "internal error: The parser doesn't do its job properly on the 2nd argument yet...\n");
     1293        DBGC_CMDHLP_ASSERT_PARSER_RET(pCmdHlp, pCmd, 1,    paArgs[1].enmType == DBGCVAR_TYPE_STRING
     1294                                                        || paArgs[1].enmType == DBGCVAR_TYPE_SYMBOL);
    13791295        if (enmType != DBGFREGVALTYPE_DTR)
    13801296        {
     
    13911307        if (RT_SUCCESS(rc))
    13921308        {
    1393             rc = DBGFR3RegNmSet(pVM, idCpu, pszReg, &Value, enmType);
     1309            rc = DBGFR3RegNmSet(pUVM, idCpu, pszReg, &Value, enmType);
    13941310            if (RT_FAILURE(rc))
    13951311                rc = DBGCCmdHlpVBoxError(pCmdHlp, rc, "DBGFR3RegNmSet failed settings '%s%s': %Rrc\n",
     
    14091325
    14101326/**
    1411  * The 'rg', 'rg64' and 'rg32' commands.
    1412  *
    1413  * @returns VBox status.
    1414  * @param   pCmd        Pointer to the command descriptor (as registered).
    1415  * @param   pCmdHlp     Pointer to command helper functions.
    1416  * @param   pVM         Pointer to the current VM (if any).
    1417  * @param   paArgs      Pointer to (readonly) array of arguments.
    1418  * @param   cArgs       Number of arguments in the array.
    1419  */
    1420 static DECLCALLBACK(int) dbgcCmdRegGuest(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
     1327 * @interface_method_impl{FNDBCCMD, The 'rg', 'rg64' and 'rg32' commands.}
     1328 */
     1329static DECLCALLBACK(int) dbgcCmdRegGuest(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
    14211330{
    14221331    /*
     
    14281337        bool const  f64BitMode = !strcmp(pCmd->pszCmd, "rg64")
    14291338                              || (   !strcmp(pCmd->pszCmd, "rg32")
    1430                                   && CPUMIsGuestIn64BitCode(VMMGetCpuById(pVM, pDbgc->idCpu)));
     1339                                  && CPUMIsGuestIn64BitCode(VMMR3GetCpuByIdU(pUVM, pDbgc->idCpu)));
    14311340        char        szDisAndRegs[8192];
    14321341        int         rc;
     
    14351344        {
    14361345            if (f64BitMode)
    1437                 rc = DBGFR3RegPrintf(pVM, pDbgc->idCpu, &szDisAndRegs[0], sizeof(szDisAndRegs),
     1346                rc = DBGFR3RegPrintf(pUVM, pDbgc->idCpu, &szDisAndRegs[0], sizeof(szDisAndRegs),
    14381347                                     "u %016VR{rip} L 0\n"
    14391348                                     "rax=%016VR{rax} rbx=%016VR{rbx} rcx=%016VR{rcx} rdx=%016VR{rdx}\n"
     
    14441353                                     "cs=%04VR{cs} ds=%04VR{ds} es=%04VR{es} fs=%04VR{fs} gs=%04VR{gs} ss=%04VR{ss}                     rflags=%08VR{rflags}\n");
    14451354            else
    1446                 rc = DBGFR3RegPrintf(pVM, pDbgc->idCpu, szDisAndRegs, sizeof(szDisAndRegs),
     1355                rc = DBGFR3RegPrintf(pUVM, pDbgc->idCpu, szDisAndRegs, sizeof(szDisAndRegs),
    14471356                                     "u %04VR{cs}:%08VR{eip} L 0\n"
    14481357                                     "eax=%08VR{eax} ebx=%08VR{ebx} ecx=%08VR{ecx} edx=%08VR{edx} esi=%08VR{esi} edi=%08VR{edi}\n"
     
    14531362        {
    14541363            if (f64BitMode)
    1455                 rc = DBGFR3RegPrintf(pVM, pDbgc->idCpu, &szDisAndRegs[0], sizeof(szDisAndRegs),
     1364                rc = DBGFR3RegPrintf(pUVM, pDbgc->idCpu, &szDisAndRegs[0], sizeof(szDisAndRegs),
    14561365                                     "u %016VR{rip} L 0\n"
    14571366                                     "rax=%016VR{rax} rbx=%016VR{rbx} rcx=%016VR{rcx} rdx=%016VR{rdx}\n"
     
    14811390                                     );
    14821391            else
    1483                 rc = DBGFR3RegPrintf(pVM, pDbgc->idCpu, szDisAndRegs, sizeof(szDisAndRegs),
     1392                rc = DBGFR3RegPrintf(pUVM, pDbgc->idCpu, szDisAndRegs, sizeof(szDisAndRegs),
    14841393                                     "u %04VR{cs}:%08VR{eip} L 0\n"
    14851394                                     "eax=%08VR{eax} ebx=%08VR{ebx} ecx=%08VR{ecx} edx=%08VR{edx} esi=%08VR{esi} edi=%08VR{edi}\n"
     
    15091418        return pCmdHlp->pfnExec(pCmdHlp, "%s", szDisAndRegs);
    15101419    }
    1511     return dbgcCmdRegCommon(pCmd, pCmdHlp, pVM, paArgs, cArgs, "");
    1512 }
    1513 
    1514 
    1515 /**
    1516  * The 'rh' command.
    1517  *
    1518  * @returns VBox status.
    1519  * @param   pCmd        Pointer to the command descriptor (as registered).
    1520  * @param   pCmdHlp     Pointer to command helper functions.
    1521  * @param   pVM         Pointer to the current VM (if any).
    1522  * @param   paArgs      Pointer to (readonly) array of arguments.
    1523  * @param   cArgs       Number of arguments in the array.
    1524  */
    1525 static DECLCALLBACK(int) dbgcCmdRegHyper(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
     1420    return dbgcCmdRegCommon(pCmd, pCmdHlp, pUVM, paArgs, cArgs, "");
     1421}
     1422
     1423
     1424/**
     1425 * @interface_method_impl{FNDBCCMD, The 'rh' command.}
     1426 */
     1427static DECLCALLBACK(int) dbgcCmdRegHyper(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
    15261428{
    15271429    /*
     
    15351437
    15361438        if (pDbgc->fRegTerse)
    1537             rc = DBGFR3RegPrintf(pVM, pDbgc->idCpu | DBGFREG_HYPER_VMCPUID, szDisAndRegs, sizeof(szDisAndRegs),
     1439            rc = DBGFR3RegPrintf(pUVM, pDbgc->idCpu | DBGFREG_HYPER_VMCPUID, szDisAndRegs, sizeof(szDisAndRegs),
    15381440                                 "u %VR{cs}:%VR{eip} L 0\n"
    15391441                                 ".eax=%08VR{eax} .ebx=%08VR{ebx} .ecx=%08VR{ecx} .edx=%08VR{edx} .esi=%08VR{esi} .edi=%08VR{edi}\n"
     
    15411443                                 ".cs=%04VR{cs} .ds=%04VR{ds} .es=%04VR{es} .fs=%04VR{fs} .gs=%04VR{gs} .ss=%04VR{ss}              .eflags=%08VR{eflags}\n");
    15421444        else
    1543             rc = DBGFR3RegPrintf(pVM, pDbgc->idCpu | DBGFREG_HYPER_VMCPUID, szDisAndRegs, sizeof(szDisAndRegs),
     1445            rc = DBGFR3RegPrintf(pUVM, pDbgc->idCpu | DBGFREG_HYPER_VMCPUID, szDisAndRegs, sizeof(szDisAndRegs),
    15441446                                 "u %04VR{cs}:%08VR{eip} L 0\n"
    15451447                                 ".eax=%08VR{eax} .ebx=%08VR{ebx} .ecx=%08VR{ecx} .edx=%08VR{edx} .esi=%08VR{esi} .edi=%08VR{edi}\n"
     
    15661468        return pCmdHlp->pfnExec(pCmdHlp, "%s", szDisAndRegs);
    15671469    }
    1568     return dbgcCmdRegCommon(pCmd, pCmdHlp, pVM, paArgs, cArgs, ".");
    1569 }
    1570 
    1571 
    1572 /**
    1573  * The 'rt' command.
    1574  *
    1575  * @returns VBox status.
    1576  * @param   pCmd        Pointer to the command descriptor (as registered).
    1577  * @param   pCmdHlp     Pointer to command helper functions.
    1578  * @param   pVM         Pointer to the current VM (if any).
    1579  * @param   paArgs      Pointer to (readonly) array of arguments.
    1580  * @param   cArgs       Number of arguments in the array.
    1581  */
    1582 static DECLCALLBACK(int) dbgcCmdRegTerse(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
    1583 {
    1584     NOREF(pCmd); NOREF(pVM); NOREF(paArgs); NOREF(cArgs);
     1470    return dbgcCmdRegCommon(pCmd, pCmdHlp, pUVM, paArgs, cArgs, ".");
     1471}
     1472
     1473
     1474/**
     1475 * @interface_method_impl{FNDBCCMD, The 'rt' command.}
     1476 */
     1477static DECLCALLBACK(int) dbgcCmdRegTerse(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
     1478{
     1479    NOREF(pCmd); NOREF(pUVM); NOREF(paArgs); NOREF(cArgs);
    15851480
    15861481    PDBGC   pDbgc = DBGC_CMDHLP2DBGC(pCmdHlp);
     
    15911486
    15921487/**
    1593  * The 't' command.
    1594  *
    1595  * @returns VBox status.
    1596  * @param   pCmd        Pointer to the command descriptor (as registered).
    1597  * @param   pCmdHlp     Pointer to command helper functions.
    1598  * @param   pVM         Pointer to the current VM (if any).
    1599  * @param   paArgs      Pointer to (readonly) array of arguments.
    1600  * @param   cArgs       Number of arguments in the array.
    1601  */
    1602 static DECLCALLBACK(int) dbgcCmdTrace(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
     1488 * @interface_method_impl{FNDBCCMD, The 't' command.}
     1489 */
     1490static DECLCALLBACK(int) dbgcCmdTrace(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
    16031491{
    16041492    PDBGC   pDbgc = DBGC_CMDHLP2DBGC(pCmdHlp);
    16051493
    1606     int rc = DBGFR3Step(pVM, pDbgc->idCpu);
     1494    int rc = DBGFR3Step(pUVM, pDbgc->idCpu);
    16071495    if (RT_SUCCESS(rc))
    16081496        pDbgc->fReady = false;
     
    16161504
    16171505/**
    1618  * The 'k', 'kg' and 'kh' commands.
    1619  *
    1620  * @returns VBox status.
    1621  * @param   pCmd        Pointer to the command descriptor (as registered).
    1622  * @param   pCmdHlp     Pointer to command helper functions.
    1623  * @param   pVM         Pointer to the current VM (if any).
    1624  * @param   paArgs      Pointer to (readonly) array of arguments.
    1625  * @param   cArgs       Number of arguments in the array.
    1626  */
    1627 static DECLCALLBACK(int) dbgcCmdStack(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
     1506 * @interface_method_impl{FNDBCCMD, The 'k', 'kg' and 'kh' commands.}
     1507 */
     1508static DECLCALLBACK(int) dbgcCmdStack(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
    16281509{
    16291510    PDBGC   pDbgc = DBGC_CMDHLP2DBGC(pCmdHlp);
     
    16361517    bool const          fGuest = pCmd->pszCmd[1] == 'g'
    16371518                              || (!pCmd->pszCmd[1] && pDbgc->fRegCtxGuest);
    1638     rc = DBGFR3StackWalkBegin(pVM, pDbgc->idCpu, fGuest ? DBGFCODETYPE_GUEST : DBGFCODETYPE_HYPER, &pFirstFrame);
     1519    rc = DBGFR3StackWalkBegin(pUVM, pDbgc->idCpu, fGuest ? DBGFCODETYPE_GUEST : DBGFCODETYPE_HYPER, &pFirstFrame);
    16391520    if (RT_FAILURE(rc))
    16401521        return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "Failed to begin stack walk, rc=%Rrc\n", rc);
     
    20181899
    20191900/**
    2020  * The 'dg', 'dga', 'dl' and 'dla' commands.
    2021  *
    2022  * @returns VBox status.
    2023  * @param   pCmd        Pointer to the command descriptor (as registered).
    2024  * @param   pCmdHlp     Pointer to command helper functions.
    2025  * @param   pVM         Pointer to the current VM (if any).
    2026  * @param   paArgs      Pointer to (readonly) array of arguments.
    2027  * @param   cArgs       Number of arguments in the array.
    2028  */
    2029 static DECLCALLBACK(int) dbgcCmdDumpDT(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
     1901 * @interface_method_impl{FNDBCCMD, The 'dg', 'dga', 'dl' and 'dla' commands.}
     1902 */
     1903static DECLCALLBACK(int) dbgcCmdDumpDT(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
    20301904{
    20311905    /*
    20321906     * Validate input.
    20331907     */
    2034     if (!pVM)
    2035         return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "error: No VM.\n");
     1908    DBGC_CMDHLP_REQ_UVM_RET(pCmdHlp, pCmd, pUVM);
    20361909
    20371910    /*
     
    20401913     */
    20411914    PDBGC       pDbgc   = DBGC_CMDHLP2DBGC(pCmdHlp);
    2042     PVMCPU      pVCpu   = VMMGetCpuById(pVM, pDbgc->idCpu);
     1915    PVMCPU      pVCpu   = VMMR3GetCpuByIdU(pUVM, pDbgc->idCpu);
    20431916    CPUMMODE    enmMode = CPUMGetGuestMode(pVCpu);
    20441917    bool        fGdt    = pCmd->pszCmd[1] == 'g';
     
    20671940          * argument is given, that that into account.
    20681941          */
    2069         /* check that what we got makes sense as we don't trust the parser yet. */
    2070         if (    paArgs[i].enmType != DBGCVAR_TYPE_NUMBER
    2071             &&  !DBGCVAR_ISPOINTER(paArgs[i].enmType))
    2072             return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "error: arg #%u isn't of number or pointer type but %d.\n", i, paArgs[i].enmType);
     1942        DBGC_CMDHLP_ASSERT_PARSER_RET(pCmdHlp, pCmd, i, paArgs[i].enmType == DBGCVAR_TYPE_NUMBER || DBGCVAR_ISPOINTER(paArgs[i].enmType));
    20731943        uint64_t u64;
    20741944        unsigned cSels = 1;
     
    20991969            {
    21001970                DBGFSELINFO SelInfo;
    2101                 int rc = DBGFR3SelQueryInfo(pVM, pDbgc->idCpu, Sel | SelTable, DBGFSELQI_FLAGS_DT_GUEST, &SelInfo);
     1971                int rc = DBGFR3SelQueryInfo(pUVM, pDbgc->idCpu, Sel | SelTable, DBGFSELQI_FLAGS_DT_GUEST, &SelInfo);
    21021972                if (RT_SUCCESS(rc))
    21031973                {
     
    21422012
    21432013/**
    2144  * The 'di' and 'dia' commands.
    2145  *
    2146  * @returns VBox status.
    2147  * @param   pCmd        Pointer to the command descriptor (as registered).
    2148  * @param   pCmdHlp     Pointer to command helper functions.
    2149  * @param   pVM         Pointer to the current VM (if any).
    2150  * @param   paArgs      Pointer to (readonly) array of arguments.
    2151  * @param   cArgs       Number of arguments in the array.
    2152  */
    2153 static DECLCALLBACK(int) dbgcCmdDumpIDT(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
     2014 * @interface_method_impl{FNDBCCMD, The 'di' and 'dia' commands.}
     2015 */
     2016static DECLCALLBACK(int) dbgcCmdDumpIDT(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
    21542017{
    21552018    /*
    21562019     * Validate input.
    21572020     */
    2158     if (!pVM)
    2159         return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "error: No VM.\n");
     2021    DBGC_CMDHLP_REQ_UVM_RET(pCmdHlp, pCmd, pUVM);
    21602022
    21612023    /*
     
    21642026     */
    21652027    PDBGC       pDbgc = DBGC_CMDHLP2DBGC(pCmdHlp);
    2166     PVMCPU      pVCpu     = VMMGetCpuById(pVM, pDbgc->idCpu);
     2028    PVMCPU      pVCpu     = VMMR3GetCpuByIdU(pUVM, pDbgc->idCpu);
    21672029    uint16_t    cbLimit;
    21682030    RTGCUINTPTR GCPtrBase = CPUMGetGuestIDTR(pVCpu, &cbLimit);
     
    21952057    for (unsigned i = 0; i < cArgs; i++)
    21962058    {
    2197         /* check that what we got makes sense as we don't trust the parser yet. */
    2198         if (paArgs[i].enmType != DBGCVAR_TYPE_NUMBER)
    2199             return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "error: arg #%u isn't of number type but %d.\n", i, paArgs[i].enmType);
     2059        DBGC_CMDHLP_ASSERT_PARSER_RET(pCmdHlp, pCmd, i, paArgs[i].enmType == DBGCVAR_TYPE_NUMBER);
    22002060        if (paArgs[i].u.u64Number < 256)
    22012061        {
     
    22272087                AddrVar.u.GCFlat = GCPtrBase + iInt * cbEntry;
    22282088                AddrVar.enmRangeType = DBGCVAR_RANGE_NONE;
    2229                 int rc = pCmdHlp->pfnMemRead(pCmdHlp, pVM, &u, cbEntry, &AddrVar, NULL);
     2089                int rc = pCmdHlp->pfnMemRead(pCmdHlp, &u, cbEntry, &AddrVar, NULL);
    22302090                if (RT_FAILURE(rc))
    22312091                    return pCmdHlp->pfnVBoxError(pCmdHlp, rc, "Reading IDT entry %#04x.\n", (unsigned)iInt);
     
    22662126
    22672127/**
    2268  * The 'da', 'dq', 'dd', 'dw' and 'db' commands.
    2269  *
    2270  * @returns VBox status.
    2271  * @param   pCmd        Pointer to the command descriptor (as registered).
    2272  * @param   pCmdHlp     Pointer to command helper functions.
    2273  * @param   pVM         Pointer to the current VM (if any).
    2274  * @param   paArgs      Pointer to (readonly) array of arguments.
    2275  * @param   cArgs       Number of arguments in the array.
    2276  */
    2277 static DECLCALLBACK(int) dbgcCmdDumpMem(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
     2128 * @interface_method_impl{FNDBCCMD, The 'da', 'dq', 'dd', 'dw' and 'db'
     2129 *                       commands.}
     2130 */
     2131static DECLCALLBACK(int) dbgcCmdDumpMem(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
    22782132{
    22792133    PDBGC   pDbgc = DBGC_CMDHLP2DBGC(pCmdHlp);
     
    22822136     * Validate input.
    22832137     */
    2284     if (    cArgs > 1
    2285         ||  (cArgs == 1 && !DBGCVAR_ISPOINTER(paArgs[0].enmType)))
    2286         return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "internal error: The parser doesn't do its job properly yet.. It might help to use the '%%' operator.\n");
    2287     if (!pVM)
    2288         return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "error: No VM.\n");
     2138    DBGC_CMDHLP_ASSERT_PARSER_RET(pCmdHlp, pCmd, 0, cArgs <= 1);
     2139    if (cArgs == 1)
     2140        DBGC_CMDHLP_ASSERT_PARSER_RET(pCmdHlp, pCmd, 0, DBGCVAR_ISPOINTER(paArgs[0].enmType));
     2141    DBGC_CMDHLP_REQ_UVM_RET(pCmdHlp, pCmd, pUVM);
    22892142
    22902143    /*
     
    23622215        size_t  cbReq = RT_MIN((int)sizeof(achBuffer), cbLeft);
    23632216        size_t  cb = RT_MIN((int)sizeof(achBuffer), cbLeft);
    2364         int rc = pCmdHlp->pfnMemRead(pCmdHlp, pVM, &achBuffer, cbReq, &pDbgc->DumpPos, &cb);
     2217        int rc = pCmdHlp->pfnMemRead(pCmdHlp, &achBuffer, cbReq, &pDbgc->DumpPos, &cb);
    23652218        if (RT_FAILURE(rc))
    23662219        {
     
    24722325static RTGCPHYS dbgcGetGuestPageMode(PDBGC pDbgc, bool *pfPAE, bool *pfLME, bool *pfPSE, bool *pfPGE, bool *pfNXE)
    24732326{
    2474     PVMCPU      pVCpu = VMMGetCpuById(pDbgc->pVM, pDbgc->idCpu);
     2327    PVMCPU      pVCpu = VMMR3GetCpuByIdU(pDbgc->pUVM, pDbgc->idCpu);
    24752328    RTGCUINTREG cr4   = CPUMGetGuestCR4(pVCpu);
    24762329    *pfPSE = !!(cr4 & X86_CR4_PSE);
     
    25032356static RTHCPHYS dbgcGetShadowPageMode(PDBGC pDbgc, bool *pfPAE, bool *pfLME, bool *pfPSE, bool *pfPGE, bool *pfNXE)
    25042357{
    2505     PVMCPU pVCpu = VMMGetCpuById(pDbgc->pVM, pDbgc->idCpu);
     2358    PVMCPU pVCpu = VMMR3GetCpuByIdU(pDbgc->pUVM, pDbgc->idCpu);
    25062359
    25072360    *pfPSE = true;
     
    25342387
    25352388/**
    2536  * The 'dpd', 'dpda', 'dpdb', 'dpdg' and 'dpdh' commands.
    2537  *
    2538  * @returns VBox status.
    2539  * @param   pCmd        Pointer to the command descriptor (as registered).
    2540  * @param   pCmdHlp     Pointer to command helper functions.
    2541  * @param   pVM         Pointer to the current VM (if any).
    2542  * @param   paArgs      Pointer to (readonly) array of arguments.
    2543  * @param   cArgs       Number of arguments in the array.
    2544  */
    2545 static DECLCALLBACK(int) dbgcCmdDumpPageDir(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
     2389 * @interface_method_impl{FNDBCCMD, The 'dpd', 'dpda', 'dpdb', 'dpdg' and 'dpdh'
     2390 *                       commands.}
     2391 */
     2392static DECLCALLBACK(int) dbgcCmdDumpPageDir(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
    25462393{
    25472394    PDBGC   pDbgc = DBGC_CMDHLP2DBGC(pCmdHlp);
     
    25502397     * Validate input.
    25512398     */
    2552     if (    cArgs > 1
    2553         ||  (cArgs == 1 && pCmd->pszCmd[3] == 'a' && !DBGCVAR_ISPOINTER(paArgs[0].enmType))
    2554         ||  (cArgs == 1 && pCmd->pszCmd[3] != 'a' && !(paArgs[0].enmType == DBGCVAR_TYPE_NUMBER || DBGCVAR_ISPOINTER(paArgs[0].enmType)))
    2555         )
    2556         return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "internal error: The parser doesn't do its job properly yet.. It might help to use the '%%' operator.\n");
    2557     if (!pVM)
    2558         return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "error: No VM.\n");
     2399    DBGC_CMDHLP_ASSERT_PARSER_RET(pCmdHlp, pCmd, 0, cArgs <= 1);
     2400    if (cArgs == 1 && pCmd->pszCmd[3] == 'a')
     2401        DBGC_CMDHLP_ASSERT_PARSER_RET(pCmdHlp, pCmd, 0, DBGCVAR_ISPOINTER(paArgs[0].enmType));
     2402    if (cArgs == 1 && pCmd->pszCmd[3] != 'a')
     2403        DBGC_CMDHLP_ASSERT_PARSER_RET(pCmdHlp, pCmd, 0,    paArgs[0].enmType == DBGCVAR_TYPE_NUMBER
     2404                                                        || DBGCVAR_ISPOINTER(paArgs[0].enmType));
     2405    DBGC_CMDHLP_REQ_UVM_RET(pCmdHlp, pCmd, pUVM);
    25592406
    25602407    /*
     
    26762523            VarCur.u.u64Number += (((uint64_t)VarGCPtr.u.GCFlat >> X86_PML4_SHIFT) & X86_PML4_MASK) * sizeof(X86PML4E);
    26772524            X86PML4E Pml4e;
    2678             rc = pCmdHlp->pfnMemRead(pCmdHlp, pVM, &Pml4e, sizeof(Pml4e), &VarCur, NULL);
     2525            rc = pCmdHlp->pfnMemRead(pCmdHlp, &Pml4e, sizeof(Pml4e), &VarCur, NULL);
    26792526            if (RT_FAILURE(rc))
    26802527                return DBGCCmdHlpVBoxError(pCmdHlp, rc, "Reading PML4E memory at %DV.\n", &VarCur);
     
    26902537            X86PDPE Pdpe;
    26912538            VarCur.u.u64Number += ((VarGCPtr.u.GCFlat >> X86_PDPT_SHIFT) & X86_PDPT_MASK_PAE) * sizeof(Pdpe);
    2692             rc = pCmdHlp->pfnMemRead(pCmdHlp, pVM, &Pdpe, sizeof(Pdpe), &VarCur, NULL);
     2539            rc = pCmdHlp->pfnMemRead(pCmdHlp, &Pdpe, sizeof(Pdpe), &VarCur, NULL);
    26932540            if (RT_FAILURE(rc))
    26942541                return DBGCCmdHlpVBoxError(pCmdHlp, rc, "Reading PDPE memory at %DV.\n", &VarCur);
     
    27272574        X86PDEPAE Pde;
    27282575        Pde.u = 0;
    2729         rc = pCmdHlp->pfnMemRead(pCmdHlp, pVM, &Pde, cbEntry, &VarPDEAddr, NULL);
     2576        rc = pCmdHlp->pfnMemRead(pCmdHlp, &Pde, cbEntry, &VarPDEAddr, NULL);
    27302577        if (RT_FAILURE(rc))
    27312578            return pCmdHlp->pfnVBoxError(pCmdHlp, rc, "Reading PDE memory at %DV.\n", &VarPDEAddr);
     
    27942641
    27952642/**
    2796  * The 'dpdb' command.
    2797  *
    2798  * @returns VBox status.
    2799  * @param   pCmd        Pointer to the command descriptor (as registered).
    2800  * @param   pCmdHlp     Pointer to command helper functions.
    2801  * @param   pVM         Pointer to the current VM (if any).
    2802  * @param   paArgs      Pointer to (readonly) array of arguments.
    2803  * @param   cArgs       Number of arguments in the array.
    2804  */
    2805 static DECLCALLBACK(int) dbgcCmdDumpPageDirBoth(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
    2806 {
    2807     if (!pVM)
    2808         return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "error: No VM.\n");
     2643 * @interface_method_impl{FNDBCCMD, The 'dpdb' command.}
     2644 */
     2645static DECLCALLBACK(int) dbgcCmdDumpPageDirBoth(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
     2646{
     2647    DBGC_CMDHLP_REQ_UVM_RET(pCmdHlp, pCmd, pUVM);
    28092648    int rc1 = pCmdHlp->pfnExec(pCmdHlp, "dpdg %DV", &paArgs[0]);
    28102649    int rc2 = pCmdHlp->pfnExec(pCmdHlp, "dpdh %DV", &paArgs[0]);
     
    28172656
    28182657/**
    2819  * The 'dph*' commands and main part of 'm'.
    2820  *
    2821  * @returns VBox status.
    2822  * @param   pCmd        Pointer to the command descriptor (as registered).
    2823  * @param   pCmdHlp     Pointer to command helper functions.
    2824  * @param   pVM         Pointer to the current VM (if any).
    2825  * @param   paArgs      Pointer to (readonly) array of arguments.
    2826  * @param   cArgs       Number of arguments in the array.
    2827  */
    2828 static DECLCALLBACK(int) dbgcCmdDumpPageHierarchy(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
     2658 * @interface_method_impl{FNDBCCMD, The 'dph*' commands and main part of 'm'.}
     2659 */
     2660static DECLCALLBACK(int) dbgcCmdDumpPageHierarchy(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
    28292661{
    28302662    PDBGC pDbgc = DBGC_CMDHLP2DBGC(pCmdHlp);
    2831     if (!pVM)
    2832         return DBGCCmdHlpFail(pCmdHlp, pCmd, "No VM.\n");
     2663    DBGC_CMDHLP_REQ_UVM_RET(pCmdHlp, pCmd, pUVM);
    28332664
    28342665    /*
     
    29312762     * Call the worker.
    29322763     */
    2933     rc = DBGFR3PagingDumpEx(pVM, pDbgc->idCpu, fFlags, cr3, GCPtrFirst, GCPtrLast, 99 /*cMaxDepth*/,
     2764    rc = DBGFR3PagingDumpEx(pUVM, pDbgc->idCpu, fFlags, cr3, GCPtrFirst, GCPtrLast, 99 /*cMaxDepth*/,
    29342765                            DBGCCmdHlpGetDbgfOutputHlp(pCmdHlp));
    29352766    if (RT_FAILURE(rc))
     
    29412772
    29422773/**
    2943  * The 'dpg*' commands.
    2944  *
    2945  * @returns VBox status.
    2946  * @param   pCmd        Pointer to the command descriptor (as registered).
    2947  * @param   pCmdHlp     Pointer to command helper functions.
    2948  * @param   pVM         Pointer to the current VM (if any).
    2949  * @param   paArgs      Pointer to (readonly) array of arguments.
    2950  * @param   cArgs       Number of arguments in the array.
    2951  */
    2952 static DECLCALLBACK(int) dbgcCmdDumpPageTable(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
     2774 * @interface_method_impl{FNDBCCMD, The 'dpg*' commands.}
     2775 */
     2776static DECLCALLBACK(int) dbgcCmdDumpPageTable(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
    29532777{
    29542778    PDBGC   pDbgc = DBGC_CMDHLP2DBGC(pCmdHlp);
     
    29572781     * Validate input.
    29582782     */
    2959     if (    cArgs != 1
    2960         ||  (pCmd->pszCmd[3] == 'a' && !DBGCVAR_ISPOINTER(paArgs[0].enmType))
    2961         ||  (pCmd->pszCmd[3] != 'a' && !(paArgs[0].enmType == DBGCVAR_TYPE_NUMBER || DBGCVAR_ISPOINTER(paArgs[0].enmType)))
    2962         )
    2963         return DBGCCmdHlpPrintf(pCmdHlp, "internal error: The parser doesn't do its job properly yet.. It might help to use the '%%' operator.\n");
    2964     if (!pVM)
    2965         return DBGCCmdHlpPrintf(pCmdHlp, "error: No VM.\n");
     2783    DBGC_CMDHLP_ASSERT_PARSER_RET(pCmdHlp, pCmd, 0, cArgs == 1);
     2784    if (pCmd->pszCmd[3] == 'a')
     2785        DBGC_CMDHLP_ASSERT_PARSER_RET(pCmdHlp, pCmd, 0, DBGCVAR_ISPOINTER(paArgs[0].enmType));
     2786    else
     2787        DBGC_CMDHLP_ASSERT_PARSER_RET(pCmdHlp, pCmd, 0,    paArgs[0].enmType == DBGCVAR_TYPE_NUMBER
     2788                                                        || DBGCVAR_ISPOINTER(paArgs[0].enmType));
     2789    DBGC_CMDHLP_REQ_UVM_RET(pCmdHlp, pCmd, pUVM);
    29662790
    29672791    /*
     
    30452869            VarCur.u.u64Number += (((uint64_t)VarGCPtr.u.GCFlat >> X86_PML4_SHIFT) & X86_PML4_MASK) * sizeof(X86PML4E);
    30462870            X86PML4E Pml4e;
    3047             rc = pCmdHlp->pfnMemRead(pCmdHlp, pVM, &Pml4e, sizeof(Pml4e), &VarCur, NULL);
     2871            rc = pCmdHlp->pfnMemRead(pCmdHlp, &Pml4e, sizeof(Pml4e), &VarCur, NULL);
    30482872            if (RT_FAILURE(rc))
    30492873                return DBGCCmdHlpVBoxError(pCmdHlp, rc, "Reading PML4E memory at %DV.\n", &VarCur);
     
    30592883            X86PDPE Pdpe;
    30602884            VarCur.u.u64Number += ((VarGCPtr.u.GCFlat >> X86_PDPT_SHIFT) & X86_PDPT_MASK_PAE) * sizeof(Pdpe);
    3061             rc = pCmdHlp->pfnMemRead(pCmdHlp, pVM, &Pdpe, sizeof(Pdpe), &VarCur, NULL);
     2885            rc = pCmdHlp->pfnMemRead(pCmdHlp, &Pdpe, sizeof(Pdpe), &VarCur, NULL);
    30622886            if (RT_FAILURE(rc))
    30632887                return DBGCCmdHlpVBoxError(pCmdHlp, rc, "Reading PDPE memory at %DV.\n", &VarCur);
     
    30702894            X86PDEPAE Pde;
    30712895            VarCur.u.u64Number += ((VarGCPtr.u.GCFlat >> X86_PD_PAE_SHIFT) & X86_PD_PAE_MASK) * sizeof(Pde);
    3072             rc = pCmdHlp->pfnMemRead(pCmdHlp, pVM, &Pde, sizeof(Pde), &VarCur, NULL);
     2896            rc = pCmdHlp->pfnMemRead(pCmdHlp, &Pde, sizeof(Pde), &VarCur, NULL);
    30732897            if (RT_FAILURE(rc))
    30742898                return DBGCCmdHlpVBoxError(pCmdHlp, rc, "Reading PDE memory at %DV.\n", &VarCur);
     
    30882912            X86PDE Pde;
    30892913            VarCur.u.u64Number += ((VarGCPtr.u.GCFlat >> X86_PD_SHIFT) & X86_PD_MASK) * sizeof(Pde);
    3090             rc = pCmdHlp->pfnMemRead(pCmdHlp, pVM, &Pde, sizeof(Pde), &VarCur, NULL);
     2914            rc = pCmdHlp->pfnMemRead(pCmdHlp, &Pde, sizeof(Pde), &VarCur, NULL);
    30912915            if (RT_FAILURE(rc))
    30922916                return DBGCCmdHlpVBoxError(pCmdHlp, rc, "Reading PDE memory at %DV.\n", &VarCur);
     
    31202944        X86PTEPAE Pte;
    31212945        Pte.u = 0;
    3122         rc = pCmdHlp->pfnMemRead(pCmdHlp, pVM, &Pte, cbEntry, &VarPTEAddr, NULL);
     2946        rc = pCmdHlp->pfnMemRead(pCmdHlp, &Pte, cbEntry, &VarPTEAddr, NULL);
    31232947        if (RT_FAILURE(rc))
    31242948            return DBGCCmdHlpVBoxError(pCmdHlp, rc, "Reading PTE memory at %DV.\n", &VarPTEAddr);
     
    31692993
    31702994/**
    3171  * The 'dptb' command.
    3172  *
    3173  * @returns VBox status.
    3174  * @param   pCmd        Pointer to the command descriptor (as registered).
    3175  * @param   pCmdHlp     Pointer to command helper functions.
    3176  * @param   pVM         Pointer to the current VM (if any).
    3177  * @param   paArgs      Pointer to (readonly) array of arguments.
    3178  * @param   cArgs       Number of arguments in the array.
    3179  */
    3180 static DECLCALLBACK(int) dbgcCmdDumpPageTableBoth(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
    3181 {
    3182     if (!pVM)
    3183         return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "error: No VM.\n");
     2995 * @interface_method_impl{FNDBCCMD, The 'dptb' command.}
     2996 */
     2997static DECLCALLBACK(int) dbgcCmdDumpPageTableBoth(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
     2998{
     2999    DBGC_CMDHLP_REQ_UVM_RET(pCmdHlp, pCmd, pUVM);
    31843000    int rc1 = pCmdHlp->pfnExec(pCmdHlp, "dptg %DV", &paArgs[0]);
    31853001    int rc2 = pCmdHlp->pfnExec(pCmdHlp, "dpth %DV", &paArgs[0]);
     
    31923008
    31933009/**
    3194  * The 'dt' command.
    3195  *
    3196  * @returns VBox status.
    3197  * @param   pCmd        Pointer to the command descriptor (as registered).
    3198  * @param   pCmdHlp     Pointer to command helper functions.
    3199  * @param   pVM         Pointer to the current VM (if any).
    3200  * @param   paArgs      Pointer to (readonly) array of arguments.
    3201  * @param   cArgs       Number of arguments in the array.
    3202  */
    3203 static DECLCALLBACK(int) dbgcCmdDumpTSS(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
     3010 * @interface_method_impl{FNDBCCMD, The 'dt' command.}
     3011 */
     3012static DECLCALLBACK(int) dbgcCmdDumpTSS(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
    32043013{
    32053014    PDBGC pDbgc = DBGC_CMDHLP2DBGC(pCmdHlp);
    32063015    int   rc;
    32073016
    3208     if (!pVM)
    3209         return DBGCCmdHlpFail(pCmdHlp, pCmd, "No VM.\n");
    3210     if (    cArgs > 1
    3211         ||  (cArgs == 1 && paArgs[0].enmType == DBGCVAR_TYPE_STRING)
    3212         ||  (cArgs == 1 && paArgs[0].enmType == DBGCVAR_TYPE_SYMBOL))
    3213         return DBGCCmdHlpFail(pCmdHlp, pCmd, "internal error: The parser doesn't do its job properly yet...\n");
     3017    DBGC_CMDHLP_REQ_UVM_RET(pCmdHlp, pCmd, pUVM);
     3018    DBGC_CMDHLP_ASSERT_PARSER_RET(pCmdHlp, pCmd, 0, cArgs <= 1);
     3019    if (cArgs == 1)
     3020        DBGC_CMDHLP_ASSERT_PARSER_RET(pCmdHlp, pCmd, 0,    paArgs[0].enmType != DBGCVAR_TYPE_STRING
     3021                                                        && paArgs[0].enmType != DBGCVAR_TYPE_SYMBOL);
    32143022
    32153023    /*
     
    32333041        /** @todo consider querying the hidden bits instead (missing API). */
    32343042        uint16_t SelTR;
    3235         rc = DBGFR3RegCpuQueryU16(pVM, pDbgc->idCpu, DBGFREG_TR, &SelTR);
     3043        rc = DBGFR3RegCpuQueryU16(pUVM, pDbgc->idCpu, DBGFREG_TR, &SelTR);
    32363044        if (RT_FAILURE(rc))
    32373045            return DBGCCmdHlpFail(pCmdHlp, pCmd, "Failed to query TR, rc=%Rrc\n", rc);
     
    32653073        SelTss = VarTssAddr.u.GCFar.sel;
    32663074        DBGFSELINFO SelInfo;
    3267         rc = DBGFR3SelQueryInfo(pVM, pDbgc->idCpu, VarTssAddr.u.GCFar.sel, DBGFSELQI_FLAGS_DT_GUEST, &SelInfo);
     3075        rc = DBGFR3SelQueryInfo(pUVM, pDbgc->idCpu, VarTssAddr.u.GCFar.sel, DBGFSELQI_FLAGS_DT_GUEST, &SelInfo);
    32683076        if (RT_FAILURE(rc))
    32693077            return DBGCCmdHlpFail(pCmdHlp, pCmd, "DBGFR3SelQueryInfo(,%u,%d,,) -> %Rrc.\n",
     
    33073115        {
    33083116            uint64_t uEfer;
    3309             rc = DBGFR3RegCpuQueryU64(pVM, pDbgc->idCpu, DBGFREG_MSR_K6_EFER, &uEfer);
     3117            rc = DBGFR3RegCpuQueryU64(pUVM, pDbgc->idCpu, DBGFREG_MSR_K6_EFER, &uEfer);
    33103118            if (   RT_FAILURE(rc)
    33113119                || !(uEfer &  MSR_K6_EFER_LMA) )
     
    33533161    uint8_t  abBuf[_64K];
    33543162    size_t   cbTssRead;
    3355     rc = DBGCCmdHlpMemRead(pCmdHlp, pVM, abBuf, cbTss, &VarTssAddr, &cbTssRead);
     3163    rc = DBGCCmdHlpMemRead(pCmdHlp, abBuf, cbTss, &VarTssAddr, &cbTssRead);
    33563164    if (RT_FAILURE(rc))
    33573165        return DBGCCmdHlpFail(pCmdHlp, pCmd, "Failed to read TSS at %Dv: %Rrc\n", &VarTssAddr, rc);
     
    35263334
    35273335/**
    3528  * The 'm' command.
    3529  *
    3530  * @returns VBox status.
    3531  * @param   pCmd        Pointer to the command descriptor (as registered).
    3532  * @param   pCmdHlp     Pointer to command helper functions.
    3533  * @param   pVM         Pointer to the current VM (if any).
    3534  * @param   paArgs      Pointer to (readonly) array of arguments.
    3535  * @param   cArgs       Number of arguments in the array.
    3536  */
    3537 static DECLCALLBACK(int) dbgcCmdMemoryInfo(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
     3336 * @interface_method_impl{FNDBCCMD, The 'm' command.}
     3337 */
     3338static DECLCALLBACK(int) dbgcCmdMemoryInfo(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
    35383339{
    35393340    DBGCCmdHlpPrintf(pCmdHlp, "Address: %DV\n", &paArgs[0]);
    3540     if (!pVM)
    3541         return DBGCCmdHlpFail(pCmdHlp, pCmd, "No VM.\n");
    3542     return dbgcCmdDumpPageHierarchy(pCmd, pCmdHlp, pVM, paArgs, cArgs);
     3341    DBGC_CMDHLP_REQ_UVM_RET(pCmdHlp, pCmd, pUVM);
     3342    return dbgcCmdDumpPageHierarchy(pCmd, pCmdHlp, pUVM, paArgs, cArgs);
    35433343}
    35443344
     
    36823482
    36833483/**
    3684  * The 'eb', 'ew', 'ed' and 'eq' commands.
    3685  *
    3686  * @returns VBox status.
    3687  * @param   pCmd        Pointer to the command descriptor (as registered).
    3688  * @param   pCmdHlp     Pointer to command helper functions.
    3689  * @param   pVM         Pointer to the current VM (if any).
    3690  * @param   paArgs      Pointer to (readonly) array of arguments.
    3691  * @param   cArgs       Number of arguments in the array.
    3692  */
    3693 static DECLCALLBACK(int) dbgcCmdEditMem(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
     3484 * @interface_method_impl{FNDBCCMD, The 'eb', 'ew', 'ed' and 'eq' commands.}
     3485 */
     3486static DECLCALLBACK(int) dbgcCmdEditMem(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
    36943487{
    36953488    PDBGC pDbgc = DBGC_CMDHLP2DBGC(pCmdHlp);
     
    36993492     * Validate input.
    37003493     */
    3701     if (     cArgs < 2
    3702         ||  !DBGCVAR_ISPOINTER(paArgs[0].enmType))
    3703         return DBGCCmdHlpFail(pCmdHlp, pCmd, "internal error: The parser doesn't do its job properly yet... It might help to use the '%%' operator.\n");
     3494    DBGC_CMDHLP_ASSERT_PARSER_RET(pCmdHlp, pCmd, 0, cArgs >= 2);
     3495    DBGC_CMDHLP_ASSERT_PARSER_RET(pCmdHlp, pCmd, 0, DBGCVAR_ISPOINTER(paArgs[0].enmType));
    37043496    for (iArg = 1; iArg < cArgs; iArg++)
    3705         if (paArgs[iArg].enmType != DBGCVAR_TYPE_NUMBER)
    3706             return DBGCCmdHlpFail(pCmdHlp, pCmd, "internal error: The parser doesn't do its job properly yet: Arg #%u is not a number.\n", iArg);
    3707     if (!pVM)
    3708         return DBGCCmdHlpFail(pCmdHlp, pCmd, "error: No VM.\n");
     3497        DBGC_CMDHLP_ASSERT_PARSER_RET(pCmdHlp, pCmd, 0, paArgs[iArg].enmType == DBGCVAR_TYPE_NUMBER);
     3498    DBGC_CMDHLP_REQ_UVM_RET(pCmdHlp, pCmd, pUVM);
    37093499
    37103500    /*
     
    37283518    {
    37293519        size_t cbWritten;
    3730         int rc = pCmdHlp->pfnMemWrite(pCmdHlp, pVM, &paArgs[iArg].u, cbElement, &Addr, &cbWritten);
     3520        int rc = pCmdHlp->pfnMemWrite(pCmdHlp, &paArgs[iArg].u, cbElement, &Addr, &cbWritten);
    37313521        if (RT_FAILURE(rc))
    37323522            return pCmdHlp->pfnVBoxError(pCmdHlp, rc, "Writing memory at %DV.\n", &Addr);
     
    37523542 * @returns VBox status code.
    37533543 * @param   pCmdHlp     The command helpers.
    3754  * @param   pVM         The VM handle.
     3544 * @param   pUVM        The user mode VM handle.
    37553545 * @param   pAddress    The address to start searching from. (undefined on output)
    37563546 * @param   cbRange     The address range to search. Must not wrap.
     
    37613551 * @param   pResult     Where to store the result if it's a function invocation.
    37623552 */
    3763 static int dbgcCmdWorkerSearchMemDoIt(PDBGCCMDHLP pCmdHlp, PVM pVM, PDBGFADDRESS pAddress, RTGCUINTPTR cbRange,
     3553static int dbgcCmdWorkerSearchMemDoIt(PDBGCCMDHLP pCmdHlp, PUVM pUVM, PDBGFADDRESS pAddress, RTGCUINTPTR cbRange,
    37643554                                      const uint8_t *pabBytes, uint32_t cbBytes,
    37653555                                      uint32_t cbUnit, uint64_t cMaxHits, PDBGCVAR pResult)
     
    37753565        /* search */
    37763566        DBGFADDRESS HitAddress;
    3777         int rc = DBGFR3MemScan(pVM, pDbgc->idCpu, pAddress, cbRange, 1, pabBytes, cbBytes, &HitAddress);
     3567        int rc = DBGFR3MemScan(pUVM, pDbgc->idCpu, pAddress, cbRange, 1, pabBytes, cbBytes, &HitAddress);
    37783568        if (RT_FAILURE(rc))
    37793569        {
     
    38393629 * @returns VBox status code.
    38403630 * @param   pCmdHlp     Pointer to the command helper functions.
    3841  * @param   pVM         Pointer to the current VM (if any).
     3631 * @param   pUVM        The user mode VM handle.
    38423632 * @param   pResult     Where to store the result of a function invocation.
    38433633 */
    3844 static int dbgcCmdWorkerSearchMemResume(PDBGCCMDHLP pCmdHlp, PVM pVM, PDBGCVAR pResult)
     3634static int dbgcCmdWorkerSearchMemResume(PDBGCCMDHLP pCmdHlp, PUVM pUVM, PDBGCVAR pResult)
    38453635{
    38463636    PDBGC pDbgc = DBGC_CMDHLP2DBGC(pCmdHlp);
     
    38713661        cbRange = ~(RTGCUINTPTR)0 - pDbgc->SearchAddr.FlatPtr + !!pDbgc->SearchAddr.FlatPtr;
    38723662
    3873     return dbgcCmdWorkerSearchMemDoIt(pCmdHlp, pVM, &Address, cbRange, pDbgc->abSearch, pDbgc->cbSearch,
     3663    return dbgcCmdWorkerSearchMemDoIt(pCmdHlp, pUVM, &Address, cbRange, pDbgc->abSearch, pDbgc->cbSearch,
    38743664                                      pDbgc->cbSearchUnit, pDbgc->cMaxSearchHits, pResult);
    38753665}
     
    38813671 * @returns VBox status.
    38823672 * @param   pCmdHlp     Pointer to the command helper functions.
    3883  * @param   pVM         Pointer to the current VM (if any).
     3673 * @param   pUVM        The user mode VM handle.
    38843674 * @param   pAddress    Where to start searching. If no range, search till end of address space.
    38853675 * @param   cMaxHits    The maximum number of hits.
     
    38893679 * @param   pResult     Where to store the result of a function invocation.
    38903680 */
    3891 static int dbgcCmdWorkerSearchMem(PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR pAddress, uint64_t cMaxHits, char chType,
     3681static int dbgcCmdWorkerSearchMem(PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR pAddress, uint64_t cMaxHits, char chType,
    38923682                                  PCDBGCVAR paPatArgs, unsigned cPatArgs, PDBGCVAR pResult)
    38933683{
     
    39503740     * Ok, do it.
    39513741     */
    3952     return dbgcCmdWorkerSearchMemDoIt(pCmdHlp, pVM, &Address, cbRange, abBytes, cbBytes, cbUnit, cMaxHits, pResult);
    3953 }
    3954 
    3955 
    3956 /**
    3957  * The 's' command.
    3958  *
    3959  * @returns VBox status.
    3960  * @param   pCmd        Pointer to the command descriptor (as registered).
    3961  * @param   pCmdHlp     Pointer to command helper functions.
    3962  * @param   pVM         Pointer to the current VM (if any).
    3963  * @param   paArgs      Pointer to (readonly) array of arguments.
    3964  * @param   cArgs       Number of arguments in the array.
    3965  */
    3966 static DECLCALLBACK(int) dbgcCmdSearchMem(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
     3742    return dbgcCmdWorkerSearchMemDoIt(pCmdHlp, pUVM, &Address, cbRange, abBytes, cbBytes, cbUnit, cMaxHits, pResult);
     3743}
     3744
     3745
     3746/**
     3747 * @interface_method_impl{FNDBCCMD, The 's' command.}
     3748 */
     3749static DECLCALLBACK(int) dbgcCmdSearchMem(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
    39673750{
    39683751    /* check that the parser did what it's supposed to do. */
     
    39753758     */
    39763759    if (cArgs == 0)
    3977         return dbgcCmdWorkerSearchMemResume(pCmdHlp, pVM, NULL);
     3760        return dbgcCmdWorkerSearchMemResume(pCmdHlp, pUVM, NULL);
    39783761
    39793762    /*
     
    39863769
    39873770/**
    3988  * The 's?' command.
    3989  *
    3990  * @returns VBox status.
    3991  * @param   pCmd        Pointer to the command descriptor (as registered).
    3992  * @param   pCmdHlp     Pointer to command helper functions.
    3993  * @param   pVM         Pointer to the current VM (if any).
    3994  * @param   paArgs      Pointer to (readonly) array of arguments.
    3995  * @param   cArgs       Number of arguments in the array.
    3996  */
    3997 static DECLCALLBACK(int) dbgcCmdSearchMemType(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
     3771 * @interface_method_impl{FNDBCCMD, The 's?' command.}
     3772 */
     3773static DECLCALLBACK(int) dbgcCmdSearchMemType(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
    39983774{
    39993775    /* check that the parser did what it's supposed to do. */
    4000     if (    cArgs < 2
    4001         ||  !DBGCVAR_ISGCPOINTER(paArgs[0].enmType))
    4002         return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "parser error\n");
    4003     return dbgcCmdWorkerSearchMem(pCmdHlp, pVM, &paArgs[0], 25, pCmd->pszCmd[1], paArgs + 1, cArgs - 1, NULL);
     3776    DBGC_CMDHLP_ASSERT_PARSER_RET(pCmdHlp, pCmd, 0, cArgs >= 2 && DBGCVAR_ISGCPOINTER(paArgs[0].enmType));
     3777    return dbgcCmdWorkerSearchMem(pCmdHlp, pUVM, &paArgs[0], 25, pCmd->pszCmd[1], paArgs + 1, cArgs - 1, NULL);
    40043778}
    40053779
     
    40103784 * @returns VBox status code.
    40113785 * @param   pCmdHlp     Pointer to command helper functions.
    4012  * @param   pVM         Pointer to the current VM (if any).
     3786 * @param   pUVM        The user mode VM handle.
    40133787 * @param   pArg        Pointer to the address or symbol to lookup.
    40143788 */
    4015 static int dbgcDoListNear(PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR pArg)
     3789static int dbgcDoListNear(PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR pArg)
    40163790{
    40173791    PDBGC pDbgc = DBGC_CMDHLP2DBGC(pCmdHlp);
     
    40243798         * Lookup the symbol address.
    40253799         */
    4026         rc = DBGFR3AsSymbolByName(pVM, pDbgc->hDbgAs, pArg->u.pszString, &Symbol, NULL);
     3800        rc = DBGFR3AsSymbolByName(pUVM, pDbgc->hDbgAs, pArg->u.pszString, &Symbol, NULL);
    40273801        if (RT_FAILURE(rc))
    40283802            return pCmdHlp->pfnVBoxError(pCmdHlp, rc, "DBGFR3AsSymbolByName(,,%s,)\n", pArg->u.pszString);
     
    40423816        RTINTPTR    offDisp;
    40433817        DBGFADDRESS Addr;
    4044         rc = DBGFR3AsSymbolByAddr(pVM, pDbgc->hDbgAs, DBGFR3AddrFromFlat(pVM, &Addr, AddrVar.u.GCFlat), &offDisp, &Symbol, NULL);
     3818        rc = DBGFR3AsSymbolByAddr(pUVM, pDbgc->hDbgAs, DBGFR3AddrFromFlat(pDbgc->pUVM, &Addr, AddrVar.u.GCFlat), &offDisp, &Symbol, NULL);
    40453819        if (RT_FAILURE(rc))
    40463820            return pCmdHlp->pfnVBoxError(pCmdHlp, rc, "DBGFR3ASymbolByAddr(,,%RGv,,)\n", AddrVar.u.GCFlat);
     
    40633837
    40643838/**
    4065  * The 'ln' (listnear) command.
    4066  *
    4067  * @returns VBox status.
    4068  * @param   pCmd        Pointer to the command descriptor (as registered).
    4069  * @param   pCmdHlp     Pointer to command helper functions.
    4070  * @param   pVM         Pointer to the current VM (if any).
    4071  * @param   paArgs      Pointer to (readonly) array of arguments.
    4072  * @param   cArgs       Number of arguments in the array.
    4073  */
    4074 static DECLCALLBACK(int) dbgcCmdListNear(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
     3839 * @interface_method_impl{FNDBCCMD, The 'ln' (listnear) command.}
     3840 */
     3841static DECLCALLBACK(int) dbgcCmdListNear(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
    40753842{
    40763843    if (!cArgs)
     
    40833850        if (RT_FAILURE(rc))
    40843851            return pCmdHlp->pfnVBoxError(pCmdHlp, rc, "%%(cs:eip)\n");
    4085         return dbgcDoListNear(pCmdHlp, pVM, &AddrVar);
     3852        return dbgcDoListNear(pCmdHlp, pUVM, &AddrVar);
    40863853    }
    40873854
     
    40923859    for (unsigned iArg = 0; iArg < cArgs; iArg++)
    40933860    {
    4094         int rc = dbgcDoListNear(pCmdHlp, pVM, &paArgs[iArg]);
     3861        int rc = dbgcDoListNear(pCmdHlp, pUVM, &paArgs[iArg]);
    40953862        if (RT_FAILURE(rc))
    40963863            return rc;
     
    41203887
    41213888/**
    4122  * The 'ln' (listnear) command.
    4123  *
    4124  * @returns VBox status.
    4125  * @param   pCmd        Pointer to the command descriptor (as registered).
    4126  * @param   pCmdHlp     Pointer to command helper functions.
    4127  * @param   pVM         Pointer to the current VM (if any).
    4128  * @param   paArgs      Pointer to (readonly) array of arguments.
    4129  * @param   cArgs       Number of arguments in the array.
    4130  */
    4131 static DECLCALLBACK(int) dbgcCmdListModules(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
     3889 * @interface_method_impl{FNDBCCMD, The 'ln' (list near) command.}
     3890 */
     3891static DECLCALLBACK(int) dbgcCmdListModules(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
    41323892{
    41333893    bool const  fMappings   = pCmd->pszCmd[2] == 'o';
     
    41383898     * those matching the input.
    41393899     */
    4140     RTDBGAS     hAs         = DBGFR3AsResolveAndRetain(pVM, pDbgc->hDbgAs);
     3900    RTDBGAS     hAs         = DBGFR3AsResolveAndRetain(pUVM, pDbgc->hDbgAs);
    41413901    uint32_t    cMods       = RTDbgAsModuleCount(hAs);
    41423902    for (uint32_t iMod = 0; iMod < cMods; iMod++)
     
    42133973 * @callback_method_impl{Reads a unsigned 8-bit value.}
    42143974 */
    4215 static DECLCALLBACK(int) dbgcFuncReadU8(PCDBGCFUNC pFunc, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, uint32_t cArgs,
     3975static DECLCALLBACK(int) dbgcFuncReadU8(PCDBGCFUNC pFunc, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, uint32_t cArgs,
    42163976                                        PDBGCVAR pResult)
    42173977{
     
    42213981
    42223982    uint8_t b;
    4223     int rc = DBGCCmdHlpMemRead(pCmdHlp, pVM, &b, sizeof(b), &paArgs[0], NULL);
     3983    int rc = DBGCCmdHlpMemRead(pCmdHlp, &b, sizeof(b), &paArgs[0], NULL);
    42243984    if (RT_FAILURE(rc))
    42253985        return rc;
     
    42343994 * @callback_method_impl{Reads a unsigned 16-bit value.}
    42353995 */
    4236 static DECLCALLBACK(int) dbgcFuncReadU16(PCDBGCFUNC pFunc, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, uint32_t cArgs,
     3996static DECLCALLBACK(int) dbgcFuncReadU16(PCDBGCFUNC pFunc, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, uint32_t cArgs,
    42373997                                         PDBGCVAR pResult)
    42383998{
     
    42424002
    42434003    uint16_t u16;
    4244     int rc = DBGCCmdHlpMemRead(pCmdHlp, pVM, &u16, sizeof(u16), &paArgs[0], NULL);
     4004    int rc = DBGCCmdHlpMemRead(pCmdHlp, &u16, sizeof(u16), &paArgs[0], NULL);
    42454005    if (RT_FAILURE(rc))
    42464006        return rc;
     
    42554015 * @callback_method_impl{Reads a unsigned 32-bit value.}
    42564016 */
    4257 static DECLCALLBACK(int) dbgcFuncReadU32(PCDBGCFUNC pFunc, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, uint32_t cArgs,
     4017static DECLCALLBACK(int) dbgcFuncReadU32(PCDBGCFUNC pFunc, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, uint32_t cArgs,
    42584018                                         PDBGCVAR pResult)
    42594019{
     
    42634023
    42644024    uint32_t u32;
    4265     int rc = DBGCCmdHlpMemRead(pCmdHlp, pVM, &u32, sizeof(u32), &paArgs[0], NULL);
     4025    int rc = DBGCCmdHlpMemRead(pCmdHlp, &u32, sizeof(u32), &paArgs[0], NULL);
    42664026    if (RT_FAILURE(rc))
    42674027        return rc;
     
    42764036 * @callback_method_impl{Reads a unsigned 64-bit value.}
    42774037 */
    4278 static DECLCALLBACK(int) dbgcFuncReadU64(PCDBGCFUNC pFunc, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, uint32_t cArgs,
     4038static DECLCALLBACK(int) dbgcFuncReadU64(PCDBGCFUNC pFunc, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, uint32_t cArgs,
    42794039                                         PDBGCVAR pResult)
    42804040{
     
    42844044
    42854045    uint64_t u64;
    4286     int rc = DBGCCmdHlpMemRead(pCmdHlp, pVM, &u64, sizeof(u64), &paArgs[0], NULL);
     4046    int rc = DBGCCmdHlpMemRead(pCmdHlp, &u64, sizeof(u64), &paArgs[0], NULL);
    42874047    if (RT_FAILURE(rc))
    42884048        return rc;
     
    42974057 * @callback_method_impl{Reads a unsigned pointer-sized value.}
    42984058 */
    4299 static DECLCALLBACK(int) dbgcFuncReadPtr(PCDBGCFUNC pFunc, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, uint32_t cArgs,
     4059static DECLCALLBACK(int) dbgcFuncReadPtr(PCDBGCFUNC pFunc, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, uint32_t cArgs,
    43004060                                         PDBGCVAR pResult)
    43014061{
     
    43064066    CPUMMODE enmMode = DBGCCmdHlpGetCpuMode(pCmdHlp);
    43074067    if (enmMode == CPUMMODE_LONG)
    4308         return dbgcFuncReadU64(pFunc, pCmdHlp, pVM, paArgs, cArgs, pResult);
    4309     return dbgcFuncReadU32(pFunc, pCmdHlp, pVM, paArgs, cArgs, pResult);
     4068        return dbgcFuncReadU64(pFunc, pCmdHlp, pUVM, paArgs, cArgs, pResult);
     4069    return dbgcFuncReadU32(pFunc, pCmdHlp, pUVM, paArgs, cArgs, pResult);
    43104070}
    43114071
     
    43144074 * @callback_method_impl{The hi(value) function implementation.}
    43154075 */
    4316 static DECLCALLBACK(int) dbgcFuncHi(PCDBGCFUNC pFunc, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, uint32_t cArgs,
     4076static DECLCALLBACK(int) dbgcFuncHi(PCDBGCFUNC pFunc, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, uint32_t cArgs,
    43174077                                    PDBGCVAR pResult)
    43184078{
     
    43344094    DBGCVAR_SET_RANGE(pResult, paArgs[0].enmRangeType, paArgs[0].u64Range);
    43354095
    4336     NOREF(pFunc); NOREF(pCmdHlp); NOREF(pVM);
     4096    NOREF(pFunc); NOREF(pCmdHlp); NOREF(pUVM);
    43374097    return VINF_SUCCESS;
    43384098}
     
    43424102 * @callback_method_impl{The low(value) function implementation.}
    43434103 */
    4344 static DECLCALLBACK(int) dbgcFuncLow(PCDBGCFUNC pFunc, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, uint32_t cArgs,
     4104static DECLCALLBACK(int) dbgcFuncLow(PCDBGCFUNC pFunc, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, uint32_t cArgs,
    43454105                                     PDBGCVAR pResult)
    43464106{
     
    43624122    DBGCVAR_SET_RANGE(pResult, paArgs[0].enmRangeType, paArgs[0].u64Range);
    43634123
    4364     NOREF(pFunc); NOREF(pCmdHlp); NOREF(pVM);
     4124    NOREF(pFunc); NOREF(pCmdHlp); NOREF(pUVM);
    43654125    return VINF_SUCCESS;
    43664126}
     
    43704130 * @callback_method_impl{The low(value) function implementation.}
    43714131 */
    4372 static DECLCALLBACK(int) dbgcFuncNot(PCDBGCFUNC pFunc, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, uint32_t cArgs,
     4132static DECLCALLBACK(int) dbgcFuncNot(PCDBGCFUNC pFunc, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, uint32_t cArgs,
    43734133                                     PDBGCVAR pResult)
    43744134{
    43754135    AssertReturn(cArgs == 1, VERR_DBGC_PARSE_BUG);
    4376     NOREF(pFunc); NOREF(pCmdHlp); NOREF(pVM);
     4136    NOREF(pFunc); NOREF(pCmdHlp); NOREF(pUVM);
    43774137    return DBGCCmdHlpEval(pCmdHlp, pResult, "!(%Dv)", &paArgs[0]);
    43784138}
  • trunk/src/VBox/Debugger/DBGCEval.cpp

    r41780 r44399  
    55
    66/*
    7  * Copyright (C) 2006-2012 Oracle Corporation
     7 * Copyright (C) 2006-2013 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    434434                                  pszArgs, &iArg, &cArgs);
    435435    if (RT_SUCCESS(rc))
    436         rc = pFunc->pfnHandler(pFunc, &pDbgc->CmdHlp, pDbgc->pVM, &pDbgc->aArgs[iArg], cArgs, pResult);
     436        rc = pFunc->pfnHandler(pFunc, &pDbgc->CmdHlp, pDbgc->pUVM, &pDbgc->aArgs[iArg], cArgs, pResult);
    437437    pDbgc->iArg = iArg;
    438438    return rc;
     
    13711371         */
    13721372        if (!fNoExecute)
    1373             rc = pCmd->pfnHandler(pCmd, &pDbgc->CmdHlp, pDbgc->pVM, &pDbgc->aArgs[iArg], cArgs);
     1373            rc = pCmd->pfnHandler(pCmd, &pDbgc->CmdHlp, pDbgc->pUVM, &pDbgc->aArgs[iArg], cArgs);
    13741374        pDbgc->rcCmd = rc;
    13751375        pDbgc->iArg  = iArg;
  • trunk/src/VBox/Debugger/DBGCFunctions.cpp

    r41561 r44399  
    55
    66/*
    7  * Copyright (C) 2006-2012 Oracle Corporation
     7 * Copyright (C) 2006-2013 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    4545 * @callback_method_impl{The randu32() function implementation.}
    4646 */
    47 static DECLCALLBACK(int) dbgcFuncRandU32(PCDBGCFUNC pFunc, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, uint32_t cArgs,
     47static DECLCALLBACK(int) dbgcFuncRandU32(PCDBGCFUNC pFunc, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, uint32_t cArgs,
    4848                                         PDBGCVAR pResult)
    4949{
     
    5151    uint32_t u32 = RTRandU32();
    5252    DBGCVAR_INIT_NUMBER(pResult, u32);
    53     NOREF(pFunc); NOREF(pCmdHlp); NOREF(pVM); NOREF(paArgs);
     53    NOREF(pFunc); NOREF(pCmdHlp); NOREF(pUVM); NOREF(paArgs);
    5454    return VINF_SUCCESS;
    5555}
  • trunk/src/VBox/Debugger/DBGCInternal.h

    r41561 r44399  
    112112    /** Pointer to the current VM. */
    113113    PVM                 pVM;
     114    /** The user mode handle of the current VM. */
     115    PUVM                pUVM;
    114116    /** The ID of current virtual CPU. */
    115117    VMCPUID             idCpu;
  • trunk/src/VBox/Debugger/DBGCOps.cpp

    r41573 r44399  
    462462    if (enmCat == DBGCVAR_CAT_SYMBOL)
    463463    {
    464         int rc = DBGFR3RegNmValidate(pDbgc->pVM, pDbgc->idCpu, pArg->u.pszString);
     464        int rc = DBGFR3RegNmValidate(pDbgc->pUVM, pDbgc->idCpu, pArg->u.pszString);
    465465        if (RT_SUCCESS(rc))
    466466            DBGCVAR_INIT_STRING(pResult, pArg->u.pszString);
     
    473473    DBGFREGVALTYPE  enmType;
    474474    DBGFREGVAL      Value;
    475     int rc = DBGFR3RegNmQuery(pDbgc->pVM, pDbgc->idCpu, pArg->u.pszString, &Value, &enmType);
     475    int rc = DBGFR3RegNmQuery(pDbgc->pUVM, pDbgc->idCpu, pArg->u.pszString, &Value, &enmType);
    476476    if (RT_SUCCESS(rc))
    477477    {
  • trunk/src/VBox/Debugger/DBGCTcp.cpp

    r35628 r44399  
    55
    66/*
    7  * Copyright (C) 2006-2011 Oracle Corporation
     7 * Copyright (C) 2006-2013 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    185185 * @param   pvUser      The VM handle.
    186186 */
    187 static int      dbgcTcpConnection(RTSOCKET Sock, void *pvUser)
     187static DECLCALLBACK(int) dbgcTcpConnection(RTSOCKET Sock, void *pvUser)
    188188{
    189189    LogFlow(("dbgcTcpConnection: connection! Sock=%d pvUser=%p\n", Sock, pvUser));
     
    199199    DbgcTcp.fAlive = true;
    200200    DbgcTcp.Sock   = Sock;
    201     int rc = DBGCCreate((PVM)pvUser, &DbgcTcp.Back, 0);
     201    int rc = DBGCCreate((PUVM)pvUser, &DbgcTcp.Back, 0);
    202202    LogFlow(("dbgcTcpConnection: disconnect rc=%Rrc\n", rc));
    203203    return rc;
     
    209209 *
    210210 * @returns VBox status.
    211  * @param   pVM        VM handle.
     211 * @param   pUVM        The user mode VM handle.
    212212 * @param   ppvData     Where to store a pointer to the instance data.
    213213 */
    214 DBGDECL(int)    DBGCTcpCreate(PVM pVM, void **ppvData)
     214DBGDECL(int)    DBGCTcpCreate(PUVM pUVM, void **ppvData)
    215215{
    216216    /*
    217217     * Check what the configuration says.
    218218     */
    219     PCFGMNODE pKey = CFGMR3GetChild(CFGMR3GetRoot(pVM), "DBGC");
     219    PCFGMNODE pKey = CFGMR3GetChild(CFGMR3GetRootU(pUVM), "DBGC");
    220220    bool fEnabled;
    221221    int rc = CFGMR3QueryBoolDef(pKey, "Enabled", &fEnabled,
     
    227227        );
    228228    if (RT_FAILURE(rc))
    229         return VM_SET_ERROR(pVM, rc, "Configuration error: Failed querying \"DBGC/Enabled\"");
     229        return VM_SET_ERROR_U(pUVM, rc, "Configuration error: Failed querying \"DBGC/Enabled\"");
    230230
    231231    if (!fEnabled)
     
    241241    rc = CFGMR3QueryU32Def(pKey, "Port", &u32Port, 5000);
    242242    if (RT_FAILURE(rc))
    243         return VM_SET_ERROR(pVM, rc, "Configuration error: Failed querying \"DBGC/Port\"");
     243        return VM_SET_ERROR_U(pUVM, rc, "Configuration error: Failed querying \"DBGC/Port\"");
    244244
    245245    /*
     
    249249    rc = CFGMR3QueryStringDef(pKey, "Address", szAddress, sizeof(szAddress), "");
    250250    if (RT_FAILURE(rc))
    251         return VM_SET_ERROR(pVM, rc, "Configuration error: Failed querying \"DBGC/Address\"");
     251        return VM_SET_ERROR_U(pUVM, rc, "Configuration error: Failed querying \"DBGC/Address\"");
    252252
    253253    /*
     
    255255     */
    256256    PRTTCPSERVER pServer;
    257     rc = RTTcpServerCreate(szAddress, u32Port, RTTHREADTYPE_DEBUGGER, "DBGC", dbgcTcpConnection, pVM, &pServer);
     257    rc = RTTcpServerCreate(szAddress, u32Port, RTTHREADTYPE_DEBUGGER, "DBGC", dbgcTcpConnection, pUVM, &pServer);
    258258    if (RT_SUCCESS(rc))
    259259    {
     
    264264
    265265    LogFlow(("DBGCTcpCreate: returns %Rrc\n", rc));
    266     return VM_SET_ERROR(pVM, rc, "Cannot start TCP-based debugging console service");
     266    return VM_SET_ERROR_U(pUVM, rc, "Cannot start TCP-based debugging console service");
    267267}
    268268
     
    272272 *
    273273 * @returns VBox status.
    274  * @param   pVM         VM handle.
    275  */
    276 DBGDECL(int) DBGCTcpTerminate(PVM pVM, void *pvData)
     274 * @param   pUVM            The user mode VM handle.
     275 * @param   pvData          The data returned by DBGCTcpCreate.
     276 */
     277DBGDECL(int) DBGCTcpTerminate(PUVM pUVM, void *pvData)
    277278{
    278279    /*
  • trunk/src/VBox/Debugger/DBGConsole.cpp

    r43394 r44399  
    55
    66/*
    7  * Copyright (C) 2006-2011 Oracle Corporation
     7 * Copyright (C) 2006-2013 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    162162#include <VBox/dbg.h>
    163163#include <VBox/vmm/dbgf.h>
     164#include <VBox/vmm/vmapi.h> /* VMR3GetVM() */
    164165#include <VBox/err.h>
    165166#include <VBox/log.h>
     
    259260     */
    260261    RTDBGSYMBOL Symbol;
    261     rc = DBGFR3AsSymbolByName(pDbgc->pVM, pDbgc->hDbgAs, pszSymbol, &Symbol, NULL);
     262    rc = DBGFR3AsSymbolByName(pDbgc->pUVM, pDbgc->hDbgAs, pszSymbol, &Symbol, NULL);
    262263    if (RT_SUCCESS(rc))
    263264    {
     
    674675                    break;
    675676            }
    676             if (RT_SUCCESS(rc) && DBGFR3IsHalted(pDbgc->pVM))
     677            if (RT_SUCCESS(rc) && DBGFR3IsHalted(pDbgc->pUVM))
    677678                rc = pDbgc->CmdHlp.pfnExec(&pDbgc->CmdHlp, "r");
    678679            else
     
    810811    for (;;)
    811812    {
    812         if (    pDbgc->pVM
    813             &&  DBGFR3CanWait(pDbgc->pVM))
     813        if (    pDbgc->pUVM
     814            &&  DBGFR3CanWait(pDbgc->pUVM))
    814815        {
    815816            /*
     
    817818             */
    818819            PCDBGFEVENT pEvent;
    819             rc = DBGFR3EventWait(pDbgc->pVM, pDbgc->fLog ? 1 : 32, &pEvent);
     820            rc = DBGFR3EventWait(pDbgc->pUVM, pDbgc->fLog ? 1 : 32, &pEvent);
    820821            if (RT_SUCCESS(rc))
    821822            {
     
    891892    pDbgc->pBack            = pBack;
    892893    pDbgc->pVM              = NULL;
     894    pDbgc->pUVM             = NULL;
    893895    pDbgc->idCpu            = 0;
    894896    pDbgc->hDbgAs           = DBGF_AS_GLOBAL;
     
    954956
    955957    /* Detach from the VM. */
    956     if (pDbgc->pVM)
    957         DBGFR3Detach(pDbgc->pVM);
     958    if (pDbgc->pUVM)
     959        DBGFR3Detach(pDbgc->pUVM);
    958960
    959961    /* finally, free the instance memory. */
     
    971973 * @returns The VBox status code causing the console termination.
    972974 *
    973  * @param   pVM         VM Handle.
     975 * @param   pUVM        The user mode VM handle.
    974976 * @param   pBack       Pointer to the backend structure. This must contain
    975977 *                      a full set of function pointers to service the console.
     
    978980 *          callbacks to return fatal failures.
    979981 */
    980 DBGDECL(int) DBGCCreate(PVM pVM, PDBGCBACK pBack, unsigned fFlags)
     982DBGDECL(int) DBGCCreate(PUVM pUVM, PDBGCBACK pBack, unsigned fFlags)
    981983{
    982984    /*
    983985     * Validate input.
    984986     */
    985     AssertPtrNullReturn(pVM, VERR_INVALID_POINTER);
     987    AssertPtrNullReturn(pUVM, VERR_INVALID_VM_HANDLE);
     988    PVM pVM = NULL;
     989    if (pUVM)
     990    {
     991        pVM = VMR3GetVM(pUVM);
     992        AssertPtrReturn(pVM, VERR_INVALID_VM_HANDLE);
     993    }
    986994
    987995    /*
     
    10021010     * Attach to the specified VM.
    10031011     */
    1004     if (RT_SUCCESS(rc) && pVM)
    1005     {
    1006         rc = DBGFR3Attach(pVM);
     1012    if (RT_SUCCESS(rc) && pUVM)
     1013    {
     1014        rc = DBGFR3Attach(pUVM);
    10071015        if (RT_SUCCESS(rc))
    10081016        {
    10091017            pDbgc->pVM   = pVM;
     1018            pDbgc->pUVM  = pUVM;
    10101019            pDbgc->idCpu = 0;
    10111020            rc = pDbgc->CmdHlp.pfnPrintf(&pDbgc->CmdHlp, NULL,
  • trunk/src/VBox/Debugger/DBGPlugInCommonELF.h

    r33540 r44399  
    3535/* @} */
    3636
    37 int DBGDiggerCommonParseElf32Mod(PVM pVM, const char *pszModName, const char *pszFilename, uint32_t fFlags,
     37int DBGDiggerCommonParseElf32Mod(PUVM pUVM, const char *pszModName, const char *pszFilename, uint32_t fFlags,
    3838                                 Elf32_Ehdr const *pEhdr, Elf32_Shdr const *paShdrs,
    3939                                 Elf32_Sym const *paSyms, size_t cMaxSyms,
     
    4141                                 RTGCPTR MinAddr, RTGCPTR MaxAddr, uint64_t uModTag);
    4242
    43 int DBGDiggerCommonParseElf64Mod(PVM pVM, const char *pszModName, const char *pszFilename, uint32_t fFlags,
     43int DBGDiggerCommonParseElf64Mod(PUVM pUVM, const char *pszModName, const char *pszFilename, uint32_t fFlags,
    4444                                 Elf64_Ehdr const *pEhdr, Elf64_Shdr const *paShdrs,
    4545                                 Elf64_Sym const *paSyms, size_t cMaxSyms,
  • trunk/src/VBox/Debugger/DBGPlugInCommonELFTmpl.cpp.h

    r43876 r44399  
    4444 * @returns VBox status code.
    4545 *
    46  * @param   pVM             The VM handle.
     46 * @param   pUVM            The user mode VM handle.
    4747 * @param   pszModName      The module name.
    4848 * @param   pszFilename     The filename. optional.
     
    6969 * @param   uModTag         Module tag. Pass 0 if tagging is of no interest.
    7070 */
    71 int DBGDiggerCommonParseElfMod(PVM pVM, const char *pszModName, const char *pszFilename, uint32_t fFlags,
     71int DBGDiggerCommonParseElfMod(PUVM pUVM, const char *pszModName, const char *pszFilename, uint32_t fFlags,
    7272                               Elf_Ehdr const *pEhdr, Elf_Shdr const *paShdrs,
    7373                               Elf_Sym const *paSyms, size_t cMaxSyms,
     
    7575                               RTGCPTR MinAddr, RTGCPTR MaxAddr, uint64_t uModTag)
    7676{
    77     AssertPtrReturn(pVM, VERR_INVALID_POINTER);
     77    AssertPtrReturn(pUVM, VERR_INVALID_POINTER);
    7878    AssertPtrReturn(pszModName, VERR_INVALID_POINTER);
    7979    AssertPtrReturn(pszFilename, VERR_INVALID_POINTER);
     
    316316     * Link it into the address space.
    317317     */
    318     RTDBGAS hAs = DBGFR3AsResolveAndRetain(pVM, DBGF_AS_KERNEL);
     318    RTDBGAS hAs = DBGFR3AsResolveAndRetain(pUVM, DBGF_AS_KERNEL);
    319319    if (hAs != NIL_RTDBGAS)
    320320        rc = dbgDiggerCommonLinkElfSegs(hAs, hMod, paSegs, cSegs);
  • trunk/src/VBox/Debugger/DBGPlugInDiggers.cpp

    r40726 r44399  
    2828
    2929
    30 DECLEXPORT(int) DBGCPlugInEntry(DBGCPLUGINOP enmOperation, PVM pVM, uintptr_t uArg)
     30DECLEXPORT(int) DBGCPlugInEntry(DBGCPLUGINOP enmOperation, PUVM pUVM, uintptr_t uArg)
    3131{
    3232    static PCDBGFOSREG s_aPlugIns[] =
     
    4848            for (unsigned i = 0; i < RT_ELEMENTS(s_aPlugIns); i++)
    4949            {
    50                 int rc = DBGFR3OSRegister(pVM, s_aPlugIns[i]);
     50                int rc = DBGFR3OSRegister(pUVM, s_aPlugIns[i]);
    5151                if (RT_FAILURE(rc))
    5252                {
    5353                    AssertRC(rc);
    5454                    while (i-- > 0)
    55                         DBGFR3OSDeregister(pVM, s_aPlugIns[i]);
     55                        DBGFR3OSDeregister(pUVM, s_aPlugIns[i]);
    5656                    return rc;
    5757                }
     
    6464            for (unsigned i = 0; i < RT_ELEMENTS(s_aPlugIns); i++)
    6565            {
    66                 int rc = DBGFR3OSDeregister(pVM, s_aPlugIns[i]);
     66                int rc = DBGFR3OSDeregister(pUVM, s_aPlugIns[i]);
    6767                AssertRC(rc);
    6868            }
  • trunk/src/VBox/Debugger/DBGPlugInLinux.cpp

    r35346 r44399  
    7474*   Internal Functions                                                         *
    7575*******************************************************************************/
    76 static DECLCALLBACK(int)  dbgDiggerLinuxInit(PVM pVM, void *pvData);
     76static DECLCALLBACK(int)  dbgDiggerLinuxInit(PUVM pUVM, void *pvData);
    7777
    7878
     
    9292 * @copydoc DBGFOSREG::pfnQueryInterface
    9393 */
    94 static DECLCALLBACK(void *) dbgDiggerLinuxQueryInterface(PVM pVM, void *pvData, DBGFOSINTERFACE enmIf)
     94static DECLCALLBACK(void *) dbgDiggerLinuxQueryInterface(PUVM pUVM, void *pvData, DBGFOSINTERFACE enmIf)
    9595{
    9696    return NULL;
     
    101101 * @copydoc DBGFOSREG::pfnQueryVersion
    102102 */
    103 static DECLCALLBACK(int)  dbgDiggerLinuxQueryVersion(PVM pVM, void *pvData, char *pszVersion, size_t cchVersion)
     103static DECLCALLBACK(int)  dbgDiggerLinuxQueryVersion(PUVM pUVM, void *pvData, char *pszVersion, size_t cchVersion)
    104104{
    105105    PDBGDIGGERLINUX pThis = (PDBGDIGGERLINUX)pvData;
     
    109109     * It's all in the linux banner.
    110110     */
    111     int rc = DBGFR3MemReadString(pVM, 0, &pThis->AddrLinuxBanner, pszVersion, cchVersion);
     111    int rc = DBGFR3MemReadString(pUVM, 0, &pThis->AddrLinuxBanner, pszVersion, cchVersion);
    112112    if (RT_SUCCESS(rc))
    113113    {
     
    129129 * @copydoc DBGFOSREG::pfnTerm
    130130 */
    131 static DECLCALLBACK(void)  dbgDiggerLinuxTerm(PVM pVM, void *pvData)
     131static DECLCALLBACK(void)  dbgDiggerLinuxTerm(PUVM pUVM, void *pvData)
    132132{
    133133    PDBGDIGGERLINUX pThis = (PDBGDIGGERLINUX)pvData;
     
    141141 * @copydoc DBGFOSREG::pfnRefresh
    142142 */
    143 static DECLCALLBACK(int)  dbgDiggerLinuxRefresh(PVM pVM, void *pvData)
     143static DECLCALLBACK(int)  dbgDiggerLinuxRefresh(PUVM pUVM, void *pvData)
    144144{
    145145    PDBGDIGGERLINUX pThis = (PDBGDIGGERLINUX)pvData;
     
    150150     * For now we'll flush and reload everything.
    151151     */
    152     dbgDiggerLinuxTerm(pVM, pvData);
    153     return dbgDiggerLinuxInit(pVM, pvData);
     152    dbgDiggerLinuxTerm(pUVM, pvData);
     153    return dbgDiggerLinuxInit(pUVM, pvData);
    154154}
    155155
     
    158158 * @copydoc DBGFOSREG::pfnInit
    159159 */
    160 static DECLCALLBACK(int)  dbgDiggerLinuxInit(PVM pVM, void *pvData)
     160static DECLCALLBACK(int)  dbgDiggerLinuxInit(PUVM pUVM, void *pvData)
    161161{
    162162    PDBGDIGGERLINUX pThis = (PDBGDIGGERLINUX)pvData;
     
    183183 * @copydoc DBGFOSREG::pfnProbe
    184184 */
    185 static DECLCALLBACK(bool)  dbgDiggerLinuxProbe(PVM pVM, void *pvData)
     185static DECLCALLBACK(bool)  dbgDiggerLinuxProbe(PUVM pUVM, void *pvData)
    186186{
    187187    PDBGDIGGERLINUX pThis = (PDBGDIGGERLINUX)pvData;
     
    196196    {
    197197        DBGFADDRESS KernelAddr;
    198         DBGFR3AddrFromFlat(pVM, &KernelAddr, g_au64LnxKernelAddresses[i]);
     198        DBGFR3AddrFromFlat(pUVM, &KernelAddr, g_au64LnxKernelAddresses[i]);
    199199        DBGFADDRESS HitAddr;
    200200        static const uint8_t s_abLinuxVersion[] = "Linux version 2.";
    201         int rc = DBGFR3MemScan(pVM, 0, &KernelAddr, LNX_MAX_KERNEL_SIZE, 1,
     201        int rc = DBGFR3MemScan(pUVM, 0, &KernelAddr, LNX_MAX_KERNEL_SIZE, 1,
    202202                               s_abLinuxVersion, sizeof(s_abLinuxVersion) - 1, &HitAddr);
    203203        if (RT_SUCCESS(rc))
     
    205205            char szTmp[128];
    206206            char const *pszY = &szTmp[sizeof(s_abLinuxVersion) - 1];
    207             rc = DBGFR3MemReadString(pVM, 0, &HitAddr, szTmp, sizeof(szTmp));
     207            rc = DBGFR3MemReadString(pUVM, 0, &HitAddr, szTmp, sizeof(szTmp));
    208208            if (    RT_SUCCESS(rc)
    209209                &&  *pszY >= '0'
     
    223223 * @copydoc DBGFOSREG::pfnDestruct
    224224 */
    225 static DECLCALLBACK(void)  dbgDiggerLinuxDestruct(PVM pVM, void *pvData)
     225static DECLCALLBACK(void)  dbgDiggerLinuxDestruct(PUVM pUVM, void *pvData)
    226226{
    227227
     
    232232 * @copydoc DBGFOSREG::pfnConstruct
    233233 */
    234 static DECLCALLBACK(int)  dbgDiggerLinuxConstruct(PVM pVM, void *pvData)
     234static DECLCALLBACK(int)  dbgDiggerLinuxConstruct(PUVM pUVM, void *pvData)
    235235{
    236236    return VINF_SUCCESS;
  • trunk/src/VBox/Debugger/DBGPlugInOS2.cpp

    r43876 r44399  
    8585*   Internal Functions                                                         *
    8686*******************************************************************************/
    87 static DECLCALLBACK(int)  dbgDiggerOS2Init(PVM pVM, void *pvData);
     87static DECLCALLBACK(int)  dbgDiggerOS2Init(PUVM pUVM, void *pvData);
    8888
    8989
     
    9696 * Process a PE image found in guest memory.
    9797 *
    98  * @param   pThis               The instance data.
    99  * @param   pVM                 The VM handle.
    100  * @param   pszName             The image name.
    101  * @param   pImageAddr          The image address.
    102  * @param   cbImage             The size of the image.
    103  * @param   pbBuf               Scratch buffer containing the first
    104  *                              RT_MIN(cbBuf, cbImage) bytes of the image.
    105  * @param   cbBuf               The scratch buffer size.
    106  */
    107 static void dbgDiggerOS2ProcessImage(PDBGDIGGEROS2 pThis, PVM pVM, const char *pszName,
     98 * @param   pThis           The instance data.
     99 * @param   pUVM            The user mode VM handle.
     100 * @param   pszName         The image name.
     101 * @param   pImageAddr      The image address.
     102 * @param   cbImage         The size of the image.
     103 * @param   pbBuf           Scratch buffer containing the first
     104 *                          RT_MIN(cbBuf, cbImage) bytes of the image.
     105 * @param   cbBuf           The scratch buffer size.
     106 */
     107static void dbgDiggerOS2ProcessImage(PDBGDIGGEROS2 pThis, PUVM pUVM, const char *pszName,
    108108                                     PCDBGFADDRESS pImageAddr, uint32_t cbImage,
    109109                                     uint8_t *pbBuf, size_t cbBuf)
     
    118118 * @copydoc DBGFOSREG::pfnQueryInterface
    119119 */
    120 static DECLCALLBACK(void *) dbgDiggerOS2QueryInterface(PVM pVM, void *pvData, DBGFOSINTERFACE enmIf)
     120static DECLCALLBACK(void *) dbgDiggerOS2QueryInterface(PUVM pUVM, void *pvData, DBGFOSINTERFACE enmIf)
    121121{
    122122    return NULL;
     
    127127 * @copydoc DBGFOSREG::pfnQueryVersion
    128128 */
    129 static DECLCALLBACK(int)  dbgDiggerOS2QueryVersion(PVM pVM, void *pvData, char *pszVersion, size_t cchVersion)
     129static DECLCALLBACK(int)  dbgDiggerOS2QueryVersion(PUVM pUVM, void *pvData, char *pszVersion, size_t cchVersion)
    130130{
    131131    PDBGDIGGEROS2 pThis = (PDBGDIGGEROS2)pvData;
     
    171171 * @copydoc DBGFOSREG::pfnTerm
    172172 */
    173 static DECLCALLBACK(void)  dbgDiggerOS2Term(PVM pVM, void *pvData)
     173static DECLCALLBACK(void)  dbgDiggerOS2Term(PUVM pUVM, void *pvData)
    174174{
    175175    PDBGDIGGEROS2 pThis = (PDBGDIGGEROS2)pvData;
     
    183183 * @copydoc DBGFOSREG::pfnRefresh
    184184 */
    185 static DECLCALLBACK(int)  dbgDiggerOS2Refresh(PVM pVM, void *pvData)
     185static DECLCALLBACK(int)  dbgDiggerOS2Refresh(PUVM pUVM, void *pvData)
    186186{
    187187    PDBGDIGGEROS2 pThis = (PDBGDIGGEROS2)pvData;
     
    192192     * For now we'll flush and reload everything.
    193193     */
    194     RTDBGAS hDbgAs = DBGFR3AsResolveAndRetain(pVM, DBGF_AS_KERNEL);
     194    RTDBGAS hDbgAs = DBGFR3AsResolveAndRetain(pUVM, DBGF_AS_KERNEL);
    195195    if (hDbgAs != NIL_RTDBGAS)
    196196    {
     
    212212    }
    213213
    214     dbgDiggerOS2Term(pVM, pvData);
    215     return dbgDiggerOS2Init(pVM, pvData);
     214    dbgDiggerOS2Term(pUVM, pvData);
     215    return dbgDiggerOS2Init(pUVM, pvData);
    216216}
    217217
     
    220220 * @copydoc DBGFOSREG::pfnInit
    221221 */
    222 static DECLCALLBACK(int)  dbgDiggerOS2Init(PVM pVM, void *pvData)
     222static DECLCALLBACK(int)  dbgDiggerOS2Init(PUVM pUVM, void *pvData)
    223223{
    224224    PDBGDIGGEROS2 pThis = (PDBGDIGGEROS2)pvData;
     
    240240    do {
    241241        /* Version info is at GIS:15h (major/minor/revision). */
    242         rc = DBGFR3AddrFromSelOff(pVM, 0 /*idCpu*/, &Addr, pThis->selGIS, 0x15);
     242        rc = DBGFR3AddrFromSelOff(pUVM, 0 /*idCpu*/, &Addr, pThis->selGIS, 0x15);
    243243        if (RT_FAILURE(rc))
    244244            break;
    245         rc = DBGFR3MemRead(pVM, 0 /*idCpu*/, &Addr, u.au32, sizeof(uint32_t));
     245        rc = DBGFR3MemRead(pUVM, 0 /*idCpu*/, &Addr, u.au32, sizeof(uint32_t));
    246246        if (RT_FAILURE(rc))
    247247            break;
     
    260260 * @copydoc DBGFOSREG::pfnProbe
    261261 */
    262 static DECLCALLBACK(bool)  dbgDiggerOS2Probe(PVM pVM, void *pvData)
     262static DECLCALLBACK(bool)  dbgDiggerOS2Probe(PUVM pUVM, void *pvData)
    263263{
    264264    PDBGDIGGEROS2   pThis = (PDBGDIGGEROS2)pvData;
     
    283283     */
    284284    do {
    285         rc = DBGFR3AddrFromSelOff(pVM, 0 /*idCpu*/, &Addr, 0x70, 0x00);
     285        rc = DBGFR3AddrFromSelOff(pUVM, 0 /*idCpu*/, &Addr, 0x70, 0x00);
    286286        if (RT_FAILURE(rc))
    287287            break;
    288         rc = DBGFR3MemRead(pVM, 0 /*idCpu*/, &Addr, u.au32, 256);
     288        rc = DBGFR3MemRead(pUVM, 0 /*idCpu*/, &Addr, u.au32, 256);
    289289        if (RT_FAILURE(rc))
    290290            break;
     
    318318 * @copydoc DBGFOSREG::pfnDestruct
    319319 */
    320 static DECLCALLBACK(void)  dbgDiggerOS2Destruct(PVM pVM, void *pvData)
     320static DECLCALLBACK(void)  dbgDiggerOS2Destruct(PUVM pUVM, void *pvData)
    321321{
    322322
     
    327327 * @copydoc DBGFOSREG::pfnConstruct
    328328 */
    329 static DECLCALLBACK(int)  dbgDiggerOS2Construct(PVM pVM, void *pvData)
     329static DECLCALLBACK(int)  dbgDiggerOS2Construct(PUVM pUVM, void *pvData)
    330330{
    331331    PDBGDIGGEROS2 pThis = (PDBGDIGGEROS2)pvData;
  • trunk/src/VBox/Debugger/DBGPlugInSolaris.cpp

    r35346 r44399  
    350350*   Internal Functions                                                         *
    351351*******************************************************************************/
    352 static DECLCALLBACK(int)  dbgDiggerSolarisInit(PVM pVM, void *pvData);
     352static DECLCALLBACK(int)  dbgDiggerSolarisInit(PUVM pUVM, void *pvData);
    353353
    354354
     
    357357 * @copydoc DBGFOSREG::pfnQueryInterface
    358358 */
    359 static DECLCALLBACK(void *) dbgDiggerSolarisQueryInterface(PVM pVM, void *pvData, DBGFOSINTERFACE enmIf)
     359static DECLCALLBACK(void *) dbgDiggerSolarisQueryInterface(PUVM pUVM, void *pvData, DBGFOSINTERFACE enmIf)
    360360{
    361361    return NULL;
     
    366366 * @copydoc DBGFOSREG::pfnQueryVersion
    367367 */
    368 static DECLCALLBACK(int)  dbgDiggerSolarisQueryVersion(PVM pVM, void *pvData, char *pszVersion, size_t cchVersion)
     368static DECLCALLBACK(int)  dbgDiggerSolarisQueryVersion(PUVM pUVM, void *pvData, char *pszVersion, size_t cchVersion)
    369369{
    370370    PDBGDIGGERSOLARIS pThis = (PDBGDIGGERSOLARIS)pvData;
     
    377377    SOL_utsname_t UtsName;
    378378    RTDBGSYMBOL SymUtsName;
    379     int rc = DBGFR3AsSymbolByName(pVM, DBGF_AS_KERNEL, "utsname", &SymUtsName, NULL);
     379    int rc = DBGFR3AsSymbolByName(pUVM, DBGF_AS_KERNEL, "utsname", &SymUtsName, NULL);
    380380    if (RT_SUCCESS(rc))
    381         rc = DBGFR3MemRead(pVM, 0, DBGFR3AddrFromFlat(pVM, &Addr, SymUtsName.Value), &UtsName, sizeof(UtsName));
     381        rc = DBGFR3MemRead(pUVM, 0, DBGFR3AddrFromFlat(pUVM, &Addr, SymUtsName.Value), &UtsName, sizeof(UtsName));
    382382    if (RT_FAILURE(rc))
    383383    {
     
    387387        memset(&UtsName, '\0', sizeof(UtsName));
    388388        strcpy(&UtsName.sysname[0], "SunOS");
    389         rc = DBGFR3MemScan(pVM, 0, &pThis->AddrUnixData, SOL_UNIX_MAX_DATA_SEG_SIZE, 1,
     389        rc = DBGFR3MemScan(pUVM, 0, &pThis->AddrUnixData, SOL_UNIX_MAX_DATA_SEG_SIZE, 1,
    390390                           &UtsName.sysname[0], sizeof(UtsName.sysname), &Addr);
    391391        if (RT_SUCCESS(rc))
    392             rc = DBGFR3MemRead(pVM, 0, DBGFR3AddrFromFlat(pVM, &Addr, Addr.FlatPtr - RT_OFFSETOF(SOL_utsname_t, sysname)),
     392            rc = DBGFR3MemRead(pUVM, 0, DBGFR3AddrFromFlat(pUVM, &Addr, Addr.FlatPtr - RT_OFFSETOF(SOL_utsname_t, sysname)),
    393393                               &UtsName, sizeof(UtsName));
    394394    }
     
    423423 * Processes a modctl_t.
    424424 *
    425  * @param   pVM     The VM handle.
     425 * @param   pUVM    The user mode VM handle.
    426426 * @param   pThis   Our instance data.
    427427 * @param   pModCtl Pointer to the modctl structure.
    428428 */
    429 static void dbgDiggerSolarisProcessModCtl32(PVM pVM, PDBGDIGGERSOLARIS pThis, SOL_modctl_t const *pModCtl)
     429static void dbgDiggerSolarisProcessModCtl32(PUVM pUVM, PDBGDIGGERSOLARIS pThis, SOL_modctl_t const *pModCtl)
    430430{
    431431    /* skip it if it's not loaded and installed */
     
    444444    char szModName[64];
    445445    DBGFADDRESS Addr;
    446     int rc = DBGFR3MemReadString(pVM, 0, DBGFR3AddrFromFlat(pVM, &Addr, pModCtl->v9_32.mod_modname), szModName, sizeof(szModName));
     446    int rc = DBGFR3MemReadString(pUVM, 0, DBGFR3AddrFromFlat(pUVM, &Addr, pModCtl->v9_32.mod_modname), szModName, sizeof(szModName));
    447447    if (RT_FAILURE(rc))
    448448        return;
     
    452452    AssertCompile2MemberOffsets(SOL_modctl_t, v11_32.mod_filename, v9_32.mod_filename);
    453453    char szFilename[256];
    454     rc = DBGFR3MemReadString(pVM, 0, DBGFR3AddrFromFlat(pVM, &Addr, pModCtl->v9_32.mod_filename), szFilename, sizeof(szFilename));
     454    rc = DBGFR3MemReadString(pUVM, 0, DBGFR3AddrFromFlat(pUVM, &Addr, pModCtl->v9_32.mod_filename), szFilename, sizeof(szFilename));
    455455    if (RT_FAILURE(rc))
    456456        strcpy(szFilename, szModName);
     
    463463    AssertCompile2MemberOffsets(SOL_modctl_t, v11_32.mod_mp, v9_32.mod_mp);
    464464    struct SOL32_module Module;
    465     rc = DBGFR3MemRead(pVM, 0, DBGFR3AddrFromFlat(pVM, &Addr, pModCtl->v9_32.mod_mp), &Module, sizeof(Module));
     465    rc = DBGFR3MemRead(pUVM, 0, DBGFR3AddrFromFlat(pUVM, &Addr, pModCtl->v9_32.mod_mp), &Module, sizeof(Module));
    466466    if (RT_FAILURE(rc))
    467467        return;
     
    533533    if (!paShdrs)
    534534        return;
    535     rc = DBGFR3MemRead(pVM, 0, DBGFR3AddrFromFlat(pVM, &Addr, Module.shdrs), paShdrs, cb);
     535    rc = DBGFR3MemRead(pUVM, 0, DBGFR3AddrFromFlat(pUVM, &Addr, Module.shdrs), paShdrs, cb);
    536536    if (RT_SUCCESS(rc))
    537537    {
     
    539539        if (pvSymSpace)
    540540        {
    541             rc = DBGFR3MemRead(pVM, 0, DBGFR3AddrFromFlat(pVM, &Addr, Module.symspace), pvSymSpace, Module.symsize);
     541            rc = DBGFR3MemRead(pUVM, 0, DBGFR3AddrFromFlat(pUVM, &Addr, Module.symspace), pvSymSpace, Module.symsize);
    542542            if (RT_SUCCESS(rc))
    543543            {
     
    554554                cMaxSyms = RT_MIN(cMaxSyms, Module.nsyms);
    555555
    556                 DBGDiggerCommonParseElf32Mod(pVM, szModName, szFilename, DBG_DIGGER_ELF_FUNNY_SHDRS,
     556                DBGDiggerCommonParseElf32Mod(pUVM, szModName, szFilename, DBG_DIGGER_ELF_FUNNY_SHDRS,
    557557                                             &Module.hdr, paShdrs, paSyms, cMaxSyms, pbStrings, cbMaxStrings,
    558558                                             SOL32_MIN_KRNL_ADDR, SOL32_MAX_KRNL_ADDR - 1, DIG_SOL_MOD_TAG);
     
    570570 * Processes a modctl_t.
    571571 *
    572  * @param   pVM     The VM handle.
     572 * @param   pUVM    The user mode VM handle.
    573573 * @param   pThis   Our instance data.
    574574 * @param   pModCtl Pointer to the modctl structure.
    575575 */
    576 static void dbgDiggerSolarisProcessModCtl64(PVM pVM, PDBGDIGGERSOLARIS pThis, SOL_modctl_t const *pModCtl)
     576static void dbgDiggerSolarisProcessModCtl64(PUVM pUVM, PDBGDIGGERSOLARIS pThis, SOL_modctl_t const *pModCtl)
    577577{
    578578    /* skip it if it's not loaded and installed */
     
    591591    char szModName[64];
    592592    DBGFADDRESS Addr;
    593     int rc = DBGFR3MemReadString(pVM, 0, DBGFR3AddrFromFlat(pVM, &Addr, pModCtl->v9_64.mod_modname), szModName, sizeof(szModName));
     593    int rc = DBGFR3MemReadString(pUVM, 0, DBGFR3AddrFromFlat(pUVM, &Addr, pModCtl->v9_64.mod_modname), szModName, sizeof(szModName));
    594594    if (RT_FAILURE(rc))
    595595        return;
     
    599599    AssertCompile2MemberOffsets(SOL_modctl_t, v11_64.mod_filename, v9_64.mod_filename);
    600600    char szFilename[256];
    601     rc = DBGFR3MemReadString(pVM, 0, DBGFR3AddrFromFlat(pVM, &Addr, pModCtl->v9_64.mod_filename), szFilename, sizeof(szFilename));
     601    rc = DBGFR3MemReadString(pUVM, 0, DBGFR3AddrFromFlat(pUVM, &Addr, pModCtl->v9_64.mod_filename), szFilename, sizeof(szFilename));
    602602    if (RT_FAILURE(rc))
    603603        strcpy(szFilename, szModName);
     
    610610    AssertCompile2MemberOffsets(SOL_modctl_t, v11_64.mod_mp, v9_64.mod_mp);
    611611    struct SOL64_module Module;
    612     rc = DBGFR3MemRead(pVM, 0, DBGFR3AddrFromFlat(pVM, &Addr, pModCtl->v9_64.mod_mp), &Module, sizeof(Module));
     612    rc = DBGFR3MemRead(pUVM, 0, DBGFR3AddrFromFlat(pUVM, &Addr, pModCtl->v9_64.mod_mp), &Module, sizeof(Module));
    613613    if (RT_FAILURE(rc))
    614614        return;
     
    679679    if (!paShdrs)
    680680        return;
    681     rc = DBGFR3MemRead(pVM, 0, DBGFR3AddrFromFlat(pVM, &Addr, Module.shdrs), paShdrs, cb);
     681    rc = DBGFR3MemRead(pUVM, 0, DBGFR3AddrFromFlat(pUVM, &Addr, Module.shdrs), paShdrs, cb);
    682682    if (RT_SUCCESS(rc))
    683683    {
     
    685685        if (pvSymSpace)
    686686        {
    687             rc = DBGFR3MemRead(pVM, 0, DBGFR3AddrFromFlat(pVM, &Addr, Module.symspace), pvSymSpace, Module.symsize);
     687            rc = DBGFR3MemRead(pUVM, 0, DBGFR3AddrFromFlat(pUVM, &Addr, Module.symspace), pvSymSpace, Module.symsize);
    688688            if (RT_SUCCESS(rc))
    689689            {
     
    700700                cMaxSyms = RT_MIN(cMaxSyms, Module.nsyms);
    701701
    702                 DBGDiggerCommonParseElf64Mod(pVM, szModName, szFilename, DBG_DIGGER_ELF_FUNNY_SHDRS,
     702                DBGDiggerCommonParseElf64Mod(pUVM, szModName, szFilename, DBG_DIGGER_ELF_FUNNY_SHDRS,
    703703                                             &Module.hdr, paShdrs, paSyms, cMaxSyms, pbStrings, cbMaxStrings,
    704704                                             SOL64_MIN_KRNL_ADDR, SOL64_MAX_KRNL_ADDR - 1, DIG_SOL_MOD_TAG);
     
    716716 * @copydoc DBGFOSREG::pfnTerm
    717717 */
    718 static DECLCALLBACK(void)  dbgDiggerSolarisTerm(PVM pVM, void *pvData)
     718static DECLCALLBACK(void)  dbgDiggerSolarisTerm(PUVM pUVM, void *pvData)
    719719{
    720720    PDBGDIGGERSOLARIS pThis = (PDBGDIGGERSOLARIS)pvData;
     
    728728 * @copydoc DBGFOSREG::pfnRefresh
    729729 */
    730 static DECLCALLBACK(int)  dbgDiggerSolarisRefresh(PVM pVM, void *pvData)
     730static DECLCALLBACK(int)  dbgDiggerSolarisRefresh(PUVM pUVM, void *pvData)
    731731{
    732732    PDBGDIGGERSOLARIS pThis = (PDBGDIGGERSOLARIS)pvData;
     
    737737     * For now we'll flush and reload everything.
    738738     */
    739     RTDBGAS hDbgAs = DBGFR3AsResolveAndRetain(pVM, DBGF_AS_KERNEL);
     739    RTDBGAS hDbgAs = DBGFR3AsResolveAndRetain(pUVM, DBGF_AS_KERNEL);
    740740    if (hDbgAs != NIL_RTDBGAS)
    741741    {
     
    757757    }
    758758
    759     dbgDiggerSolarisTerm(pVM, pvData);
    760     return dbgDiggerSolarisInit(pVM, pvData);
     759    dbgDiggerSolarisTerm(pUVM, pvData);
     760    return dbgDiggerSolarisInit(pUVM, pvData);
    761761}
    762762
     
    765765 * @copydoc DBGFOSREG::pfnInit
    766766 */
    767 static DECLCALLBACK(int)  dbgDiggerSolarisInit(PVM pVM, void *pvData)
     767static DECLCALLBACK(int)  dbgDiggerSolarisInit(PUVM pUVM, void *pvData)
    768768{
    769769    PDBGDIGGERSOLARIS pThis = (PDBGDIGGERSOLARIS)pvData;
     
    775775     * On Solaris the kernel and is the global address space.
    776776     */
    777     DBGFR3AsSetAlias(pVM, DBGF_AS_KERNEL, DBGF_AS_GLOBAL);
     777    DBGFR3AsSetAlias(pUVM, DBGF_AS_KERNEL, DBGF_AS_GLOBAL);
    778778
    779779/** @todo Use debug_info, build 7x / S10U6. */
     
    783783     * We know it resides in the unix data segment.
    784784     */
    785     DBGFR3AddrFromFlat(pVM, &pThis->AddrUnixModCtl, 0);
     785    DBGFR3AddrFromFlat(pUVM, &pThis->AddrUnixModCtl, 0);
    786786
    787787    DBGFADDRESS     CurAddr = pThis->AddrUnixData;
    788788    DBGFADDRESS     MaxAddr;
    789     DBGFR3AddrFromFlat(pVM, &MaxAddr, CurAddr.FlatPtr + SOL_UNIX_MAX_DATA_SEG_SIZE);
     789    DBGFR3AddrFromFlat(pUVM, &MaxAddr, CurAddr.FlatPtr + SOL_UNIX_MAX_DATA_SEG_SIZE);
    790790    const uint8_t  *pbExpr = (const uint8_t *)&pThis->AddrUnixText.FlatPtr;
    791791    const uint32_t  cbExpr = pThis->f64Bit ? sizeof(uint64_t) : sizeof(uint32_t);
     
    794794    {
    795795        DBGFADDRESS HitAddr;
    796         rc = DBGFR3MemScan(pVM, 0, &CurAddr, MaxAddr.FlatPtr - CurAddr.FlatPtr, 1, pbExpr, cbExpr, &HitAddr);
     796        rc = DBGFR3MemScan(pUVM, 0, &CurAddr, MaxAddr.FlatPtr - CurAddr.FlatPtr, 1, pbExpr, cbExpr, &HitAddr);
    797797        if (RT_FAILURE(rc))
    798798            break;
     
    806806        if (pThis->f64Bit)
    807807        {
    808             DBGFR3AddrFromFlat(pVM, &ModCtlAddr, HitAddr.FlatPtr - RT_OFFSETOF(SOL32v11_modctl_t, mod_text));
     808            DBGFR3AddrFromFlat(pUVM, &ModCtlAddr, HitAddr.FlatPtr - RT_OFFSETOF(SOL32v11_modctl_t, mod_text));
    809809            SOL64v11_modctl_t ModCtlv11;
    810             rc = DBGFR3MemRead(pVM, 0, &ModCtlAddr, &ModCtlv11, sizeof(ModCtlv11));
     810            rc = DBGFR3MemRead(pUVM, 0, &ModCtlAddr, &ModCtlv11, sizeof(ModCtlv11));
    811811            if (RT_SUCCESS(rc))
    812812            {
     
    828828                    char szUnix[5];
    829829                    DBGFADDRESS NameAddr;
    830                     DBGFR3AddrFromFlat(pVM, &NameAddr, ModCtlv11.mod_modname);
    831                     rc = DBGFR3MemRead(pVM, 0, &NameAddr, &szUnix, sizeof(szUnix));
     830                    DBGFR3AddrFromFlat(pUVM, &NameAddr, ModCtlv11.mod_modname);
     831                    rc = DBGFR3MemRead(pUVM, 0, &NameAddr, &szUnix, sizeof(szUnix));
    832832                    if (RT_SUCCESS(rc))
    833833                    {
     
    846846        else
    847847        {
    848             DBGFR3AddrFromFlat(pVM, &ModCtlAddr, HitAddr.FlatPtr - RT_OFFSETOF(SOL32v11_modctl_t, mod_text));
     848            DBGFR3AddrFromFlat(pUVM, &ModCtlAddr, HitAddr.FlatPtr - RT_OFFSETOF(SOL32v11_modctl_t, mod_text));
    849849            SOL32v11_modctl_t ModCtlv11;
    850             rc = DBGFR3MemRead(pVM, 0, &ModCtlAddr, &ModCtlv11, sizeof(ModCtlv11));
     850            rc = DBGFR3MemRead(pUVM, 0, &ModCtlAddr, &ModCtlv11, sizeof(ModCtlv11));
    851851            if (RT_SUCCESS(rc))
    852852            {
     
    868868                    char szUnix[5];
    869869                    DBGFADDRESS NameAddr;
    870                     DBGFR3AddrFromFlat(pVM, &NameAddr, ModCtlv11.mod_modname);
    871                     rc = DBGFR3MemRead(pVM, 0, &NameAddr, &szUnix, sizeof(szUnix));
     870                    DBGFR3AddrFromFlat(pUVM, &NameAddr, ModCtlv11.mod_modname);
     871                    rc = DBGFR3MemRead(pUVM, 0, &NameAddr, &szUnix, sizeof(szUnix));
    872872                    if (RT_SUCCESS(rc))
    873873                    {
     
    888888        if (pThis->f64Bit)
    889889        {
    890             DBGFR3AddrFromFlat(pVM, &ModCtlAddr, HitAddr.FlatPtr - RT_OFFSETOF(SOL64v9_modctl_t, mod_text));
     890            DBGFR3AddrFromFlat(pUVM, &ModCtlAddr, HitAddr.FlatPtr - RT_OFFSETOF(SOL64v9_modctl_t, mod_text));
    891891            SOL64v9_modctl_t ModCtlv9;
    892             rc = DBGFR3MemRead(pVM, 0, &ModCtlAddr, &ModCtlv9, sizeof(ModCtlv9));
     892            rc = DBGFR3MemRead(pUVM, 0, &ModCtlAddr, &ModCtlv9, sizeof(ModCtlv9));
    893893            if (RT_SUCCESS(rc))
    894894            {
     
    908908                    char szUnix[5];
    909909                    DBGFADDRESS NameAddr;
    910                     DBGFR3AddrFromFlat(pVM, &NameAddr, ModCtlv9.mod_modname);
    911                     rc = DBGFR3MemRead(pVM, 0, &NameAddr, &szUnix, sizeof(szUnix));
     910                    DBGFR3AddrFromFlat(pUVM, &NameAddr, ModCtlv9.mod_modname);
     911                    rc = DBGFR3MemRead(pUVM, 0, &NameAddr, &szUnix, sizeof(szUnix));
    912912                    if (RT_SUCCESS(rc))
    913913                    {
     
    926926        else
    927927        {
    928             DBGFR3AddrFromFlat(pVM, &ModCtlAddr, HitAddr.FlatPtr - RT_OFFSETOF(SOL32v9_modctl_t, mod_text));
     928            DBGFR3AddrFromFlat(pUVM, &ModCtlAddr, HitAddr.FlatPtr - RT_OFFSETOF(SOL32v9_modctl_t, mod_text));
    929929            SOL32v9_modctl_t ModCtlv9;
    930             rc = DBGFR3MemRead(pVM, 0, &ModCtlAddr, &ModCtlv9, sizeof(ModCtlv9));
     930            rc = DBGFR3MemRead(pUVM, 0, &ModCtlAddr, &ModCtlv9, sizeof(ModCtlv9));
    931931            if (RT_SUCCESS(rc))
    932932            {
     
    946946                    char szUnix[5];
    947947                    DBGFADDRESS NameAddr;
    948                     DBGFR3AddrFromFlat(pVM, &NameAddr, ModCtlv9.mod_modname);
    949                     rc = DBGFR3MemRead(pVM, 0, &NameAddr, &szUnix, sizeof(szUnix));
     948                    DBGFR3AddrFromFlat(pUVM, &NameAddr, ModCtlv9.mod_modname);
     949                    rc = DBGFR3MemRead(pUVM, 0, &NameAddr, &szUnix, sizeof(szUnix));
    950950                    if (RT_SUCCESS(rc))
    951951                    {
     
    964964
    965965        /* next */
    966         DBGFR3AddrFromFlat(pVM, &CurAddr, HitAddr.FlatPtr + cbExpr);
     966        DBGFR3AddrFromFlat(pUVM, &CurAddr, HitAddr.FlatPtr + cbExpr);
    967967    }
    968968
     
    978978            /* read it */
    979979            SOL_modctl_t ModCtl;
    980             rc = DBGFR3MemRead(pVM, 0, &CurAddr, &ModCtl, cbModCtl);
     980            rc = DBGFR3MemRead(pUVM, 0, &CurAddr, &ModCtl, cbModCtl);
    981981            if (RT_FAILURE(rc))
    982982            {
     
    987987            /* process it. */
    988988            if (pThis->f64Bit)
    989                 dbgDiggerSolarisProcessModCtl64(pVM, pThis, &ModCtl);
     989                dbgDiggerSolarisProcessModCtl64(pUVM, pThis, &ModCtl);
    990990            else
    991                 dbgDiggerSolarisProcessModCtl32(pVM, pThis, &ModCtl);
     991                dbgDiggerSolarisProcessModCtl32(pUVM, pThis, &ModCtl);
    992992
    993993            /* next */
     
    10001000                    break;
    10011001                }
    1002                 DBGFR3AddrFromFlat(pVM, &CurAddr, ModCtl.v9_64.mod_next);
     1002                DBGFR3AddrFromFlat(pUVM, &CurAddr, ModCtl.v9_64.mod_next);
    10031003            }
    10041004            else
     
    10101010                    break;
    10111011                }
    1012                 DBGFR3AddrFromFlat(pVM, &CurAddr, ModCtl.v9_32.mod_next);
     1012                DBGFR3AddrFromFlat(pUVM, &CurAddr, ModCtl.v9_32.mod_next);
    10131013            }
    10141014            if (++iMod >= 1024)
     
    10281028 * @copydoc DBGFOSREG::pfnProbe
    10291029 */
    1030 static DECLCALLBACK(bool)  dbgDiggerSolarisProbe(PVM pVM, void *pvData)
     1030static DECLCALLBACK(bool)  dbgDiggerSolarisProbe(PUVM pUVM, void *pvData)
    10311031{
    10321032    PDBGDIGGERSOLARIS pThis = (PDBGDIGGERSOLARIS)pvData;
     
    10391039
    10401040    /* 32-bit search range. */
    1041     DBGFR3AddrFromFlat(pVM, &Addr, 0xfe800000);
     1041    DBGFR3AddrFromFlat(pUVM, &Addr, 0xfe800000);
    10421042    RTGCUINTPTR cbRange = 0xfec00000 - 0xfe800000;
    10431043
    10441044    DBGFADDRESS HitAddr;
    10451045    static const uint8_t s_abSunRelease[] = "SunOS Release ";
    1046     int rc = DBGFR3MemScan(pVM, 0, &Addr, cbRange, 1, s_abSunRelease, sizeof(s_abSunRelease) - 1, &HitAddr);
     1046    int rc = DBGFR3MemScan(pUVM, 0, &Addr, cbRange, 1, s_abSunRelease, sizeof(s_abSunRelease) - 1, &HitAddr);
    10471047    if (RT_FAILURE(rc))
    10481048    {
    10491049        /* 64-bit.... */
    1050         DBGFR3AddrFromFlat(pVM, &Addr, UINT64_C(0xfffffffffb800000));
     1050        DBGFR3AddrFromFlat(pUVM, &Addr, UINT64_C(0xfffffffffb800000));
    10511051        cbRange = UINT64_C(0xfffffffffbc00000) - UINT64_C(0xfffffffffb800000);
    1052         rc = DBGFR3MemScan(pVM, 0, &Addr, cbRange, 1, s_abSunRelease, sizeof(s_abSunRelease) - 1, &HitAddr);
     1052        rc = DBGFR3MemScan(pUVM, 0, &Addr, cbRange, 1, s_abSunRelease, sizeof(s_abSunRelease) - 1, &HitAddr);
    10531053        if (RT_FAILURE(rc))
    10541054            return false;
     
    10611061    static const uint8_t s_abSMI[] = "Sun Microsystems, Inc.";
    10621062    static const uint8_t s_abORCL[] = "Oracle and/or its affiliates.";
    1063     rc = DBGFR3MemScan(pVM, 0, &Addr, cbRange, 1, s_abSMI, sizeof(s_abSMI) - 1, &HitAddr);
     1063    rc = DBGFR3MemScan(pUVM, 0, &Addr, cbRange, 1, s_abSMI, sizeof(s_abSMI) - 1, &HitAddr);
    10641064    if (RT_FAILURE(rc))
    10651065    {
    10661066        /* Try the alternate copyright string. */
    1067         rc = DBGFR3MemScan(pVM, 0, &Addr, cbRange, 1, s_abORCL, sizeof(s_abORCL) - 1, &HitAddr);
     1067        rc = DBGFR3MemScan(pUVM, 0, &Addr, cbRange, 1, s_abORCL, sizeof(s_abORCL) - 1, &HitAddr);
    10681068        if (RT_FAILURE(rc))
    10691069            return false;
     
    10851085 * @copydoc DBGFOSREG::pfnDestruct
    10861086 */
    1087 static DECLCALLBACK(void)  dbgDiggerSolarisDestruct(PVM pVM, void *pvData)
     1087static DECLCALLBACK(void)  dbgDiggerSolarisDestruct(PUVM pUVM, void *pvData)
    10881088{
    10891089
     
    10941094 * @copydoc DBGFOSREG::pfnConstruct
    10951095 */
    1096 static DECLCALLBACK(int)  dbgDiggerSolarisConstruct(PVM pVM, void *pvData)
     1096static DECLCALLBACK(int)  dbgDiggerSolarisConstruct(PUVM pUVM, void *pvData)
    10971097{
    10981098    return VINF_SUCCESS;
  • trunk/src/VBox/Debugger/DBGPlugInWinNt.cpp

    r37809 r44399  
    261261*   Internal Functions                                                         *
    262262*******************************************************************************/
    263 static DECLCALLBACK(int)  dbgDiggerWinNtInit(PVM pVM, void *pvData);
     263static DECLCALLBACK(int)  dbgDiggerWinNtInit(PUVM pUVM, void *pvData);
    264264
    265265
     
    277277 * Process a PE image found in guest memory.
    278278 *
    279  * @param   pThis               The instance data.
    280  * @param   pVM                 The VM handle.
    281  * @param   pszName             The image name.
    282  * @param   pImageAddr          The image address.
    283  * @param   cbImage             The size of the image.
    284  * @param   pbBuf               Scratch buffer containing the first
    285  *                              RT_MIN(cbBuf, cbImage) bytes of the image.
    286  * @param   cbBuf               The scratch buffer size.
    287  */
    288 static void dbgDiggerWinNtProcessImage(PDBGDIGGERWINNT pThis, PVM pVM, const char *pszName,
     279 * @param   pThis           The instance data.
     280 * @param   pUVM            The user mode VM handle.
     281 * @param   pszName         The image name.
     282 * @param   pImageAddr      The image address.
     283 * @param   cbImage         The size of the image.
     284 * @param   pbBuf           Scratch buffer containing the first
     285 *                          RT_MIN(cbBuf, cbImage) bytes of the image.
     286 * @param   cbBuf           The scratch buffer size.
     287 */
     288static void dbgDiggerWinNtProcessImage(PDBGDIGGERWINNT pThis, PUVM pUVM, const char *pszName,
    289289                                       PCDBGFADDRESS pImageAddr, uint32_t cbImage,
    290290                                       uint8_t *pbBuf, size_t cbBuf)
     
    409409        DBGFADDRESS Addr = *pImageAddr;
    410410        DBGFR3AddrAdd(&Addr, uRvaDebugDir);
    411         rc = DBGFR3MemRead(pVM, 0 /*idCpu*/, &Addr, pbBuf, RT_MIN(cbDebugDir, cbBuf));
     411        rc = DBGFR3MemRead(pUVM, 0 /*idCpu*/, &Addr, pbBuf, RT_MIN(cbDebugDir, cbBuf));
    412412        if (RT_SUCCESS(rc))
    413413        {
     
    430430     * Link the module.
    431431     */
    432     RTDBGAS hAs = DBGFR3AsResolveAndRetain(pVM, DBGF_AS_KERNEL);
     432    RTDBGAS hAs = DBGFR3AsResolveAndRetain(pUVM, DBGF_AS_KERNEL);
    433433    if (hAs != NIL_RTDBGAS)
    434434        rc = RTDbgAsModuleLink(hAs, hMod, pImageAddr->FlatPtr, RTDBGASLINK_FLAGS_REPLACE /*fFlags*/);
     
    443443 * @copydoc DBGFOSREG::pfnQueryInterface
    444444 */
    445 static DECLCALLBACK(void *) dbgDiggerWinNtQueryInterface(PVM pVM, void *pvData, DBGFOSINTERFACE enmIf)
     445static DECLCALLBACK(void *) dbgDiggerWinNtQueryInterface(PUVM pUVM, void *pvData, DBGFOSINTERFACE enmIf)
    446446{
    447447    return NULL;
     
    452452 * @copydoc DBGFOSREG::pfnQueryVersion
    453453 */
    454 static DECLCALLBACK(int)  dbgDiggerWinNtQueryVersion(PVM pVM, void *pvData, char *pszVersion, size_t cchVersion)
     454static DECLCALLBACK(int)  dbgDiggerWinNtQueryVersion(PUVM pUVM, void *pvData, char *pszVersion, size_t cchVersion)
    455455{
    456456    PDBGDIGGERWINNT pThis = (PDBGDIGGERWINNT)pvData;
     
    472472 * @copydoc DBGFOSREG::pfnTerm
    473473 */
    474 static DECLCALLBACK(void)  dbgDiggerWinNtTerm(PVM pVM, void *pvData)
     474static DECLCALLBACK(void)  dbgDiggerWinNtTerm(PUVM pUVM, void *pvData)
    475475{
    476476    PDBGDIGGERWINNT pThis = (PDBGDIGGERWINNT)pvData;
     
    484484 * @copydoc DBGFOSREG::pfnRefresh
    485485 */
    486 static DECLCALLBACK(int)  dbgDiggerWinNtRefresh(PVM pVM, void *pvData)
     486static DECLCALLBACK(int)  dbgDiggerWinNtRefresh(PUVM pUVM, void *pvData)
    487487{
    488488    PDBGDIGGERWINNT pThis = (PDBGDIGGERWINNT)pvData;
     
    493493     * For now we'll flush and reload everything.
    494494     */
    495     RTDBGAS hDbgAs = DBGFR3AsResolveAndRetain(pVM, DBGF_AS_KERNEL);
     495    RTDBGAS hDbgAs = DBGFR3AsResolveAndRetain(pUVM, DBGF_AS_KERNEL);
    496496    if (hDbgAs != NIL_RTDBGAS)
    497497    {
     
    513513    }
    514514
    515     dbgDiggerWinNtTerm(pVM, pvData);
    516     return dbgDiggerWinNtInit(pVM, pvData);
     515    dbgDiggerWinNtTerm(pUVM, pvData);
     516    return dbgDiggerWinNtInit(pUVM, pvData);
    517517}
    518518
     
    521521 * @copydoc DBGFOSREG::pfnInit
    522522 */
    523 static DECLCALLBACK(int)  dbgDiggerWinNtInit(PVM pVM, void *pvData)
     523static DECLCALLBACK(int)  dbgDiggerWinNtInit(PUVM pUVM, void *pvData)
    524524{
    525525    PDBGDIGGERWINNT pThis = (PDBGDIGGERWINNT)pvData;
     
    538538     * Figure the NT version.
    539539     */
    540     DBGFR3AddrFromFlat(pVM, &Addr, pThis->f32Bit ? NTKUSERSHAREDDATA_WINNT32 : NTKUSERSHAREDDATA_WINNT64);
    541     rc = DBGFR3MemRead(pVM, 0 /*idCpu*/, &Addr, &u, PAGE_SIZE);
     540    DBGFR3AddrFromFlat(pUVM, &Addr, pThis->f32Bit ? NTKUSERSHAREDDATA_WINNT32 : NTKUSERSHAREDDATA_WINNT64);
     541    rc = DBGFR3MemRead(pUVM, 0 /*idCpu*/, &Addr, &u, PAGE_SIZE);
    542542    if (RT_FAILURE(rc))
    543543        return rc;
     
    557557        /* Read the validate the MTE. */
    558558        NTMTE Mte;
    559         rc = DBGFR3MemRead(pVM, 0 /*idCpu*/, &Addr, &Mte, pThis->f32Bit ? sizeof(Mte.vX_32) : sizeof(Mte.vX_64));
     559        rc = DBGFR3MemRead(pUVM, 0 /*idCpu*/, &Addr, &Mte, pThis->f32Bit ? sizeof(Mte.vX_32) : sizeof(Mte.vX_64));
    560560        if (RT_FAILURE(rc))
    561561            break;
     
    591591        /* Read the full name. */
    592592        DBGFADDRESS AddrName;
    593         DBGFR3AddrFromFlat(pVM, &AddrName, WINNT_UNION(pThis, &Mte, FullDllName.Buffer));
     593        DBGFR3AddrFromFlat(pUVM, &AddrName, WINNT_UNION(pThis, &Mte, FullDllName.Buffer));
    594594        uint16_t    cbName = WINNT_UNION(pThis, &Mte, FullDllName.Length);
    595595        if (cbName < sizeof(u))
    596             rc = DBGFR3MemRead(pVM, 0 /*idCpu*/, &AddrName, &u, cbName);
     596            rc = DBGFR3MemRead(pUVM, 0 /*idCpu*/, &AddrName, &u, cbName);
    597597        else
    598598            rc = VERR_OUT_OF_RANGE;
    599599        if (RT_FAILURE(rc))
    600600        {
    601             DBGFR3AddrFromFlat(pVM, &AddrName, WINNT_UNION(pThis, &Mte, BaseDllName.Buffer));
     601            DBGFR3AddrFromFlat(pUVM, &AddrName, WINNT_UNION(pThis, &Mte, BaseDllName.Buffer));
    602602            cbName = WINNT_UNION(pThis, &Mte, BaseDllName.Length);
    603603            if (cbName < sizeof(u))
    604                 rc = DBGFR3MemRead(pVM, 0 /*idCpu*/, &AddrName, &u, cbName);
     604                rc = DBGFR3MemRead(pUVM, 0 /*idCpu*/, &AddrName, &u, cbName);
    605605            else
    606606                rc = VERR_OUT_OF_RANGE;
     
    615615                /* Read the start of the PE image and pass it along to a worker. */
    616616                DBGFADDRESS ImageAddr;
    617                 DBGFR3AddrFromFlat(pVM, &ImageAddr, WINNT_UNION(pThis, &Mte, DllBase));
     617                DBGFR3AddrFromFlat(pUVM, &ImageAddr, WINNT_UNION(pThis, &Mte, DllBase));
    618618                uint32_t    cbImageBuf = RT_MIN(sizeof(u), WINNT_UNION(pThis, &Mte, SizeOfImage));
    619                 rc = DBGFR3MemRead(pVM, 0 /*idCpu*/, &ImageAddr, &u, cbImageBuf);
     619                rc = DBGFR3MemRead(pUVM, 0 /*idCpu*/, &ImageAddr, &u, cbImageBuf);
    620620                if (RT_SUCCESS(rc))
    621621                    dbgDiggerWinNtProcessImage(pThis,
    622                                                pVM,
     622                                               pUVM,
    623623                                               pszName,
    624624                                               &ImageAddr,
     
    632632        /* next */
    633633        AddrPrev = Addr;
    634         DBGFR3AddrFromFlat(pVM, &Addr, WINNT_UNION(pThis, &Mte, InLoadOrderLinks.Flink));
     634        DBGFR3AddrFromFlat(pUVM, &Addr, WINNT_UNION(pThis, &Mte, InLoadOrderLinks.Flink));
    635635    } while (   Addr.FlatPtr != pThis->KernelMteAddr.FlatPtr
    636636             && Addr.FlatPtr != pThis->PsLoadedModuleListAddr.FlatPtr);
     
    644644 * @copydoc DBGFOSREG::pfnProbe
    645645 */
    646 static DECLCALLBACK(bool)  dbgDiggerWinNtProbe(PVM pVM, void *pvData)
     646static DECLCALLBACK(bool)  dbgDiggerWinNtProbe(PUVM pUVM, void *pvData)
    647647{
    648648    PDBGDIGGERWINNT pThis = (PDBGDIGGERWINNT)pvData;
     
    663663     * success.
    664664     */
    665     CPUMMODE enmMode = DBGFR3CpuGetMode(pVM, 0 /*idCpu*/);
     665    CPUMMODE enmMode = DBGFR3CpuGetMode(pUVM, 0 /*idCpu*/);
    666666    if (enmMode == CPUMMODE_LONG)
    667667    {
     
    671671    {
    672672        DBGFADDRESS KernelAddr;
    673         for (DBGFR3AddrFromFlat(pVM, &KernelAddr, UINT32_C(0x80001000));
     673        for (DBGFR3AddrFromFlat(pUVM, &KernelAddr, UINT32_C(0x80001000));
    674674             KernelAddr.FlatPtr < UINT32_C(0xffff0000);
    675675             KernelAddr.FlatPtr += PAGE_SIZE)
    676676        {
    677             int rc = DBGFR3MemScan(pVM, 0 /*idCpu*/, &KernelAddr, UINT32_C(0xffff0000) - KernelAddr.FlatPtr,
     677            int rc = DBGFR3MemScan(pUVM, 0 /*idCpu*/, &KernelAddr, UINT32_C(0xffff0000) - KernelAddr.FlatPtr,
    678678                                   1, "MISYSPTE", sizeof("MISYSPTE") - 1, &KernelAddr);
    679679            if (RT_FAILURE(rc))
     
    682682
    683683            /* MZ + PE header. */
    684             rc = DBGFR3MemRead(pVM, 0 /*idCpu*/, &KernelAddr, &u, sizeof(u));
     684            rc = DBGFR3MemRead(pUVM, 0 /*idCpu*/, &KernelAddr, &u, sizeof(u));
    685685            if (    RT_SUCCESS(rc)
    686686                &&  u.MzHdr.e_magic == IMAGE_DOS_SIGNATURE
     
    707707                    Mte.SizeOfImage = pHdrs->OptionalHeader.SizeOfImage;
    708708                    DBGFADDRESS HitAddr;
    709                     rc = DBGFR3MemScan(pVM, 0 /*idCpu*/, &KernelAddr, UINT32_MAX - KernelAddr.FlatPtr,
     709                    rc = DBGFR3MemScan(pUVM, 0 /*idCpu*/, &KernelAddr, UINT32_MAX - KernelAddr.FlatPtr,
    710710                                       4 /*align*/, &Mte.DllBase, 3 * sizeof(uint32_t), &HitAddr);
    711711                    while (RT_SUCCESS(rc))
     
    714714                        NTMTE32 Mte2;
    715715                        DBGFADDRESS MteAddr = HitAddr;
    716                         rc = DBGFR3MemRead(pVM, 0 /*idCpu*/, DBGFR3AddrSub(&MteAddr, RT_OFFSETOF(NTMTE32, DllBase)),
     716                        rc = DBGFR3MemRead(pUVM, 0 /*idCpu*/, DBGFR3AddrSub(&MteAddr, RT_OFFSETOF(NTMTE32, DllBase)),
    717717                                           &Mte2, sizeof(Mte2));
    718718                        if (    RT_SUCCESS(rc)
     
    731731                           )
    732732                        {
    733                             rc = DBGFR3MemRead(pVM, 0 /*idCpu*/, DBGFR3AddrFromFlat(pVM, &Addr, Mte2.BaseDllName.Buffer),
     733                            rc = DBGFR3MemRead(pUVM, 0 /*idCpu*/, DBGFR3AddrFromFlat(pUVM, &Addr, Mte2.BaseDllName.Buffer),
    734734                                               u.wsz, Mte2.BaseDllName.Length);
    735735                            u.wsz[Mte2.BaseDllName.Length / 2] = '\0';
     
    741741                            {
    742742                                NTMTE32 Mte3;
    743                                 rc = DBGFR3MemRead(pVM, 0 /*idCpu*/, DBGFR3AddrFromFlat(pVM, &Addr, Mte2.InLoadOrderLinks.Blink),
     743                                rc = DBGFR3MemRead(pUVM, 0 /*idCpu*/, DBGFR3AddrFromFlat(pUVM, &Addr, Mte2.InLoadOrderLinks.Blink),
    744744                                                   &Mte3, RT_SIZEOFMEMB(NTMTE32, InLoadOrderLinks));
    745745                                if (   RT_SUCCESS(rc)
     
    761761                        DBGFR3AddrAdd(&HitAddr, 4);
    762762                        if (HitAddr.FlatPtr <= UINT32_C(0xfffff000))
    763                             rc = DBGFR3MemScan(pVM, 0 /*idCpu*/, &HitAddr, UINT32_MAX - HitAddr.FlatPtr,
     763                            rc = DBGFR3MemScan(pUVM, 0 /*idCpu*/, &HitAddr, UINT32_MAX - HitAddr.FlatPtr,
    764764                                               4 /*align*/, &Mte.DllBase, 3 * sizeof(uint32_t), &HitAddr);
    765765                        else
     
    777777 * @copydoc DBGFOSREG::pfnDestruct
    778778 */
    779 static DECLCALLBACK(void)  dbgDiggerWinNtDestruct(PVM pVM, void *pvData)
     779static DECLCALLBACK(void)  dbgDiggerWinNtDestruct(PUVM pUVM, void *pvData)
    780780{
    781781
     
    786786 * @copydoc DBGFOSREG::pfnConstruct
    787787 */
    788 static DECLCALLBACK(int)  dbgDiggerWinNtConstruct(PVM pVM, void *pvData)
     788static DECLCALLBACK(int)  dbgDiggerWinNtConstruct(PUVM pUVM, void *pvData)
    789789{
    790790    PDBGDIGGERWINNT pThis = (PDBGDIGGERWINNT)pvData;
  • trunk/src/VBox/Debugger/VBoxDbgBase.cpp

    r44393 r44399  
    9898    if (    pUVM
    9999        &&  VMR3GetStateU(pUVM) < VMSTATE_DESTROYING)
    100         return DBGCCreate(VMR3GetVM(pUVM), pBack, fFlags);
     100        return DBGCCreate(pUVM, pBack, fFlags);
    101101    return VERR_INVALID_HANDLE;
    102102}
  • trunk/src/VBox/Debugger/testcase/tstDBGCStubs.cpp

    r42165 r44399  
    2323
    2424#include <VBox/vmm/dbgf.h>
    25 VMMR3DECL(PDBGFADDRESS) DBGFR3AddrFromFlat(PVM pVM, PDBGFADDRESS pAddress, RTGCUINTPTR FlatPtr)
    26 {
    27     return NULL;
    28 }
    29 
    30 VMMR3DECL(int) DBGFR3AddrFromSelOff(PVM pVM, VMCPUID idCpu, PDBGFADDRESS pAddress, RTSEL Sel, RTUINTPTR off)
     25VMMR3DECL(PDBGFADDRESS) DBGFR3AddrFromFlat(PUVM pUVM, PDBGFADDRESS pAddress, RTGCUINTPTR FlatPtr)
     26{
     27    return NULL;
     28}
     29
     30VMMR3DECL(int) DBGFR3AddrFromSelOff(PUVM pUVM, VMCPUID idCpu, PDBGFADDRESS pAddress, RTSEL Sel, RTUINTPTR off)
    3131{
    3232    /* bad:bad -> provke error during parsing. */
     
    4242}
    4343
    44 VMMR3DECL(int)  DBGFR3AddrToPhys(PVM pVM, VMCPUID idCpu, PDBGFADDRESS pAddress, PRTGCPHYS pGCPhys)
    45 {
    46     return VERR_INTERNAL_ERROR;
    47 }
    48 
    49 VMMR3DECL(int)  DBGFR3AddrToHostPhys(PVMCPU pVCpu, PDBGFADDRESS pAddress, PRTHCPHYS pHCPhys)
    50 {
    51     return VERR_INTERNAL_ERROR;
    52 }
    53 
    54 VMMR3DECL(int)  DBGFR3AddrToVolatileR3Ptr(PVMCPU pVCpu, PDBGFADDRESS pAddress, bool fReadOnly, void **ppvR3Ptr)
    55 {
    56     return VERR_INTERNAL_ERROR;
    57 }
    58 
    59 VMMR3DECL(int) DBGFR3Attach(PVM pVM)
    60 {
    61     return VERR_INTERNAL_ERROR;
    62 }
    63 
    64 VMMR3DECL(int) DBGFR3BpClear(PVM pVM, RTUINT iBp)
    65 {
    66     return VERR_INTERNAL_ERROR;
    67 }
    68 VMMR3DECL(int) DBGFR3BpDisable(PVM pVM, RTUINT iBp)
    69 {
    70     return VERR_INTERNAL_ERROR;
    71 }
    72 VMMR3DECL(int) DBGFR3BpEnable(PVM pVM, RTUINT iBp)
    73 {
    74     return VERR_INTERNAL_ERROR;
    75 }
    76 VMMR3DECL(int) DBGFR3BpEnum(PVM pVM, PFNDBGFBPENUM pfnCallback, void *pvUser)
    77 {
    78     return VERR_INTERNAL_ERROR;
    79 }
    80 VMMR3DECL(int) DBGFR3BpSet(PVM pVM, PCDBGFADDRESS pAddress, uint64_t iHitTrigger, uint64_t iHitDisable, PRTUINT piBp)
    81 {
    82     return VERR_INTERNAL_ERROR;
    83 }
    84 VMMR3DECL(int) DBGFR3BpSetReg(PVM pVM, PCDBGFADDRESS pAddress, uint64_t iHitTrigger, uint64_t iHitDisable,
     44VMMR3DECL(int)  DBGFR3AddrToPhys(PUVM pUVM, VMCPUID idCpu, PDBGFADDRESS pAddress, PRTGCPHYS pGCPhys)
     45{
     46    return VERR_INTERNAL_ERROR;
     47}
     48
     49VMMR3DECL(int) DBGFR3Attach(PUVM pUVM)
     50{
     51    return VERR_INTERNAL_ERROR;
     52}
     53
     54VMMR3DECL(int) DBGFR3BpClear(PUVM pUVM, RTUINT iBp)
     55{
     56    return VERR_INTERNAL_ERROR;
     57}
     58VMMR3DECL(int) DBGFR3BpDisable(PUVM pUVM, RTUINT iBp)
     59{
     60    return VERR_INTERNAL_ERROR;
     61}
     62VMMR3DECL(int) DBGFR3BpEnable(PUVM pUVM, RTUINT iBp)
     63{
     64    return VERR_INTERNAL_ERROR;
     65}
     66VMMR3DECL(int) DBGFR3BpEnum(PUVM pUVM, PFNDBGFBPENUM pfnCallback, void *pvUser)
     67{
     68    return VERR_INTERNAL_ERROR;
     69}
     70VMMR3DECL(int) DBGFR3BpSet(PUVM pUVM, PCDBGFADDRESS pAddress, uint64_t iHitTrigger, uint64_t iHitDisable, PRTUINT piBp)
     71{
     72    return VERR_INTERNAL_ERROR;
     73}
     74VMMR3DECL(int) DBGFR3BpSetReg(PUVM pUVM, PCDBGFADDRESS pAddress, uint64_t iHitTrigger, uint64_t iHitDisable,
    8575                              uint8_t fType, uint8_t cb, PRTUINT piBp)
    8676{
    8777    return VERR_INTERNAL_ERROR;
    8878}
    89 VMMR3DECL(int) DBGFR3BpSetREM(PVM pVM, PCDBGFADDRESS pAddress, uint64_t iHitTrigger, uint64_t iHitDisable, PRTUINT piBp)
    90 {
    91     return VERR_INTERNAL_ERROR;
    92 }
    93 VMMR3DECL(bool) DBGFR3CanWait(PVM pVM)
     79VMMR3DECL(int) DBGFR3BpSetREM(PUVM pUVM, PCDBGFADDRESS pAddress, uint64_t iHitTrigger, uint64_t iHitDisable, PRTUINT piBp)
     80{
     81    return VERR_INTERNAL_ERROR;
     82}
     83VMMR3DECL(bool) DBGFR3CanWait(PUVM pUVM)
    9484{
    9585    return true;
    9686}
    97 VMMR3DECL(int) DBGFR3Detach(PVM pVM)
    98 {
    99     return VERR_INTERNAL_ERROR;
    100 }
    101 VMMR3DECL(int) DBGFR3DisasInstrEx(PVM pVM, VMCPUID idCpu, RTSEL Sel, RTGCPTR GCPtr, uint32_t fFlags,
     87VMMR3DECL(int) DBGFR3Detach(PUVM pUVM)
     88{
     89    return VERR_INTERNAL_ERROR;
     90}
     91VMMR3DECL(int) DBGFR3DisasInstrEx(PUVM pUVM, VMCPUID idCpu, RTSEL Sel, RTGCPTR GCPtr, uint32_t fFlags,
    10292                                  char *pszOutput, uint32_t cchOutput, uint32_t *pcbInstr)
    10393{
    10494    return VERR_INTERNAL_ERROR;
    10595}
    106 VMMR3DECL(int) DBGFR3EventWait(PVM pVM, RTMSINTERVAL cMillies, PCDBGFEVENT *ppEvent)
    107 {
    108     return VERR_INTERNAL_ERROR;
    109 }
    110 VMMR3DECL(int) DBGFR3Halt(PVM pVM)
    111 {
    112     return VERR_INTERNAL_ERROR;
    113 }
    114 VMMR3DECL(int) DBGFR3Info(PVM pVM, const char *pszName, const char *pszArgs, PCDBGFINFOHLP pHlp)
    115 {
    116     return VERR_INTERNAL_ERROR;
    117 }
    118 VMMR3DECL(int) DBGFR3InfoEx(PVM pVM, VMCPUID idCpu, const char *pszName, const char *pszArgs, PCDBGFINFOHLP pHlp)
    119 {
    120     return VERR_INTERNAL_ERROR;
    121 }
    122 VMMR3DECL(bool) DBGFR3IsHalted(PVM pVM)
     96VMMR3DECL(int) DBGFR3EventWait(PUVM pUVM, RTMSINTERVAL cMillies, PCDBGFEVENT *ppEvent)
     97{
     98    return VERR_INTERNAL_ERROR;
     99}
     100VMMR3DECL(int) DBGFR3Halt(PUVM pUVM)
     101{
     102    return VERR_INTERNAL_ERROR;
     103}
     104VMMR3DECL(int) DBGFR3Info(PUVM pUVM, const char *pszName, const char *pszArgs, PCDBGFINFOHLP pHlp)
     105{
     106    return VERR_INTERNAL_ERROR;
     107}
     108VMMR3DECL(int) DBGFR3InfoEx(PUVM pUVM, VMCPUID idCpu, const char *pszName, const char *pszArgs, PCDBGFINFOHLP pHlp)
     109{
     110    return VERR_INTERNAL_ERROR;
     111}
     112VMMR3DECL(bool) DBGFR3IsHalted(PUVM pUVM)
    123113{
    124114    return true;
    125115}
    126 VMMR3DECL(int) DBGFR3LineByAddr(PVM pVM, RTGCUINTPTR Address, PRTGCINTPTR poffDisplacement, PDBGFLINE pLine)
    127 {
    128     return VERR_INTERNAL_ERROR;
    129 }
    130 VMMR3DECL(int) DBGFR3LogModifyDestinations(PVM pVM, const char *pszDestSettings)
    131 {
    132     return VERR_INTERNAL_ERROR;
    133 }
    134 VMMR3DECL(int) DBGFR3LogModifyFlags(PVM pVM, const char *pszFlagSettings)
    135 {
    136     return VERR_INTERNAL_ERROR;
    137 }
    138 VMMR3DECL(int) DBGFR3LogModifyGroups(PVM pVM, const char *pszGroupSettings)
    139 {
    140     return VERR_INTERNAL_ERROR;
    141 }
    142 VMMR3DECL(int) DBGFR3ModuleLoad(PVM pVM, const char *pszFilename, RTGCUINTPTR AddressDelta, const char *pszName, RTGCUINTPTR ModuleAddress, unsigned cbImage)
    143 {
    144     return VERR_INTERNAL_ERROR;
    145 }
    146 VMMR3DECL(int) DBGFR3AsLoadImage(PVM pVM, RTDBGAS hAS, const char *pszFilename, const char *pszModName, PCDBGFADDRESS pModAddress, RTDBGSEGIDX iModSeg, uint32_t fFlags)
    147 {
    148     return VERR_INTERNAL_ERROR;
    149 }
    150 VMMR3DECL(int) DBGFR3AsLoadMap(PVM pVM, RTDBGAS hAS, const char *pszFilename, const char *pszModName, PCDBGFADDRESS pModAddress, RTDBGSEGIDX iModSeg, RTGCUINTPTR uSubtrahend, uint32_t fFlags)
    151 {
    152     return VERR_INTERNAL_ERROR;
    153 }
    154 VMMR3DECL(RTDBGAS) DBGFR3AsResolveAndRetain(PVM pVM, RTDBGAS hAlias)
     116VMMR3DECL(int) DBGFR3LineByAddr(PUVM pUVM, RTGCUINTPTR Address, PRTGCINTPTR poffDisplacement, PDBGFLINE pLine)
     117{
     118    return VERR_INTERNAL_ERROR;
     119}
     120VMMR3DECL(int) DBGFR3LogModifyDestinations(PUVM pUVM, const char *pszDestSettings)
     121{
     122    return VERR_INTERNAL_ERROR;
     123}
     124VMMR3DECL(int) DBGFR3LogModifyFlags(PUVM pUVM, const char *pszFlagSettings)
     125{
     126    return VERR_INTERNAL_ERROR;
     127}
     128VMMR3DECL(int) DBGFR3LogModifyGroups(PUVM pUVM, const char *pszGroupSettings)
     129{
     130    return VERR_INTERNAL_ERROR;
     131}
     132VMMR3DECL(int) DBGFR3ModuleLoad(PUVM pUVM, const char *pszFilename, RTGCUINTPTR AddressDelta, const char *pszName, RTGCUINTPTR ModuleAddress, unsigned cbImage)
     133{
     134    return VERR_INTERNAL_ERROR;
     135}
     136VMMR3DECL(int) DBGFR3AsLoadImage(PUVM pUVM, RTDBGAS hAS, const char *pszFilename, const char *pszModName, PCDBGFADDRESS pModAddress, RTDBGSEGIDX iModSeg, uint32_t fFlags)
     137{
     138    return VERR_INTERNAL_ERROR;
     139}
     140VMMR3DECL(int) DBGFR3AsLoadMap(PUVM pUVM, RTDBGAS hAS, const char *pszFilename, const char *pszModName, PCDBGFADDRESS pModAddress, RTDBGSEGIDX iModSeg, RTGCUINTPTR uSubtrahend, uint32_t fFlags)
     141{
     142    return VERR_INTERNAL_ERROR;
     143}
     144VMMR3DECL(RTDBGAS) DBGFR3AsResolveAndRetain(PUVM pUVM, RTDBGAS hAlias)
    155145{
    156146    return NIL_RTDBGAS;
    157147}
    158 VMMR3DECL(int) DBGFR3Resume(PVM pVM)
    159 {
    160     return VERR_INTERNAL_ERROR;
    161 }
    162 VMMR3DECL(int) DBGFR3StackWalkBegin(PVM pVM, VMCPUID idCpu, DBGFCODETYPE enmCodeType, PCDBGFSTACKFRAME *ppFirstFrame)
     148VMMR3DECL(int) DBGFR3Resume(PUVM pUVM)
     149{
     150    return VERR_INTERNAL_ERROR;
     151}
     152VMMR3DECL(int) DBGFR3StackWalkBegin(PUVM pUVM, VMCPUID idCpu, DBGFCODETYPE enmCodeType, PCDBGFSTACKFRAME *ppFirstFrame)
    163153{
    164154    return VERR_INTERNAL_ERROR;
     
    171161{
    172162}
    173 VMMR3DECL(int) DBGFR3Step(PVM pVM, VMCPUID idCpu)
    174 {
    175     return VERR_INTERNAL_ERROR;
    176 }
    177 VMMR3DECL(int) DBGFR3AsSymbolByAddr(PVM pVM, RTDBGAS hDbgAs, PCDBGFADDRESS pAddress, PRTGCINTPTR poffDisplacement, PRTDBGSYMBOL pSymbol, PRTDBGMOD phMod)
    178 {
    179     return VERR_INTERNAL_ERROR;
    180 }
    181 VMMR3DECL(int) DBGFR3AsSymbolByName(PVM pVM, RTDBGAS hDbgAs, const char *pszSymbol, PRTDBGSYMBOL pSymbol, PRTDBGMOD phMod)
    182 {
    183     return VERR_INTERNAL_ERROR;
    184 }
    185 VMMR3DECL(int) DBGFR3MemScan(PVM pVM, VMCPUID idCpu, PCDBGFADDRESS pAddress, RTGCUINTPTR cbRange, RTGCUINTPTR uAlign, const void *pabNeedle, size_t cbNeedle, PDBGFADDRESS pHitAddress)
    186 {
    187     return VERR_INTERNAL_ERROR;
    188 }
    189 VMMR3DECL(int) DBGFR3MemRead(PVM pVM, VMCPUID idCpu, PCDBGFADDRESS pAddress, void *pvBuf, size_t cbRead)
    190 {
    191     return VERR_INTERNAL_ERROR;
    192 }
    193 VMMR3DECL(int) DBGFR3MemReadString(PVM pVM, VMCPUID idCpu, PCDBGFADDRESS pAddress, char *pszBuf, size_t cchBuf)
    194 {
    195     return VERR_INTERNAL_ERROR;
    196 }
    197 VMMR3DECL(int) DBGFR3MemWrite(PVM pVM, VMCPUID idCpu, PCDBGFADDRESS pAddress, const void *pvBuf, size_t cbRead)
    198 {
    199     return VERR_INTERNAL_ERROR;
    200 }
    201 VMMDECL(int) DBGFR3PagingDumpEx(PVM pVM, VMCPUID idCpu, uint32_t fFlags, uint64_t cr3, uint64_t u64FirstAddr,
     163VMMR3DECL(int) DBGFR3Step(PUVM pUVM, VMCPUID idCpu)
     164{
     165    return VERR_INTERNAL_ERROR;
     166}
     167VMMR3DECL(int) DBGFR3AsSymbolByAddr(PUVM pUVM, RTDBGAS hDbgAs, PCDBGFADDRESS pAddress, PRTGCINTPTR poffDisplacement, PRTDBGSYMBOL pSymbol, PRTDBGMOD phMod)
     168{
     169    return VERR_INTERNAL_ERROR;
     170}
     171VMMR3DECL(int) DBGFR3AsSymbolByName(PUVM pUVM, RTDBGAS hDbgAs, const char *pszSymbol, PRTDBGSYMBOL pSymbol, PRTDBGMOD phMod)
     172{
     173    return VERR_INTERNAL_ERROR;
     174}
     175VMMR3DECL(int) DBGFR3MemScan(PUVM pUVM, VMCPUID idCpu, PCDBGFADDRESS pAddress, RTGCUINTPTR cbRange, RTGCUINTPTR uAlign, const void *pabNeedle, size_t cbNeedle, PDBGFADDRESS pHitAddress)
     176{
     177    return VERR_INTERNAL_ERROR;
     178}
     179VMMR3DECL(int) DBGFR3MemRead(PUVM pUVM, VMCPUID idCpu, PCDBGFADDRESS pAddress, void *pvBuf, size_t cbRead)
     180{
     181    return VERR_INTERNAL_ERROR;
     182}
     183VMMR3DECL(int) DBGFR3MemReadString(PUVM pUVM, VMCPUID idCpu, PCDBGFADDRESS pAddress, char *pszBuf, size_t cchBuf)
     184{
     185    return VERR_INTERNAL_ERROR;
     186}
     187VMMR3DECL(int) DBGFR3MemWrite(PUVM pUVM, VMCPUID idCpu, PCDBGFADDRESS pAddress, const void *pvBuf, size_t cbRead)
     188{
     189    return VERR_INTERNAL_ERROR;
     190}
     191VMMDECL(int) DBGFR3PagingDumpEx(PUVM pUVM, VMCPUID idCpu, uint32_t fFlags, uint64_t cr3, uint64_t u64FirstAddr,
    202192                                uint64_t u64LastAddr, uint32_t cMaxDepth, PCDBGFINFOHLP pHlp)
    203193{
    204194    return VERR_INTERNAL_ERROR;
    205195}
    206 VMMR3DECL(int) DBGFR3RegNmValidate(PVM pVM, VMCPUID idDefCpu, const char *pszReg)
     196VMMR3DECL(int) DBGFR3RegNmValidate(PUVM pUVM, VMCPUID idDefCpu, const char *pszReg)
    207197{
    208198    if (   !strcmp(pszReg, "ah")
     
    213203    return VERR_DBGF_REGISTER_NOT_FOUND;
    214204}
    215 VMMR3DECL(int) DBGFR3RegCpuQueryU8(  PVM pVM, VMCPUID idCpu, DBGFREG enmReg, uint8_t     *pu8)
    216 {
    217     return VERR_INTERNAL_ERROR;
    218 }
    219 VMMR3DECL(int) DBGFR3RegCpuQueryU16( PVM pVM, VMCPUID idCpu, DBGFREG enmReg, uint16_t    *pu16)
    220 {
    221     return VERR_INTERNAL_ERROR;
    222 }
    223 VMMR3DECL(int) DBGFR3RegCpuQueryU32( PVM pVM, VMCPUID idCpu, DBGFREG enmReg, uint32_t    *pu32)
    224 {
    225     return VERR_INTERNAL_ERROR;
    226 }
    227 VMMR3DECL(int) DBGFR3RegCpuQueryU64( PVM pVM, VMCPUID idCpu, DBGFREG enmReg, uint64_t    *pu64)
    228 {
    229     return VERR_INTERNAL_ERROR;
    230 }
    231 VMMR3DECL(int) DBGFR3RegNmQuery(PVM pVM, VMCPUID idDefCpu, const char *pszReg, PDBGFREGVAL pValue, PDBGFREGVALTYPE penmType)
     205VMMR3DECL(int) DBGFR3RegCpuQueryU8(  PUVM pUVM, VMCPUID idCpu, DBGFREG enmReg, uint8_t     *pu8)
     206{
     207    return VERR_INTERNAL_ERROR;
     208}
     209VMMR3DECL(int) DBGFR3RegCpuQueryU16( PUVM pUVM, VMCPUID idCpu, DBGFREG enmReg, uint16_t    *pu16)
     210{
     211    return VERR_INTERNAL_ERROR;
     212}
     213VMMR3DECL(int) DBGFR3RegCpuQueryU32( PUVM pUVM, VMCPUID idCpu, DBGFREG enmReg, uint32_t    *pu32)
     214{
     215    return VERR_INTERNAL_ERROR;
     216}
     217VMMR3DECL(int) DBGFR3RegCpuQueryU64( PUVM pUVM, VMCPUID idCpu, DBGFREG enmReg, uint64_t    *pu64)
     218{
     219    return VERR_INTERNAL_ERROR;
     220}
     221VMMR3DECL(int) DBGFR3RegNmQuery(PUVM pUVM, VMCPUID idDefCpu, const char *pszReg, PDBGFREGVAL pValue, PDBGFREGVALTYPE penmType)
    232222{
    233223    if (idDefCpu == 0 || idDefCpu == DBGFREG_HYPER_VMCPUID)
     
    260250    return VERR_DBGF_REGISTER_NOT_FOUND;
    261251}
    262 VMMR3DECL(int) DBGFR3RegPrintf(PVM pVM, VMCPUID idCpu, char *pszBuf, size_t cbBuf, const char *pszFormat, ...)
     252VMMR3DECL(int) DBGFR3RegPrintf(PUVM pUVM, VMCPUID idCpu, char *pszBuf, size_t cbBuf, const char *pszFormat, ...)
    263253{
    264254    return VERR_INTERNAL_ERROR;
     
    268258    return VERR_INTERNAL_ERROR;
    269259}
    270 VMMR3DECL(int) DBGFR3RegNmSet(PVM pVM, VMCPUID idDefCpu, const char *pszReg, PCDBGFREGVAL pValue, DBGFREGVALTYPE enmType)
    271 {
    272     return VERR_INTERNAL_ERROR;
    273 }
    274 
    275 VMMR3DECL(PDBGFADDRESS) DBGFR3AddrFromPhys(PVM pVM, PDBGFADDRESS pAddress, RTGCPHYS PhysAddr)
    276 {
    277     return NULL;
    278 }
    279 VMMR3DECL(int)  DBGFR3AddrToHostPhys(PVM pVM, VMCPUID idCpu, PDBGFADDRESS pAddress, PRTHCPHYS pHCPhys)
    280 {
    281     return VERR_INTERNAL_ERROR;
    282 }
    283 VMMR3DECL(int)  DBGFR3AddrToVolatileR3Ptr(PVM pVM, VMCPUID idCpu, PDBGFADDRESS pAddress, bool fReadOnly, void **ppvR3Ptr)
    284 {
    285     return VERR_INTERNAL_ERROR;
    286 }
    287 
    288 VMMR3DECL(int) DBGFR3OSRegister(PVM pVM, PCDBGFOSREG pReg)
    289 {
    290     return VERR_INTERNAL_ERROR;
    291 }
    292 VMMR3DECL(int) DBGFR3OSDetect(PVM pVM, char *pszName, size_t cchName)
    293 {
    294     return VERR_INTERNAL_ERROR;
    295 }
    296 VMMR3DECL(int) DBGFR3OSQueryNameAndVersion(PVM pVM, char *pszName, size_t cchName, char *pszVersion, size_t cchVersion)
    297 {
    298     return VERR_INTERNAL_ERROR;
    299 }
    300 
    301 VMMR3DECL(int) DBGFR3SelQueryInfo(PVM pVM, VMCPUID idCpu, RTSEL Sel, uint32_t fFlags, PDBGFSELINFO pSelInfo)
    302 {
    303     return VERR_INTERNAL_ERROR;
    304 }
    305 
    306 VMMR3DECL(CPUMMODE) DBGFR3CpuGetMode(PVM pVM, VMCPUID idCpu)
     260VMMR3DECL(int) DBGFR3RegNmSet(PUVM pUVM, VMCPUID idDefCpu, const char *pszReg, PCDBGFREGVAL pValue, DBGFREGVALTYPE enmType)
     261{
     262    return VERR_INTERNAL_ERROR;
     263}
     264
     265VMMR3DECL(PDBGFADDRESS) DBGFR3AddrFromPhys(PUVM pUVM, PDBGFADDRESS pAddress, RTGCPHYS PhysAddr)
     266{
     267    return NULL;
     268}
     269VMMR3DECL(int)  DBGFR3AddrToHostPhys(PUVM pUVM, VMCPUID idCpu, PDBGFADDRESS pAddress, PRTHCPHYS pHCPhys)
     270{
     271    return VERR_INTERNAL_ERROR;
     272}
     273VMMR3DECL(int)  DBGFR3AddrToVolatileR3Ptr(PUVM pUVM, VMCPUID idCpu, PDBGFADDRESS pAddress, bool fReadOnly, void **ppvR3Ptr)
     274{
     275    return VERR_INTERNAL_ERROR;
     276}
     277
     278VMMR3DECL(int) DBGFR3OSRegister(PUVM pUVM, PCDBGFOSREG pReg)
     279{
     280    return VERR_INTERNAL_ERROR;
     281}
     282VMMR3DECL(int) DBGFR3OSDetect(PUVM pUVM, char *pszName, size_t cchName)
     283{
     284    return VERR_INTERNAL_ERROR;
     285}
     286VMMR3DECL(int) DBGFR3OSQueryNameAndVersion(PUVM pUVM, char *pszName, size_t cchName, char *pszVersion, size_t cchVersion)
     287{
     288    return VERR_INTERNAL_ERROR;
     289}
     290
     291VMMR3DECL(int) DBGFR3SelQueryInfo(PUVM pUVM, VMCPUID idCpu, RTSEL Sel, uint32_t fFlags, PDBGFSELINFO pSelInfo)
     292{
     293    return VERR_INTERNAL_ERROR;
     294}
     295
     296VMMR3DECL(CPUMMODE) DBGFR3CpuGetMode(PUVM pUVM, VMCPUID idCpu)
    307297{
    308298    return CPUMMODE_INVALID;
    309299}
    310 
    311 VMMR3DECL(int) DBGFR3CoreWrite(PVM pVM, const char *pszFilename, bool fReplaceFile)
     300VMMR3DECL(VMCPUID) DBGFR3CpuGetCount(PUVM pUVM)
     301{
     302    return 1;
     303}
     304
     305VMMR3DECL(int) DBGFR3CoreWrite(PUVM pUVM, const char *pszFilename, bool fReplaceFile)
    312306{
    313307    return VERR_INTERNAL_ERROR;
     
    382376
    383377
    384 #include <VBox/vmm/mm.h>
    385 
    386 VMMR3DECL(int) MMR3HCPhys2HCVirt(PVM pVM, RTHCPHYS HCPhys, void **ppv)
    387 {
    388     return VERR_INTERNAL_ERROR;
    389 }
    390 
    391 
    392 
    393378
    394379#include <VBox/vmm/pgm.h>
     
    404389}
    405390
    406 VMMR3DECL(int) PGMR3DbgR3Ptr2GCPhys(PVM pVM, RTR3PTR R3Ptr, PRTGCPHYS pGCPhys)
    407 {
    408     return VERR_INTERNAL_ERROR;
    409 }
    410 
    411 VMMR3DECL(int) PGMR3DbgR3Ptr2HCPhys(PVM pVM, RTR3PTR R3Ptr, PRTHCPHYS pHCPhys)
    412 {
    413     return VERR_INTERNAL_ERROR;
    414 }
    415 VMMR3DECL(int) PGMR3DbgHCPhys2GCPhys(PVM pVM, RTHCPHYS HCPhys, PRTGCPHYS pGCPhys)
     391VMMR3DECL(int) PGMR3DbgR3Ptr2GCPhys(PUVM pUVM, RTR3PTR R3Ptr, PRTGCPHYS pGCPhys)
     392{
     393    return VERR_INTERNAL_ERROR;
     394}
     395
     396VMMR3DECL(int) PGMR3DbgR3Ptr2HCPhys(PUVM pUVM, RTR3PTR R3Ptr, PRTHCPHYS pHCPhys)
     397{
     398    return VERR_INTERNAL_ERROR;
     399}
     400VMMR3DECL(int) PGMR3DbgHCPhys2GCPhys(PUVM pUVM, RTHCPHYS HCPhys, PRTGCPHYS pGCPhys)
    416401{
    417402    return VERR_INTERNAL_ERROR;
     
    421406#include <VBox/vmm/vmm.h>
    422407
    423 VMMDECL(PVMCPU) VMMGetCpuById(PVM pVM, RTCPUID idCpu)
    424 {
    425     return NULL;
    426 }
    427 
     408VMMR3DECL(PVMCPU) VMMR3GetCpuByIdU(PUVM pUVM, RTCPUID idCpu)
     409{
     410    return NULL;
     411}
     412
     413
     414VMMR3DECL(PVM) VMR3GetVM(PUVM pUVM)
     415{
     416    return NULL;
     417}
  • trunk/src/VBox/Devices/VMMDev/VMMDev.cpp

    r44130 r44399  
    985985                     * Write the core file.
    986986                     */
    987                     PVM pVM = PDMDevHlpGetVM(pDevIns);
    988                     pRequestHeader->rc = DBGFR3CoreWrite(pVM, szCorePath, true /*fReplaceFile*/);
     987                    PUVM pUVM = PDMDevHlpGetUVM(pDevIns);
     988                    pRequestHeader->rc = DBGFR3CoreWrite(pUVM, szCorePath, true /*fReplaceFile*/);
    989989                }
    990990                else
  • trunk/src/VBox/Devices/VMMDev/VMMDevTesting.cpp

    r43876 r44399  
    134134    if (cchValueNm && pszRegNm && *pszRegNm)
    135135    {
    136         PVM         pVM = PDMDevHlpGetVM(pDevIns);
     136        PUVM        pUVM  = PDMDevHlpGetUVM(pDevIns);
     137        PVM         pVM   = PDMDevHlpGetVM(pDevIns);
    137138        VMCPUID     idCpu = VMMGetCpuId(pVM);
    138139        uint64_t    u64Value;
    139         int rc2 = DBGFR3RegNmQueryU64(pVM, idCpu, pszRegNm, &u64Value);
     140        int rc2 = DBGFR3RegNmQueryU64(pUVM, idCpu, pszRegNm, &u64Value);
    140141        if (RT_SUCCESS(rc2))
    141142        {
     
    144145            char szFormat[128], szValue[128];
    145146            RTStrPrintf(szFormat, sizeof(szFormat), "%%VR{%s}", pszRegNm);
    146             rc2 = DBGFR3RegPrintf(pVM, idCpu, szValue, sizeof(szValue), szFormat);
     147            rc2 = DBGFR3RegPrintf(pUVM, idCpu, szValue, sizeof(szValue), szFormat);
    147148            if (RT_SUCCESS(rc2))
    148149                VMMDEV_TESTING_OUTPUT(("testing: VALUE '%s'%*s: %16s {reg=%s}%s\n",
  • trunk/src/VBox/Main/src-client/ConsoleImpl2.cpp

    r44393 r44399  
    49354935                PFNDBGFHANDLEREXT pfnHandler = (PFNDBGFHANDLEREXT)(uintptr_t)Params[0].u.pointer.addr;
    49364936                void *pService = (void*)Params[1].u.pointer.addr;
    4937                 DBGFR3InfoRegisterExternal(VMR3GetVM(pUVM), "guestprops", "Display the guest properties", pfnHandler, pService);
     4937                DBGFR3InfoRegisterExternal(pUVM, "guestprops", "Display the guest properties", pfnHandler, pService);
    49384938            }
    49394939        }
  • trunk/src/VBox/Main/src-client/MachineDebuggerImpl.cpp

    r44385 r44399  
    448448
    449449#ifdef LOG_ENABLED
    450     int vrc = DBGFR3LogModifyFlags(ptrVM, aEnabled ? "enabled" : "disabled");
     450    int vrc = DBGFR3LogModifyFlags(ptrVM.rawUVM(), aEnabled ? "enabled" : "disabled");
    451451    if (RT_FAILURE(vrc))
    452452    {
     
    676676             */
    677677            char szName[64];
    678             int vrc = DBGFR3OSQueryNameAndVersion(ptrVM.raw(), szName, sizeof(szName), NULL, 0);
     678            int vrc = DBGFR3OSQueryNameAndVersion(ptrVM.rawUVM(), szName, sizeof(szName), NULL, 0);
    679679            if (RT_SUCCESS(vrc))
    680680            {
     
    713713             */
    714714            char szVersion[256];
    715             int vrc = DBGFR3OSQueryNameAndVersion(ptrVM.raw(), NULL, 0, szVersion, sizeof(szVersion));
     715            int vrc = DBGFR3OSQueryNameAndVersion(ptrVM.rawUVM(), NULL, 0, szVersion, sizeof(szVersion));
    716716            if (RT_SUCCESS(vrc))
    717717            {
     
    753753    {
    754754        uint32_t cr4;
    755         int rc = DBGFR3RegCpuQueryU32(ptrVM.raw(), 0 /*idCpu*/,  DBGFREG_CR4, &cr4); AssertRC(rc);
     755        int rc = DBGFR3RegCpuQueryU32(ptrVM.rawUVM(), 0 /*idCpu*/,  DBGFREG_CR4, &cr4); AssertRC(rc);
    756756        *aEnabled = RT_BOOL(cr4 & X86_CR4_PAE);
    757757    }
     
    879879        if (SUCCEEDED(hrc))
    880880        {
    881             int vrc = DBGFR3CoreWrite(ptrVM, strFilename.c_str(), false /*fReplaceFile*/);
     881            int vrc = DBGFR3CoreWrite(ptrVM.rawUVM(), strFilename.c_str(), false /*fReplaceFile*/);
    882882            if (RT_SUCCESS(vrc))
    883883                hrc = S_OK;
     
    10391039            MACHINEDEBUGGERINOFHLP Hlp;
    10401040            MachineDebuggerInfoInit(&Hlp);
    1041             int vrc = DBGFR3Info(ptrVM.raw(),  strName.c_str(),  strArgs.c_str(), &Hlp.Core);
     1041            int vrc = DBGFR3Info(ptrVM.rawUVM(),  strName.c_str(),  strArgs.c_str(), &Hlp.Core);
    10421042            if (RT_SUCCESS(vrc))
    10431043            {
     
    11061106        if (SUCCEEDED(hrc))
    11071107        {
    1108             int vrc = DBGFR3LogModifyFlags(ptrVM, strSettings.c_str());
     1108            int vrc = DBGFR3LogModifyFlags(ptrVM.rawUVM(), strSettings.c_str());
    11091109            if (RT_SUCCESS(vrc))
    11101110                hrc = S_OK;
     
    11311131        if (SUCCEEDED(hrc))
    11321132        {
    1133             int vrc = DBGFR3LogModifyGroups(ptrVM, strSettings.c_str());
     1133            int vrc = DBGFR3LogModifyGroups(ptrVM.rawUVM(), strSettings.c_str());
    11341134            if (RT_SUCCESS(vrc))
    11351135                hrc = S_OK;
     
    11561156        if (SUCCEEDED(hrc))
    11571157        {
    1158             int vrc = DBGFR3LogModifyDestinations(ptrVM, strSettings.c_str());
     1158            int vrc = DBGFR3LogModifyDestinations(ptrVM.rawUVM(), strSettings.c_str());
    11591159            if (RT_SUCCESS(vrc))
    11601160                hrc = S_OK;
     
    12081208/** @todo automatically load the DBGC plugins or this is a waste of time. */
    12091209            char szName[64];
    1210             int vrc = DBGFR3OSDetect(ptrVM.raw(), szName, sizeof(szName));
     1210            int vrc = DBGFR3OSDetect(ptrVM.rawUVM(), szName, sizeof(szName));
    12111211            if (RT_SUCCESS(vrc) && vrc != VINF_DBGF_OS_NOT_DETCTED)
    12121212            {
     
    12831283            DBGFREGVAL      Value;
    12841284            DBGFREGVALTYPE  enmType;
    1285             int vrc = DBGFR3RegNmQuery(ptrVM.raw(), a_idCpu, strName.c_str(), &Value, &enmType);
     1285            int vrc = DBGFR3RegNmQuery(ptrVM.rawUVM(), a_idCpu, strName.c_str(), &Value, &enmType);
    12861286            if (RT_SUCCESS(vrc))
    12871287            {
     
    13311331             */
    13321332            size_t cRegs;
    1333             int vrc = DBGFR3RegNmQueryAllCount(ptrVM.raw(), &cRegs);
     1333            int vrc = DBGFR3RegNmQueryAllCount(ptrVM.rawUVM(), &cRegs);
    13341334            if (RT_SUCCESS(vrc))
    13351335            {
     
    13371337                if (paRegs)
    13381338                {
    1339                     vrc = DBGFR3RegNmQueryAll(ptrVM.raw(), paRegs, cRegs);
     1339                    vrc = DBGFR3RegNmQueryAll(ptrVM.rawUVM(), paRegs, cRegs);
    13401340                    if (RT_SUCCESS(vrc))
    13411341                    {
  • trunk/src/VBox/VMM/VMMAll/DBGFAll.cpp

    r41965 r44399  
    3333 * @param   pVM         Pointer to the VM.
    3434 */
    35 VMMDECL(RTGCUINTREG) DBGFBpGetDR7(PVM pVM)
     35VMM_INT_DECL(RTGCUINTREG) DBGFBpGetDR7(PVM pVM)
    3636{
    3737    RTGCUINTREG uDr7 = X86_DR7_GD | X86_DR7_GE | X86_DR7_LE | X86_DR7_MB1_MASK;
     
    6464 * @param   pVM         Pointer to the VM.
    6565 */
    66 VMMDECL(RTGCUINTREG) DBGFBpGetDR0(PVM pVM)
     66VMM_INT_DECL(RTGCUINTREG) DBGFBpGetDR0(PVM pVM)
    6767{
    6868    PCDBGFBP    pBp = &pVM->dbgf.s.aHwBreakpoints[0];
     
    7878 * @param   pVM         Pointer to the VM.
    7979 */
    80 VMMDECL(RTGCUINTREG) DBGFBpGetDR1(PVM pVM)
     80VMM_INT_DECL(RTGCUINTREG) DBGFBpGetDR1(PVM pVM)
    8181{
    8282    PCDBGFBP    pBp = &pVM->dbgf.s.aHwBreakpoints[1];
     
    9292 * @param   pVM         Pointer to the VM.
    9393 */
    94 VMMDECL(RTGCUINTREG) DBGFBpGetDR2(PVM pVM)
     94VMM_INT_DECL(RTGCUINTREG) DBGFBpGetDR2(PVM pVM)
    9595{
    9696    PCDBGFBP    pBp = &pVM->dbgf.s.aHwBreakpoints[2];
     
    106106 * @param   pVM         Pointer to the VM.
    107107 */
    108 VMMDECL(RTGCUINTREG) DBGFBpGetDR3(PVM pVM)
     108VMM_INT_DECL(RTGCUINTREG) DBGFBpGetDR3(PVM pVM)
    109109{
    110110    PCDBGFBP    pBp = &pVM->dbgf.s.aHwBreakpoints[3];
     
    121121 * @param   pVCpu       Pointer to the VMCPU.
    122122 */
    123 VMMDECL(bool) DBGFIsStepping(PVMCPU pVCpu)
     123VMM_INT_DECL(bool) DBGFIsStepping(PVMCPU pVCpu)
    124124{
    125125    return pVCpu->dbgf.s.fSingleSteppingRaw;
  • trunk/src/VBox/VMM/VMMAll/IEMAll.cpp

    r42778 r44399  
    24592459        PVMCPU  pVCpu = IEMCPU_TO_VMCPU(pIemCpu);
    24602460        char    szRegs[4096];
    2461         DBGFR3RegPrintf(pVM, pVCpu->idCpu, &szRegs[0], sizeof(szRegs),
     2461        DBGFR3RegPrintf(pVM->pUVM, pVCpu->idCpu, &szRegs[0], sizeof(szRegs),
    24622462                        "rax=%016VR{rax} rbx=%016VR{rbx} rcx=%016VR{rcx} rdx=%016VR{rdx}\n"
    24632463                        "rsi=%016VR{rsi} rdi=%016VR{rdi} r8 =%016VR{r8} r9 =%016VR{r9}\n"
     
    24872487
    24882488        char szInstr[256];
    2489         DBGFR3DisasInstrEx(pVM, pVCpu->idCpu, 0, 0,
     2489        DBGFR3DisasInstrEx(pVM->pUVM, pVCpu->idCpu, 0, 0,
    24902490                           DBGF_DISAS_FLAGS_CURRENT_GUEST | DBGF_DISAS_FLAGS_DEFAULT_MODE,
    24912491                           szInstr, sizeof(szInstr), NULL);
     
    28362836    PVMCPU  pVCpu = IEMCPU_TO_VMCPU(pIemCpu);
    28372837    char szRegs[4096];
    2838     DBGFR3RegPrintf(pVM, pVCpu->idCpu, &szRegs[0], sizeof(szRegs),
     2838    DBGFR3RegPrintf(pVM->pUVM, pVCpu->idCpu, &szRegs[0], sizeof(szRegs),
    28392839                    "rax=%016VR{rax} rbx=%016VR{rbx} rcx=%016VR{rcx} rdx=%016VR{rdx}\n"
    28402840                    "rsi=%016VR{rsi} rdi=%016VR{rdi} r8 =%016VR{r8} r9 =%016VR{r9}\n"
     
    28642864
    28652865    char szInstr[256];
    2866     DBGFR3DisasInstrEx(pVM, pVCpu->idCpu, 0, 0,
     2866    DBGFR3DisasInstrEx(pVM->pUVM, pVCpu->idCpu, 0, 0,
    28672867                       DBGF_DISAS_FLAGS_CURRENT_GUEST | DBGF_DISAS_FLAGS_DEFAULT_MODE,
    28682868                       szInstr, sizeof(szInstr), NULL);
     
    77917791    PVMCPU   pVCpu = IEMCPU_TO_VMCPU(pIemCpu);
    77927792    char szRegs[4096];
    7793     DBGFR3RegPrintf(pVM, pVCpu->idCpu, &szRegs[0], sizeof(szRegs),
     7793    DBGFR3RegPrintf(pVM->pUVM, pVCpu->idCpu, &szRegs[0], sizeof(szRegs),
    77947794                    "rax=%016VR{rax} rbx=%016VR{rbx} rcx=%016VR{rcx} rdx=%016VR{rdx}\n"
    77957795                    "rsi=%016VR{rsi} rdi=%016VR{rdi} r8 =%016VR{r8} r9 =%016VR{r9}\n"
     
    78197819
    78207820    char szInstr1[256];
    7821     DBGFR3DisasInstrEx(pVM, pVCpu->idCpu, pIemCpu->uOldCs, pIemCpu->uOldRip,
     7821    DBGFR3DisasInstrEx(pVM->pUVM, pVCpu->idCpu, pIemCpu->uOldCs, pIemCpu->uOldRip,
    78227822                       DBGF_DISAS_FLAGS_DEFAULT_MODE,
    78237823                       szInstr1, sizeof(szInstr1), NULL);
    78247824    char szInstr2[256];
    7825     DBGFR3DisasInstrEx(pVM, pVCpu->idCpu, 0, 0,
     7825    DBGFR3DisasInstrEx(pVM->pUVM, pVCpu->idCpu, 0, 0,
    78267826                       DBGF_DISAS_FLAGS_CURRENT_GUEST | DBGF_DISAS_FLAGS_DEFAULT_MODE,
    78277827                       szInstr2, sizeof(szInstr2), NULL);
     
    81708170        if (cDiffs != 0)
    81718171        {
    8172             DBGFR3Info(pVM, "cpumguest", "verbose", NULL);
     8172            DBGFR3Info(pVM->pUVM, "cpumguest", "verbose", NULL);
    81738173            RTAssertMsg1(NULL, __LINE__, __FILE__, __FUNCTION__);
    81748174            iemVerifyAssertMsg2(pIemCpu);
     
    83918391        char     szInstr[256];
    83928392        uint32_t cbInstr = 0;
    8393         DBGFR3DisasInstrEx(pVCpu->pVMR3, pVCpu->idCpu, 0, 0,
     8393        DBGFR3DisasInstrEx(pVCpu->pVMR3->pUVM, pVCpu->idCpu, 0, 0,
    83948394                           DBGF_DISAS_FLAGS_CURRENT_GUEST | DBGF_DISAS_FLAGS_DEFAULT_MODE,
    83958395                           szInstr, sizeof(szInstr), &cbInstr);
     
    84108410
    84118411        if (LogIs3Enabled())
    8412             DBGFR3Info(pVCpu->pVMR3, "cpumguest", "verbose", NULL);
     8412            DBGFR3Info(pVCpu->pVMR3->pUVM, "cpumguest", "verbose", NULL);
    84138413    }
    84148414    else
  • trunk/src/VBox/VMM/VMMAll/PGMAllBth.h

    r43387 r44399  
    37303730    pgmGstGet32bitPDPtr(pVCpu);
    37313731    RTGCPHYS GCPhys;
    3732     rc = PGMR3DbgR3Ptr2GCPhys(pVM, pPGM->pGst32BitPdR3, &GCPhys);
     3732    rc = PGMR3DbgR3Ptr2GCPhys(pVM->pUVM, pPGM->pGst32BitPdR3, &GCPhys);
    37333733    AssertRCReturn(rc, 1);
    37343734    AssertMsgReturn(PGM_A20_APPLY(pVCpu, cr3 & GST_CR3_PAGE_MASK) == GCPhys, ("GCPhys=%RGp cr3=%RGp\n", GCPhys, (RTGCPHYS)cr3), false);
     
    40664066#  ifdef IN_RING3
    40674067                                PGMAssertHandlerAndFlagsInSync(pVM);
    4068                                 DBGFR3PagingDumpEx(pVM, pVCpu->idCpu, DBGFPGDMP_FLAGS_CURRENT_CR3 | DBGFPGDMP_FLAGS_CURRENT_MODE
     4068                                DBGFR3PagingDumpEx(pVM->pUVM, pVCpu->idCpu, DBGFPGDMP_FLAGS_CURRENT_CR3 | DBGFPGDMP_FLAGS_CURRENT_MODE
    40694069                                                   | DBGFPGDMP_FLAGS_GUEST | DBGFPGDMP_FLAGS_HEADER | DBGFPGDMP_FLAGS_PRINT_CR3,
    40704070                                                   0, 0, UINT64_MAX, 99, NULL);
  • trunk/src/VBox/VMM/VMMAll/PGMAllHandler.cpp

    r43387 r44399  
    130130    {
    131131#ifdef IN_RING3
    132         DBGFR3Info(pVM, "phys", NULL, NULL);
     132        DBGFR3Info(pVM->pUVM, "phys", NULL, NULL);
    133133#endif
    134134        AssertMsgFailed(("No RAM range for %RGp-%RGp\n", GCPhys, GCPhysLast));
     
    184184
    185185#if defined(IN_RING3) && defined(VBOX_STRICT)
    186     DBGFR3Info(pVM, "handlers", "phys nostats", NULL);
     186    DBGFR3Info(pVM->pUVM, "handlers", "phys nostats", NULL);
    187187#endif
    188188    AssertMsgFailed(("Conflict! GCPhys=%RGp GCPhysLast=%RGp pszDesc=%s\n", GCPhys, GCPhysLast, pszDesc));
  • trunk/src/VBox/VMM/VMMR3/CFGM.cpp

    r44387 r44399  
    108108     * Register DBGF into item.
    109109     */
    110     int rc = DBGFR3InfoRegisterInternal(pVM, "cfgm", "Dumps a part of the CFGM tree. The argument indicates where to start.", cfgmR3Info);
     110    int rc = DBGFR3InfoRegisterInternal(pVM, "cfgm", "Dumps a part of the CFGM tree. The argument indicates where to start.",
     111                                        cfgmR3Info);
    111112    AssertRCReturn(rc,rc);
    112113
  • trunk/src/VBox/VMM/VMMR3/CPUM.cpp

    r44362 r44399  
    44024402                RTCpuSetToU64(RTMpGetOnlineSet(&OnlineSet)) ));
    44034403    LogRel(("************************* CPUID dump ************************\n"));
    4404     DBGFR3Info(pVM, "cpuid", "verbose", DBGFR3InfoLogRelHlp());
     4404    DBGFR3Info(pVM->pUVM, "cpuid", "verbose", DBGFR3InfoLogRelHlp());
    44054405    LogRel(("\n"));
    4406     DBGFR3InfoLog(pVM, "cpuid", "verbose"); /* macro */
     4406    DBGFR3_INFO_LOG(pVM, "cpuid", "verbose"); /* macro */
    44074407    RTLogRelSetBuffering(fOldBuffered);
    44084408    LogRel(("******************** End of CPUID dump **********************\n"));
  • trunk/src/VBox/VMM/VMMR3/CSAM.cpp

    r44385 r44399  
    8484static bool fInCSAMCodePageInvalidate = false;
    8585
     86#ifdef VBOX_WITH_DEBUGGER
     87static FNDBGCCMD csamr3CmdOn;
     88static FNDBGCCMD csamr3CmdOff;
     89#endif
     90
     91
    8692/*******************************************************************************
    8793*   Global Variables                                                           *
    8894*******************************************************************************/
    8995#ifdef VBOX_WITH_DEBUGGER
    90 static DECLCALLBACK(int) csamr3CmdOn(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
    91 static DECLCALLBACK(int) csamr3CmdOff(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
    92 
    9396/** Command descriptors. */
    9497static const DBGCCMD    g_aCmds[] =
     
    27232726
    27242727/**
    2725  * The '.csamoff' command.
    2726  *
    2727  * @returns VBox status.
    2728  * @param   pCmd        Pointer to the command descriptor (as registered).
    2729  * @param   pCmdHlp     Pointer to command helper functions.
    2730  * @param   pVM         Pointer to the current VM (if any).
    2731  * @param   paArgs      Pointer to (readonly) array of arguments.
    2732  * @param   cArgs       Number of arguments in the array.
    2733  */
    2734 static DECLCALLBACK(int) csamr3CmdOff(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
    2735 {
    2736     DBGC_CMDHLP_REQ_VM_RET(pCmdHlp, pCmd, pVM);
     2728 * @callback_method_impl{FNDBGCCMD, The '.csamoff' command.}
     2729 */
     2730static DECLCALLBACK(int) csamr3CmdOff(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
     2731{
     2732    DBGC_CMDHLP_REQ_UVM_RET(pCmdHlp, pCmd, pUVM);
    27372733    NOREF(cArgs); NOREF(paArgs);
    27382734
    2739     int rc = CSAMDisableScanning(pVM);
     2735    int rc = CSAMR3SetScanningEnabled(pUVM, false);
    27402736    if (RT_FAILURE(rc))
    2741         return DBGCCmdHlpFailRc(pCmdHlp, pCmd, rc, "CSAMDisableScanning");
     2737        return DBGCCmdHlpFailRc(pCmdHlp, pCmd, rc, "CSAMR3SetScanningEnabled");
    27422738    return DBGCCmdHlpPrintf(pCmdHlp, "CSAM Scanning disabled\n");
    27432739}
    27442740
    27452741/**
    2746  * The '.csamon' command.
    2747  *
    2748  * @returns VBox status.
    2749  * @param   pCmd        Pointer to the command descriptor (as registered).
    2750  * @param   pCmdHlp     Pointer to command helper functions.
    2751  * @param   pVM         Pointer to the current VM (if any).
    2752  * @param   paArgs      Pointer to (readonly) array of arguments.
    2753  * @param   cArgs       Number of arguments in the array.
    2754  */
    2755 static DECLCALLBACK(int) csamr3CmdOn(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
    2756 {
    2757     DBGC_CMDHLP_REQ_VM_RET(pCmdHlp, pCmd, pVM);
     2742 * @callback_method_impl{FNDBGCCMD, The '.csamon' command.}
     2743 */
     2744static DECLCALLBACK(int) csamr3CmdOn(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
     2745{
     2746    DBGC_CMDHLP_REQ_UVM_RET(pCmdHlp, pCmd, pUVM);
    27582747    NOREF(cArgs); NOREF(paArgs);
    27592748
    2760     int rc = CSAMEnableScanning(pVM);
     2749    int rc = CSAMR3SetScanningEnabled(pUVM, true);
    27612750    if (RT_FAILURE(rc))
    2762         return DBGCCmdHlpFailRc(pCmdHlp, pCmd, rc, "CSAMEnableScanning");
     2751        return DBGCCmdHlpFailRc(pCmdHlp, pCmd, rc, "CSAMR3SetScanningEnabled");
    27632752    return DBGCCmdHlpPrintf(pCmdHlp, "CSAM Scanning enabled\n");
    27642753}
  • trunk/src/VBox/VMM/VMMR3/DBGF.cpp

    r44373 r44399  
    135135 * @param   pVM     Pointer to the VM.
    136136 */
    137 VMMR3DECL(int) DBGFR3Init(PVM pVM)
    138 {
    139     int rc = dbgfR3InfoInit(pVM);
     137VMMR3_INT_DECL(int) DBGFR3Init(PVM pVM)
     138{
     139    PUVM pUVM = pVM->pUVM;
     140    int rc = dbgfR3InfoInit(pUVM);
    140141    if (RT_SUCCESS(rc))
    141142        rc = dbgfR3TraceInit(pVM);
    142143    if (RT_SUCCESS(rc))
    143         rc = dbgfR3RegInit(pVM);
     144        rc = dbgfR3RegInit(pUVM);
    144145    if (RT_SUCCESS(rc))
    145         rc = dbgfR3AsInit(pVM);
     146        rc = dbgfR3AsInit(pUVM);
    146147    if (RT_SUCCESS(rc))
    147148        rc = dbgfR3SymInit(pVM);
     
    158159 * @param   pVM     Pointer to the VM.
    159160 */
    160 VMMR3DECL(int) DBGFR3Term(PVM pVM)
    161 {
     161VMMR3_INT_DECL(int) DBGFR3Term(PVM pVM)
     162{
     163    PUVM pUVM = pVM->pUVM;
    162164    int rc;
    163165
     
    213215     * Terminate the other bits.
    214216     */
    215     dbgfR3OSTerm(pVM);
    216     dbgfR3AsTerm(pVM);
    217     dbgfR3RegTerm(pVM);
     217    dbgfR3OSTerm(pUVM);
     218    dbgfR3AsTerm(pUVM);
     219    dbgfR3RegTerm(pUVM);
    218220    dbgfR3TraceTerm(pVM);
    219     dbgfR3InfoTerm(pVM);
     221    dbgfR3InfoTerm(pUVM);
    220222    return VINF_SUCCESS;
    221223}
     
    230232 * @param   offDelta    Relocation delta relative to old location.
    231233 */
    232 VMMR3DECL(void) DBGFR3Relocate(PVM pVM, RTGCINTPTR offDelta)
     234VMMR3_INT_DECL(void) DBGFR3Relocate(PVM pVM, RTGCINTPTR offDelta)
    233235{
    234236    dbgfR3TraceRelocate(pVM);
    235     dbgfR3AsRelocate(pVM, offDelta);
     237    dbgfR3AsRelocate(pVM->pUVM, offDelta);
    236238}
    237239
     
    300302 * @param   pVM         Pointer to the VM.
    301303 */
    302 VMMR3DECL(int) DBGFR3VMMForcedAction(PVM pVM)
     304VMMR3_INT_DECL(int) DBGFR3VMMForcedAction(PVM pVM)
    303305{
    304306    int rc = VINF_SUCCESS;
     
    450452 * @param   pVM         Pointer to the VM.
    451453 * @param   enmEvent    The event to send.
     454 * @internal
    452455 */
    453456VMMR3DECL(int) DBGFR3Event(PVM pVM, DBGFEVENTTYPE enmEvent)
     
    477480 * @param   pszFormat   Message which accompanies the event.
    478481 * @param   ...         Message arguments.
     482 * @internal
    479483 */
    480484VMMR3DECL(int) DBGFR3EventSrc(PVM pVM, DBGFEVENTTYPE enmEvent, const char *pszFile, unsigned uLine, const char *pszFunction, const char *pszFormat, ...)
     
    499503 * @param   pszFormat   Message which accompanies the event.
    500504 * @param   args        Message arguments.
     505 * @internal
    501506 */
    502507VMMR3DECL(int) DBGFR3EventSrcV(PVM pVM, DBGFEVENTTYPE enmEvent, const char *pszFile, unsigned uLine, const char *pszFunction, const char *pszFormat, va_list args)
     
    539544 * @param   pszMsg2     Second assertion message.
    540545 */
    541 VMMR3DECL(int) DBGFR3EventAssertion(PVM pVM, DBGFEVENTTYPE enmEvent, const char *pszMsg1, const char *pszMsg2)
     546VMMR3_INT_DECL(int) DBGFR3EventAssertion(PVM pVM, DBGFEVENTTYPE enmEvent, const char *pszMsg1, const char *pszMsg2)
    542547{
    543548    int rc = dbgfR3EventPrologue(pVM, enmEvent);
     
    564569 * @param   enmEvent    DBGFEVENT_BREAKPOINT_HYPER or DBGFEVENT_BREAKPOINT.
    565570 */
    566 VMMR3DECL(int) DBGFR3EventBreakpoint(PVM pVM, DBGFEVENTTYPE enmEvent)
     571VMMR3_INT_DECL(int) DBGFR3EventBreakpoint(PVM pVM, DBGFEVENTTYPE enmEvent)
    567572{
    568573    int rc = dbgfR3EventPrologue(pVM, enmEvent);
     
    857862 *
    858863 * @returns VBox status code.
    859  * @param   pVM     Pointer to the VM.
    860  */
    861 VMMR3DECL(int) DBGFR3Attach(PVM pVM)
    862 {
    863     VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
     864 * @param   pUVM        The user mode VM handle.
     865 */
     866VMMR3DECL(int) DBGFR3Attach(PUVM pUVM)
     867{
     868    UVM_ASSERT_VALID_EXT_RETURN(pUVM, false);
     869    PVM pVM = pUVM->pVM;
     870    VM_ASSERT_VALID_EXT_RETURN(pVM, false);
    864871
    865872    /*
     
    905912 *
    906913 * @returns VBox status code.
    907  * @param   pVM     Pointer to the VM.
    908  */
    909 VMMR3DECL(int) DBGFR3Detach(PVM pVM)
     914 * @param   pUVM        The user mode VM handle.
     915 */
     916VMMR3DECL(int) DBGFR3Detach(PUVM pUVM)
    910917{
    911918    LogFlow(("DBGFR3Detach:\n"));
     
    915922     * Check if attached.
    916923     */
     924    UVM_ASSERT_VALID_EXT_RETURN(pUVM, false);
     925    PVM pVM = pUVM->pVM;
     926    VM_ASSERT_VALID_EXT_RETURN(pVM, false);
    917927    AssertReturn(pVM->dbgf.s.fAttached, VERR_DBGF_NOT_ATTACHED);
    918928
     
    951961 *
    952962 * @returns VBox status. Will not return VBOX_INTERRUPTED.
    953  * @param   pVM         Pointer to the VM.
     963 * @param   pUVM        The user mode VM handle.
    954964 * @param   cMillies    Number of millis to wait.
    955965 * @param   ppEvent     Where to store the event pointer.
    956966 */
    957 VMMR3DECL(int) DBGFR3EventWait(PVM pVM, RTMSINTERVAL cMillies, PCDBGFEVENT *ppEvent)
     967VMMR3DECL(int) DBGFR3EventWait(PUVM pUVM, RTMSINTERVAL cMillies, PCDBGFEVENT *ppEvent)
    958968{
    959969    /*
    960970     * Check state.
    961971     */
     972    UVM_ASSERT_VALID_EXT_RETURN(pUVM, false);
     973    PVM pVM = pUVM->pVM;
     974    VM_ASSERT_VALID_EXT_RETURN(pVM, false);
    962975    AssertReturn(pVM->dbgf.s.fAttached, VERR_DBGF_NOT_ATTACHED);
    963976    *ppEvent = NULL;
     
    985998 *
    986999 * @returns VBox status.
    987  * @param   pVM     Pointer to the VM.
    988  */
    989 VMMR3DECL(int) DBGFR3Halt(PVM pVM)
     1000 * @param   pUVM        The user mode VM handle.
     1001 */
     1002VMMR3DECL(int) DBGFR3Halt(PUVM pUVM)
    9901003{
    9911004    /*
    9921005     * Check state.
    9931006     */
     1007    UVM_ASSERT_VALID_EXT_RETURN(pUVM, false);
     1008    PVM pVM = pUVM->pVM;
     1009    VM_ASSERT_VALID_EXT_RETURN(pVM, false);
    9941010    AssertReturn(pVM->dbgf.s.fAttached, VERR_DBGF_NOT_ATTACHED);
    9951011    RTPINGPONGSPEAKER enmSpeaker = pVM->dbgf.s.PingPong.enmSpeaker;
     
    10121028 * @returns True if halted.
    10131029 * @returns False if not halted.
    1014  * @param   pVM     Pointer to the VM.
    1015  */
    1016 VMMR3DECL(bool) DBGFR3IsHalted(PVM pVM)
    1017 {
     1030 * @param   pUVM        The user mode VM handle.
     1031 */
     1032VMMR3DECL(bool) DBGFR3IsHalted(PUVM pUVM)
     1033{
     1034    UVM_ASSERT_VALID_EXT_RETURN(pUVM, false);
     1035    PVM pVM = pUVM->pVM;
     1036    VM_ASSERT_VALID_EXT_RETURN(pVM, false);
    10181037    AssertReturn(pVM->dbgf.s.fAttached, false);
     1038
    10191039    RTPINGPONGSPEAKER enmSpeaker = pVM->dbgf.s.PingPong.enmSpeaker;
    10201040    return enmSpeaker == RTPINGPONGSPEAKER_PONG_SIGNALED
     
    10301050 * @returns True if waitable.
    10311051 * @returns False if not waitable.
    1032  * @param   pVM     Pointer to the VM.
    1033  */
    1034 VMMR3DECL(bool) DBGFR3CanWait(PVM pVM)
    1035 {
     1052 * @param   pUVM        The user mode VM handle.
     1053 */
     1054VMMR3DECL(bool) DBGFR3CanWait(PUVM pUVM)
     1055{
     1056    UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE);
     1057    PVM pVM = pUVM->pVM;
     1058    VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
    10361059    AssertReturn(pVM->dbgf.s.fAttached, false);
     1060
    10371061    return RTSemPongShouldWait(&pVM->dbgf.s.PingPong);
    10381062}
     
    10451069 *
    10461070 * @returns VBox status.
    1047  * @param   pVM     Pointer to the VM.
    1048  */
    1049 VMMR3DECL(int) DBGFR3Resume(PVM pVM)
     1071 * @param   pUVM        The user mode VM handle.
     1072 */
     1073VMMR3DECL(int) DBGFR3Resume(PUVM pUVM)
    10501074{
    10511075    /*
    10521076     * Check state.
    10531077     */
     1078    UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE);
     1079    PVM pVM = pUVM->pVM;
     1080    VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
    10541081    AssertReturn(pVM->dbgf.s.fAttached, VERR_DBGF_NOT_ATTACHED);
    10551082    AssertReturn(RTSemPongIsSpeaker(&pVM->dbgf.s.PingPong), VERR_SEM_OUT_OF_TURN);
     
    10731100 *
    10741101 * @returns VBox status.
    1075  * @param   pVM     Pointer to the VM.
     1102 * @param   pUVM        The user mode VM handle.
    10761103 * @param   idCpu   The ID of the CPU to single step on.
    10771104 */
    1078 VMMR3DECL(int) DBGFR3Step(PVM pVM, VMCPUID idCpu)
     1105VMMR3DECL(int) DBGFR3Step(PUVM pUVM, VMCPUID idCpu)
    10791106{
    10801107    /*
    10811108     * Check state.
    10821109     */
     1110    UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE);
     1111    PVM pVM = pUVM->pVM;
     1112    VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
    10831113    AssertReturn(pVM->dbgf.s.fAttached, VERR_DBGF_NOT_ATTACHED);
    10841114    AssertReturn(RTSemPongIsSpeaker(&pVM->dbgf.s.PingPong), VERR_SEM_OUT_OF_TURN);
     
    11081138 *
    11091139 * @thread  VCpu EMT
    1110  */
    1111 VMMR3DECL(int) DBGFR3PrgStep(PVMCPU pVCpu)
     1140 * @internal
     1141 */
     1142VMMR3_INT_DECL(int) DBGFR3PrgStep(PVMCPU pVCpu)
    11121143{
    11131144    VMCPU_ASSERT_EMT(pVCpu);
  • trunk/src/VBox/VMM/VMMR3/DBGFAddr.cpp

    r41965 r44399  
    2727#include "DBGFInternal.h"
    2828#include <VBox/vmm/vm.h>
     29#include <VBox/vmm/uvm.h>
     30
    2931#include <VBox/param.h>
    3032#include <VBox/err.h>
     
    3638/**
    3739 * Checks if an address is in the HMA or not.
    38  * @returns true if it's inside the HMA.
    39  * @returns flase if it's not inside the HMA.
    40  * @param   pVM         Pointer to the VM.
    41  * @param   FlatPtr     The address in question.
    42  */
    43 DECLINLINE(bool) dbgfR3IsHMA(PVM pVM, RTGCUINTPTR FlatPtr)
    44 {
    45     return MMHyperIsInsideArea(pVM, FlatPtr);
     40 *
     41 * @retval  true if it's inside the HMA.
     42 * @retval  flase if it's not inside the HMA.
     43 *
     44 * @param   pUVM            The user mode VM handle.
     45 * @param   FlatPtr         The address in question.
     46 */
     47DECLINLINE(bool) dbgfR3IsHMA(PUVM pUVM, RTGCUINTPTR FlatPtr)
     48{
     49    return MMHyperIsInsideArea(pUVM->pVM, FlatPtr);
    4650}
    4751
     
    9296 *
    9397 * @returns VBox status code.
    94  * @param   pVM         Pointer to the VM.
    95  * @param   idCpu       The CPU ID.
    96  * @param   pAddress    Where to store the mixed address.
    97  * @param   Sel         The selector part.
    98  * @param   off         The offset part.
    99  */
    100 VMMR3DECL(int) DBGFR3AddrFromSelOff(PVM pVM, VMCPUID idCpu, PDBGFADDRESS pAddress, RTSEL Sel, RTUINTPTR off)
    101 {
    102     AssertReturn(idCpu < pVM->cCpus, VERR_INVALID_PARAMETER);
     98 * @param   pUVM            The user mode VM handle.
     99 * @param   idCpu           The CPU ID.
     100 * @param   pAddress        Where to store the mixed address.
     101 * @param   Sel             The selector part.
     102 * @param   off             The offset part.
     103 */
     104VMMR3DECL(int) DBGFR3AddrFromSelOff(PUVM pUVM, VMCPUID idCpu, PDBGFADDRESS pAddress, RTSEL Sel, RTUINTPTR off)
     105{
     106    UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE);
     107    VM_ASSERT_VALID_EXT_RETURN(pUVM->pVM, VERR_INVALID_VM_HANDLE);
     108    AssertReturn(idCpu < pUVM->cCpus, VERR_INVALID_PARAMETER);
    103109
    104110    pAddress->Sel = Sel;
     
    107113    {
    108114        DBGFSELINFO SelInfo;
    109         int rc = DBGFR3SelQueryInfo(pVM, idCpu, Sel, DBGFSELQI_FLAGS_DT_GUEST | DBGFSELQI_FLAGS_DT_ADJ_64BIT_MODE, &SelInfo);
     115        int rc = DBGFR3SelQueryInfo(pUVM, idCpu, Sel, DBGFSELQI_FLAGS_DT_GUEST | DBGFSELQI_FLAGS_DT_ADJ_64BIT_MODE, &SelInfo);
    110116        if (RT_FAILURE(rc))
    111117            return rc;
     
    120126    }
    121127    pAddress->fFlags |= DBGFADDRESS_FLAGS_VALID;
    122     if (dbgfR3IsHMA(pVM, pAddress->FlatPtr))
     128    if (dbgfR3IsHMA(pUVM, pAddress->FlatPtr))
    123129        pAddress->fFlags |= DBGFADDRESS_FLAGS_HMA;
    124130
     
    132138 *
    133139 * @returns VBox status code.
    134  * @param   pVM         Pointer to the VM.
    135  * @param   idCpu       The CPU ID.
    136  * @param   pAddress    Where to store the mixed address.
    137  * @param   pSelInfo    The selector info.
    138  * @param   off         The offset part.
    139  */
    140 VMMR3DECL(int) DBGFR3AddrFromSelInfoOff(PVM pVM, PDBGFADDRESS pAddress, PCDBGFSELINFO pSelInfo, RTUINTPTR off)
    141 {
     140 * @param   pUVM            The user mode VM handle.
     141 * @param   idCpu           The CPU ID.
     142 * @param   pAddress        Where to store the mixed address.
     143 * @param   pSelInfo        The selector info.
     144 * @param   off             The offset part.
     145 */
     146VMMR3DECL(int) DBGFR3AddrFromSelInfoOff(PUVM pUVM, PDBGFADDRESS pAddress, PCDBGFSELINFO pSelInfo, RTUINTPTR off)
     147{
     148    UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE);
     149    VM_ASSERT_VALID_EXT_RETURN(pUVM->pVM, VERR_INVALID_VM_HANDLE);
     150
    142151    pAddress->Sel = pSelInfo->Sel;
    143152    pAddress->off = off;
     
    145154    if (RT_FAILURE(rc))
    146155        return rc;
     156
    147157    pAddress->fFlags |= DBGFADDRESS_FLAGS_VALID;
    148     if (dbgfR3IsHMA(pVM, pAddress->FlatPtr))
     158    if (dbgfR3IsHMA(pUVM, pAddress->FlatPtr))
    149159        pAddress->fFlags |= DBGFADDRESS_FLAGS_HMA;
     160
    150161    return VINF_SUCCESS;
    151162}
     
    156167 *
    157168 * @returns pAddress.
    158  * @param   pVM         Pointer to the VM.
    159  * @param   pAddress    Where to store the mixed address.
    160  * @param   FlatPtr     The flat pointer.
    161  */
    162 VMMR3DECL(PDBGFADDRESS) DBGFR3AddrFromFlat(PVM pVM, PDBGFADDRESS pAddress, RTGCUINTPTR FlatPtr)
    163 {
     169 * @param   pUVM            The user mode VM handle.
     170 * @param   pAddress        Where to store the mixed address.
     171 * @param   FlatPtr         The flat pointer.
     172 */
     173VMMR3DECL(PDBGFADDRESS) DBGFR3AddrFromFlat(PUVM pUVM, PDBGFADDRESS pAddress, RTGCUINTPTR FlatPtr)
     174{
     175    UVM_ASSERT_VALID_EXT_RETURN(pUVM, NULL);
     176    VM_ASSERT_VALID_EXT_RETURN(pUVM->pVM, NULL);
    164177    pAddress->Sel     = DBGF_SEL_FLAT;
    165178    pAddress->off     = FlatPtr;
    166179    pAddress->FlatPtr = FlatPtr;
    167180    pAddress->fFlags  = DBGFADDRESS_FLAGS_FLAT | DBGFADDRESS_FLAGS_VALID;
    168     if (dbgfR3IsHMA(pVM, pAddress->FlatPtr))
     181    if (dbgfR3IsHMA(pUVM, pAddress->FlatPtr))
    169182        pAddress->fFlags |= DBGFADDRESS_FLAGS_HMA;
    170183    return pAddress;
     
    176189 *
    177190 * @returns pAddress.
    178  * @param   pVM         Pointer to the VM.
    179  * @param   pAddress    Where to store the mixed address.
    180  * @param   PhysAddr    The guest physical address.
    181  */
    182 VMMR3DECL(PDBGFADDRESS) DBGFR3AddrFromPhys(PVM pVM, PDBGFADDRESS pAddress, RTGCPHYS PhysAddr)
    183 {
    184     NOREF(pVM);
     191 * @param   pUVM            The user mode VM handle.
     192 * @param   pAddress        Where to store the mixed address.
     193 * @param   PhysAddr        The guest physical address.
     194 */
     195VMMR3DECL(PDBGFADDRESS) DBGFR3AddrFromPhys(PUVM pUVM, PDBGFADDRESS pAddress, RTGCPHYS PhysAddr)
     196{
     197    UVM_ASSERT_VALID_EXT_RETURN(pUVM, NULL);
    185198    pAddress->Sel     = DBGF_SEL_FLAT;
    186199    pAddress->off     = PhysAddr;
     
    196209 * @returns true if valid.
    197210 * @returns false if invalid.
    198  * @param   pVM         Pointer to the VM.
    199  * @param   pAddress    The address to validate.
    200  */
    201 VMMR3DECL(bool) DBGFR3AddrIsValid(PVM pVM, PCDBGFADDRESS pAddress)
    202 {
    203     NOREF(pVM);
     211 * @param   pUVM            The user mode VM handle.
     212 * @param   pAddress        The address to validate.
     213 */
     214VMMR3DECL(bool) DBGFR3AddrIsValid(PUVM pUVM, PCDBGFADDRESS pAddress)
     215{
     216    UVM_ASSERT_VALID_EXT_RETURN(pUVM, false);
    204217    if (!VALID_PTR(pAddress))
    205218        return false;
     
    241254 * @retval  VERR_PAGE_MAP_LEVEL4_NOT_PRESENT
    242255 *
    243  * @param   pVM             Pointer to the VM.
     256 * @param   pUVM            The user mode VM handle.
    244257 * @param   idCpu           The ID of the CPU context to convert virtual
    245258 *                          addresses.
     
    247260 * @param   pGCPhys         Where to return the physical address.
    248261 */
    249 VMMR3DECL(int)  DBGFR3AddrToPhys(PVM pVM, VMCPUID idCpu, PDBGFADDRESS pAddress, PRTGCPHYS pGCPhys)
     262VMMR3DECL(int)  DBGFR3AddrToPhys(PUVM pUVM, VMCPUID idCpu, PDBGFADDRESS pAddress, PRTGCPHYS pGCPhys)
    250263{
    251264    /*
     
    256269    AssertPtr(pAddress);
    257270    AssertReturn(DBGFADDRESS_IS_VALID(pAddress), VERR_INVALID_PARAMETER);
    258     VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_STATE);
    259     AssertReturn(idCpu < pVM->cCpus, VERR_INVALID_PARAMETER);
     271    UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_STATE);
     272    PVM pVM = pUVM->pVM;
     273    VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
     274    AssertReturn(idCpu < pUVM->cCpus, VERR_INVALID_PARAMETER);
    260275
    261276    /*
     
    276291            rc = dbgfR3AddrToPhysOnVCpu(pVCpu, pAddress, pGCPhys);
    277292        else
    278             rc = VMR3ReqPriorityCallWait(pVCpu->pVMR3, pVCpu->idCpu,
    279                                          (PFNRT)dbgfR3AddrToPhysOnVCpu, 3, pVCpu, pAddress, pGCPhys);
     293            rc = VMR3ReqPriorityCallWaitU(pUVM, pVCpu->idCpu,
     294                                          (PFNRT)dbgfR3AddrToPhysOnVCpu, 3, pVCpu, pAddress, pGCPhys);
    280295    }
    281296    return rc;
     
    299314 * @retval  VERR_PGM_INVALID_GC_PHYSICAL_ADDRESS
    300315 *
    301  * @param   pVM             Pointer to the VM.
     316 * @param   pUVM            The user mode VM handle.
    302317 * @param   idCpu           The ID of the CPU context to convert virtual
    303318 *                          addresses.
     
    305320 * @param   pHCPhys         Where to return the physical address.
    306321 */
    307 VMMR3DECL(int)  DBGFR3AddrToHostPhys(PVM pVM, VMCPUID idCpu, PDBGFADDRESS pAddress, PRTHCPHYS pHCPhys)
     322VMMR3DECL(int)  DBGFR3AddrToHostPhys(PUVM pUVM, VMCPUID idCpu, PDBGFADDRESS pAddress, PRTHCPHYS pHCPhys)
    308323{
    309324    /*
     
    314329    AssertPtr(pAddress);
    315330    AssertReturn(DBGFADDRESS_IS_VALID(pAddress), VERR_INVALID_PARAMETER);
    316     VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_STATE);
    317     AssertReturn(idCpu < pVM->cCpus, VERR_INVALID_PARAMETER);
     331    UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_STATE);
     332    PVM pVM = pUVM->pVM;
     333    VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
     334    AssertReturn(idCpu < pUVM->cCpus, VERR_INVALID_PARAMETER);
    318335
    319336    /*
     
    326343    {
    327344        RTGCPHYS GCPhys;
    328         rc = DBGFR3AddrToPhys(pVM, idCpu, pAddress, &GCPhys);
     345        rc = DBGFR3AddrToPhys(pUVM, idCpu, pAddress, &GCPhys);
    329346        if (RT_SUCCESS(rc))
    330347            rc = PGMPhysGCPhys2HCPhys(pVM, pAddress->FlatPtr, pHCPhys);
     
    339356 * @returns VBox status code.
    340357 *
    341  * @param   pVM             Pointer to the VM.
     358 * @param   pUVM            The user mode VM handle.
    342359 * @param   idCpu           The ID of the CPU context.
    343360 * @param   pAddress        The address.
     
    345362 * @param   ppvR3Ptr        Where to return the address.
    346363 */
    347 static DECLCALLBACK(int) dbgfR3AddrToVolatileR3PtrOnVCpu(PVM pVM, VMCPUID idCpu, PDBGFADDRESS pAddress, bool fReadOnly, void **ppvR3Ptr)
    348 {
     364static DECLCALLBACK(int) dbgfR3AddrToVolatileR3PtrOnVCpu(PUVM pUVM, VMCPUID idCpu, PDBGFADDRESS pAddress, bool fReadOnly,
     365                                                         void **ppvR3Ptr)
     366{
     367    PVM pVM = pUVM->pVM;
     368    VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
    349369    Assert(idCpu == VMMGetCpuId(pVM));
    350370
     
    410430 * @retval  VERR_PGM_INVALID_GC_PHYSICAL_ADDRESS
    411431 *
    412  * @param   pVM             Pointer to the VM.
     432 * @param   pUVM            The user mode VM handle.
    413433 * @param   idCpu           The ID of the CPU context to convert virtual
    414434 *                          addresses.
     
    419439 * @param   ppvR3Ptr        Where to return the address.
    420440 */
    421 VMMR3DECL(int)  DBGFR3AddrToVolatileR3Ptr(PVM pVM, VMCPUID idCpu, PDBGFADDRESS pAddress, bool fReadOnly, void **ppvR3Ptr)
     441VMMR3DECL(int)  DBGFR3AddrToVolatileR3Ptr(PUVM pUVM, VMCPUID idCpu, PDBGFADDRESS pAddress, bool fReadOnly, void **ppvR3Ptr)
    422442{
    423443    /*
     
    428448    AssertPtr(pAddress);
    429449    AssertReturn(DBGFADDRESS_IS_VALID(pAddress), VERR_INVALID_PARAMETER);
    430     VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_STATE);
    431     AssertReturn(idCpu < pVM->cCpus, VERR_INVALID_PARAMETER);
     450    UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_STATE);
     451    AssertReturn(idCpu < pUVM->cCpus, VERR_INVALID_PARAMETER);
    432452
    433453    /*
    434454     * Convert it.
    435455     */
    436     return VMR3ReqPriorityCallWait(pVM, idCpu, (PFNRT)dbgfR3AddrToVolatileR3PtrOnVCpu, 5, pVM, idCpu, pAddress, fReadOnly, ppvR3Ptr);
     456    return VMR3ReqPriorityCallWaitU(pUVM, idCpu, (PFNRT)dbgfR3AddrToVolatileR3PtrOnVCpu, 5,
     457                                    pUVM, idCpu, pAddress, fReadOnly, ppvR3Ptr);
    437458}
    438459
  • trunk/src/VBox/VMM/VMMR3/DBGFAddrSpace.cpp

    r41965 r44399  
    55
    66/*
    7  * Copyright (C) 2008 Oracle Corporation
     7 * Copyright (C) 2008-2013 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    4242#include <VBox/vmm/mm.h>
    4343#include "DBGFInternal.h"
     44#include <VBox/vmm/uvm.h>
    4445#include <VBox/vmm/vm.h>
    4546#include <VBox/err.h>
     
    7980typedef struct DBGFR3ASLOADOPENDATA
    8081{
    81     const char *pszModName;
    82     RTGCUINTPTR uSubtrahend;
    83     uint32_t fFlags;
    84     RTDBGMOD hMod;
     82    const char     *pszModName;
     83    RTGCUINTPTR     uSubtrahend;
     84    uint32_t        fFlags;
     85    RTDBGMOD        hMod;
    8586} DBGFR3ASLOADOPENDATA;
    8687
     
    101102*******************************************************************************/
    102103/** Locks the address space database for writing. */
    103 #define DBGF_AS_DB_LOCK_WRITE(pVM) \
     104#define DBGF_AS_DB_LOCK_WRITE(pUVM) \
    104105    do { \
    105         int rcSem = RTSemRWRequestWrite((pVM)->dbgf.s.hAsDbLock, RT_INDEFINITE_WAIT); \
     106        int rcSem = RTSemRWRequestWrite((pUVM)->dbgf.s.hAsDbLock, RT_INDEFINITE_WAIT); \
    106107        AssertRC(rcSem); \
    107108    } while (0)
    108109
    109110/** Unlocks the address space database after writing. */
    110 #define DBGF_AS_DB_UNLOCK_WRITE(pVM) \
     111#define DBGF_AS_DB_UNLOCK_WRITE(pUVM) \
    111112    do { \
    112         int rcSem = RTSemRWReleaseWrite((pVM)->dbgf.s.hAsDbLock); \
     113        int rcSem = RTSemRWReleaseWrite((pUVM)->dbgf.s.hAsDbLock); \
    113114        AssertRC(rcSem); \
    114115    } while (0)
    115116
    116117/** Locks the address space database for reading. */
    117 #define DBGF_AS_DB_LOCK_READ(pVM) \
     118#define DBGF_AS_DB_LOCK_READ(pUVM) \
    118119    do { \
    119         int rcSem = RTSemRWRequestRead((pVM)->dbgf.s.hAsDbLock, RT_INDEFINITE_WAIT); \
     120        int rcSem = RTSemRWRequestRead((pUVM)->dbgf.s.hAsDbLock, RT_INDEFINITE_WAIT); \
    120121        AssertRC(rcSem); \
    121122    } while (0)
    122123
    123124/** Unlocks the address space database after reading. */
    124 #define DBGF_AS_DB_UNLOCK_READ(pVM) \
     125#define DBGF_AS_DB_UNLOCK_READ(pUVM) \
    125126    do { \
    126         int rcSem = RTSemRWReleaseRead((pVM)->dbgf.s.hAsDbLock); \
     127        int rcSem = RTSemRWReleaseRead((pUVM)->dbgf.s.hAsDbLock); \
    127128        AssertRC(rcSem); \
    128129    } while (0)
     
    134135 *
    135136 * @returns VBox status code.
    136  * @param   pVM             Pointer to the VM.
    137  */
    138 int dbgfR3AsInit(PVM pVM)
     137 * @param   pUVM        The user mode VM handle.
     138 */
     139int dbgfR3AsInit(PUVM pUVM)
    139140{
    140141    /*
    141142     * Create the semaphore.
    142143     */
    143     int rc = RTSemRWCreate(&pVM->dbgf.s.hAsDbLock);
     144    int rc = RTSemRWCreate(&pUVM->dbgf.s.hAsDbLock);
    144145    AssertRCReturn(rc, rc);
    145146
     
    150151    rc = RTDbgAsCreate(&hDbgAs, 0, RTGCPTR_MAX, "Global");
    151152    AssertRCReturn(rc, rc);
    152     rc = DBGFR3AsAdd(pVM, hDbgAs, NIL_RTPROCESS);
     153    rc = DBGFR3AsAdd(pUVM, hDbgAs, NIL_RTPROCESS);
    153154    AssertRCReturn(rc, rc);
    154155    RTDbgAsRetain(hDbgAs);
    155     pVM->dbgf.s.ahAsAliases[DBGF_AS_ALIAS_2_INDEX(DBGF_AS_GLOBAL)] = hDbgAs;
     156    pUVM->dbgf.s.ahAsAliases[DBGF_AS_ALIAS_2_INDEX(DBGF_AS_GLOBAL)] = hDbgAs;
    156157
    157158    RTDbgAsRetain(hDbgAs);
    158     pVM->dbgf.s.ahAsAliases[DBGF_AS_ALIAS_2_INDEX(DBGF_AS_KERNEL)] = hDbgAs;
     159    pUVM->dbgf.s.ahAsAliases[DBGF_AS_ALIAS_2_INDEX(DBGF_AS_KERNEL)] = hDbgAs;
    159160
    160161    rc = RTDbgAsCreate(&hDbgAs, 0, RTGCPHYS_MAX, "Physical");
    161162    AssertRCReturn(rc, rc);
    162     rc = DBGFR3AsAdd(pVM, hDbgAs, NIL_RTPROCESS);
     163    rc = DBGFR3AsAdd(pUVM, hDbgAs, NIL_RTPROCESS);
    163164    AssertRCReturn(rc, rc);
    164165    RTDbgAsRetain(hDbgAs);
    165     pVM->dbgf.s.ahAsAliases[DBGF_AS_ALIAS_2_INDEX(DBGF_AS_PHYS)] = hDbgAs;
     166    pUVM->dbgf.s.ahAsAliases[DBGF_AS_ALIAS_2_INDEX(DBGF_AS_PHYS)] = hDbgAs;
    166167
    167168    rc = RTDbgAsCreate(&hDbgAs, 0, RTRCPTR_MAX, "HyperRawMode");
    168169    AssertRCReturn(rc, rc);
    169     rc = DBGFR3AsAdd(pVM, hDbgAs, NIL_RTPROCESS);
     170    rc = DBGFR3AsAdd(pUVM, hDbgAs, NIL_RTPROCESS);
    170171    AssertRCReturn(rc, rc);
    171172    RTDbgAsRetain(hDbgAs);
    172     pVM->dbgf.s.ahAsAliases[DBGF_AS_ALIAS_2_INDEX(DBGF_AS_RC)] = hDbgAs;
     173    pUVM->dbgf.s.ahAsAliases[DBGF_AS_ALIAS_2_INDEX(DBGF_AS_RC)] = hDbgAs;
    173174    RTDbgAsRetain(hDbgAs);
    174     pVM->dbgf.s.ahAsAliases[DBGF_AS_ALIAS_2_INDEX(DBGF_AS_RC_AND_GC_GLOBAL)] = hDbgAs;
     175    pUVM->dbgf.s.ahAsAliases[DBGF_AS_ALIAS_2_INDEX(DBGF_AS_RC_AND_GC_GLOBAL)] = hDbgAs;
    175176
    176177    rc = RTDbgAsCreate(&hDbgAs, 0, RTR0PTR_MAX, "HyperRing0");
    177178    AssertRCReturn(rc, rc);
    178     rc = DBGFR3AsAdd(pVM, hDbgAs, NIL_RTPROCESS);
     179    rc = DBGFR3AsAdd(pUVM, hDbgAs, NIL_RTPROCESS);
    179180    AssertRCReturn(rc, rc);
    180181    RTDbgAsRetain(hDbgAs);
    181     pVM->dbgf.s.ahAsAliases[DBGF_AS_ALIAS_2_INDEX(DBGF_AS_R0)] = hDbgAs;
     182    pUVM->dbgf.s.ahAsAliases[DBGF_AS_ALIAS_2_INDEX(DBGF_AS_R0)] = hDbgAs;
    182183
    183184    return VINF_SUCCESS;
     
    207208 * Terminates the address space parts of DBGF.
    208209 *
    209  * @param   pVM             Pointer to the VM.
    210  */
    211 void dbgfR3AsTerm(PVM pVM)
     210 * @param   pUVM        The user mode VM handle.
     211 */
     212void dbgfR3AsTerm(PUVM pUVM)
    212213{
    213214    /*
    214215     * Create the semaphore.
    215216     */
    216     int rc = RTSemRWDestroy(pVM->dbgf.s.hAsDbLock);
     217    int rc = RTSemRWDestroy(pUVM->dbgf.s.hAsDbLock);
    217218    AssertRC(rc);
    218     pVM->dbgf.s.hAsDbLock = NIL_RTSEMRW;
     219    pUVM->dbgf.s.hAsDbLock = NIL_RTSEMRW;
    219220
    220221    /*
    221222     * Release all the address spaces.
    222223     */
    223     RTAvlPVDestroy(&pVM->dbgf.s.AsHandleTree, dbgfR3AsTermDestroyNode, NULL);
    224     for (size_t i = 0; i < RT_ELEMENTS(pVM->dbgf.s.ahAsAliases); i++)
    225     {
    226         RTDbgAsRelease(pVM->dbgf.s.ahAsAliases[i]);
    227         pVM->dbgf.s.ahAsAliases[i] = NIL_RTDBGAS;
     224    RTAvlPVDestroy(&pUVM->dbgf.s.AsHandleTree, dbgfR3AsTermDestroyNode, NULL);
     225    for (size_t i = 0; i < RT_ELEMENTS(pUVM->dbgf.s.ahAsAliases); i++)
     226    {
     227        RTDbgAsRelease(pUVM->dbgf.s.ahAsAliases[i]);
     228        pUVM->dbgf.s.ahAsAliases[i] = NIL_RTDBGAS;
    228229    }
    229230}
     
    233234 * Relocates the RC address space.
    234235 *
    235  * @param   pVM             Pointer to the VM.
    236  * @param   offDelta        The relocation delta.
    237  */
    238 void dbgfR3AsRelocate(PVM pVM, RTGCUINTPTR offDelta)
     236 * @param   pUVM        The user mode VM handle.
     237 * @param   offDelta    The relocation delta.
     238 */
     239void dbgfR3AsRelocate(PUVM pUVM, RTGCUINTPTR offDelta)
    239240{
    240241    /** @todo */
    241     NOREF(pVM); NOREF(offDelta);
     242    NOREF(pUVM); NOREF(offDelta);
    242243}
    243244
     
    247248 *
    248249 * @returns VBox status code.
    249  * @param   pVM             Pointer to the VM.
    250  * @param   hDbgAs          The address space handle. The reference of the
    251  *                          caller will NOT be consumed.
    252  * @param   ProcId          The process id or NIL_RTPROCESS.
    253  */
    254 VMMR3DECL(int) DBGFR3AsAdd(PVM pVM, RTDBGAS hDbgAs, RTPROCESS ProcId)
     250 * @param   pUVM        The user mode VM handle.
     251 * @param   hDbgAs      The address space handle. The reference of the caller
     252 *                      will NOT be consumed.
     253 * @param   ProcId      The process id or NIL_RTPROCESS.
     254 */
     255VMMR3DECL(int) DBGFR3AsAdd(PUVM pUVM, RTDBGAS hDbgAs, RTPROCESS ProcId)
    255256{
    256257    /*
    257258     * Input validation.
    258259     */
    259     VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
     260    UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE);
    260261    const char *pszName = RTDbgAsName(hDbgAs);
    261262    if (!pszName)
     
    269270     */
    270271    int rc = VERR_NO_MEMORY;
    271     PDBGFASDBNODE pDbNode = (PDBGFASDBNODE)MMR3HeapAlloc(pVM, MM_TAG_DBGF_AS, sizeof(*pDbNode));
     272    PDBGFASDBNODE pDbNode = (PDBGFASDBNODE)MMR3HeapAllocU(pUVM, MM_TAG_DBGF_AS, sizeof(*pDbNode));
    272273    if (pDbNode)
    273274    {
     
    276277        pDbNode->NameCore.pszString = pszName;
    277278        pDbNode->NameCore.cchString = strlen(pszName);
    278         DBGF_AS_DB_LOCK_WRITE(pVM);
    279         if (RTStrSpaceInsert(&pVM->dbgf.s.AsNameSpace, &pDbNode->NameCore))
     279        DBGF_AS_DB_LOCK_WRITE(pUVM);
     280        if (RTStrSpaceInsert(&pUVM->dbgf.s.AsNameSpace, &pDbNode->NameCore))
    280281        {
    281             if (RTAvlPVInsert(&pVM->dbgf.s.AsHandleTree, &pDbNode->HandleCore))
     282            if (RTAvlPVInsert(&pUVM->dbgf.s.AsHandleTree, &pDbNode->HandleCore))
    282283            {
    283                 DBGF_AS_DB_UNLOCK_WRITE(pVM);
     284                DBGF_AS_DB_UNLOCK_WRITE(pUVM);
    284285                return VINF_SUCCESS;
    285286            }
    286287
    287288            /* bail out */
    288             RTStrSpaceRemove(&pVM->dbgf.s.AsNameSpace, pszName);
     289            RTStrSpaceRemove(&pUVM->dbgf.s.AsNameSpace, pszName);
    289290        }
    290         DBGF_AS_DB_UNLOCK_WRITE(pVM);
     291        DBGF_AS_DB_UNLOCK_WRITE(pUVM);
    291292        MMR3HeapFree(pDbNode);
    292293    }
     
    305306 * @retval  VERR_NOT_FOUND if not found in the address space database.
    306307 *
    307  * @param   pVM             Pointer to the VM.
    308  * @param   hDbgAs          The address space handle. Aliases are not allowed.
    309  */
    310 VMMR3DECL(int) DBGFR3AsDelete(PVM pVM, RTDBGAS hDbgAs)
     308 * @param   pUVM        The user mode VM handle.
     309 * @param   hDbgAs      The address space handle. Aliases are not allowed.
     310 */
     311VMMR3DECL(int) DBGFR3AsDelete(PUVM pUVM, RTDBGAS hDbgAs)
    311312{
    312313    /*
     
    314315     * the lock as well as validated.
    315316     */
    316     VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
     317    UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE);
    317318    if (hDbgAs == NIL_RTDBGAS)
    318319        return VINF_SUCCESS;
     
    322323    RTDbgAsRelease(hDbgAs);
    323324
    324     DBGF_AS_DB_LOCK_WRITE(pVM);
     325    DBGF_AS_DB_LOCK_WRITE(pUVM);
    325326
    326327    /*
    327328     * You cannot delete any of the aliases.
    328329     */
    329     for (size_t i = 0; i < RT_ELEMENTS(pVM->dbgf.s.ahAsAliases); i++)
    330         if (pVM->dbgf.s.ahAsAliases[i] == hDbgAs)
     330    for (size_t i = 0; i < RT_ELEMENTS(pUVM->dbgf.s.ahAsAliases); i++)
     331        if (pUVM->dbgf.s.ahAsAliases[i] == hDbgAs)
    331332        {
    332             DBGF_AS_DB_UNLOCK_WRITE(pVM);
     333            DBGF_AS_DB_UNLOCK_WRITE(pUVM);
    333334            return VERR_SHARING_VIOLATION;
    334335        }
     
    337338     * Ok, try remove it from the database.
    338339     */
    339     PDBGFASDBNODE pDbNode = (PDBGFASDBNODE)RTAvlPVRemove(&pVM->dbgf.s.AsHandleTree, hDbgAs);
     340    PDBGFASDBNODE pDbNode = (PDBGFASDBNODE)RTAvlPVRemove(&pUVM->dbgf.s.AsHandleTree, hDbgAs);
    340341    if (!pDbNode)
    341342    {
    342         DBGF_AS_DB_UNLOCK_WRITE(pVM);
     343        DBGF_AS_DB_UNLOCK_WRITE(pUVM);
    343344        return VERR_NOT_FOUND;
    344345    }
    345     RTStrSpaceRemove(&pVM->dbgf.s.AsNameSpace, pDbNode->NameCore.pszString);
     346    RTStrSpaceRemove(&pUVM->dbgf.s.AsNameSpace, pDbNode->NameCore.pszString);
    346347    if (pDbNode->PidCore.Key != NIL_RTPROCESS)
    347         RTAvlU32Remove(&pVM->dbgf.s.AsPidTree, pDbNode->PidCore.Key);
    348 
    349     DBGF_AS_DB_UNLOCK_WRITE(pVM);
     348        RTAvlU32Remove(&pUVM->dbgf.s.AsPidTree, pDbNode->PidCore.Key);
     349
     350    DBGF_AS_DB_UNLOCK_WRITE(pUVM);
    350351
    351352    /*
     
    366367 *
    367368 * @returns VBox status code.
    368  * @param   pVM             Pointer to the VM.
    369  * @param   hAlias          The alias to change.
    370  * @param   hAliasFor       The address space hAlias should be an alias for.
    371  *                          This can be an alias. The caller's reference to
    372  *                          this address space will NOT be consumed.
    373  */
    374 VMMR3DECL(int) DBGFR3AsSetAlias(PVM pVM, RTDBGAS hAlias, RTDBGAS hAliasFor)
     369 * @param   pUVM        The user mode VM handle.
     370 * @param   hAlias      The alias to change.
     371 * @param   hAliasFor   The address space hAlias should be an alias for.  This
     372 *                      can be an alias. The caller's reference to this address
     373 *                      space will NOT be consumed.
     374 */
     375VMMR3DECL(int) DBGFR3AsSetAlias(PUVM pUVM, RTDBGAS hAlias, RTDBGAS hAliasFor)
    375376{
    376377    /*
    377378     * Input validation.
    378379     */
    379     VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
     380    UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE);
    380381    AssertMsgReturn(DBGF_AS_IS_ALIAS(hAlias), ("%p\n", hAlias), VERR_INVALID_PARAMETER);
    381382    AssertMsgReturn(!DBGF_AS_IS_FIXED_ALIAS(hAlias), ("%p\n", hAlias), VERR_INVALID_PARAMETER);
    382     RTDBGAS hRealAliasFor = DBGFR3AsResolveAndRetain(pVM, hAliasFor);
     383    RTDBGAS hRealAliasFor = DBGFR3AsResolveAndRetain(pUVM, hAliasFor);
    383384    if (hRealAliasFor == NIL_RTDBGAS)
    384385        return VERR_INVALID_HANDLE;
     
    388389     */
    389390    int rc = VERR_NOT_FOUND;
    390     DBGF_AS_DB_LOCK_WRITE(pVM);
    391     if (RTAvlPVGet(&pVM->dbgf.s.AsHandleTree, hRealAliasFor))
     391    DBGF_AS_DB_LOCK_WRITE(pUVM);
     392    if (RTAvlPVGet(&pUVM->dbgf.s.AsHandleTree, hRealAliasFor))
    392393    {
    393394        /*
     
    395396         */
    396397        RTDBGAS hAsOld;
    397         ASMAtomicXchgHandle(&pVM->dbgf.s.ahAsAliases[DBGF_AS_ALIAS_2_INDEX(hAlias)], hRealAliasFor, &hAsOld);
     398        ASMAtomicXchgHandle(&pUVM->dbgf.s.ahAsAliases[DBGF_AS_ALIAS_2_INDEX(hAlias)], hRealAliasFor, &hAsOld);
    398399        uint32_t cRefs = RTDbgAsRelease(hAsOld);
    399400        Assert(cRefs > 0); Assert(cRefs != UINT32_MAX); NOREF(cRefs);
    400401        rc = VINF_SUCCESS;
    401402    }
    402     DBGF_AS_DB_UNLOCK_WRITE(pVM);
     403    DBGF_AS_DB_UNLOCK_WRITE(pUVM);
    403404
    404405    return rc;
     
    437438 * Lazily populates the specified address space.
    438439 *
    439  * @param   pVM                 Pointer to the VM.
    440  * @param   hAlias              The alias.
    441  */
    442 static void dbgfR3AsLazyPopulate(PVM pVM, RTDBGAS hAlias)
    443 {
    444     DBGF_AS_DB_LOCK_WRITE(pVM);
     440 * @param   pUVM        The user mode VM handle.
     441 * @param   hAlias      The alias.
     442 */
     443static void dbgfR3AsLazyPopulate(PUVM pUVM, RTDBGAS hAlias)
     444{
     445    DBGF_AS_DB_LOCK_WRITE(pUVM);
    445446    uintptr_t iAlias = DBGF_AS_ALIAS_2_INDEX(hAlias);
    446     if (!pVM->dbgf.s.afAsAliasPopuplated[iAlias])
    447     {
    448         RTDBGAS hAs = pVM->dbgf.s.ahAsAliases[iAlias];
    449         if (hAlias == DBGF_AS_R0)
    450             PDMR3LdrEnumModules(pVM, dbgfR3AsLazyPopulateR0Callback, hAs);
     447    if (!pUVM->dbgf.s.afAsAliasPopuplated[iAlias])
     448    {
     449        RTDBGAS hAs = pUVM->dbgf.s.ahAsAliases[iAlias];
     450        if (hAlias == DBGF_AS_R0 && pUVM->pVM)
     451            PDMR3LdrEnumModules(pUVM->pVM, dbgfR3AsLazyPopulateR0Callback, hAs);
    451452        /** @todo what do we do about DBGF_AS_RC?  */
    452453
    453         pVM->dbgf.s.afAsAliasPopuplated[iAlias] = true;
    454     }
    455     DBGF_AS_DB_UNLOCK_WRITE(pVM);
     454        pUVM->dbgf.s.afAsAliasPopuplated[iAlias] = true;
     455    }
     456    DBGF_AS_DB_UNLOCK_WRITE(pUVM);
    456457}
    457458
     
    462463 * @returns Real address space handle. NIL_RTDBGAS if invalid handle.
    463464 *
    464  * @param   pVM             Pointer to the VM.
    465  * @param   hAlias          The possibly address space alias.
     465 * @param   pUVM        The user mode VM handle.
     466 * @param   hAlias      The possibly address space alias.
    466467 *
    467468 * @remarks Doesn't take any locks.
    468469 */
    469 VMMR3DECL(RTDBGAS) DBGFR3AsResolve(PVM pVM, RTDBGAS hAlias)
    470 {
    471     VM_ASSERT_VALID_EXT_RETURN(pVM, NULL);
     470VMMR3DECL(RTDBGAS) DBGFR3AsResolve(PUVM pUVM, RTDBGAS hAlias)
     471{
     472    UVM_ASSERT_VALID_EXT_RETURN(pUVM, NULL);
    472473    AssertCompileNS(NIL_RTDBGAS == (RTDBGAS)0);
    473474
    474475    uintptr_t   iAlias = DBGF_AS_ALIAS_2_INDEX(hAlias);
    475476    if (iAlias < DBGF_AS_COUNT)
    476         ASMAtomicReadHandle(&pVM->dbgf.s.ahAsAliases[iAlias], &hAlias);
     477        ASMAtomicReadHandle(&pUVM->dbgf.s.ahAsAliases[iAlias], &hAlias);
    477478    return hAlias;
    478479}
     
    485486 * @returns Real address space handle. NIL_RTDBGAS if invalid handle.
    486487 *
    487  * @param   pVM             Pointer to the VM.
    488  * @param   hAlias          The possibly address space alias.
    489  */
    490 VMMR3DECL(RTDBGAS) DBGFR3AsResolveAndRetain(PVM pVM, RTDBGAS hAlias)
    491 {
    492     VM_ASSERT_VALID_EXT_RETURN(pVM, NULL);
     488 * @param   pUVM        The user mode VM handle.
     489 * @param   hAlias      The possibly address space alias.
     490 */
     491VMMR3DECL(RTDBGAS) DBGFR3AsResolveAndRetain(PUVM pUVM, RTDBGAS hAlias)
     492{
     493    UVM_ASSERT_VALID_EXT_RETURN(pUVM, NULL);
    493494    AssertCompileNS(NIL_RTDBGAS == (RTDBGAS)0);
    494495
     
    500501        {
    501502            /* Perform lazy address space population. */
    502             if (!pVM->dbgf.s.afAsAliasPopuplated[iAlias])
    503                 dbgfR3AsLazyPopulate(pVM, hAlias);
     503            if (!pUVM->dbgf.s.afAsAliasPopuplated[iAlias])
     504                dbgfR3AsLazyPopulate(pUVM, hAlias);
    504505
    505506            /* Won't ever change, no need to grab the lock. */
    506             hAlias = pVM->dbgf.s.ahAsAliases[iAlias];
     507            hAlias = pUVM->dbgf.s.ahAsAliases[iAlias];
    507508            cRefs = RTDbgAsRetain(hAlias);
    508509        }
     
    510511        {
    511512            /* May change, grab the lock so we can read it safely. */
    512             DBGF_AS_DB_LOCK_READ(pVM);
    513             hAlias = pVM->dbgf.s.ahAsAliases[iAlias];
     513            DBGF_AS_DB_LOCK_READ(pUVM);
     514            hAlias = pUVM->dbgf.s.ahAsAliases[iAlias];
    514515            cRefs = RTDbgAsRetain(hAlias);
    515             DBGF_AS_DB_UNLOCK_READ(pVM);
     516            DBGF_AS_DB_UNLOCK_READ(pUVM);
    516517        }
    517518    }
     
    529530 * @returns Retained address space handle if found, NIL_RTDBGAS if not.
    530531 *
    531  * @param   pVM         Pointer to the VM.
     532 * @param   pUVM        The user mode VM handle.
    532533 * @param   pszName     The name.
    533534 */
    534 VMMR3DECL(RTDBGAS) DBGFR3AsQueryByName(PVM pVM, const char *pszName)
     535VMMR3DECL(RTDBGAS) DBGFR3AsQueryByName(PUVM pUVM, const char *pszName)
    535536{
    536537    /*
    537538     * Validate the input.
    538539     */
    539     VM_ASSERT_VALID_EXT_RETURN(pVM, NIL_RTDBGAS);
     540    UVM_ASSERT_VALID_EXT_RETURN(pUVM, NIL_RTDBGAS);
    540541    AssertPtrReturn(pszName, NIL_RTDBGAS);
    541542    AssertReturn(*pszName, NIL_RTDBGAS);
     
    545546     */
    546547    RTDBGAS hDbgAs = NIL_RTDBGAS;
    547     DBGF_AS_DB_LOCK_READ(pVM);
    548 
    549     PRTSTRSPACECORE pNode = RTStrSpaceGet(&pVM->dbgf.s.AsNameSpace, pszName);
     548    DBGF_AS_DB_LOCK_READ(pUVM);
     549
     550    PRTSTRSPACECORE pNode = RTStrSpaceGet(&pUVM->dbgf.s.AsNameSpace, pszName);
    550551    if (pNode)
    551552    {
     
    556557            hDbgAs = NIL_RTDBGAS;
    557558    }
    558     DBGF_AS_DB_UNLOCK_READ(pVM);
    559 
     559
     560    DBGF_AS_DB_UNLOCK_READ(pUVM);
    560561    return hDbgAs;
    561562}
     
    567568 * @returns Retained address space handle if found, NIL_RTDBGAS if not.
    568569 *
    569  * @param   pVM         Pointer to the VM.
     570 * @param   pUVM        The user mode VM handle.
    570571 * @param   ProcId      The process ID.
    571572 */
    572 VMMR3DECL(RTDBGAS) DBGFR3AsQueryByPid(PVM pVM, RTPROCESS ProcId)
     573VMMR3DECL(RTDBGAS) DBGFR3AsQueryByPid(PUVM pUVM, RTPROCESS ProcId)
    573574{
    574575    /*
    575576     * Validate the input.
    576577     */
    577     VM_ASSERT_VALID_EXT_RETURN(pVM, NIL_RTDBGAS);
     578    UVM_ASSERT_VALID_EXT_RETURN(pUVM, NIL_RTDBGAS);
    578579    AssertReturn(ProcId != NIL_RTPROCESS, NIL_RTDBGAS);
    579580
     
    582583     */
    583584    RTDBGAS hDbgAs = NIL_RTDBGAS;
    584     DBGF_AS_DB_LOCK_READ(pVM);
    585 
    586     PAVLU32NODECORE pNode = RTAvlU32Get(&pVM->dbgf.s.AsPidTree, ProcId);
     585    DBGF_AS_DB_LOCK_READ(pUVM);
     586
     587    PAVLU32NODECORE pNode = RTAvlU32Get(&pUVM->dbgf.s.AsPidTree, ProcId);
    587588    if (pNode)
    588589    {
     
    593594            hDbgAs = NIL_RTDBGAS;
    594595    }
    595     DBGF_AS_DB_UNLOCK_READ(pVM);
     596    DBGF_AS_DB_UNLOCK_READ(pUVM);
    596597
    597598    return hDbgAs;
     
    717718 *
    718719 * @returns VBox status code.
     720 * @param   pUVM            The user mode VM handle.
    719721 * @param   pszFilename     The filename.
    720722 * @param   pszCfgValue     The name of the config variable (under /DBGF/).
     
    722724 * @param   pvUser          User argument for the callback.
    723725 */
    724 static int dbgfR3AsSearchCfgPath(PVM pVM, const char *pszFilename, const char *pszCfgValue, PFNDBGFR3ASSEARCHOPEN pfnOpen, void *pvUser)
     726static int dbgfR3AsSearchCfgPath(PUVM pUVM, const char *pszFilename, const char *pszCfgValue,
     727                                 PFNDBGFR3ASSEARCHOPEN pfnOpen, void *pvUser)
    725728{
    726729    char *pszPath;
    727     int rc = CFGMR3QueryStringAllocDef(CFGMR3GetChild(CFGMR3GetRoot(pVM), "/DBGF"), pszCfgValue, &pszPath, NULL);
     730    int rc = CFGMR3QueryStringAllocDef(CFGMR3GetChild(CFGMR3GetRootU(pUVM), "/DBGF"), pszCfgValue, &pszPath, NULL);
    728731    if (RT_FAILURE(rc))
    729732        return rc;
     
    758761 * @returns VBox status code.
    759762 *
    760  * @param   pVM             Pointer to the VM.
     763 * @param   pUVM            The user mode VM handle.
    761764 * @param   hDbgAs          The address space.
    762765 * @param   pszFilename     The filename of the executable module.
     
    768771 * @param   fFlags          Flags reserved for future extensions, must be 0.
    769772 */
    770 VMMR3DECL(int) DBGFR3AsLoadImage(PVM pVM, RTDBGAS hDbgAs, const char *pszFilename, const char *pszModName, PCDBGFADDRESS pModAddress, RTDBGSEGIDX iModSeg, uint32_t fFlags)
     773VMMR3DECL(int) DBGFR3AsLoadImage(PUVM pUVM, RTDBGAS hDbgAs, const char *pszFilename, const char *pszModName, PCDBGFADDRESS pModAddress, RTDBGSEGIDX iModSeg, uint32_t fFlags)
    771774{
    772775    /*
    773776     * Validate input
    774777     */
     778    UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE);
    775779    AssertPtrReturn(pszFilename, VERR_INVALID_POINTER);
    776780    AssertReturn(*pszFilename, VERR_INVALID_PARAMETER);
    777     AssertReturn(DBGFR3AddrIsValid(pVM, pModAddress), VERR_INVALID_PARAMETER);
     781    AssertReturn(DBGFR3AddrIsValid(pUVM, pModAddress), VERR_INVALID_PARAMETER);
    778782    AssertReturn(fFlags == 0, VERR_INVALID_PARAMETER);
    779     RTDBGAS hRealAS = DBGFR3AsResolveAndRetain(pVM, hDbgAs);
     783    RTDBGAS hRealAS = DBGFR3AsResolveAndRetain(pUVM, hDbgAs);
    780784    if (hRealAS == NIL_RTDBGAS)
    781785        return VERR_INVALID_HANDLE;
     
    789793    Data.fFlags = 0;
    790794    Data.hMod = NIL_RTDBGMOD;
    791     int rc = dbgfR3AsSearchCfgPath(pVM, pszFilename, "ImagePath", dbgfR3AsLoadImageOpen, &Data);
     795    int rc = dbgfR3AsSearchCfgPath(pUVM, pszFilename, "ImagePath", dbgfR3AsLoadImageOpen, &Data);
    792796    if (RT_FAILURE(rc))
    793797        rc = dbgfR3AsSearchEnvPath(pszFilename, "VBOXDBG_IMAGE_PATH", dbgfR3AsLoadImageOpen, &Data);
    794798    if (RT_FAILURE(rc))
    795         rc = dbgfR3AsSearchCfgPath(pVM, pszFilename, "Path", dbgfR3AsLoadImageOpen, &Data);
     799        rc = dbgfR3AsSearchCfgPath(pUVM, pszFilename, "Path", dbgfR3AsLoadImageOpen, &Data);
    796800    if (RT_FAILURE(rc))
    797801        rc = dbgfR3AsSearchEnvPath(pszFilename, "VBOXDBG_PATH", dbgfR3AsLoadImageOpen, &Data);
    798802    if (RT_SUCCESS(rc))
    799803    {
    800         rc = DBGFR3AsLinkModule(pVM, hRealAS, Data.hMod, pModAddress, iModSeg, 0);
     804        rc = DBGFR3AsLinkModule(pUVM, hRealAS, Data.hMod, pModAddress, iModSeg, 0);
    801805        if (RT_FAILURE(rc))
    802806            RTDbgModRelease(Data.hMod);
     
    830834 * @returns VBox status code.
    831835 *
    832  * @param   pVM             Pointer to the VM.
     836 * @param   pUVM            The user mode VM handle.
    833837 * @param   hDbgAs          The address space.
    834838 * @param   pszFilename     The map file.
     
    843847 * @param   fFlags          Flags reserved for future extensions, must be 0.
    844848 */
    845 VMMR3DECL(int) DBGFR3AsLoadMap(PVM pVM, RTDBGAS hDbgAs, const char *pszFilename, const char *pszModName,
     849VMMR3DECL(int) DBGFR3AsLoadMap(PUVM pUVM, RTDBGAS hDbgAs, const char *pszFilename, const char *pszModName,
    846850                               PCDBGFADDRESS pModAddress, RTDBGSEGIDX iModSeg, RTGCUINTPTR uSubtrahend, uint32_t fFlags)
    847851{
     
    849853     * Validate input
    850854     */
     855    UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE);
    851856    AssertPtrReturn(pszFilename, VERR_INVALID_POINTER);
    852857    AssertReturn(*pszFilename, VERR_INVALID_PARAMETER);
    853     AssertReturn(DBGFR3AddrIsValid(pVM, pModAddress), VERR_INVALID_PARAMETER);
     858    AssertReturn(DBGFR3AddrIsValid(pUVM, pModAddress), VERR_INVALID_PARAMETER);
    854859    AssertReturn(fFlags == 0, VERR_INVALID_PARAMETER);
    855     RTDBGAS hRealAS = DBGFR3AsResolveAndRetain(pVM, hDbgAs);
     860    RTDBGAS hRealAS = DBGFR3AsResolveAndRetain(pUVM, hDbgAs);
    856861    if (hRealAS == NIL_RTDBGAS)
    857862        return VERR_INVALID_HANDLE;
     
    865870    Data.fFlags = 0;
    866871    Data.hMod = NIL_RTDBGMOD;
    867     int rc = dbgfR3AsSearchCfgPath(pVM, pszFilename, "MapPath", dbgfR3AsLoadMapOpen, &Data);
     872    int rc = dbgfR3AsSearchCfgPath(pUVM, pszFilename, "MapPath", dbgfR3AsLoadMapOpen, &Data);
    868873    if (RT_FAILURE(rc))
    869874        rc = dbgfR3AsSearchEnvPath(pszFilename, "VBOXDBG_MAP_PATH", dbgfR3AsLoadMapOpen, &Data);
    870875    if (RT_FAILURE(rc))
    871         rc = dbgfR3AsSearchCfgPath(pVM, pszFilename, "Path", dbgfR3AsLoadMapOpen, &Data);
     876        rc = dbgfR3AsSearchCfgPath(pUVM, pszFilename, "Path", dbgfR3AsLoadMapOpen, &Data);
    872877    if (RT_FAILURE(rc))
    873878        rc = dbgfR3AsSearchEnvPath(pszFilename, "VBOXDBG_PATH", dbgfR3AsLoadMapOpen, &Data);
    874879    if (RT_SUCCESS(rc))
    875880    {
    876         rc = DBGFR3AsLinkModule(pVM, hRealAS, Data.hMod, pModAddress, iModSeg, 0);
     881        rc = DBGFR3AsLinkModule(pUVM, hRealAS, Data.hMod, pModAddress, iModSeg, 0);
    877882        if (RT_FAILURE(rc))
    878883            RTDbgModRelease(Data.hMod);
     
    888893 *
    889894 * @returns VBox status code.
    890  * @param   pVM             Pointer to the VM.
     895 * @param   pUVM            The user mode VM handle.
    891896 * @param   hDbgAs          The address space handle.
    892897 * @param   hMod            The module handle.
     
    895900 * @param   fFlags          Flags to pass to the link functions, see RTDBGASLINK_FLAGS_*.
    896901 */
    897 VMMR3DECL(int) DBGFR3AsLinkModule(PVM pVM, RTDBGAS hDbgAs, RTDBGMOD hMod, PCDBGFADDRESS pModAddress, RTDBGSEGIDX iModSeg, uint32_t fFlags)
     902VMMR3DECL(int) DBGFR3AsLinkModule(PUVM pUVM, RTDBGAS hDbgAs, RTDBGMOD hMod, PCDBGFADDRESS pModAddress,
     903                                  RTDBGSEGIDX iModSeg, uint32_t fFlags)
    898904{
    899905    /*
    900906     * Input validation.
    901907     */
    902     VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
    903     AssertReturn(DBGFR3AddrIsValid(pVM, pModAddress), VERR_INVALID_PARAMETER);
    904     RTDBGAS hRealAS = DBGFR3AsResolveAndRetain(pVM, hDbgAs);
     908    UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE);
     909    AssertReturn(DBGFR3AddrIsValid(pUVM, pModAddress), VERR_INVALID_PARAMETER);
     910    RTDBGAS hRealAS = DBGFR3AsResolveAndRetain(pUVM, hDbgAs);
    905911    if (hRealAS == NIL_RTDBGAS)
    906912        return VERR_INVALID_HANDLE;
     
    967973 * @returns VBox status code. See RTDbgAsSymbolByAddr.
    968974 *
    969  * @param   pVM                 Pointer to the VM.
    970  * @param   hDbgAs              The address space handle.
    971  * @param   pAddress            The address to lookup.
    972  * @param   poffDisp            Where to return the distance between the
    973  *                              returned symbol and pAddress. Optional.
    974  * @param   pSymbol             Where to return the symbol information.
    975  *                              The returned symbol name will be prefixed by
    976  *                              the module name as far as space allows.
    977  * @param   phMod               Where to return the module handle. Optional.
    978  */
    979 VMMR3DECL(int) DBGFR3AsSymbolByAddr(PVM pVM, RTDBGAS hDbgAs, PCDBGFADDRESS pAddress,
     975 * @param   pUVM            The user mode VM handle.
     976 * @param   hDbgAs          The address space handle.
     977 * @param   pAddress        The address to lookup.
     978 * @param   poffDisp        Where to return the distance between the returned
     979 *                          symbol and pAddress. Optional.
     980 * @param   pSymbol         Where to return the symbol information. The returned
     981 *                          symbol name will be prefixed by the module name as
     982 *                          far as space allows.
     983 * @param   phMod           Where to return the module handle. Optional.
     984 */
     985VMMR3DECL(int) DBGFR3AsSymbolByAddr(PUVM pUVM, RTDBGAS hDbgAs, PCDBGFADDRESS pAddress,
    980986                                    PRTGCINTPTR poffDisp, PRTDBGSYMBOL pSymbol, PRTDBGMOD phMod)
    981987{
     
    985991    if (hDbgAs == DBGF_AS_RC_AND_GC_GLOBAL)
    986992    {
    987         int rc = DBGFR3AsSymbolByAddr(pVM, DBGF_AS_RC, pAddress, poffDisp, pSymbol, phMod);
     993        int rc = DBGFR3AsSymbolByAddr(pUVM, DBGF_AS_RC, pAddress, poffDisp, pSymbol, phMod);
    988994        if (RT_FAILURE(rc))
    989             rc = DBGFR3AsSymbolByAddr(pVM, DBGF_AS_GLOBAL, pAddress, poffDisp, pSymbol, phMod);
     995            rc = DBGFR3AsSymbolByAddr(pUVM, DBGF_AS_GLOBAL, pAddress, poffDisp, pSymbol, phMod);
    990996        return rc;
    991997    }
     
    9941000     * Input validation.
    9951001     */
    996     VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
    997     AssertReturn(DBGFR3AddrIsValid(pVM, pAddress), VERR_INVALID_PARAMETER);
     1002    UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE);
     1003    AssertReturn(DBGFR3AddrIsValid(pUVM, pAddress), VERR_INVALID_PARAMETER);
    9981004    AssertPtrNullReturn(poffDisp, VERR_INVALID_POINTER);
    9991005    AssertPtrReturn(pSymbol, VERR_INVALID_POINTER);
     
    10031009    if (phMod)
    10041010        *phMod = NIL_RTDBGMOD;
    1005     RTDBGAS hRealAS = DBGFR3AsResolveAndRetain(pVM, hDbgAs);
     1011    RTDBGAS hRealAS = DBGFR3AsResolveAndRetain(pUVM, hDbgAs);
    10061012    if (hRealAS == NIL_RTDBGAS)
    10071013        return VERR_INVALID_HANDLE;
     
    10221028    {
    10231029        DBGFSYMBOL DbgfSym;
    1024         rc = DBGFR3SymbolByAddr(pVM, pAddress->FlatPtr, poffDisp, &DbgfSym);
     1030        rc = DBGFR3SymbolByAddr(pUVM->pVM, pAddress->FlatPtr, poffDisp, &DbgfSym);
    10251031        if (RT_SUCCESS(rc))
    10261032            dbgfR3AsSymbolConvert(pSymbol, &DbgfSym);
     
    10321038        RTR0PTR     R0PtrNearSym;
    10331039        RTR0PTR     R0PtrNearSym2;
    1034         rc = PDMR3LdrQueryR0ModFromPC(pVM, pAddress->FlatPtr,
     1040        VM_ASSERT_VALID_EXT_RETURN(pUVM->pVM, VERR_INVALID_VM_HANDLE);
     1041        rc = PDMR3LdrQueryR0ModFromPC(pUVM->pVM, pAddress->FlatPtr,
    10351042                                      pSymbol->szName, sizeof(pSymbol->szName) / 2, &R0PtrMod,
    10361043                                      &szNearSym[0],   sizeof(szNearSym),           &R0PtrNearSym,
     
    10661073 *          occurs.
    10671074 *
    1068  * @param   pVM                 Pointer to the VM.
    1069  * @param   hDbgAs              See DBGFR3AsSymbolByAddr.
    1070  * @param   pAddress            See DBGFR3AsSymbolByAddr.
    1071  * @param   poffDisp            See DBGFR3AsSymbolByAddr.
    1072  * @param   phMod               See DBGFR3AsSymbolByAddr.
    1073  */
    1074 VMMR3DECL(PRTDBGSYMBOL) DBGFR3AsSymbolByAddrA(PVM pVM, RTDBGAS hDbgAs, PCDBGFADDRESS pAddress, PRTGCINTPTR poffDisp, PRTDBGMOD phMod)
     1075 * @param   pUVM            The user mode VM handle.
     1076 * @param   hDbgAs          See DBGFR3AsSymbolByAddr.
     1077 * @param   pAddress        See DBGFR3AsSymbolByAddr.
     1078 * @param   poffDisp        See DBGFR3AsSymbolByAddr.
     1079 * @param   phMod           See DBGFR3AsSymbolByAddr.
     1080 */
     1081VMMR3DECL(PRTDBGSYMBOL) DBGFR3AsSymbolByAddrA(PUVM pUVM, RTDBGAS hDbgAs, PCDBGFADDRESS pAddress, PRTGCINTPTR poffDisp, PRTDBGMOD phMod)
    10751082{
    10761083    RTDBGSYMBOL SymInfo;
    1077     int rc = DBGFR3AsSymbolByAddr(pVM, hDbgAs, pAddress, poffDisp, &SymInfo, phMod);
     1084    int rc = DBGFR3AsSymbolByAddr(pUVM, hDbgAs, pAddress, poffDisp, &SymInfo, phMod);
    10781085    if (RT_SUCCESS(rc))
    10791086        return RTDbgSymbolDup(&SymInfo);
     
    10911098 * @returns VBox status code. See RTDbgAsSymbolByAddr.
    10921099 *
    1093  * @param   pVM                 Pointer to the VM.
    1094  * @param   hDbgAs              The address space handle.
    1095  * @param   pszSymbol           The symbol to search for, maybe prefixed by a
    1096  *                              module pattern.
    1097  * @param   pSymbol             Where to return the symbol information.
    1098  *                              The returned symbol name will be prefixed by
    1099  *                              the module name as far as space allows.
    1100  * @param   phMod               Where to return the module handle. Optional.
    1101  */
    1102 VMMR3DECL(int) DBGFR3AsSymbolByName(PVM pVM, RTDBGAS hDbgAs, const char *pszSymbol,
     1100 * @param   pUVM            The user mode VM handle.
     1101 * @param   hDbgAs          The address space handle.
     1102 * @param   pszSymbol       The symbol to search for, maybe prefixed by a
     1103 *                          module pattern.
     1104 * @param   pSymbol         Where to return the symbol information.
     1105 *                          The returned symbol name will be prefixed by
     1106 *                          the module name as far as space allows.
     1107 * @param   phMod           Where to return the module handle. Optional.
     1108 */
     1109VMMR3DECL(int) DBGFR3AsSymbolByName(PUVM pUVM, RTDBGAS hDbgAs, const char *pszSymbol,
    11031110                                    PRTDBGSYMBOL pSymbol, PRTDBGMOD phMod)
    11041111{
     
    11081115    if (hDbgAs == DBGF_AS_RC_AND_GC_GLOBAL)
    11091116    {
    1110         int rc = DBGFR3AsSymbolByName(pVM, DBGF_AS_RC, pszSymbol, pSymbol, phMod);
     1117        int rc = DBGFR3AsSymbolByName(pUVM, DBGF_AS_RC, pszSymbol, pSymbol, phMod);
    11111118        if (RT_FAILURE(rc))
    1112             rc = DBGFR3AsSymbolByName(pVM, DBGF_AS_GLOBAL, pszSymbol, pSymbol, phMod);
     1119            rc = DBGFR3AsSymbolByName(pUVM, DBGF_AS_GLOBAL, pszSymbol, pSymbol, phMod);
    11131120        return rc;
    11141121    }
     
    11171124     * Input validation.
    11181125     */
    1119     VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
     1126    UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE);
    11201127    AssertPtrReturn(pSymbol, VERR_INVALID_POINTER);
    11211128    AssertPtrNullReturn(phMod, VERR_INVALID_POINTER);
    11221129    if (phMod)
    11231130        *phMod = NIL_RTDBGMOD;
    1124     RTDBGAS hRealAS = DBGFR3AsResolveAndRetain(pVM, hDbgAs);
     1131    RTDBGAS hRealAS = DBGFR3AsResolveAndRetain(pUVM, hDbgAs);
    11251132    if (hRealAS == NIL_RTDBGAS)
    11261133        return VERR_INVALID_HANDLE;
     
    11421149    {
    11431150        DBGFSYMBOL DbgfSym;
    1144         rc = DBGFR3SymbolByName(pVM, pszSymbol, &DbgfSym);
     1151        rc = DBGFR3SymbolByName(pUVM->pVM, pszSymbol, &DbgfSym);
    11451152        if (RT_SUCCESS(rc))
    11461153            dbgfR3AsSymbolConvert(pSymbol, &DbgfSym);
  • trunk/src/VBox/VMM/VMMR3/DBGFBp.cpp

    r42834 r44399  
    2828# include <VBox/vmm/iem.h>
    2929#endif
     30#include <VBox/vmm/mm.h>
    3031#include "DBGFInternal.h"
    3132#include <VBox/vmm/vm.h>
    32 #include <VBox/vmm/mm.h>
     33#include <VBox/vmm/uvm.h>
     34
    3335#include <VBox/err.h>
    3436#include <VBox/log.h>
     
    4143*******************************************************************************/
    4244RT_C_DECLS_BEGIN
    43 static DECLCALLBACK(int) dbgfR3BpSetReg(PVM pVM, PCDBGFADDRESS pAddress, uint64_t *piHitTrigger, uint64_t *piHitDisable,
    44                                         uint8_t u8Type, uint8_t cb, uint32_t *piBp);
    45 static DECLCALLBACK(int) dbgfR3BpSetInt3(PVM pVM, PCDBGFADDRESS pAddress, uint64_t *piHitTrigger, uint64_t *piHitDisable, uint32_t *piBp);
    46 static DECLCALLBACK(int) dbgfR3BpSetREM(PVM pVM, PCDBGFADDRESS pAddress, uint64_t *piHitTrigger, uint64_t *piHitDisable, uint32_t *piBp);
    47 static DECLCALLBACK(int) dbgfR3BpClear(PVM pVM, uint32_t iBp);
    48 static DECLCALLBACK(int) dbgfR3BpEnable(PVM pVM, uint32_t iBp);
    49 static DECLCALLBACK(int) dbgfR3BpDisable(PVM pVM, uint32_t iBp);
    50 static DECLCALLBACK(int) dbgfR3BpEnum(PVM pVM, PFNDBGFBPENUM pfnCallback, void *pvUser);
    5145static int dbgfR3BpRegArm(PVM pVM, PDBGFBP pBp);
    52 static int dbgfR3BpRegDisarm(PVM pVM, PDBGFBP pBp);
    53 static int dbgfR3BpInt3Arm(PVM pVM, PDBGFBP pBp);
    54 static int dbgfR3BpInt3Disarm(PVM pVM, PDBGFBP pBp);
     46static int dbgfR3BpInt3Arm(PUVM pUVM, PDBGFBP pBp);
    5547RT_C_DECLS_END
    5648
     
    279271 *
    280272 * @returns VBox status code.
    281  * @param   pVM         Pointer to the VM.
     273 * @param   pUVM            The user mode VM handle.
     274 * @param   pAddress        The address of the breakpoint.
     275 * @param   piHitTrigger    The hit count at which the breakpoint start triggering.
     276 *                          Use 0 (or 1) if it's gonna trigger at once.
     277 * @param   piHitDisable    The hit count which disables the breakpoint.
     278 *                          Use ~(uint64_t) if it's never gonna be disabled.
     279 * @param   piBp            Where to store the breakpoint id. (optional)
     280 * @thread  Any thread.
     281 */
     282static DECLCALLBACK(int) dbgfR3BpSetInt3(PUVM pUVM, PCDBGFADDRESS pAddress, uint64_t *piHitTrigger,
     283                                         uint64_t *piHitDisable, uint32_t *piBp)
     284{
     285    /*
     286     * Validate input.
     287     */
     288    PVM pVM = pUVM->pVM;
     289    VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
     290    if (!DBGFR3AddrIsValid(pUVM, pAddress))
     291        return VERR_INVALID_PARAMETER;
     292    if (*piHitTrigger > *piHitDisable)
     293        return VERR_INVALID_PARAMETER;
     294    AssertMsgReturn(!piBp || VALID_PTR(piBp), ("piBp=%p\n", piBp), VERR_INVALID_POINTER);
     295    if (piBp)
     296        *piBp = ~0;
     297
     298    /*
     299     * Check if the breakpoint already exists.
     300     */
     301    PDBGFBP pBp = dbgfR3BpGetByAddr(pVM, DBGFBPTYPE_INT3, pAddress->FlatPtr);
     302    if (pBp)
     303    {
     304        int rc = VINF_SUCCESS;
     305        if (!pBp->fEnabled)
     306            rc = dbgfR3BpInt3Arm(pUVM, pBp);
     307        if (RT_SUCCESS(rc))
     308        {
     309            rc = VINF_DBGF_BP_ALREADY_EXIST;
     310            if (piBp)
     311                *piBp = pBp->iBp;
     312        }
     313        return rc;
     314    }
     315
     316    /*
     317     * Allocate and initialize the bp.
     318     */
     319    pBp = dbgfR3BpAlloc(pVM, DBGFBPTYPE_INT3);
     320    if (!pBp)
     321        return VERR_DBGF_NO_MORE_BP_SLOTS;
     322    pBp->GCPtr       = pAddress->FlatPtr;
     323    pBp->iHitTrigger = *piHitTrigger;
     324    pBp->iHitDisable = *piHitDisable;
     325    pBp->fEnabled    = true;
     326
     327    /*
     328     * Now ask REM to set the breakpoint.
     329     */
     330    int rc = dbgfR3BpInt3Arm(pUVM, pBp);
     331    if (RT_SUCCESS(rc))
     332    {
     333        if (piBp)
     334            *piBp = pBp->iBp;
     335    }
     336    else
     337        dbgfR3BpFree(pVM, pBp);
     338
     339    return rc;
     340}
     341
     342
     343/**
     344 * Sets a breakpoint (int 3 based).
     345 *
     346 * @returns VBox status code.
     347 * @param   pUVM        The user mode VM handle.
    282348 * @param   pAddress    The address of the breakpoint.
    283349 * @param   iHitTrigger The hit count at which the breakpoint start triggering.
     
    288354 * @thread  Any thread.
    289355 */
    290 VMMR3DECL(int) DBGFR3BpSet(PVM pVM, PCDBGFADDRESS pAddress, uint64_t iHitTrigger, uint64_t iHitDisable, uint32_t *piBp)
     356VMMR3DECL(int) DBGFR3BpSet(PUVM pUVM, PCDBGFADDRESS pAddress, uint64_t iHitTrigger, uint64_t iHitDisable, uint32_t *piBp)
    291357{
    292358    /*
     
    294360     */
    295361    /** @todo SMP? */
    296     int rc = VMR3ReqPriorityCallWait(pVM, VMCPUID_ANY, (PFNRT)dbgfR3BpSetInt3, 5, pVM, pAddress, &iHitTrigger, &iHitDisable, piBp);
     362    int rc = VMR3ReqPriorityCallWaitU(pUVM, VMCPUID_ANY, (PFNRT)dbgfR3BpSetInt3, 5,
     363                                      pUVM, pAddress, &iHitTrigger, &iHitDisable, piBp);
    297364    LogFlow(("DBGFR3BpSet: returns %Rrc\n", rc));
    298     return rc;
    299 }
    300 
    301 
    302 /**
    303  * Sets a breakpoint (int 3 based).
    304  *
    305  * @returns VBox status code.
    306  * @param   pVM             Pointer to the VM.
    307  * @param   pAddress        The address of the breakpoint.
    308  * @param   piHitTrigger    The hit count at which the breakpoint start triggering.
    309  *                          Use 0 (or 1) if it's gonna trigger at once.
    310  * @param   piHitDisable    The hit count which disables the breakpoint.
    311  *                          Use ~(uint64_t) if it's never gonna be disabled.
    312  * @param   piBp            Where to store the breakpoint id. (optional)
    313  * @thread  Any thread.
    314  */
    315 static DECLCALLBACK(int) dbgfR3BpSetInt3(PVM pVM, PCDBGFADDRESS pAddress, uint64_t *piHitTrigger, uint64_t *piHitDisable, uint32_t *piBp)
    316 {
    317     /*
    318      * Validate input.
    319      */
    320     if (!DBGFR3AddrIsValid(pVM, pAddress))
    321         return VERR_INVALID_PARAMETER;
    322     if (*piHitTrigger > *piHitDisable)
    323         return VERR_INVALID_PARAMETER;
    324     AssertMsgReturn(!piBp || VALID_PTR(piBp), ("piBp=%p\n", piBp), VERR_INVALID_POINTER);
    325     if (piBp)
    326         *piBp = ~0;
    327 
    328     /*
    329      * Check if the breakpoint already exists.
    330      */
    331     PDBGFBP pBp = dbgfR3BpGetByAddr(pVM, DBGFBPTYPE_INT3, pAddress->FlatPtr);
    332     if (pBp)
    333     {
    334         int rc = VINF_SUCCESS;
    335         if (!pBp->fEnabled)
    336             rc = dbgfR3BpInt3Arm(pVM, pBp);
    337         if (RT_SUCCESS(rc))
    338         {
    339             rc = VINF_DBGF_BP_ALREADY_EXIST;
    340             if (piBp)
    341                 *piBp = pBp->iBp;
    342         }
    343         return rc;
    344     }
    345 
    346     /*
    347      * Allocate and initialize the bp.
    348      */
    349     pBp = dbgfR3BpAlloc(pVM, DBGFBPTYPE_INT3);
    350     if (!pBp)
    351         return VERR_DBGF_NO_MORE_BP_SLOTS;
    352     pBp->GCPtr       = pAddress->FlatPtr;
    353     pBp->iHitTrigger = *piHitTrigger;
    354     pBp->iHitDisable = *piHitDisable;
    355     pBp->fEnabled    = true;
    356 
    357     /*
    358      * Now ask REM to set the breakpoint.
    359      */
    360     int rc = dbgfR3BpInt3Arm(pVM, pBp);
    361     if (RT_SUCCESS(rc))
    362     {
    363         if (piBp)
    364             *piBp = pBp->iBp;
    365     }
    366     else
    367         dbgfR3BpFree(pVM, pBp);
    368 
    369365    return rc;
    370366}
     
    376372 *
    377373 * @returns VBox status code.
    378  * @param   pVM         Pointer to the VM.
     374 * @param   pUVM        The user mode VM handle.
    379375 * @param   pBp         The breakpoint.
    380376 */
    381 static int dbgfR3BpInt3Arm(PVM pVM, PDBGFBP pBp)
     377static int dbgfR3BpInt3Arm(PUVM pUVM, PDBGFBP pBp)
    382378{
    383379    /** @todo should actually use physical address here! */
    384380
     381    /** @todo SMP support! */
     382    VMCPUID idCpu = 0;
     383
     384    /*
     385     * Save current byte and write int3 instruction.
     386     */
     387    DBGFADDRESS Addr;
     388    DBGFR3AddrFromFlat(pUVM, &Addr, pBp->GCPtr);
     389    int rc = DBGFR3MemRead(pUVM, idCpu, &Addr, &pBp->u.Int3.bOrg, 1);
     390    if (RT_SUCCESS(rc))
     391    {
     392        static const uint8_t s_bInt3 = 0xcc;
     393        rc = DBGFR3MemWrite(pUVM, idCpu, &Addr, &s_bInt3, 1);
     394    }
     395    return rc;
     396}
     397
     398
     399/**
     400 * Disarms an int 3 breakpoint.
     401 * This is used to implement both DBGFR3BpClear() and DBGFR3BpDisable().
     402 *
     403 * @returns VBox status code.
     404 * @param   pUVM        The user mode VM handle.
     405 * @param   pBp         The breakpoint.
     406 */
     407static int dbgfR3BpInt3Disarm(PUVM pUVM, PDBGFBP pBp)
     408{
    385409    /* @todo SMP support! */
    386410    VMCPUID idCpu = 0;
    387411
    388412    /*
    389      * Save current byte and write int3 instruction.
    390      */
    391     DBGFADDRESS Addr;
    392     DBGFR3AddrFromFlat(pVM, &Addr, pBp->GCPtr);
    393     int rc = DBGFR3MemRead(pVM, idCpu, &Addr, &pBp->u.Int3.bOrg, 1);
    394     if (RT_SUCCESS(rc))
    395     {
    396         static const uint8_t s_bInt3 = 0xcc;
    397         rc = DBGFR3MemWrite(pVM, idCpu, &Addr, &s_bInt3, 1);
    398     }
    399     return rc;
    400 }
    401 
    402 
    403 /**
    404  * Disarms an int 3 breakpoint.
    405  * This is used to implement both DBGFR3BpClear() and DBGFR3BpDisable().
    406  *
    407  * @returns VBox status code.
    408  * @param   pVM         Pointer to the VM.
    409  * @param   pBp         The breakpoint.
    410  */
    411 static int dbgfR3BpInt3Disarm(PVM pVM, PDBGFBP pBp)
    412 {
    413     /* @todo SMP support! */
    414     VMCPUID idCpu = 0;
    415 
    416     /*
    417413     * Check that the current byte is the int3 instruction, and restore the original one.
    418414     * We currently ignore invalid bytes.
    419415     */
    420416    DBGFADDRESS     Addr;
    421     DBGFR3AddrFromFlat(pVM, &Addr, pBp->GCPtr);
     417    DBGFR3AddrFromFlat(pUVM, &Addr, pBp->GCPtr);
    422418    uint8_t         bCurrent;
    423     int rc = DBGFR3MemRead(pVM, idCpu, &Addr, &bCurrent, 1);
     419    int rc = DBGFR3MemRead(pUVM, idCpu, &Addr, &bCurrent, 1);
    424420    if (bCurrent == 0xcc)
    425         rc = DBGFR3MemWrite(pVM, idCpu, &Addr, &pBp->u.Int3.bOrg, 1);
     421        rc = DBGFR3MemWrite(pUVM, idCpu, &Addr, &pBp->u.Int3.bOrg, 1);
    426422    return rc;
    427423}
     
    432428 *
    433429 * @returns VBox status code.
    434  * @param   pVM         Pointer to the VM.
    435  * @param   pAddress    The address of the breakpoint.
    436  * @param   iHitTrigger The hit count at which the breakpoint start triggering.
    437  *                      Use 0 (or 1) if it's gonna trigger at once.
    438  * @param   iHitDisable The hit count which disables the breakpoint.
    439  *                      Use ~(uint64_t) if it's never gonna be disabled.
    440  * @param   fType       The access type (one of the X86_DR7_RW_* defines).
    441  * @param   cb          The access size - 1,2,4 or 8 (the latter is AMD64 long mode only.
    442  *                      Must be 1 if fType is X86_DR7_RW_EO.
    443  * @param   piBp        Where to store the breakpoint id. (optional)
    444  * @thread  Any thread.
    445  */
    446 VMMR3DECL(int) DBGFR3BpSetReg(PVM pVM, PCDBGFADDRESS pAddress, uint64_t iHitTrigger, uint64_t iHitDisable,
    447                               uint8_t fType, uint8_t cb, uint32_t *piBp)
    448 {
    449     /** @todo SMP - broadcast, VT-x/AMD-V. */
    450     /*
    451      * This must be done on EMT.
    452      */
    453     int rc = VMR3ReqPriorityCallWait(pVM, VMCPUID_ANY, (PFNRT)dbgfR3BpSetReg, 7, pVM, pAddress, &iHitTrigger, &iHitDisable, fType, cb, piBp);
    454     LogFlow(("DBGFR3BpSetReg: returns %Rrc\n", rc));
    455     return rc;
    456 
    457 }
    458 
    459 
    460 /**
    461  * Sets a register breakpoint.
    462  *
    463  * @returns VBox status code.
    464  * @param   pVM             Pointer to the VM.
     430 * @param   pUVM            The user mode VM handle.
    465431 * @param   pAddress        The address of the breakpoint.
    466432 * @param   piHitTrigger    The hit count at which the breakpoint start triggering.
     
    475441 * @internal
    476442 */
    477 static DECLCALLBACK(int) dbgfR3BpSetReg(PVM pVM, PCDBGFADDRESS pAddress, uint64_t *piHitTrigger, uint64_t *piHitDisable,
     443static DECLCALLBACK(int) dbgfR3BpSetReg(PUVM pUVM, PCDBGFADDRESS pAddress, uint64_t *piHitTrigger, uint64_t *piHitDisable,
    478444                                        uint8_t fType, uint8_t cb, uint32_t *piBp)
    479445{
     
    481447     * Validate input.
    482448     */
    483     if (!DBGFR3AddrIsValid(pVM, pAddress))
     449    PVM pVM = pUVM->pVM;
     450    VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
     451    if (!DBGFR3AddrIsValid(pUVM, pAddress))
    484452        return VERR_INVALID_PARAMETER;
    485453    if (*piHitTrigger > *piHitDisable)
     
    565533
    566534/**
    567  * Arms a debug register breakpoint.
    568  * This is used to implement both DBGFR3BpSetReg() and DBGFR3BpEnable().
    569  *
    570  * @returns VBox status code.
    571  * @param   pVM         Pointer to the VM.
    572  * @param   pBp         The breakpoint.
    573  */
    574 static int dbgfR3BpRegArm(PVM pVM, PDBGFBP pBp)
    575 {
    576     /* @todo SMP support! */
    577     PVMCPU pVCpu = &pVM->aCpus[0];
    578 
    579     Assert(pBp->fEnabled);
    580     return CPUMRecalcHyperDRx(pVCpu);
    581 }
    582 
    583 
    584 /**
    585  * Disarms a debug register breakpoint.
    586  * This is used to implement both DBGFR3BpClear() and DBGFR3BpDisable().
    587  *
    588  * @returns VBox status code.
    589  * @param   pVM         Pointer to the VM.
    590  * @param   pBp         The breakpoint.
    591  */
    592 static int dbgfR3BpRegDisarm(PVM pVM, PDBGFBP pBp)
    593 {
    594     /** @todo SMP support! */
    595     PVMCPU pVCpu = &pVM->aCpus[0];
    596 
    597     Assert(!pBp->fEnabled);
    598     return CPUMRecalcHyperDRx(pVCpu);
    599 }
    600 
    601 
    602 /**
    603  * Sets a recompiler breakpoint.
    604  *
    605  * @returns VBox status code.
    606  * @param   pVM         Pointer to the VM.
     535 * Sets a register breakpoint.
     536 *
     537 * @returns VBox status code.
     538 * @param   pUVM        The user mode VM handle.
    607539 * @param   pAddress    The address of the breakpoint.
    608540 * @param   iHitTrigger The hit count at which the breakpoint start triggering.
     
    610542 * @param   iHitDisable The hit count which disables the breakpoint.
    611543 *                      Use ~(uint64_t) if it's never gonna be disabled.
     544 * @param   fType       The access type (one of the X86_DR7_RW_* defines).
     545 * @param   cb          The access size - 1,2,4 or 8 (the latter is AMD64 long mode only.
     546 *                      Must be 1 if fType is X86_DR7_RW_EO.
    612547 * @param   piBp        Where to store the breakpoint id. (optional)
    613548 * @thread  Any thread.
    614549 */
    615 VMMR3DECL(int) DBGFR3BpSetREM(PVM pVM, PCDBGFADDRESS pAddress, uint64_t iHitTrigger, uint64_t iHitDisable, uint32_t *piBp)
     550VMMR3DECL(int) DBGFR3BpSetReg(PUVM pUVM, PCDBGFADDRESS pAddress, uint64_t iHitTrigger, uint64_t iHitDisable,
     551                              uint8_t fType, uint8_t cb, uint32_t *piBp)
    616552{
    617553    /*
    618554     * This must be done on EMT.
    619555     */
    620     int rc = VMR3ReqPriorityCallWait(pVM, VMCPUID_ANY, (PFNRT)dbgfR3BpSetREM, 5, pVM, pAddress, &iHitTrigger, &iHitDisable, piBp);
    621     LogFlow(("DBGFR3BpSetREM: returns %Rrc\n", rc));
    622     return rc;
     556    int rc = VMR3ReqPriorityCallWaitU(pUVM, VMCPUID_ANY, (PFNRT)dbgfR3BpSetReg, 7,
     557                                      pUVM, pAddress, &iHitTrigger, &iHitDisable, fType, cb, piBp);
     558    LogFlow(("DBGFR3BpSetReg: returns %Rrc\n", rc));
     559    return rc;
     560
     561}
     562
     563
     564/** @callback_method_impl{FNVMMEMTRENDEZVOUS}  */
     565DECLCALLBACK(VBOXSTRICTRC) dbgfR3BpRegRecalcOnCpu(PVM pVM, PVMCPU pVCpu, void *pvUser)
     566{
     567    NOREF(pVM); NOREF(pvUser);
     568    return CPUMRecalcHyperDRx(pVCpu);
     569}
     570
     571
     572/**
     573 * Arms a debug register breakpoint.
     574 * This is used to implement both DBGFR3BpSetReg() and DBGFR3BpEnable().
     575 *
     576 * @returns VBox status code.
     577 * @param   pUVM        The user mode VM handle.
     578 * @param   pBp         The breakpoint.
     579 */
     580static int dbgfR3BpRegArm(PVM pVM, PDBGFBP pBp)
     581{
     582    Assert(pBp->fEnabled);
     583    return VMMR3EmtRendezvous(pVM, VMMEMTRENDEZVOUS_FLAGS_TYPE_ALL_AT_ONCE, dbgfR3BpRegRecalcOnCpu, NULL);
     584}
     585
     586
     587/**
     588 * Disarms a debug register breakpoint.
     589 * This is used to implement both DBGFR3BpClear() and DBGFR3BpDisable().
     590 *
     591 * @returns VBox status code.
     592 * @param   pUVM        The user mode VM handle.
     593 * @param   pBp         The breakpoint.
     594 */
     595static int dbgfR3BpRegDisarm(PVM pVM, PDBGFBP pBp)
     596{
     597    Assert(!pBp->fEnabled);
     598    return VMMR3EmtRendezvous(pVM, VMMEMTRENDEZVOUS_FLAGS_TYPE_ALL_AT_ONCE, dbgfR3BpRegRecalcOnCpu, NULL);
    623599}
    624600
     
    628604 *
    629605 * @returns VBox status code.
    630  * @param   pVM             Pointer to the VM.
     606 * @param   pUVM            The user mode VM handle.
    631607 * @param   pAddress        The address of the breakpoint.
    632608 * @param   piHitTrigger    The hit count at which the breakpoint start triggering.
     
    638614 * @internal
    639615 */
    640 static DECLCALLBACK(int) dbgfR3BpSetREM(PVM pVM, PCDBGFADDRESS pAddress, uint64_t *piHitTrigger, uint64_t *piHitDisable, uint32_t *piBp)
     616static DECLCALLBACK(int) dbgfR3BpSetREM(PUVM pUVM, PCDBGFADDRESS pAddress, uint64_t *piHitTrigger,
     617                                        uint64_t *piHitDisable, uint32_t *piBp)
    641618{
    642619    /*
    643620     * Validate input.
    644621     */
    645     if (!DBGFR3AddrIsValid(pVM, pAddress))
     622    PVM pVM = pUVM->pVM;
     623    VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
     624    if (!DBGFR3AddrIsValid(pUVM, pAddress))
    646625        return VERR_INVALID_PARAMETER;
    647626    if (*piHitTrigger > *piHitDisable)
     
    706685
    707686/**
    708  * Clears a breakpoint.
    709  *
    710  * @returns VBox status code.
    711  * @param   pVM         Pointer to the VM.
    712  * @param   iBp         The id of the breakpoint which should be removed (cleared).
     687 * Sets a recompiler breakpoint.
     688 *
     689 * @returns VBox status code.
     690 * @param   pUVM        The user mode VM handle.
     691 * @param   pAddress    The address of the breakpoint.
     692 * @param   iHitTrigger The hit count at which the breakpoint start triggering.
     693 *                      Use 0 (or 1) if it's gonna trigger at once.
     694 * @param   iHitDisable The hit count which disables the breakpoint.
     695 *                      Use ~(uint64_t) if it's never gonna be disabled.
     696 * @param   piBp        Where to store the breakpoint id. (optional)
    713697 * @thread  Any thread.
    714698 */
    715 VMMR3DECL(int) DBGFR3BpClear(PVM pVM, uint32_t iBp)
     699VMMR3DECL(int) DBGFR3BpSetREM(PUVM pUVM, PCDBGFADDRESS pAddress, uint64_t iHitTrigger, uint64_t iHitDisable, uint32_t *piBp)
    716700{
    717701    /*
    718702     * This must be done on EMT.
    719703     */
    720     int rc = VMR3ReqPriorityCallWait(pVM, VMCPUID_ANY, (PFNRT)dbgfR3BpClear, 2, pVM, iBp);
    721     LogFlow(("DBGFR3BpClear: returns %Rrc\n", rc));
     704    int rc = VMR3ReqPriorityCallWaitU(pUVM, VMCPUID_ANY, (PFNRT)dbgfR3BpSetREM, 5,
     705                                      pUVM, pAddress, &iHitTrigger, &iHitDisable, piBp);
     706    LogFlow(("DBGFR3BpSetREM: returns %Rrc\n", rc));
    722707    return rc;
    723708}
     
    728713 *
    729714 * @returns VBox status code.
    730  * @param   pVM         Pointer to the VM.
     715 * @param   pUVM        The user mode VM handle.
    731716 * @param   iBp         The id of the breakpoint which should be removed (cleared).
    732717 * @thread  EMT
    733718 * @internal
    734719 */
    735 static DECLCALLBACK(int) dbgfR3BpClear(PVM pVM, uint32_t iBp)
     720static DECLCALLBACK(int) dbgfR3BpClear(PUVM pUVM, uint32_t iBp)
    736721{
    737722    /*
    738723     * Validate input.
    739724     */
     725    PVM pVM = pUVM->pVM;
     726    VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
    740727    PDBGFBP pBp = dbgfR3BpGet(pVM, iBp);
    741728    if (!pBp)
     
    756743
    757744            case DBGFBPTYPE_INT3:
    758                 rc = dbgfR3BpInt3Disarm(pVM, pBp);
     745                rc = dbgfR3BpInt3Disarm(pUVM, pBp);
    759746                break;
    760747
     
    782769
    783770/**
    784  * Enables a breakpoint.
    785  *
    786  * @returns VBox status code.
    787  * @param   pVM         Pointer to the VM.
    788  * @param   iBp         The id of the breakpoint which should be enabled.
     771 * Clears a breakpoint.
     772 *
     773 * @returns VBox status code.
     774 * @param   pUVM        The user mode VM handle.
     775 * @param   iBp         The id of the breakpoint which should be removed (cleared).
    789776 * @thread  Any thread.
    790777 */
    791 VMMR3DECL(int) DBGFR3BpEnable(PVM pVM, uint32_t iBp)
     778VMMR3DECL(int) DBGFR3BpClear(PUVM pUVM, uint32_t iBp)
    792779{
    793780    /*
    794781     * This must be done on EMT.
    795782     */
    796     int rc = VMR3ReqPriorityCallWait(pVM, VMCPUID_ANY, (PFNRT)dbgfR3BpEnable, 2, pVM, iBp);
    797     LogFlow(("DBGFR3BpEnable: returns %Rrc\n", rc));
     783    int rc = VMR3ReqPriorityCallWaitU(pUVM, VMCPUID_ANY, (PFNRT)dbgfR3BpClear, 2, pUVM, iBp);
     784    LogFlow(("DBGFR3BpClear: returns %Rrc\n", rc));
    798785    return rc;
    799786}
     
    804791 *
    805792 * @returns VBox status code.
    806  * @param   pVM         Pointer to the VM.
     793 * @param   pUVM        The user mode VM handle.
    807794 * @param   iBp         The id of the breakpoint which should be enabled.
    808795 * @thread  EMT
    809796 * @internal
    810797 */
    811 static DECLCALLBACK(int) dbgfR3BpEnable(PVM pVM, uint32_t iBp)
     798static DECLCALLBACK(int) dbgfR3BpEnable(PUVM pUVM, uint32_t iBp)
    812799{
    813800    /*
    814801     * Validate input.
    815802     */
     803    PVM pVM = pUVM->pVM;
     804    VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
    816805    PDBGFBP pBp = dbgfR3BpGet(pVM, iBp);
    817806    if (!pBp)
     
    836825
    837826        case DBGFBPTYPE_INT3:
    838             rc = dbgfR3BpInt3Arm(pVM, pBp);
     827            rc = dbgfR3BpInt3Arm(pUVM, pBp);
    839828            break;
    840829
     
    858847
    859848/**
    860  * Disables a breakpoint.
    861  *
    862  * @returns VBox status code.
    863  * @param   pVM         Pointer to the VM.
    864  * @param   iBp         The id of the breakpoint which should be disabled.
     849 * Enables a breakpoint.
     850 *
     851 * @returns VBox status code.
     852 * @param   pUVM        The user mode VM handle.
     853 * @param   iBp         The id of the breakpoint which should be enabled.
    865854 * @thread  Any thread.
    866855 */
    867 VMMR3DECL(int) DBGFR3BpDisable(PVM pVM, uint32_t iBp)
     856VMMR3DECL(int) DBGFR3BpEnable(PUVM pUVM, uint32_t iBp)
    868857{
    869858    /*
    870859     * This must be done on EMT.
    871860     */
    872     int rc = VMR3ReqPriorityCallWait(pVM, VMCPUID_ANY, (PFNRT)dbgfR3BpDisable, 2, pVM, iBp);
    873     LogFlow(("DBGFR3BpDisable: returns %Rrc\n", rc));
     861    int rc = VMR3ReqPriorityCallWaitU(pUVM, VMCPUID_ANY, (PFNRT)dbgfR3BpEnable, 2, pUVM, iBp);
     862    LogFlow(("DBGFR3BpEnable: returns %Rrc\n", rc));
    874863    return rc;
    875864}
     
    880869 *
    881870 * @returns VBox status code.
    882  * @param   pVM         Pointer to the VM.
     871 * @param   pUVM        The user mode VM handle.
    883872 * @param   iBp         The id of the breakpoint which should be disabled.
    884873 * @thread  EMT
    885874 * @internal
    886875 */
    887 static DECLCALLBACK(int) dbgfR3BpDisable(PVM pVM, uint32_t iBp)
     876static DECLCALLBACK(int) dbgfR3BpDisable(PUVM pUVM, uint32_t iBp)
    888877{
    889878    /*
    890879     * Validate input.
    891880     */
     881    PVM pVM = pUVM->pVM;
     882    VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
    892883    PDBGFBP pBp = dbgfR3BpGet(pVM, iBp);
    893884    if (!pBp)
     
    912903
    913904        case DBGFBPTYPE_INT3:
    914             rc = dbgfR3BpInt3Disarm(pVM, pBp);
     905            rc = dbgfR3BpInt3Disarm(pUVM, pBp);
    915906            break;
    916907
     
    932923
    933924/**
    934  * Enumerate the breakpoints.
    935  *
    936  * @returns VBox status code.
    937  * @param   pVM         Pointer to the VM.
    938  * @param   pfnCallback The callback function.
    939  * @param   pvUser      The user argument to pass to the callback.
    940  * @thread  Any thread but the callback will be called from EMT.
    941  */
    942 VMMR3DECL(int) DBGFR3BpEnum(PVM pVM, PFNDBGFBPENUM pfnCallback, void *pvUser)
     925 * Disables a breakpoint.
     926 *
     927 * @returns VBox status code.
     928 * @param   pUVM        The user mode VM handle.
     929 * @param   iBp         The id of the breakpoint which should be disabled.
     930 * @thread  Any thread.
     931 */
     932VMMR3DECL(int) DBGFR3BpDisable(PUVM pUVM, uint32_t iBp)
    943933{
    944934    /*
    945935     * This must be done on EMT.
    946936     */
    947     int rc = VMR3ReqPriorityCallWait(pVM, VMCPUID_ANY, (PFNRT)dbgfR3BpEnum, 3, pVM, pfnCallback, pvUser);
    948     LogFlow(("DBGFR3BpClear: returns %Rrc\n", rc));
     937    int rc = VMR3ReqPriorityCallWaitU(pUVM, VMCPUID_ANY, (PFNRT)dbgfR3BpDisable, 2, pUVM, iBp);
     938    LogFlow(("DBGFR3BpDisable: returns %Rrc\n", rc));
    949939    return rc;
    950940}
     
    955945 *
    956946 * @returns VBox status code.
    957  * @param   pVM         Pointer to the VM.
     947 * @param   pUVM        The user mode VM handle.
    958948 * @param   pfnCallback The callback function.
    959949 * @param   pvUser      The user argument to pass to the callback.
     
    961951 * @internal
    962952 */
    963 static DECLCALLBACK(int) dbgfR3BpEnum(PVM pVM, PFNDBGFBPENUM pfnCallback, void *pvUser)
     953static DECLCALLBACK(int) dbgfR3BpEnum(PUVM pUVM, PFNDBGFBPENUM pfnCallback, void *pvUser)
    964954{
    965955    /*
    966956     * Validate input.
    967957     */
    968     AssertMsgReturn(VALID_PTR(pfnCallback), ("pfnCallback=%p\n", pfnCallback), VERR_INVALID_POINTER);
     958    PVM pVM = pUVM->pVM;
     959    VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
     960    AssertPtrReturn(pfnCallback, VERR_INVALID_POINTER);
    969961
    970962    /*
     
    975967        if (pVM->dbgf.s.aHwBreakpoints[i].enmType != DBGFBPTYPE_FREE)
    976968        {
    977             int rc = pfnCallback(pVM, pvUser, &pVM->dbgf.s.aHwBreakpoints[i]);
     969            int rc = pfnCallback(pUVM, pvUser, &pVM->dbgf.s.aHwBreakpoints[i]);
    978970            if (RT_FAILURE(rc))
    979971                return rc;
     
    986978        if (pVM->dbgf.s.aBreakpoints[i].enmType != DBGFBPTYPE_FREE)
    987979        {
    988             int rc = pfnCallback(pVM, pvUser, &pVM->dbgf.s.aBreakpoints[i]);
     980            int rc = pfnCallback(pUVM, pvUser, &pVM->dbgf.s.aBreakpoints[i]);
    989981            if (RT_FAILURE(rc))
    990982                return rc;
     
    994986}
    995987
     988
     989/**
     990 * Enumerate the breakpoints.
     991 *
     992 * @returns VBox status code.
     993 * @param   pUVM        The user mode VM handle.
     994 * @param   pfnCallback The callback function.
     995 * @param   pvUser      The user argument to pass to the callback.
     996 * @thread  Any thread but the callback will be called from EMT.
     997 */
     998VMMR3DECL(int) DBGFR3BpEnum(PUVM pUVM, PFNDBGFBPENUM pfnCallback, void *pvUser)
     999{
     1000    /*
     1001     * This must be done on EMT.
     1002     */
     1003    int rc = VMR3ReqPriorityCallWaitU(pUVM, VMCPUID_ANY, (PFNRT)dbgfR3BpEnum, 3, pUVM, pfnCallback, pvUser);
     1004    LogFlow(("DBGFR3BpClear: returns %Rrc\n", rc));
     1005    return rc;
     1006}
     1007
  • trunk/src/VBox/VMM/VMMR3/DBGFCoreWrite.cpp

    r41783 r44399  
    55
    66/*
    7  * Copyright (C) 2010 Oracle Corporation
     7 * Copyright (C) 2010-2013 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    5555
    5656#include <VBox/vmm/cpum.h>
    57 #include "CPUMInternal.h"
     57#include <VBox/vmm/pgm.h>
    5858#include <VBox/vmm/dbgf.h>
    5959#include <VBox/vmm/dbgfcorefmt.h>
     60#include <VBox/vmm/mm.h>
    6061#include <VBox/vmm/vm.h>
    61 #include <VBox/vmm/pgm.h>
     62#include <VBox/vmm/uvm.h>
     63
    6264#include <VBox/err.h>
    6365#include <VBox/log.h>
    64 #include <VBox/vmm/mm.h>
    6566#include <VBox/version.h>
    6667
     
    430431    for (uint32_t iCpu = 0; iCpu < pVM->cCpus; iCpu++)
    431432    {
    432         PCPUMCTX pCpuCtx = &pVM->aCpus[iCpu].cpum.s.Guest;
     433        PCPUMCTX pCpuCtx = CPUMQueryGuestCtxPtr(&pVM->aCpus[iCpu]);
    433434        rc = Elf64WriteNoteHdr(hFile, NT_VBOXCPU, s_pcszCoreVBoxCpu, pCpuCtx, sizeof(CPUMCTX));
    434435        if (RT_FAILURE(rc))
     
    534535 *
    535536 * @returns VBox status code.
    536  * @param   pVM                 Pointer to the VM.
     537 * @param   pUVM                The user mode VM handle.
    537538 * @param   pszFilename         The name of the file to which the guest core
    538539 *                              dump should be written.
     
    542543 *          interfer with the state.
    543544 */
    544 VMMR3DECL(int) DBGFR3CoreWrite(PVM pVM, const char *pszFilename, bool fReplaceFile)
    545 {
     545VMMR3DECL(int) DBGFR3CoreWrite(PUVM pUVM, const char *pszFilename, bool fReplaceFile)
     546{
     547    UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE);
     548    PVM pVM = pUVM->pVM;
    546549    VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
    547550    AssertReturn(pszFilename, VERR_INVALID_HANDLE);
  • trunk/src/VBox/VMM/VMMR3/DBGFCpu.cpp

    r41783 r44399  
    2525#include "DBGFInternal.h"
    2626#include <VBox/vmm/vm.h>
     27#include <VBox/vmm/uvm.h>
    2728#include <VBox/err.h>
    2829#include <VBox/log.h>
     
    3536 *
    3637 * @returns VINF_SUCCESS.
    37  * @param   pVM                 Pointer to the VM.
    38  * @param   idCpu               The current CPU ID.
    39  * @param   penmMode            Where to return the mode.
     38 * @param   pVM         Pointer to the VM.
     39 * @param   idCpu       The current CPU ID.
     40 * @param   penmMode    Where to return the mode.
    4041 */
    4142static DECLCALLBACK(int) dbgfR3CpuGetMode(PVM pVM, VMCPUID idCpu, CPUMMODE *penmMode)
     
    5253 *
    5354 * @returns The CPU mode on success, CPUMMODE_INVALID on failure.
    54  * @param   pVM                 Pointer to the VM.
    55  * @param   idCpu               The target CPU ID.
     55 * @param   pUVM        The user mode VM handle.
     56 * @param   idCpu       The target CPU ID.
    5657 */
    57 VMMR3DECL(CPUMMODE) DBGFR3CpuGetMode(PVM pVM, VMCPUID idCpu)
     58VMMR3DECL(CPUMMODE) DBGFR3CpuGetMode(PUVM pUVM, VMCPUID idCpu)
    5859{
    59     VM_ASSERT_VALID_EXT_RETURN(pVM, CPUMMODE_INVALID);
    60     AssertReturn(idCpu < pVM->cCpus, CPUMMODE_INVALID);
     60    UVM_ASSERT_VALID_EXT_RETURN(pUVM, CPUMMODE_INVALID);
     61    VM_ASSERT_VALID_EXT_RETURN(pUVM->pVM, CPUMMODE_INVALID);
     62    AssertReturn(idCpu < pUVM->pVM->cCpus, CPUMMODE_INVALID);
    6163
    6264    CPUMMODE enmMode;
    63     int rc = VMR3ReqPriorityCallWait(pVM, idCpu, (PFNRT)dbgfR3CpuGetMode, 3, pVM, idCpu, &enmMode);
     65    int rc = VMR3ReqPriorityCallWaitU(pUVM, idCpu, (PFNRT)dbgfR3CpuGetMode, 3, pUVM->pVM, idCpu, &enmMode);
    6466    if (RT_FAILURE(rc))
    6567        return CPUMMODE_INVALID;
     
    6769}
    6870
     71
     72/**
     73 * Get the number of CPUs (or threads if you insist).
     74 *
     75 * @returns The number of CPUs
     76 * @param   pUVM        The user mode VM handle.
     77 */
     78VMMR3DECL(VMCPUID) DBGFR3CpuGetCount(PUVM pUVM)
     79{
     80    UVM_ASSERT_VALID_EXT_RETURN(pUVM, 1);
     81    return pUVM->cCpus;
     82}
     83
  • trunk/src/VBox/VMM/VMMR3/DBGFDisas.cpp

    r42420 r44399  
    3030#include <VBox/param.h>
    3131#include <VBox/vmm/vm.h>
     32#include <VBox/vmm/uvm.h>
    3233#include "internal/pgm.h"
    3334
     
    296297        :  pSelInfo->Sel == DIS_FMT_SEL_GET_VALUE(u32Sel))
    297298    {
    298         rc = DBGFR3AddrFromSelInfoOff(pState->pVM, &Addr, pSelInfo, uAddress);
     299        rc = DBGFR3AddrFromSelInfoOff(pState->pVM->pUVM, &Addr, pSelInfo, uAddress);
    299300        if (RT_SUCCESS(rc))
    300             rc = DBGFR3AsSymbolByAddr(pState->pVM, pState->hAs, &Addr, &off, &Sym, NULL /*phMod*/);
     301            rc = DBGFR3AsSymbolByAddr(pState->pVM->pUVM, pState->hAs, &Addr, &off, &Sym, NULL /*phMod*/);
    301302    }
    302303    else
     
    576577 *
    577578 * @returns VBox status code.
    578  * @param   pVM             Pointer to the VM.
     579 * @param   pUVM            The user mode VM handle.
    579580 * @param   idCpu           The ID of virtual CPU.
    580581 * @param   Sel             The code selector. This used to determine the 32/16 bit ness and
     
    591592 *          address conversion.
    592593 */
    593 VMMR3DECL(int) DBGFR3DisasInstrEx(PVM pVM, VMCPUID idCpu, RTSEL Sel, RTGCPTR GCPtr, uint32_t fFlags,
     594VMMR3DECL(int) DBGFR3DisasInstrEx(PUVM pUVM, VMCPUID idCpu, RTSEL Sel, RTGCPTR GCPtr, uint32_t fFlags,
    594595                                  char *pszOutput, uint32_t cbOutput, uint32_t *pcbInstr)
    595596{
    596597    AssertReturn(cbOutput > 0, VERR_INVALID_PARAMETER);
    597598    *pszOutput = '\0';
     599    UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE);
     600    PVM pVM = pUVM->pVM;
    598601    VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
    599     AssertReturn(idCpu < pVM->cCpus, VERR_INVALID_CPU_ID);
     602    AssertReturn(idCpu < pUVM->cCpus, VERR_INVALID_CPU_ID);
    600603    AssertReturn(!(fFlags & ~DBGF_DISAS_FLAGS_VALID_MASK), VERR_INVALID_PARAMETER);
    601604    AssertReturn((fFlags & DBGF_DISAS_FLAGS_MODE_MASK) <= DBGF_DISAS_FLAGS_64BIT_MODE, VERR_INVALID_PARAMETER);
     
    626629 *                          terminated if @a cbOutput is greater than zero.
    627630 * @param   cbOutput        Size of the output buffer.
    628  */
    629 VMMR3DECL(int) DBGFR3DisasInstrCurrent(PVMCPU pVCpu, char *pszOutput, uint32_t cbOutput)
     631 * @thread  EMT(pVCpu)
     632 */
     633VMMR3_INT_DECL(int) DBGFR3DisasInstrCurrent(PVMCPU pVCpu, char *pszOutput, uint32_t cbOutput)
    630634{
    631635    AssertReturn(cbOutput > 0, VERR_INVALID_PARAMETER);
    632636    *pszOutput = '\0';
    633     AssertReturn(pVCpu, VERR_INVALID_CONTEXT);
    634     return DBGFR3DisasInstrEx(pVCpu->pVMR3, pVCpu->idCpu, 0, 0,
    635                               DBGF_DISAS_FLAGS_CURRENT_GUEST | DBGF_DISAS_FLAGS_DEFAULT_MODE,
    636                               pszOutput, cbOutput, NULL);
     637    Assert(VMCPU_IS_EMT(pVCpu));
     638
     639    RTGCPTR GCPtr = 0;
     640    return dbgfR3DisasInstrExOnVCpu(pVCpu->pVMR3, pVCpu, 0, &GCPtr,
     641                                    DBGF_DISAS_FLAGS_CURRENT_GUEST | DBGF_DISAS_FLAGS_DEFAULT_MODE,
     642                                    pszOutput, cbOutput, NULL);
    637643}
    638644
     
    645651 * @param   pVCpu           Pointer to the VMCPU.
    646652 * @param   pszPrefix       Short prefix string to the disassembly string. (optional)
     653 * @thread  EMT(pVCpu)
    647654 */
    648655VMMR3DECL(int) DBGFR3DisasInstrCurrentLogInternal(PVMCPU pVCpu, const char *pszPrefix)
     
    667674 *
    668675 * @returns VBox status code.
    669  * @param   pVM             Pointer to the VM.
    670676 * @param   pVCpu           Pointer to the VMCPU, defaults to CPU 0 if NULL.
    671677 * @param   Sel             The code selector. This used to determine the 32/16 bit-ness and
     
    673679 * @param   GCPtr           The code address relative to the base of Sel.
    674680 * @param   pszPrefix       Short prefix string to the disassembly string. (optional)
     681 * @thread  EMT(pVCpu)
    675682 */
    676683VMMR3DECL(int) DBGFR3DisasInstrLogInternal(PVMCPU pVCpu, RTSEL Sel, RTGCPTR GCPtr, const char *pszPrefix)
    677684{
     685    Assert(VMCPU_IS_EMT(pVCpu));
     686
    678687    char szBuf[256];
    679     int rc = DBGFR3DisasInstrEx(pVCpu->pVMR3, pVCpu->idCpu, Sel, GCPtr, DBGF_DISAS_FLAGS_DEFAULT_MODE,
    680                                 &szBuf[0], sizeof(szBuf), NULL);
     688    RTGCPTR GCPtrTmp = GCPtr;
     689    int rc = dbgfR3DisasInstrExOnVCpu(pVCpu->pVMR3, pVCpu, Sel, &GCPtrTmp, DBGF_DISAS_FLAGS_DEFAULT_MODE,
     690                                      &szBuf[0], sizeof(szBuf), NULL);
    681691    if (RT_FAILURE(rc))
    682692        RTStrPrintf(szBuf, sizeof(szBuf), "DBGFR3DisasInstrLog(, %RTsel, %RGv) failed with rc=%Rrc\n", Sel, GCPtr, rc);
  • trunk/src/VBox/VMM/VMMR3/DBGFInfo.cpp

    r41965 r44399  
    55
    66/*
    7  * Copyright (C) 2006-2007 Oracle Corporation
     7 * Copyright (C) 2006-2013 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    2626#include "DBGFInternal.h"
    2727#include <VBox/vmm/vm.h>
     28#include <VBox/vmm/uvm.h>
    2829#include <VBox/err.h>
    2930#include <VBox/log.h>
     
    3132#include <iprt/assert.h>
    3233#include <iprt/ctype.h>
     34#include <iprt/param.h>
    3335#include <iprt/semaphore.h>
    3436#include <iprt/stream.h>
     
    7880 *
    7981 * @returns VBox status code.
    80  * @param   pVM     Pointer to the VM.
    81  */
    82 int dbgfR3InfoInit(PVM pVM)
     82 * @param   pUVM        The user mode VM handle.
     83 */
     84int dbgfR3InfoInit(PUVM pUVM)
    8385{
    8486    /*
    8587     * Make sure we already didn't initialized in the lazy manner.
    8688     */
    87     if (RTCritSectIsInitialized(&pVM->dbgf.s.InfoCritSect))
     89    if (RTCritSectIsInitialized(&pUVM->dbgf.s.InfoCritSect))
    8890        return VINF_SUCCESS;
    8991
     
    9193     * Initialize the crit sect.
    9294     */
    93     int rc = RTCritSectInit(&pVM->dbgf.s.InfoCritSect);
     95    int rc = RTCritSectInit(&pUVM->dbgf.s.InfoCritSect);
    9496    AssertRCReturn(rc, rc);
    9597
     
    9799     * Register the 'info help' item.
    98100     */
    99     rc = DBGFR3InfoRegisterInternal(pVM, "help", "List of info items.", dbgfR3InfoHelp);
     101    rc = DBGFR3InfoRegisterInternal(pUVM->pVM, "help", "List of info items.", dbgfR3InfoHelp);
    100102    AssertRCReturn(rc, rc);
    101103
     
    108110 *
    109111 * @returns VBox status code.
    110  * @param   pVM     Pointer to the VM.
    111  */
    112 int dbgfR3InfoTerm(PVM pVM)
     112 * @param   pUVM        The user mode VM handle.
     113 */
     114int dbgfR3InfoTerm(PUVM pUVM)
    113115{
    114116    /*
    115117     * Delete the crit sect.
    116118     */
    117     int rc = RTCritSectDelete(&pVM->dbgf.s.InfoCritSect);
     119    int rc = RTCritSectDelete(&pUVM->dbgf.s.InfoCritSect);
    118120    AssertRC(rc);
    119121    return rc;
     
    211213 *
    212214 * @returns VBox status code.
    213  * @param   pVM         Pointer to the VM.
     215 * @param   pUVM        The user mode VM handle.
    214216 * @param   pszName     The identifier of the info.
    215217 * @param   pszDesc     The description of the info and any arguments the handler may take.
     
    217219 * @param   ppInfo      Where to store the created
    218220 */
    219 static int dbgfR3InfoRegister(PVM pVM, const char *pszName, const char *pszDesc, uint32_t fFlags, PDBGFINFO *ppInfo)
     221static int dbgfR3InfoRegister(PUVM pUVM, const char *pszName, const char *pszDesc, uint32_t fFlags, PDBGFINFO *ppInfo)
    220222{
    221223    /*
     
    232234    int rc;
    233235    size_t cchName = strlen(pszName) + 1;
    234     PDBGFINFO pInfo = (PDBGFINFO)MMR3HeapAlloc(pVM, MM_TAG_DBGF_INFO, RT_OFFSETOF(DBGFINFO, szName[cchName]));
     236    PDBGFINFO pInfo = (PDBGFINFO)MMR3HeapAllocU(pUVM, MM_TAG_DBGF_INFO, RT_OFFSETOF(DBGFINFO, szName[cchName]));
    235237    if (pInfo)
    236238    {
     
    243245        /* lazy init */
    244246        rc = VINF_SUCCESS;
    245         if (!RTCritSectIsInitialized(&pVM->dbgf.s.InfoCritSect))
    246             rc = dbgfR3InfoInit(pVM);
     247        if (!RTCritSectIsInitialized(&pUVM->dbgf.s.InfoCritSect))
     248            rc = dbgfR3InfoInit(pUVM);
    247249        if (RT_SUCCESS(rc))
    248250        {
     
    250252             * Insert in alphabetical order.
    251253             */
    252             rc = RTCritSectEnter(&pVM->dbgf.s.InfoCritSect);
     254            rc = RTCritSectEnter(&pUVM->dbgf.s.InfoCritSect);
    253255            AssertRC(rc);
    254256            PDBGFINFO pPrev = NULL;
    255257            PDBGFINFO pCur;
    256             for (pCur = pVM->dbgf.s.pInfoFirst; pCur; pPrev = pCur, pCur = pCur->pNext)
     258            for (pCur = pUVM->dbgf.s.pInfoFirst; pCur; pPrev = pCur, pCur = pCur->pNext)
    257259                if (strcmp(pszName, pCur->szName) < 0)
    258260                    break;
     
    261263                pPrev->pNext = pInfo;
    262264            else
    263                 pVM->dbgf.s.pInfoFirst = pInfo;
     265                pUVM->dbgf.s.pInfoFirst = pInfo;
    264266
    265267            *ppInfo = pInfo;
     
    284286 * @param   pDevIns     The device instance owning the info.
    285287 */
    286 VMMR3DECL(int) DBGFR3InfoRegisterDevice(PVM pVM, const char *pszName, const char *pszDesc, PFNDBGFHANDLERDEV pfnHandler, PPDMDEVINS pDevIns)
     288VMMR3_INT_DECL(int) DBGFR3InfoRegisterDevice(PVM pVM, const char *pszName, const char *pszDesc,
     289                                             PFNDBGFHANDLERDEV pfnHandler, PPDMDEVINS pDevIns)
    287290{
    288291    LogFlow(("DBGFR3InfoRegisterDevice: pszName=%p:{%s} pszDesc=%p:{%s} pfnHandler=%p pDevIns=%p\n",
     
    292295     * Validate the specific stuff.
    293296     */
    294     if (!pfnHandler)
    295     {
    296         AssertMsgFailed(("No handler\n"));
    297         return VERR_INVALID_PARAMETER;
    298     }
    299     if (!pDevIns)
    300     {
    301         AssertMsgFailed(("No pDevIns\n"));
    302         return VERR_INVALID_PARAMETER;
    303     }
     297    AssertPtrReturn(pfnHandler, VERR_INVALID_POINTER);
     298    AssertPtrReturn(pDevIns, VERR_INVALID_POINTER);
    304299
    305300    /*
     
    307302     */
    308303    PDBGFINFO pInfo;
    309     int rc = dbgfR3InfoRegister(pVM, pszName, pszDesc, 0, &pInfo);
     304    int rc = dbgfR3InfoRegister(pVM->pUVM, pszName, pszDesc, 0, &pInfo);
    310305    if (RT_SUCCESS(rc))
    311306    {
     
    313308        pInfo->u.Dev.pfnHandler = pfnHandler;
    314309        pInfo->u.Dev.pDevIns = pDevIns;
    315         RTCritSectLeave(&pVM->dbgf.s.InfoCritSect);
     310        RTCritSectLeave(&pVM->pUVM->dbgf.s.InfoCritSect);
    316311    }
    317312
     
    330325 * @param   pDrvIns     The driver instance owning the info.
    331326 */
    332 VMMR3DECL(int) DBGFR3InfoRegisterDriver(PVM pVM, const char *pszName, const char *pszDesc, PFNDBGFHANDLERDRV pfnHandler, PPDMDRVINS pDrvIns)
     327VMMR3_INT_DECL(int) DBGFR3InfoRegisterDriver(PVM pVM, const char *pszName, const char *pszDesc, PFNDBGFHANDLERDRV pfnHandler, PPDMDRVINS pDrvIns)
    333328{
    334329    LogFlow(("DBGFR3InfoRegisterDriver: pszName=%p:{%s} pszDesc=%p:{%s} pfnHandler=%p pDrvIns=%p\n",
     
    338333     * Validate the specific stuff.
    339334     */
    340     if (!pfnHandler)
    341     {
    342         AssertMsgFailed(("No handler\n"));
    343         return VERR_INVALID_PARAMETER;
    344     }
    345     if (!pDrvIns)
    346     {
    347         AssertMsgFailed(("No pDrvIns\n"));
    348         return VERR_INVALID_PARAMETER;
    349     }
     335    AssertPtrReturn(pfnHandler, VERR_INVALID_POINTER);
     336    AssertPtrReturn(pDrvIns, VERR_INVALID_POINTER);
    350337
    351338    /*
     
    353340     */
    354341    PDBGFINFO pInfo;
    355     int rc = dbgfR3InfoRegister(pVM, pszName, pszDesc, 0, &pInfo);
     342    int rc = dbgfR3InfoRegister(pVM->pUVM, pszName, pszDesc, 0, &pInfo);
    356343    if (RT_SUCCESS(rc))
    357344    {
     
    359346        pInfo->u.Drv.pfnHandler = pfnHandler;
    360347        pInfo->u.Drv.pDrvIns = pDrvIns;
    361         RTCritSectLeave(&pVM->dbgf.s.InfoCritSect);
     348        RTCritSectLeave(&pVM->pUVM->dbgf.s.InfoCritSect);
    362349    }
    363350
     
    375362 * @param   pfnHandler  The handler function to be called to display the info.
    376363 */
    377 VMMR3DECL(int) DBGFR3InfoRegisterInternal(PVM pVM, const char *pszName, const char *pszDesc, PFNDBGFHANDLERINT pfnHandler)
     364VMMR3_INT_DECL(int) DBGFR3InfoRegisterInternal(PVM pVM, const char *pszName, const char *pszDesc, PFNDBGFHANDLERINT pfnHandler)
    378365{
    379366    return DBGFR3InfoRegisterInternalEx(pVM, pszName, pszDesc, pfnHandler, 0);
     
    391378 * @param   fFlags      Flags, see the DBGFINFO_FLAGS_*.
    392379 */
    393 VMMR3DECL(int) DBGFR3InfoRegisterInternalEx(PVM pVM, const char *pszName, const char *pszDesc, PFNDBGFHANDLERINT pfnHandler, uint32_t fFlags)
     380VMMR3_INT_DECL(int) DBGFR3InfoRegisterInternalEx(PVM pVM, const char *pszName, const char *pszDesc,
     381                                                 PFNDBGFHANDLERINT pfnHandler, uint32_t fFlags)
    394382{
    395383    LogFlow(("DBGFR3InfoRegisterInternal: pszName=%p:{%s} pszDesc=%p:{%s} pfnHandler=%p fFlags=%x\n",
     
    399387     * Validate the specific stuff.
    400388     */
    401     if (!pfnHandler)
    402     {
    403         AssertMsgFailed(("No handler\n"));
    404         return VERR_INVALID_PARAMETER;
    405     }
     389    AssertPtrReturn(pfnHandler, VERR_INVALID_POINTER);
    406390
    407391    /*
     
    409393     */
    410394    PDBGFINFO pInfo;
    411     int rc = dbgfR3InfoRegister(pVM, pszName, pszDesc, fFlags, &pInfo);
     395    int rc = dbgfR3InfoRegister(pVM->pUVM, pszName, pszDesc, fFlags, &pInfo);
    412396    if (RT_SUCCESS(rc))
    413397    {
    414398        pInfo->enmType = DBGFINFOTYPE_INT;
    415399        pInfo->u.Int.pfnHandler = pfnHandler;
    416         RTCritSectLeave(&pVM->dbgf.s.InfoCritSect);
     400        RTCritSectLeave(&pVM->pUVM->dbgf.s.InfoCritSect);
    417401    }
    418402
     
    425409 *
    426410 * @returns VBox status code.
    427  * @param   pVM         Pointer to the VM.
     411 * @param   pUVM        The user mode VM handle.
    428412 * @param   pszName     The identifier of the info.
    429413 * @param   pszDesc     The description of the info and any arguments the handler may take.
     
    431415 * @param   pvUser      User argument to be passed to the handler.
    432416 */
    433 VMMR3DECL(int) DBGFR3InfoRegisterExternal(PVM pVM, const char *pszName, const char *pszDesc, PFNDBGFHANDLEREXT pfnHandler, void *pvUser)
     417VMMR3DECL(int) DBGFR3InfoRegisterExternal(PUVM pUVM, const char *pszName, const char *pszDesc,
     418                                          PFNDBGFHANDLEREXT pfnHandler, void *pvUser)
    434419{
    435420    LogFlow(("DBGFR3InfoRegisterExternal: pszName=%p:{%s} pszDesc=%p:{%s} pfnHandler=%p pvUser=%p\n",
     
    439424     * Validate the specific stuff.
    440425     */
    441     if (!pfnHandler)
    442     {
    443         AssertMsgFailed(("No handler\n"));
    444         return VERR_INVALID_PARAMETER;
    445     }
     426    AssertPtrReturn(pfnHandler, VERR_INVALID_POINTER);
     427    UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE);
    446428
    447429    /*
     
    449431     */
    450432    PDBGFINFO pInfo;
    451     int rc = dbgfR3InfoRegister(pVM, pszName, pszDesc, 0, &pInfo);
     433    int rc = dbgfR3InfoRegister(pUVM, pszName, pszDesc, 0, &pInfo);
    452434    if (RT_SUCCESS(rc))
    453435    {
     
    455437        pInfo->u.Ext.pfnHandler = pfnHandler;
    456438        pInfo->u.Ext.pvUser = pvUser;
    457         RTCritSectLeave(&pVM->dbgf.s.InfoCritSect);
     439        RTCritSectLeave(&pUVM->dbgf.s.InfoCritSect);
    458440    }
    459441
     
    470452 * @param   pszName     The identifier of the info. If NULL all owned by the device.
    471453 */
    472 VMMR3DECL(int) DBGFR3InfoDeregisterDevice(PVM pVM, PPDMDEVINS pDevIns, const char *pszName)
     454VMMR3_INT_DECL(int) DBGFR3InfoDeregisterDevice(PVM pVM, PPDMDEVINS pDevIns, const char *pszName)
    473455{
    474456    LogFlow(("DBGFR3InfoDeregisterDevice: pDevIns=%p pszName=%p:{%s}\n", pDevIns, pszName, pszName));
     
    477459     * Validate input.
    478460     */
    479     if (!pDevIns)
    480     {
    481         AssertMsgFailed(("!pDevIns\n"));
    482         return VERR_INVALID_PARAMETER;
    483     }
     461    AssertPtrReturn(pDevIns, VERR_INVALID_POINTER);
     462    AssertPtrNullReturn(pszName, VERR_INVALID_POINTER);
    484463    size_t cchName = pszName ? strlen(pszName) : 0;
     464    PUVM pUVM = pVM->pUVM;
    485465
    486466    /*
    487467     * Enumerate the info handlers and free the requested entries.
    488468     */
    489     int rc = RTCritSectEnter(&pVM->dbgf.s.InfoCritSect);
    490     AssertRC(rc);
     469    int rc = RTCritSectEnter(&pUVM->dbgf.s.InfoCritSect); AssertRC(rc);
    491470    rc = VERR_FILE_NOT_FOUND;
    492471    PDBGFINFO pPrev = NULL;
    493     PDBGFINFO pInfo = pVM->dbgf.s.pInfoFirst;
     472    PDBGFINFO pInfo = pUVM->dbgf.s.pInfoFirst;
    494473    if (pszName)
    495474    {
     
    506485                    pPrev->pNext = pInfo->pNext;
    507486                else
    508                     pVM->dbgf.s.pInfoFirst = pInfo->pNext;
     487                    pUVM->dbgf.s.pInfoFirst = pInfo->pNext;
    509488                MMR3HeapFree(pInfo);
    510489                rc = VINF_SUCCESS;
     
    515494    {
    516495        /*
    517          * Free all owned by the driver.
     496         * Free all owned by the device.
    518497         */
    519498        for (; pInfo; pPrev = pInfo, pInfo = pInfo->pNext)
     
    524503                    pPrev->pNext = pInfo->pNext;
    525504                else
    526                     pVM->dbgf.s.pInfoFirst = pInfo->pNext;
     505                    pUVM->dbgf.s.pInfoFirst = pInfo->pNext;
    527506                MMR3HeapFree(pInfo);
    528507                pInfo = pPrev;
     
    530509        rc = VINF_SUCCESS;
    531510    }
    532     int rc2 = RTCritSectLeave(&pVM->dbgf.s.InfoCritSect);
     511    int rc2 = RTCritSectLeave(&pUVM->dbgf.s.InfoCritSect);
    533512    AssertRC(rc2);
    534513    AssertRC(rc);
     
    545524 * @param   pszName     The identifier of the info. If NULL all owned by the driver.
    546525 */
    547 VMMR3DECL(int) DBGFR3InfoDeregisterDriver(PVM pVM, PPDMDRVINS pDrvIns, const char *pszName)
     526VMMR3_INT_DECL(int) DBGFR3InfoDeregisterDriver(PVM pVM, PPDMDRVINS pDrvIns, const char *pszName)
    548527{
    549528    LogFlow(("DBGFR3InfoDeregisterDriver: pDrvIns=%p pszName=%p:{%s}\n", pDrvIns, pszName, pszName));
     
    552531     * Validate input.
    553532     */
    554     if (!pDrvIns)
    555     {
    556         AssertMsgFailed(("!pDrvIns\n"));
    557         return VERR_INVALID_PARAMETER;
    558     }
     533    AssertPtrReturn(pDrvIns, VERR_INVALID_POINTER);
     534    AssertPtrNullReturn(pszName, VERR_INVALID_POINTER);
    559535    size_t cchName = pszName ? strlen(pszName) : 0;
     536    PUVM pUVM = pVM->pUVM;
    560537
    561538    /*
    562539     * Enumerate the info handlers and free the requested entries.
    563540     */
    564     int rc = RTCritSectEnter(&pVM->dbgf.s.InfoCritSect);
    565     AssertRC(rc);
     541    int rc = RTCritSectEnter(&pUVM->dbgf.s.InfoCritSect); AssertRC(rc);
    566542    rc = VERR_FILE_NOT_FOUND;
    567543    PDBGFINFO pPrev = NULL;
    568     PDBGFINFO pInfo = pVM->dbgf.s.pInfoFirst;
     544    PDBGFINFO pInfo = pUVM->dbgf.s.pInfoFirst;
    569545    if (pszName)
    570546    {
     
    581557                    pPrev->pNext = pInfo->pNext;
    582558                else
    583                     pVM->dbgf.s.pInfoFirst = pInfo->pNext;
     559                    pUVM->dbgf.s.pInfoFirst = pInfo->pNext;
    584560                MMR3HeapFree(pInfo);
    585561                rc = VINF_SUCCESS;
     
    599575                    pPrev->pNext = pInfo->pNext;
    600576                else
    601                     pVM->dbgf.s.pInfoFirst = pInfo->pNext;
     577                    pUVM->dbgf.s.pInfoFirst = pInfo->pNext;
    602578                MMR3HeapFree(pInfo);
    603579                pInfo = pPrev;
     
    605581        rc = VINF_SUCCESS;
    606582    }
    607     int rc2 = RTCritSectLeave(&pVM->dbgf.s.InfoCritSect);
     583    int rc2 = RTCritSectLeave(&pUVM->dbgf.s.InfoCritSect);
    608584    AssertRC(rc2);
    609585    AssertRC(rc);
     
    617593 *
    618594 * @returns VBox status code.
    619  * @param   pVM         Pointer to the VM.
     595 * @param   pUVM        Pointer to the VM.
    620596 * @param   pszName     The identifier of the info.
    621597 * @param   enmType     The info owner type.
    622598 */
    623 static int dbgfR3InfoDeregister(PVM pVM, const char *pszName, DBGFINFOTYPE enmType)
     599static int dbgfR3InfoDeregister(PUVM pUVM, const char *pszName, DBGFINFOTYPE enmType)
    624600{
    625601    /*
    626602     * Validate input.
    627603     */
    628     if (!pszName)
    629     {
    630         AssertMsgFailed(("!pszName\n"));
    631         return VERR_INVALID_PARAMETER;
    632     }
     604    AssertPtrReturn(pszName, VERR_INVALID_POINTER);
    633605
    634606    /*
     
    636608     */
    637609    size_t cchName = strlen(pszName);
    638     int rc = RTCritSectEnter(&pVM->dbgf.s.InfoCritSect);
     610    int rc = RTCritSectEnter(&pUVM->dbgf.s.InfoCritSect);
    639611    AssertRC(rc);
    640612    rc = VERR_FILE_NOT_FOUND;
    641613    PDBGFINFO pPrev = NULL;
    642     PDBGFINFO pInfo = pVM->dbgf.s.pInfoFirst;
     614    PDBGFINFO pInfo = pUVM->dbgf.s.pInfoFirst;
    643615    for (; pInfo; pPrev = pInfo, pInfo = pInfo->pNext)
    644616        if (    pInfo->cchName == cchName
     
    649621                pPrev->pNext = pInfo->pNext;
    650622            else
    651                 pVM->dbgf.s.pInfoFirst = pInfo->pNext;
     623                pUVM->dbgf.s.pInfoFirst = pInfo->pNext;
    652624            MMR3HeapFree(pInfo);
    653625            rc = VINF_SUCCESS;
    654626            break;
    655627        }
    656     int rc2 = RTCritSectLeave(&pVM->dbgf.s.InfoCritSect);
     628    int rc2 = RTCritSectLeave(&pUVM->dbgf.s.InfoCritSect);
    657629    AssertRC(rc2);
    658630    AssertRC(rc);
     
    669641 * @param   pszName     The identifier of the info. If NULL all owned by the device.
    670642 */
    671 VMMR3DECL(int) DBGFR3InfoDeregisterInternal(PVM pVM, const char *pszName)
     643VMMR3_INT_DECL(int) DBGFR3InfoDeregisterInternal(PVM pVM, const char *pszName)
    672644{
    673645    LogFlow(("DBGFR3InfoDeregisterInternal: pszName=%p:{%s}\n", pszName, pszName));
    674     return dbgfR3InfoDeregister(pVM, pszName, DBGFINFOTYPE_INT);
     646    return dbgfR3InfoDeregister(pVM->pUVM, pszName, DBGFINFOTYPE_INT);
    675647}
    676648
     
    680652 *
    681653 * @returns VBox status code.
    682  * @param   pVM         Pointer to the VM.
     654 * @param   pUVM        The user mode VM handle.
    683655 * @param   pszName     The identifier of the info. If NULL all owned by the device.
    684656 */
    685 VMMR3DECL(int) DBGFR3InfoDeregisterExternal(PVM pVM, const char *pszName)
     657VMMR3DECL(int) DBGFR3InfoDeregisterExternal(PUVM pUVM, const char *pszName)
    686658{
    687659    LogFlow(("DBGFR3InfoDeregisterExternal: pszName=%p:{%s}\n", pszName, pszName));
    688     return dbgfR3InfoDeregister(pVM, pszName, DBGFINFOTYPE_EXT);
     660    UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE);
     661    return dbgfR3InfoDeregister(pUVM, pszName, DBGFINFOTYPE_EXT);
    689662}
    690663
     
    694667 *
    695668 * @returns VBox status code.
    696  * @param   pVM                 Pointer to the VM.
    697  * @param   idCpu               Which CPU to run EMT bound handlers on.
    698  *                              VMCPUID_ANY or a valid CPU ID.
    699  * @param   pszName             What to dump.
    700  * @param   pszArgs             Arguments, optional.
    701  * @param   pHlp                Output helper, optional.
    702  */
    703 static DECLCALLBACK(int) dbgfR3Info(PVM pVM, VMCPUID idCpu, const char *pszName, const char *pszArgs, PCDBGFINFOHLP pHlp)
     669 * @param   pUVM        The user mode VM handle.
     670 * @param   idCpu       Which CPU to run EMT bound handlers on.  VMCPUID_ANY or
     671 *                      a valid CPU ID.
     672 * @param   pszName     What to dump.
     673 * @param   pszArgs     Arguments, optional.
     674 * @param   pHlp        Output helper, optional.
     675 */
     676static DECLCALLBACK(int) dbgfR3Info(PUVM pUVM, VMCPUID idCpu, const char *pszName, const char *pszArgs, PCDBGFINFOHLP pHlp)
    704677{
    705678    /*
     
    707680     */
    708681    AssertPtrReturn(pszName, VERR_INVALID_POINTER);
     682    AssertPtrNullReturn(pszArgs, VERR_INVALID_POINTER);
    709683    if (pHlp)
    710684    {
    711         if (    !pHlp->pfnPrintf
    712             ||  !pHlp->pfnPrintfV)
    713         {
    714             AssertMsgFailed(("A pHlp member is missing!\n"));
    715             return VERR_INVALID_PARAMETER;
    716         }
     685        AssertPtrReturn(pHlp, VERR_INVALID_PARAMETER);
     686        AssertPtrReturn(pHlp->pfnPrintf, VERR_INVALID_PARAMETER);
     687        AssertPtrReturn(pHlp->pfnPrintfV, VERR_INVALID_PARAMETER);
    717688    }
    718689    else
     
    723694     */
    724695    size_t cchName = strlen(pszName);
    725     int rc = RTCritSectEnter(&pVM->dbgf.s.InfoCritSect);
     696    int rc = RTCritSectEnter(&pUVM->dbgf.s.InfoCritSect);
    726697    AssertRC(rc);
    727     PDBGFINFO pInfo = pVM->dbgf.s.pInfoFirst;
     698    PDBGFINFO pInfo = pUVM->dbgf.s.pInfoFirst;
    728699    for (; pInfo; pInfo = pInfo->pNext)
    729700        if (    pInfo->cchName == cchName
     
    738709         */
    739710        DBGFINFO Info = *pInfo;
    740         rc = RTCritSectLeave(&pVM->dbgf.s.InfoCritSect);
     711        rc = RTCritSectLeave(&pUVM->dbgf.s.InfoCritSect);
    741712        AssertRC(rc);
    742713        rc = VINF_SUCCESS;
     
    745716            case DBGFINFOTYPE_DEV:
    746717                if (Info.fFlags & DBGFINFO_FLAGS_RUN_ON_EMT)
    747                     rc = VMR3ReqCallVoidWait(pVM, idCpu, (PFNRT)Info.u.Dev.pfnHandler, 3, Info.u.Dev.pDevIns, pHlp, pszArgs);
     718                    rc = VMR3ReqCallVoidWaitU(pUVM, idCpu, (PFNRT)Info.u.Dev.pfnHandler, 3, Info.u.Dev.pDevIns, pHlp, pszArgs);
    748719                else
    749720                    Info.u.Dev.pfnHandler(Info.u.Dev.pDevIns, pHlp, pszArgs);
     
    752723            case DBGFINFOTYPE_DRV:
    753724                if (Info.fFlags & DBGFINFO_FLAGS_RUN_ON_EMT)
    754                     rc = VMR3ReqCallVoidWait(pVM, idCpu, (PFNRT)Info.u.Drv.pfnHandler, 3, Info.u.Drv.pDrvIns, pHlp, pszArgs);
     725                    rc = VMR3ReqCallVoidWaitU(pUVM, idCpu, (PFNRT)Info.u.Drv.pfnHandler, 3, Info.u.Drv.pDrvIns, pHlp, pszArgs);
    755726                else
    756727                    Info.u.Drv.pfnHandler(Info.u.Drv.pDrvIns, pHlp, pszArgs);
     
    758729
    759730            case DBGFINFOTYPE_INT:
    760                 if (Info.fFlags & DBGFINFO_FLAGS_RUN_ON_EMT)
    761                     rc = VMR3ReqCallVoidWait(pVM, idCpu, (PFNRT)Info.u.Int.pfnHandler, 3, pVM, pHlp, pszArgs);
     731                if (RT_VALID_PTR(pUVM->pVM))
     732                {
     733                    if (Info.fFlags & DBGFINFO_FLAGS_RUN_ON_EMT)
     734                        rc = VMR3ReqCallVoidWaitU(pUVM, idCpu, (PFNRT)Info.u.Int.pfnHandler, 3, pUVM->pVM, pHlp, pszArgs);
     735                    else
     736                        Info.u.Int.pfnHandler(pUVM->pVM, pHlp, pszArgs);
     737                }
    762738                else
    763                     Info.u.Int.pfnHandler(pVM, pHlp, pszArgs);
     739                    rc = VERR_INVALID_VM_HANDLE;
    764740                break;
    765741
    766742            case DBGFINFOTYPE_EXT:
    767743                if (Info.fFlags & DBGFINFO_FLAGS_RUN_ON_EMT)
    768                     rc = VMR3ReqCallVoidWait(pVM, idCpu, (PFNRT)Info.u.Ext.pfnHandler, 3, Info.u.Ext.pvUser, pHlp, pszArgs);
     744                    rc = VMR3ReqCallVoidWaitU(pUVM, idCpu, (PFNRT)Info.u.Ext.pfnHandler, 3, Info.u.Ext.pvUser, pHlp, pszArgs);
    769745                else
    770746                    Info.u.Ext.pfnHandler(Info.u.Ext.pvUser, pHlp, pszArgs);
     
    777753    else
    778754    {
    779         rc = RTCritSectLeave(&pVM->dbgf.s.InfoCritSect);
     755        rc = RTCritSectLeave(&pUVM->dbgf.s.InfoCritSect);
    780756        AssertRC(rc);
    781757        rc = VERR_FILE_NOT_FOUND;
     
    788764 *
    789765 * @returns VBox status code.
    790  * @param   pVM         Pointer to the VM.
     766 * @param   pUVM        The user mode VM handle.
    791767 * @param   pszName     The identifier of the info to display.
    792768 * @param   pszArgs     Arguments to the info handler.
    793769 * @param   pHlp        The output helper functions. If NULL the logger will be used.
    794770 */
    795 VMMR3DECL(int) DBGFR3Info(PVM pVM, const char *pszName, const char *pszArgs, PCDBGFINFOHLP pHlp)
    796 {
    797     return dbgfR3Info(pVM, VMCPUID_ANY, pszName, pszArgs, pHlp);
     771VMMR3DECL(int) DBGFR3Info(PUVM pUVM, const char *pszName, const char *pszArgs, PCDBGFINFOHLP pHlp)
     772{
     773    UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE);
     774    return dbgfR3Info(pUVM, VMCPUID_ANY, pszName, pszArgs, pHlp);
    798775}
    799776
     
    803780 *
    804781 * @returns VBox status code.
    805  * @param   pVM         Pointer to the VM.
     782 * @param   pUVM        The user mode VM handle.
    806783 * @param   idCpu       The CPU to exectue the request on.  Pass NIL_VMCPUID
    807784 *                      to not involve any EMT.
     
    810787 * @param   pHlp        The output helper functions. If NULL the logger will be used.
    811788 */
    812 VMMR3DECL(int) DBGFR3InfoEx(PVM pVM, VMCPUID idCpu, const char *pszName, const char *pszArgs, PCDBGFINFOHLP pHlp)
    813 {
     789VMMR3DECL(int) DBGFR3InfoEx(PUVM pUVM, VMCPUID idCpu, const char *pszName, const char *pszArgs, PCDBGFINFOHLP pHlp)
     790{
     791    UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE);
    814792    if (idCpu == NIL_VMCPUID)
    815         return dbgfR3Info(pVM, VMCPUID_ANY, pszName, pszArgs, pHlp);
    816     return VMR3ReqPriorityCallWait(pVM, idCpu,
    817                                    (PFNRT)dbgfR3Info, 5, pVM, idCpu, pszName, pszArgs, pHlp);
     793        return dbgfR3Info(pUVM, VMCPUID_ANY, pszName, pszArgs, pHlp);
     794    return VMR3ReqPriorityCallWaitU(pUVM, idCpu,
     795                                    (PFNRT)dbgfR3Info, 5, pUVM, idCpu, pszName, pszArgs, pHlp);
    818796}
    819797
     
    823801 *
    824802 * @returns See DBGFR3Info.
    825  * @param   pVM                 Pointer to the VM.
    826  * @param   pszName             See DBGFR3Info.
    827  * @param   pszArgs             See DBGFR3Info.
    828  */
    829 VMMR3DECL(int) DBGFR3InfoLogRel(PVM pVM, const char *pszName, const char *pszArgs)
    830 {
    831     return DBGFR3Info(pVM, pszName, pszArgs, &g_dbgfR3InfoLogRelHlp);
     803 * @param   pUVM        The user mode VM handle.
     804 * @param   pszName     See DBGFR3Info.
     805 * @param   pszArgs     See DBGFR3Info.
     806 */
     807VMMR3DECL(int) DBGFR3InfoLogRel(PUVM pUVM, const char *pszName, const char *pszArgs)
     808{
     809    return DBGFR3Info(pUVM, pszName, pszArgs, &g_dbgfR3InfoLogRelHlp);
    832810}
    833811
     
    837815 *
    838816 * @returns See DBGFR3Info.
    839  * @param   pVM                 Pointer to the VM.
    840  * @param   pszName             See DBGFR3Info.
    841  * @param   pszArgs             See DBGFR3Info.
    842  */
    843 VMMR3DECL(int) DBGFR3InfoStdErr(PVM pVM, const char *pszName, const char *pszArgs)
    844 {
    845     return DBGFR3Info(pVM, pszName, pszArgs, &g_dbgfR3InfoStdErrHlp);
     817 * @param   pUVM        The user mode VM handle.
     818 * @param   pszName     See DBGFR3Info.
     819 * @param   pszArgs     See DBGFR3Info.
     820 */
     821VMMR3DECL(int) DBGFR3InfoStdErr(PUVM pUVM, const char *pszName, const char *pszArgs)
     822{
     823    return DBGFR3Info(pUVM, pszName, pszArgs, &g_dbgfR3InfoStdErrHlp);
    846824}
    847825
     
    863841 * @threads EMT
    864842 */
    865 VMMR3DECL(int) DBGFR3InfoMulti(PVM pVM, const char *pszIncludePat, const char *pszExcludePat, const char *pszSepFmt,
    866                                PCDBGFINFOHLP pHlp)
     843VMMR3_INT_DECL(int) DBGFR3InfoMulti(PVM pVM, const char *pszIncludePat, const char *pszExcludePat, const char *pszSepFmt,
     844                                    PCDBGFINFOHLP pHlp)
    867845{
    868846    /*
    869847     * Validate input.
    870848     */
     849    PUVM pUVM = pVM->pUVM;
    871850    VM_ASSERT_EMT_RETURN(pVM, VERR_VM_THREAD_NOT_EMT);
    872851    AssertPtrReturn(pszIncludePat, VERR_INVALID_POINTER);
     
    888867     * Note! We won't leave the critical section here...
    889868     */
    890     int rc = RTCritSectEnter(&pVM->dbgf.s.InfoCritSect);
     869    int rc = RTCritSectEnter(&pUVM->dbgf.s.InfoCritSect);
    891870    AssertRC(rc);
    892871    rc = VWRN_NOT_FOUND;
    893     for (PDBGFINFO pInfo = pVM->dbgf.s.pInfoFirst; pInfo; pInfo = pInfo->pNext)
     872    for (PDBGFINFO pInfo = pUVM->dbgf.s.pInfoFirst; pInfo; pInfo = pInfo->pNext)
    894873    {
    895874        if (   RTStrSimplePatternMultiMatch(pszIncludePat, cchIncludePat, pInfo->szName, pInfo->cchName, NULL)
     
    902881                case DBGFINFOTYPE_DEV:
    903882                    if (pInfo->fFlags & DBGFINFO_FLAGS_RUN_ON_EMT)
    904                         rc = VMR3ReqCallVoidWait(pVM, VMCPUID_ANY, (PFNRT)pInfo->u.Dev.pfnHandler, 3, pInfo->u.Dev.pDevIns, pHlp, pszArgs);
     883                        rc = VMR3ReqCallVoidWaitU(pUVM, VMCPUID_ANY, (PFNRT)pInfo->u.Dev.pfnHandler, 3,
     884                                                  pInfo->u.Dev.pDevIns, pHlp, pszArgs);
    905885                    else
    906886                        pInfo->u.Dev.pfnHandler(pInfo->u.Dev.pDevIns, pHlp, pszArgs);
     
    909889                case DBGFINFOTYPE_DRV:
    910890                    if (pInfo->fFlags & DBGFINFO_FLAGS_RUN_ON_EMT)
    911                         rc = VMR3ReqCallVoidWait(pVM, VMCPUID_ANY, (PFNRT)pInfo->u.Drv.pfnHandler, 3, pInfo->u.Drv.pDrvIns, pHlp, pszArgs);
     891                        rc = VMR3ReqCallVoidWaitU(pUVM, VMCPUID_ANY, (PFNRT)pInfo->u.Drv.pfnHandler, 3,
     892                                                  pInfo->u.Drv.pDrvIns, pHlp, pszArgs);
    912893                    else
    913894                        pInfo->u.Drv.pfnHandler(pInfo->u.Drv.pDrvIns, pHlp, pszArgs);
     
    916897                case DBGFINFOTYPE_INT:
    917898                    if (pInfo->fFlags & DBGFINFO_FLAGS_RUN_ON_EMT)
    918                         rc = VMR3ReqCallVoidWait(pVM, VMCPUID_ANY, (PFNRT)pInfo->u.Int.pfnHandler, 3, pVM, pHlp, pszArgs);
     899                        rc = VMR3ReqCallVoidWaitU(pUVM, VMCPUID_ANY, (PFNRT)pInfo->u.Int.pfnHandler, 3, pVM, pHlp, pszArgs);
    919900                    else
    920901                        pInfo->u.Int.pfnHandler(pVM, pHlp, pszArgs);
     
    923904                case DBGFINFOTYPE_EXT:
    924905                    if (pInfo->fFlags & DBGFINFO_FLAGS_RUN_ON_EMT)
    925                         rc = VMR3ReqCallVoidWait(pVM, VMCPUID_ANY, (PFNRT)pInfo->u.Ext.pfnHandler, 3, pInfo->u.Ext.pvUser, pHlp, pszArgs);
     906                        rc = VMR3ReqCallVoidWaitU(pUVM, VMCPUID_ANY, (PFNRT)pInfo->u.Ext.pfnHandler, 3,
     907                                                  pInfo->u.Ext.pvUser, pHlp, pszArgs);
    926908                    else
    927909                        pInfo->u.Ext.pfnHandler(pInfo->u.Ext.pvUser, pHlp, pszArgs);
     
    933915        }
    934916    }
    935     int rc2 = RTCritSectLeave(&pVM->dbgf.s.InfoCritSect);
     917    int rc2 = RTCritSectLeave(&pUVM->dbgf.s.InfoCritSect);
    936918    AssertRC(rc2);
    937919
     
    944926 *
    945927 * @returns VBox status code.
    946  * @param   pVM             Pointer to the VM.
     928 * @param   pUVM            The user mode VM handle.
    947929 * @param   pfnCallback     Pointer to callback function.
    948930 * @param   pvUser          User argument to pass to the callback.
    949931 */
    950 VMMR3DECL(int) DBGFR3InfoEnum(PVM pVM, PFNDBGFINFOENUM pfnCallback, void *pvUser)
     932VMMR3DECL(int) DBGFR3InfoEnum(PUVM pUVM, PFNDBGFINFOENUM pfnCallback, void *pvUser)
    951933{
    952934    LogFlow(("DBGFR3InfoLog: pfnCallback=%p pvUser=%p\n", pfnCallback, pvUser));
     
    960942        return VERR_INVALID_PARAMETER;
    961943    }
     944    UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE);
    962945
    963946    /*
    964947     * Enter and enumerate.
    965948     */
    966     int rc = RTCritSectEnter(&pVM->dbgf.s.InfoCritSect);
     949    int rc = RTCritSectEnter(&pUVM->dbgf.s.InfoCritSect);
    967950    AssertRC(rc);
    968951
    969952    rc = VINF_SUCCESS;
    970     for (PDBGFINFO pInfo = pVM->dbgf.s.pInfoFirst; RT_SUCCESS(rc) && pInfo; pInfo = pInfo->pNext)
    971         rc = pfnCallback(pVM, pInfo->szName, pInfo->pszDesc, pvUser);
     953    for (PDBGFINFO pInfo = pUVM->dbgf.s.pInfoFirst; RT_SUCCESS(rc) && pInfo; pInfo = pInfo->pNext)
     954        rc = pfnCallback(pUVM, pInfo->szName, pInfo->pszDesc, pvUser);
    972955
    973956    /*
    974957     * Leave and exit.
    975958     */
    976     int rc2 = RTCritSectLeave(&pVM->dbgf.s.InfoCritSect);
     959    int rc2 = RTCritSectLeave(&pUVM->dbgf.s.InfoCritSect);
    977960    AssertRC(rc2);
    978961
     
    996979     * Enter and enumerate.
    997980     */
    998     int rc = RTCritSectEnter(&pVM->dbgf.s.InfoCritSect);
     981    PUVM pUVM = pVM->pUVM;
     982    int rc = RTCritSectEnter(&pUVM->dbgf.s.InfoCritSect);
    999983    AssertRC(rc);
    1000984
    1001985    if (pszArgs && *pszArgs)
    1002986    {
    1003         for (PDBGFINFO pInfo = pVM->dbgf.s.pInfoFirst; pInfo; pInfo = pInfo->pNext)
     987        for (PDBGFINFO pInfo = pUVM->dbgf.s.pInfoFirst; pInfo; pInfo = pInfo->pNext)
    1004988        {
    1005989            const char *psz = strstr(pszArgs, pInfo->szName);
     
    1015999    else
    10161000    {
    1017         for (PDBGFINFO pInfo = pVM->dbgf.s.pInfoFirst; pInfo; pInfo = pInfo->pNext)
     1001        for (PDBGFINFO pInfo = pUVM->dbgf.s.pInfoFirst; pInfo; pInfo = pInfo->pNext)
    10181002            pHlp->pfnPrintf(pHlp, "%-16s  %s\n",
    10191003                            pInfo->szName, pInfo->pszDesc);
     
    10231007     * Leave and exit.
    10241008     */
    1025     rc = RTCritSectLeave(&pVM->dbgf.s.InfoCritSect);
     1009    rc = RTCritSectLeave(&pUVM->dbgf.s.InfoCritSect);
    10261010    AssertRC(rc);
    10271011}
  • trunk/src/VBox/VMM/VMMR3/DBGFLog.cpp

    r41965 r44399  
    2323#include <VBox/vmm/vmm.h>
    2424#include <VBox/vmm/dbgf.h>
     25#include <VBox/vmm/uvm.h>
     26#include <VBox/vmm/vm.h>
    2527#include <VBox/log.h>
    2628#include <VBox/err.h>
    2729#include <iprt/assert.h>
     30#include <iprt/param.h>
    2831#include <iprt/string.h>
    29 
    30 
    31 /*******************************************************************************
    32 *   Internal Functions                                                         *
    33 *******************************************************************************/
    34 static DECLCALLBACK(int) dbgfR3LogModifyGroups(PVM pVM, const char *pszGroupSettings);
    35 static DECLCALLBACK(int) dbgfR3LogModifyFlags(PVM pVM, const char *pszFlagSettings);
    36 static DECLCALLBACK(int) dbgfR3LogModifyDestinations(PVM pVM, const char *pszDestSettings);
    3732
    3833
     
    6358
    6459/**
     60 * EMT worker for DBGFR3LogModifyGroups.
     61 *
     62 * @returns VBox status code.
     63 * @param   pUVM                The user mode VM handle.
     64 * @param   pszGroupSettings    The group settings string. (VBOX_LOG)
     65 */
     66static DECLCALLBACK(int) dbgfR3LogModifyGroups(PUVM pUVM, const char *pszGroupSettings)
     67{
     68    PRTLOGGER pLogger = dbgfR3LogResolvedLogger(&pszGroupSettings);
     69    if (!pLogger)
     70        return VINF_SUCCESS;
     71
     72    int rc = RTLogGroupSettings(pLogger, pszGroupSettings);
     73    if (RT_SUCCESS(rc) && pUVM->pVM)
     74    {
     75        VM_ASSERT_VALID_EXT_RETURN(pUVM->pVM, VERR_INVALID_VM_HANDLE);
     76        rc = VMMR3UpdateLoggers(pUVM->pVM);
     77    }
     78    return rc;
     79}
     80
     81
     82/**
    6583 * Changes the logger group settings.
    6684 *
    6785 * @returns VBox status code.
    68  * @param   pVM                 Pointer to the VM.
     86 * @param   pUVM                The user mode VM handle.
    6987 * @param   pszGroupSettings    The group settings string. (VBOX_LOG)
    7088 *                              By prefixing the string with \"release:\" the
     
    7391 *                              is also recognized.
    7492 */
    75 VMMR3DECL(int) DBGFR3LogModifyGroups(PVM pVM, const char *pszGroupSettings)
     93VMMR3DECL(int) DBGFR3LogModifyGroups(PUVM pUVM, const char *pszGroupSettings)
    7694{
    77     AssertPtrReturn(pVM, VERR_INVALID_POINTER);
     95    UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE);
    7896    AssertPtrReturn(pszGroupSettings, VERR_INVALID_POINTER);
    7997
    80     return VMR3ReqPriorityCallWait(pVM, VMCPUID_ANY, (PFNRT)dbgfR3LogModifyGroups, 2, pVM, pszGroupSettings);
     98    return VMR3ReqPriorityCallWaitU(pUVM, VMCPUID_ANY, (PFNRT)dbgfR3LogModifyGroups, 2, pUVM, pszGroupSettings);
    8199}
    82100
    83101
    84102/**
    85  * EMT worker for DBGFR3LogModifyGroups.
     103 * EMT worker for DBGFR3LogModifyFlags.
    86104 *
    87105 * @returns VBox status code.
    88  * @param   pVM                 Pointer to the VM.
    89  * @param   pszGroupSettings    The group settings string. (VBOX_LOG)
     106 * @param   pUVM                The user mode VM handle.
     107 * @param   pszFlagSettings     The group settings string. (VBOX_LOG_FLAGS)
    90108 */
    91 static DECLCALLBACK(int) dbgfR3LogModifyGroups(PVM pVM, const char *pszGroupSettings)
     109static DECLCALLBACK(int) dbgfR3LogModifyFlags(PUVM pUVM, const char *pszFlagSettings)
    92110{
    93     PRTLOGGER pLogger = dbgfR3LogResolvedLogger(&pszGroupSettings);
     111    PRTLOGGER pLogger = dbgfR3LogResolvedLogger(&pszFlagSettings);
    94112    if (!pLogger)
    95113        return VINF_SUCCESS;
    96114
    97     int rc = RTLogGroupSettings(pLogger, pszGroupSettings);
    98     if (RT_SUCCESS(rc))
    99         rc = VMMR3UpdateLoggers(pVM);
     115    int rc = RTLogFlags(pLogger, pszFlagSettings);
     116    if (RT_SUCCESS(rc) && pUVM->pVM)
     117    {
     118        VM_ASSERT_VALID_EXT_RETURN(pUVM->pVM, VERR_INVALID_VM_HANDLE);
     119        rc = VMMR3UpdateLoggers(pUVM->pVM);
     120    }
    100121    return rc;
    101122}
     
    106127 *
    107128 * @returns VBox status code.
    108  * @param   pVM                 Pointer to the VM.
     129 * @param   pUVM                The user mode VM handle.
    109130 * @param   pszFlagSettings     The group settings string. (VBOX_LOG_FLAGS)
    110131 *                              By prefixing the string with \"release:\" the
     
    113134 *                              is also recognized.
    114135 */
    115 VMMR3DECL(int) DBGFR3LogModifyFlags(PVM pVM, const char *pszFlagSettings)
     136VMMR3DECL(int) DBGFR3LogModifyFlags(PUVM pUVM, const char *pszFlagSettings)
    116137{
    117     AssertPtrReturn(pVM, VERR_INVALID_POINTER);
     138    UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE);
    118139    AssertPtrReturn(pszFlagSettings, VERR_INVALID_POINTER);
    119140
    120     return VMR3ReqPriorityCallWait(pVM, VMCPUID_ANY, (PFNRT)dbgfR3LogModifyFlags, 2, pVM, pszFlagSettings);
     141    return VMR3ReqPriorityCallWaitU(pUVM, VMCPUID_ANY, (PFNRT)dbgfR3LogModifyFlags, 2, pUVM, pszFlagSettings);
    121142}
    122143
     
    126147 *
    127148 * @returns VBox status code.
    128  * @param   pVM                 Pointer to the VM.
    129  * @param   pszFlagSettings     The group settings string. (VBOX_LOG_FLAGS)
     149 * @param   pUVM                The user mode VM handle.
     150 * @param   pszDestSettings     The destination settings string. (VBOX_LOG_DEST)
    130151 */
    131 static DECLCALLBACK(int) dbgfR3LogModifyFlags(PVM pVM, const char *pszFlagSettings)
     152static DECLCALLBACK(int) dbgfR3LogModifyDestinations(PUVM pUVM, const char *pszDestSettings)
    132153{
    133     PRTLOGGER pLogger = dbgfR3LogResolvedLogger(&pszFlagSettings);
     154    PRTLOGGER pLogger = dbgfR3LogResolvedLogger(&pszDestSettings);
    134155    if (!pLogger)
    135156        return VINF_SUCCESS;
    136157
    137     int rc = RTLogFlags(pLogger, pszFlagSettings);
    138     if (RT_SUCCESS(rc))
    139         rc = VMMR3UpdateLoggers(pVM);
     158    int rc = RTLogDestinations(NULL, pszDestSettings);
     159    if (RT_SUCCESS(rc) && pUVM->pVM)
     160    {
     161        VM_ASSERT_VALID_EXT_RETURN(pUVM->pVM, VERR_INVALID_VM_HANDLE);
     162        rc = VMMR3UpdateLoggers(pUVM->pVM);
     163    }
    140164    return rc;
    141165}
     
    146170 *
    147171 * @returns VBox status code.
    148  * @param   pVM                 Pointer to the VM.
     172 * @param   pUVM                The user mode VM handle.
    149173 * @param   pszDestSettings     The destination settings string. (VBOX_LOG_DEST)
    150174 *                              By prefixing the string with \"release:\" the
     
    153177 *                              is also recognized.
    154178 */
    155 VMMR3DECL(int) DBGFR3LogModifyDestinations(PVM pVM, const char *pszDestSettings)
     179VMMR3DECL(int) DBGFR3LogModifyDestinations(PUVM pUVM, const char *pszDestSettings)
    156180{
    157     AssertReturn(VALID_PTR(pVM), VERR_INVALID_POINTER);
    158     AssertReturn(VALID_PTR(pszDestSettings), VERR_INVALID_POINTER);
     181    UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE);
     182    AssertPtrReturn(pszDestSettings, VERR_INVALID_POINTER);
    159183
    160     return VMR3ReqPriorityCallWait(pVM, VMCPUID_ANY, (PFNRT)dbgfR3LogModifyDestinations, 2, pVM, pszDestSettings);
     184    return VMR3ReqPriorityCallWaitU(pUVM, VMCPUID_ANY, (PFNRT)dbgfR3LogModifyDestinations, 2, pUVM, pszDestSettings);
    161185}
    162186
    163 
    164 /**
    165  * EMT worker for DBGFR3LogModifyFlags.
    166  *
    167  * @returns VBox status code.
    168  * @param   pVM                 Pointer to the VM.
    169  * @param   pszDestSettings     The destination settings string. (VBOX_LOG_DEST)
    170  */
    171 static DECLCALLBACK(int) dbgfR3LogModifyDestinations(PVM pVM, const char *pszDestSettings)
    172 {
    173     PRTLOGGER pLogger = dbgfR3LogResolvedLogger(&pszDestSettings);
    174     if (!pLogger)
    175         return VINF_SUCCESS;
    176 
    177     int rc = RTLogDestinations(NULL, pszDestSettings);
    178     if (RT_SUCCESS(rc))
    179         rc = VMMR3UpdateLoggers(pVM);
    180     return rc;
    181 }
    182 
  • trunk/src/VBox/VMM/VMMR3/DBGFMem.cpp

    r43387 r44399  
    2727#include "DBGFInternal.h"
    2828#include <VBox/vmm/vm.h>
     29#include <VBox/vmm/uvm.h>
    2930#include <VBox/err.h>
    3031#include <VBox/log.h>
     
    3738 *
    3839 * @returns VBox status code.
    39  * @param   pVM         Pointer to the VM.
     40 * @param   pUVM        The user mode VM handle.
    4041 * @param   idCpu       The ID of the CPU context to search in.
    4142 * @param   pAddress    Where to store the mixed address.
     
    4748 * @param   pHitAddress Where to put the address of the first hit.
    4849 */
    49 static DECLCALLBACK(int) dbgfR3MemScan(PVM pVM, VMCPUID idCpu, PCDBGFADDRESS pAddress, PCRTGCUINTPTR pcbRange, RTGCUINTPTR *puAlign,
    50                                        const uint8_t *pabNeedle, size_t cbNeedle, PDBGFADDRESS pHitAddress)
    51 {
     50static DECLCALLBACK(int) dbgfR3MemScan(PUVM pUVM, VMCPUID idCpu, PCDBGFADDRESS pAddress, PCRTGCUINTPTR pcbRange,
     51                                       RTGCUINTPTR *puAlign, const uint8_t *pabNeedle, size_t cbNeedle, PDBGFADDRESS pHitAddress)
     52{
     53    PVM pVM = pUVM->pVM;
     54    VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
    5255    Assert(idCpu == VMMGetCpuId(pVM));
    5356
     
    5659     */
    5760    RTGCUINTPTR cbRange = *pcbRange;
    58     if (!DBGFR3AddrIsValid(pVM, pAddress))
     61    if (!DBGFR3AddrIsValid(pUVM, pAddress))
    5962        return VERR_INVALID_POINTER;
    6063    if (!VALID_PTR(pHitAddress))
     
    8083        rc = PGMR3DbgScanPhysical(pVM, pAddress->FlatPtr, cbRange, GCPhysAlign, pabNeedle, cbNeedle, &PhysHit);
    8184        if (RT_SUCCESS(rc))
    82             DBGFR3AddrFromPhys(pVM, pHitAddress, PhysHit);
     85            DBGFR3AddrFromPhys(pUVM, pHitAddress, PhysHit);
    8386    }
    8487    else
     
    9497        rc = PGMR3DbgScanVirtual(pVM, pVCpu, pAddress->FlatPtr, cbRange, *puAlign, pabNeedle, cbNeedle, &GCPtrHit);
    9598        if (RT_SUCCESS(rc))
    96             DBGFR3AddrFromFlat(pVM, pHitAddress, GCPtrHit);
     99            DBGFR3AddrFromFlat(pUVM, pHitAddress, GCPtrHit);
    97100    }
    98101
     
    110113 * @retval  VERR_INVALID_ARGUMENT if any other arguments are invalid.
    111114 *
    112  * @param   pVM         Pointer to the VM.
     115 * @param   pUVM        The user mode VM handle.
    113116 * @param   idCpu       The ID of the CPU context to search in.
    114117 * @param   pAddress    Where to store the mixed address.
     
    122125 * @thread  Any thread.
    123126 */
    124 VMMR3DECL(int) DBGFR3MemScan(PVM pVM, VMCPUID idCpu, PCDBGFADDRESS pAddress, RTGCUINTPTR cbRange, RTGCUINTPTR uAlign,
     127VMMR3DECL(int) DBGFR3MemScan(PUVM pUVM, VMCPUID idCpu, PCDBGFADDRESS pAddress, RTGCUINTPTR cbRange, RTGCUINTPTR uAlign,
    125128                             const void *pvNeedle, size_t cbNeedle, PDBGFADDRESS pHitAddress)
    126129{
     130    UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE);
     131    AssertReturn(idCpu < pUVM->cCpus, VERR_INVALID_CPU_ID);
     132    return VMR3ReqPriorityCallWaitU(pUVM, idCpu, (PFNRT)dbgfR3MemScan, 8,
     133                                    pUVM, idCpu, pAddress, &cbRange, &uAlign, pvNeedle, cbNeedle, pHitAddress);
     134
     135}
     136
     137
     138/**
     139 * Read guest memory.
     140 *
     141 * @returns VBox status code.
     142 * @param   pUVM        The user mode VM handle.
     143 * @param   pAddress    Where to start reading.
     144 * @param   pvBuf       Where to store the data we've read.
     145 * @param   cbRead      The number of bytes to read.
     146 */
     147static DECLCALLBACK(int) dbgfR3MemRead(PUVM pUVM, VMCPUID idCpu, PCDBGFADDRESS pAddress, void *pvBuf, size_t cbRead)
     148{
     149    PVM pVM = pUVM->pVM;
    127150    VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
    128     AssertReturn(idCpu < pVM->cCpus, VERR_INVALID_CPU_ID);
    129     return VMR3ReqPriorityCallWait(pVM, idCpu, (PFNRT)dbgfR3MemScan, 8,
    130                                    pVM, idCpu, pAddress, &cbRange, &uAlign, pvNeedle, cbNeedle, pHitAddress);
    131 
    132 }
    133 
    134 
    135 /**
    136  * Read guest memory.
    137  *
    138  * @returns VBox status code.
    139  * @param   pVM             Pointer to the VM.
    140  * @param   pAddress        Where to start reading.
    141  * @param   pvBuf           Where to store the data we've read.
    142  * @param   cbRead          The number of bytes to read.
    143  */
    144 static DECLCALLBACK(int) dbgfR3MemRead(PVM pVM, VMCPUID idCpu, PCDBGFADDRESS pAddress, void *pvBuf, size_t cbRead)
    145 {
    146151    Assert(idCpu == VMMGetCpuId(pVM));
    147152
     
    149154     * Validate the input we use, PGM does the rest.
    150155     */
    151     if (!DBGFR3AddrIsValid(pVM, pAddress))
     156    if (!DBGFR3AddrIsValid(pUVM, pAddress))
    152157        return VERR_INVALID_POINTER;
    153158    if (!VALID_PTR(pvBuf))
     
    197202 * @returns VBox status code.
    198203 *
    199  * @param   pVM             Pointer to the VM.
    200  * @param   idCpu           The ID of the source CPU context (for the address).
    201  * @param   pAddress        Where to start reading.
    202  * @param   pvBuf           Where to store the data we've read.
    203  * @param   cbRead          The number of bytes to read.
    204  */
    205 VMMR3DECL(int) DBGFR3MemRead(PVM pVM, VMCPUID idCpu, PCDBGFADDRESS pAddress, void *pvBuf, size_t cbRead)
    206 {
    207     VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
    208     AssertReturn(idCpu < pVM->cCpus, VERR_INVALID_CPU_ID);
     204 * @param   pUVM        The user mode VM handle.
     205 * @param   idCpu       The ID of the source CPU context (for the address).
     206 * @param   pAddress    Where to start reading.
     207 * @param   pvBuf       Where to store the data we've read.
     208 * @param   cbRead      The number of bytes to read.
     209 */
     210VMMR3DECL(int) DBGFR3MemRead(PUVM pUVM, VMCPUID idCpu, PCDBGFADDRESS pAddress, void *pvBuf, size_t cbRead)
     211{
     212    UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE);
     213    AssertReturn(idCpu < pUVM->cCpus, VERR_INVALID_CPU_ID);
     214
    209215    if ((pAddress->fFlags & DBGFADDRESS_FLAGS_TYPE_MASK) == DBGFADDRESS_FLAGS_RING0)
    210216    {
    211217        AssertCompile(sizeof(RTHCUINTPTR) <= sizeof(pAddress->FlatPtr));
    212         return VMMR3ReadR0Stack(pVM, idCpu, (RTHCUINTPTR)pAddress->FlatPtr, pvBuf, cbRead);
    213     }
    214     return VMR3ReqPriorityCallWait(pVM, idCpu, (PFNRT)dbgfR3MemRead, 5, pVM, idCpu, pAddress, pvBuf, cbRead);
     218        VM_ASSERT_VALID_EXT_RETURN(pUVM->pVM, VERR_INVALID_VM_HANDLE);
     219        return VMMR3ReadR0Stack(pUVM->pVM, idCpu, (RTHCUINTPTR)pAddress->FlatPtr, pvBuf, cbRead);
     220    }
     221    return VMR3ReqPriorityCallWaitU(pUVM, idCpu, (PFNRT)dbgfR3MemRead, 5, pUVM, idCpu, pAddress, pvBuf, cbRead);
    215222}
    216223
     
    221228 * @returns VBox status code.
    222229 *
    223  * @param   pVM             Pointer to the VM.
    224  * @param   idCpu           The ID of the source CPU context (for the address).
    225  * @param   pAddress        Where to start reading.
    226  * @param   pszBuf          Where to store the string.
    227  * @param   cchBuf          The size of the buffer.
    228  */
    229 static DECLCALLBACK(int) dbgfR3MemReadString(PVM pVM, VMCPUID idCpu, PCDBGFADDRESS pAddress, char *pszBuf, size_t cchBuf)
     230 * @param   pUVM        The user mode VM handle.
     231 * @param   idCpu       The ID of the source CPU context (for the address).
     232 * @param   pAddress    Where to start reading.
     233 * @param   pszBuf      Where to store the string.
     234 * @param   cchBuf      The size of the buffer.
     235 */
     236static DECLCALLBACK(int) dbgfR3MemReadString(PUVM pUVM, VMCPUID idCpu, PCDBGFADDRESS pAddress, char *pszBuf, size_t cchBuf)
    230237{
    231238    /*
    232239     * Validate the input we use, PGM does the rest.
    233240     */
    234     if (!DBGFR3AddrIsValid(pVM, pAddress))
     241    if (!DBGFR3AddrIsValid(pUVM, pAddress))
    235242        return VERR_INVALID_POINTER;
    236243    if (!VALID_PTR(pszBuf))
     
    240247     * Let dbgfR3MemRead do the job.
    241248     */
    242     int rc = dbgfR3MemRead(pVM, idCpu, pAddress, pszBuf, cchBuf);
     249    int rc = dbgfR3MemRead(pUVM, idCpu, pAddress, pszBuf, cchBuf);
    243250
    244251    /*
     
    269276 * @returns VBox status code.
    270277 *
    271  * @param   pVM             Pointer to the VM.
    272  * @param   idCpu           The ID of the source CPU context (for the address).
    273  * @param   pAddress        Where to start reading.
    274  * @param   pszBuf          Where to store the string.
    275  * @param   cchBuf          The size of the buffer.
    276  */
    277 VMMR3DECL(int) DBGFR3MemReadString(PVM pVM, VMCPUID idCpu, PCDBGFADDRESS pAddress, char *pszBuf, size_t cchBuf)
     278 * @param   pUVM        The user mode VM handle.
     279 * @param   idCpu       The ID of the source CPU context (for the address).
     280 * @param   pAddress    Where to start reading.
     281 * @param   pszBuf      Where to store the string.
     282 * @param   cchBuf      The size of the buffer.
     283 */
     284VMMR3DECL(int) DBGFR3MemReadString(PUVM pUVM, VMCPUID idCpu, PCDBGFADDRESS pAddress, char *pszBuf, size_t cchBuf)
    278285{
    279286    /*
     
    285292        return VERR_INVALID_PARAMETER;
    286293    memset(pszBuf, 0, cchBuf);
     294    UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE);
     295    AssertReturn(idCpu < pUVM->cCpus, VERR_INVALID_CPU_ID);
     296
     297    /*
     298     * Pass it on to the EMT.
     299     */
     300    return VMR3ReqPriorityCallWaitU(pUVM, idCpu, (PFNRT)dbgfR3MemReadString, 5, pUVM, idCpu, pAddress, pszBuf, cchBuf);
     301}
     302
     303
     304/**
     305 * Writes guest memory.
     306 *
     307 * @returns VBox status code.
     308 *
     309 * @param   pUVM        The user mode VM handle.
     310 * @param   idCpu       The ID of the target CPU context (for the address).
     311 * @param   pAddress    Where to start writing.
     312 * @param   pvBuf       The data to write.
     313 * @param   cbWrite     The number of bytes to write.
     314 */
     315static DECLCALLBACK(int) dbgfR3MemWrite(PUVM pUVM, VMCPUID idCpu, PCDBGFADDRESS pAddress, void const *pvBuf, size_t cbWrite)
     316{
     317    /*
     318     * Validate the input we use, PGM does the rest.
     319     */
     320    if (!DBGFR3AddrIsValid(pUVM, pAddress))
     321        return VERR_INVALID_POINTER;
     322    if (!VALID_PTR(pvBuf))
     323        return VERR_INVALID_POINTER;
     324    PVM pVM = pUVM->pVM;
    287325    VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
    288     AssertReturn(idCpu < pVM->cCpus, VERR_INVALID_CPU_ID);
    289 
    290     /*
    291      * Pass it on to the EMT.
    292      */
    293     return VMR3ReqPriorityCallWait(pVM, idCpu, (PFNRT)dbgfR3MemReadString, 5, pVM, idCpu, pAddress, pszBuf, cchBuf);
    294 }
    295 
    296 
    297 /**
    298  * Writes guest memory.
    299  *
    300  * @returns VBox status code.
    301  *
    302  * @param   pVM             Pointer to the VM.
    303  * @param   idCpu           The ID of the target CPU context (for the address).
    304  * @param   pAddress        Where to start writing.
    305  * @param   pvBuf           The data to write.
    306  * @param   cbWrite         The number of bytes to write.
    307  */
    308 static DECLCALLBACK(int) dbgfR3MemWrite(PVM pVM, VMCPUID idCpu, PCDBGFADDRESS pAddress, void const *pvBuf, size_t cbWrite)
    309 {
    310     /*
    311      * Validate the input we use, PGM does the rest.
    312      */
    313     if (!DBGFR3AddrIsValid(pVM, pAddress))
    314         return VERR_INVALID_POINTER;
    315     if (!VALID_PTR(pvBuf))
    316         return VERR_INVALID_POINTER;
    317326
    318327    /*
     
    357366 * @returns VBox status code.
    358367 *
    359  * @param   pVM             Pointer to the VM.
    360  * @param   idCpu           The ID of the target CPU context (for the address).
    361  * @param   pAddress        Where to start writing.
    362  * @param   pvBuf           The data to write.
    363  * @param   cbRead          The number of bytes to write.
    364  */
    365 VMMR3DECL(int) DBGFR3MemWrite(PVM pVM, VMCPUID idCpu, PCDBGFADDRESS pAddress, void const *pvBuf, size_t cbWrite)
    366 {
     368 * @param   pUVM        The user mode VM handle.
     369 * @param   idCpu       The ID of the target CPU context (for the address).
     370 * @param   pAddress    Where to start writing.
     371 * @param   pvBuf       The data to write.
     372 * @param   cbRead      The number of bytes to write.
     373 */
     374VMMR3DECL(int) DBGFR3MemWrite(PUVM pUVM, VMCPUID idCpu, PCDBGFADDRESS pAddress, void const *pvBuf, size_t cbWrite)
     375{
     376    UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE);
     377    AssertReturn(idCpu < pUVM->cCpus, VERR_INVALID_CPU_ID);
     378    return VMR3ReqPriorityCallWaitU(pUVM, idCpu, (PFNRT)dbgfR3MemWrite, 5, pUVM, idCpu, pAddress, pvBuf, cbWrite);
     379}
     380
     381
     382/**
     383 * Worker for DBGFR3SelQueryInfo that calls into SELM.
     384 */
     385static DECLCALLBACK(int) dbgfR3SelQueryInfo(PUVM pUVM, VMCPUID idCpu, RTSEL Sel, uint32_t fFlags, PDBGFSELINFO pSelInfo)
     386{
     387    PVM pVM = pUVM->pVM;
    367388    VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
    368     AssertReturn(idCpu < pVM->cCpus, VERR_INVALID_CPU_ID);
    369     return VMR3ReqPriorityCallWait(pVM, idCpu, (PFNRT)dbgfR3MemWrite, 5, pVM, idCpu, pAddress, pvBuf, cbWrite);
    370 }
    371 
    372 
    373 /**
    374  * Worker for DBGFR3SelQueryInfo that calls into SELM.
    375  */
    376 static DECLCALLBACK(int) dbgfR3SelQueryInfo(PVM pVM, VMCPUID idCpu, RTSEL Sel, uint32_t fFlags, PDBGFSELINFO pSelInfo)
    377 {
     389
    378390    /*
    379391     * Make the query.
     
    446458 *          pagetable or page backing the selector table wasn't present.
    447459 *
    448  * @param   pVM         Pointer to the VM.
     460 * @param   pUVM        The user mode VM handle.
    449461 * @param   idCpu       The ID of the virtual CPU context.
    450462 * @param   Sel         The selector to get info about.
     
    456468 *          SELMR3GetShadowSelectorInfo.
    457469 */
    458 VMMR3DECL(int) DBGFR3SelQueryInfo(PVM pVM, VMCPUID idCpu, RTSEL Sel, uint32_t fFlags, PDBGFSELINFO pSelInfo)
    459 {
    460     VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
    461     AssertReturn(idCpu < pVM->cCpus, VERR_INVALID_CPU_ID);
     470VMMR3DECL(int) DBGFR3SelQueryInfo(PUVM pUVM, VMCPUID idCpu, RTSEL Sel, uint32_t fFlags, PDBGFSELINFO pSelInfo)
     471{
     472    UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE);
     473    AssertReturn(idCpu < pUVM->cCpus, VERR_INVALID_CPU_ID);
    462474    AssertReturn(!(fFlags & ~(DBGFSELQI_FLAGS_DT_GUEST | DBGFSELQI_FLAGS_DT_SHADOW | DBGFSELQI_FLAGS_DT_ADJ_64BIT_MODE)), VERR_INVALID_PARAMETER);
    463475    AssertReturn(    (fFlags & (DBGFSELQI_FLAGS_DT_SHADOW | DBGFSELQI_FLAGS_DT_ADJ_64BIT_MODE))
     
    470482     * Dispatch the request to a worker running on the target CPU.
    471483     */
    472     return VMR3ReqPriorityCallWait(pVM, idCpu, (PFNRT)dbgfR3SelQueryInfo, 5, pVM, idCpu, Sel, fFlags, pSelInfo);
     484    return VMR3ReqPriorityCallWaitU(pUVM, idCpu, (PFNRT)dbgfR3SelQueryInfo, 5, pUVM, idCpu, Sel, fFlags, pSelInfo);
    473485}
    474486
     
    545557 *
    546558 * @returns VBox status code.
    547  * @param   pVM             Pointer to the VM.
     559 * @param   pUVM            The shared VM handle.
    548560 * @param   idCpu           The current CPU ID.
    549561 * @param   fFlags          The flags, DBGFPGDMP_FLAGS_XXX.  Valid.
     
    555567 * @param   pHlp            The output callbacks.
    556568 */
    557 static DECLCALLBACK(int) dbgfR3PagingDumpEx(PVM pVM, VMCPUID idCpu, uint32_t fFlags, uint64_t *pcr3,
     569static DECLCALLBACK(int) dbgfR3PagingDumpEx(PUVM pUVM, VMCPUID idCpu, uint32_t fFlags, uint64_t *pcr3,
    558570                                            uint64_t *pu64FirstAddr, uint64_t *pu64LastAddr,
    559571                                            uint32_t cMaxDepth, PCDBGFINFOHLP pHlp)
     
    564576    if ((fFlags & (DBGFPGDMP_FLAGS_GUEST | DBGFPGDMP_FLAGS_SHADOW)) == (DBGFPGDMP_FLAGS_GUEST | DBGFPGDMP_FLAGS_SHADOW))
    565577    {
    566         int rc1 = dbgfR3PagingDumpEx(pVM, idCpu, fFlags & ~DBGFPGDMP_FLAGS_GUEST,
     578        int rc1 = dbgfR3PagingDumpEx(pUVM, idCpu, fFlags & ~DBGFPGDMP_FLAGS_GUEST,
    567579                                     pcr3, pu64FirstAddr, pu64LastAddr, cMaxDepth, pHlp);
    568         int rc2 = dbgfR3PagingDumpEx(pVM, idCpu, fFlags & ~DBGFPGDMP_FLAGS_SHADOW,
     580        int rc2 = dbgfR3PagingDumpEx(pUVM, idCpu, fFlags & ~DBGFPGDMP_FLAGS_SHADOW,
    569581                                     pcr3, pu64FirstAddr, pu64LastAddr, cMaxDepth, pHlp);
    570582        return RT_FAILURE(rc1) ? rc1 : rc2;
    571583    }
     584
     585    PVM pVM = pUVM->pVM;
     586    VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
    572587
    573588    /*
     
    626641 *
    627642 * @returns VBox status code.
    628  * @param   pVM             Pointer to the VM.
     643 * @param   pUVM            The user mode VM handle.
    629644 * @param   idCpu           The current CPU ID.
    630645 * @param   fFlags          The flags, DBGFPGDMP_FLAGS_XXX.
     
    637652 *                          NULL.
    638653 */
    639 VMMDECL(int) DBGFR3PagingDumpEx(PVM pVM, VMCPUID idCpu, uint32_t fFlags, uint64_t cr3, uint64_t u64FirstAddr,
     654VMMDECL(int) DBGFR3PagingDumpEx(PUVM pUVM, VMCPUID idCpu, uint32_t fFlags, uint64_t cr3, uint64_t u64FirstAddr,
    640655                                uint64_t u64LastAddr, uint32_t cMaxDepth, PCDBGFINFOHLP pHlp)
    641656{
     
    643658     * Input validation.
    644659     */
    645     VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
    646     AssertReturn(idCpu < pVM->cCpus, VERR_INVALID_CPU_ID);
     660    UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE);
     661    AssertReturn(idCpu < pUVM->cCpus, VERR_INVALID_CPU_ID);
    647662    AssertReturn(!(fFlags & ~DBGFPGDMP_FLAGS_VALID_MASK), VERR_INVALID_PARAMETER);
    648663    AssertReturn(fFlags & (DBGFPGDMP_FLAGS_SHADOW | DBGFPGDMP_FLAGS_GUEST), VERR_INVALID_PARAMETER);
     
    657672     * Forward the request to the target CPU.
    658673     */
    659     return VMR3ReqPriorityCallWait(pVM, idCpu, (PFNRT)dbgfR3PagingDumpEx, 8,
    660                                    pVM, idCpu, fFlags, &cr3, &u64FirstAddr, &u64LastAddr, cMaxDepth, pHlp);
    661 }
    662 
     674    return VMR3ReqPriorityCallWaitU(pUVM, idCpu, (PFNRT)dbgfR3PagingDumpEx, 8,
     675                                    pUVM, idCpu, fFlags, &cr3, &u64FirstAddr, &u64LastAddr, cMaxDepth, pHlp);
     676}
     677
  • trunk/src/VBox/VMM/VMMR3/DBGFOS.cpp

    r44340 r44399  
    55
    66/*
    7  * Copyright (C) 2008 Oracle Corporation
     7 * Copyright (C) 2008-2013 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    2424#include <VBox/vmm/mm.h>
    2525#include "DBGFInternal.h"
    26 #include <VBox/vmm/vm.h>
     26#include <VBox/vmm/uvm.h>
    2727#include <VBox/err.h>
    2828#include <VBox/log.h>
     
    3636*   Defined Constants And Macros                                               *
    3737*******************************************************************************/
    38 #define DBGF_OS_READ_LOCK(pVM)      do { } while (0)
    39 #define DBGF_OS_READ_UNLOCK(pVM)    do { } while (0)
    40 
    41 #define DBGF_OS_WRITE_LOCK(pVM)     do { } while (0)
    42 #define DBGF_OS_WRITE_UNLOCK(pVM)   do { } while (0)
     38#define DBGF_OS_READ_LOCK(pUVM)      do { } while (0)
     39#define DBGF_OS_READ_UNLOCK(pUVM)    do { } while (0)
     40
     41#define DBGF_OS_WRITE_LOCK(pUVM)     do { } while (0)
     42#define DBGF_OS_WRITE_UNLOCK(pUVM)   do { } while (0)
    4343
    4444
     
    4646 * Internal cleanup routine called by DBGFR3Term().
    4747 *
    48  * @param   pVM     Pointer to the VM.
    49  */
    50 void dbgfR3OSTerm(PVM pVM)
     48 * @param   pUVM    The user mode VM handle.
     49 */
     50void dbgfR3OSTerm(PUVM pUVM)
    5151{
    5252    /*
    5353     * Terminate the current one.
    5454     */
    55     if (pVM->dbgf.s.pCurOS)
    56     {
    57         pVM->dbgf.s.pCurOS->pReg->pfnTerm(pVM, pVM->dbgf.s.pCurOS->abData);
    58         pVM->dbgf.s.pCurOS = NULL;
     55    if (pUVM->dbgf.s.pCurOS)
     56    {
     57        pUVM->dbgf.s.pCurOS->pReg->pfnTerm(pUVM, pUVM->dbgf.s.pCurOS->abData);
     58        pUVM->dbgf.s.pCurOS = NULL;
    5959    }
    6060
     
    6262     * Destroy all the instances.
    6363     */
    64     while (pVM->dbgf.s.pOSHead)
    65     {
    66         PDBGFOS pOS = pVM->dbgf.s.pOSHead;
    67         pVM->dbgf.s.pOSHead = pOS->pNext;
     64    while (pUVM->dbgf.s.pOSHead)
     65    {
     66        PDBGFOS pOS = pUVM->dbgf.s.pOSHead;
     67        pUVM->dbgf.s.pOSHead = pOS->pNext;
    6868        if (pOS->pReg->pfnDestruct)
    69             pOS->pReg->pfnDestruct(pVM, pOS->abData);
     69            pOS->pReg->pfnDestruct(pUVM, pOS->abData);
    7070        MMR3HeapFree(pOS);
    7171    }
     
    7777 *
    7878 * @returns VBox status code.
    79  * @param   pVM     Pointer to the VM.
     79 * @param   pUVM    The user mode VM handle.
    8080 * @param   pReg    The registration structure.
    8181 */
    82 static DECLCALLBACK(int) dbgfR3OSRegister(PVM pVM, PDBGFOSREG pReg)
     82static DECLCALLBACK(int) dbgfR3OSRegister(PUVM pUVM, PDBGFOSREG pReg)
    8383{
    8484    /* more validations. */
    85     DBGF_OS_READ_LOCK(pVM);
     85    DBGF_OS_READ_LOCK(pUVM);
    8686    PDBGFOS pOS;
    87     for (pOS = pVM->dbgf.s.pOSHead; pOS; pOS = pOS->pNext)
     87    for (pOS = pUVM->dbgf.s.pOSHead; pOS; pOS = pOS->pNext)
    8888        if (!strcmp(pOS->pReg->szName, pReg->szName))
    8989        {
    90             DBGF_OS_READ_UNLOCK(pVM);
     90            DBGF_OS_READ_UNLOCK(pUVM);
    9191            Log(("dbgfR3OSRegister: %s -> VERR_ALREADY_LOADED\n", pReg->szName));
    9292            return VERR_ALREADY_LOADED;
     
    9696     * Allocate a new structure, call the constructor and link it into the list.
    9797     */
    98     pOS = (PDBGFOS)MMR3HeapAllocZ(pVM, MM_TAG_DBGF_OS, RT_OFFSETOF(DBGFOS, abData[pReg->cbData]));
     98    pOS = (PDBGFOS)MMR3HeapAllocZU(pUVM, MM_TAG_DBGF_OS, RT_OFFSETOF(DBGFOS, abData[pReg->cbData]));
    9999    AssertReturn(pOS, VERR_NO_MEMORY);
    100100    pOS->pReg = pReg;
    101101
    102     int rc = pOS->pReg->pfnConstruct(pVM, pOS->abData);
     102    int rc = pOS->pReg->pfnConstruct(pUVM, pOS->abData);
    103103    if (RT_SUCCESS(rc))
    104104    {
    105         DBGF_OS_WRITE_LOCK(pVM);
    106         pOS->pNext = pVM->dbgf.s.pOSHead;
    107         pVM->dbgf.s.pOSHead = pOS;
    108         DBGF_OS_WRITE_UNLOCK(pVM);
     105        DBGF_OS_WRITE_LOCK(pUVM);
     106        pOS->pNext = pUVM->dbgf.s.pOSHead;
     107        pUVM->dbgf.s.pOSHead = pOS;
     108        DBGF_OS_WRITE_UNLOCK(pUVM);
    109109    }
    110110    else
    111111    {
    112112        if (pOS->pReg->pfnDestruct)
    113             pOS->pReg->pfnDestruct(pVM, pOS->abData);
     113            pOS->pReg->pfnDestruct(pUVM, pOS->abData);
    114114        MMR3HeapFree(pOS);
    115115    }
     
    126126 *
    127127 * @returns VBox status code.
    128  * @param   pVM     Pointer to the VM.
     128 * @param   pUVM    The user mode VM handle.
    129129 * @param   pReg    The registration structure.
    130130 * @thread  Any.
    131131 */
    132 VMMR3DECL(int) DBGFR3OSRegister(PVM pVM, PCDBGFOSREG pReg)
     132VMMR3DECL(int) DBGFR3OSRegister(PUVM pUVM, PCDBGFOSREG pReg)
    133133{
    134134    /*
    135135     * Validate intput.
    136136     */
    137     VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
     137    UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE);
    138138
    139139    AssertPtrReturn(pReg, VERR_INVALID_POINTER);
     
    156156     * Pass it on to EMT(0).
    157157     */
    158     return VMR3ReqPriorityCallWait(pVM, 0 /*idDstCpu*/, (PFNRT)dbgfR3OSRegister, 2, pVM, pReg);
     158    return VMR3ReqPriorityCallWaitU(pUVM, 0 /*idDstCpu*/, (PFNRT)dbgfR3OSRegister, 2, pUVM, pReg);
    159159}
    160160
     
    164164 *
    165165 * @returns VBox status code.
    166  * @param   pVM     Pointer to the VM.
     166 * @param   pUVM    The user mode VM handle.
    167167 * @param   pReg    The registration structure.
    168168 */
    169 static DECLCALLBACK(int) dbgfR3OSDeregister(PVM pVM, PDBGFOSREG pReg)
     169static DECLCALLBACK(int) dbgfR3OSDeregister(PUVM pUVM, PDBGFOSREG pReg)
    170170{
    171171    /*
     
    175175    PDBGFOS pOSPrev   = NULL;
    176176    PDBGFOS pOS;
    177     DBGF_OS_WRITE_LOCK(pVM);
    178     for (pOS = pVM->dbgf.s.pOSHead; pOS; pOSPrev = pOS, pOS = pOS->pNext)
     177    DBGF_OS_WRITE_LOCK(pUVM);
     178    for (pOS = pUVM->dbgf.s.pOSHead; pOS; pOSPrev = pOS, pOS = pOS->pNext)
    179179        if (pOS->pReg == pReg)
    180180        {
     
    182182                pOSPrev->pNext = pOS->pNext;
    183183            else
    184                 pVM->dbgf.s.pOSHead = pOS->pNext;
    185             if (pVM->dbgf.s.pCurOS == pOS)
     184                pUVM->dbgf.s.pOSHead = pOS->pNext;
     185            if (pUVM->dbgf.s.pCurOS == pOS)
    186186            {
    187                 pVM->dbgf.s.pCurOS = NULL;
     187                pUVM->dbgf.s.pCurOS = NULL;
    188188                fWasCurOS = true;
    189189            }
    190190            break;
    191191        }
    192     DBGF_OS_WRITE_UNLOCK(pVM);
     192    DBGF_OS_WRITE_UNLOCK(pUVM);
    193193    if (!pOS)
    194194    {
     
    202202     */
    203203    if (fWasCurOS)
    204         pOS->pReg->pfnTerm(pVM, pOS->abData);
     204        pOS->pReg->pfnTerm(pUVM, pOS->abData);
    205205    if (pOS->pReg->pfnDestruct)
    206         pOS->pReg->pfnDestruct(pVM, pOS->abData);
     206        pOS->pReg->pfnDestruct(pUVM, pOS->abData);
    207207    MMR3HeapFree(pOS);
    208208
     
    216216 * @returns VBox status code.
    217217 *
    218  * @param   pVM     Pointer to the VM.
     218 * @param   pUVM    The user mode VM handle.
    219219 * @param   pReg    The registration structure.
    220220 * @thread  Any.
    221221 */
    222 VMMR3DECL(int)  DBGFR3OSDeregister(PVM pVM, PCDBGFOSREG pReg)
     222VMMR3DECL(int)  DBGFR3OSDeregister(PUVM pUVM, PCDBGFOSREG pReg)
    223223{
    224224    /*
    225225     * Validate input.
    226226     */
    227     VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
     227    UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE);
    228228    AssertPtrReturn(pReg, VERR_INVALID_POINTER);
    229229    AssertReturn(pReg->u32Magic == DBGFOSREG_MAGIC, VERR_INVALID_MAGIC);
     
    231231    AssertReturn(RTStrEnd(&pReg->szName[0], sizeof(pReg->szName)), VERR_INVALID_NAME);
    232232
    233     DBGF_OS_READ_LOCK(pVM);
     233    DBGF_OS_READ_LOCK(pUVM);
    234234    PDBGFOS pOS;
    235     for (pOS = pVM->dbgf.s.pOSHead; pOS; pOS = pOS->pNext)
     235    for (pOS = pUVM->dbgf.s.pOSHead; pOS; pOS = pOS->pNext)
    236236        if (pOS->pReg == pReg)
    237237            break;
    238     DBGF_OS_READ_LOCK(pVM);
     238    DBGF_OS_READ_LOCK(pUVM);
    239239
    240240    if (!pOS)
     
    247247     * Pass it on to EMT(0).
    248248     */
    249     return VMR3ReqPriorityCallWait(pVM, 0 /*idDstCpu*/, (PFNRT)dbgfR3OSDeregister, 2, pVM, pReg);
     249    return VMR3ReqPriorityCallWaitU(pUVM, 0 /*idDstCpu*/, (PFNRT)dbgfR3OSDeregister, 2, pUVM, pReg);
    250250}
    251251
     
    258258 * @retval  VINF_DBGF_OS_NOT_DETCTED if we cannot figure it out.
    259259 *
    260  * @param   pVM         Pointer to the VM.
     260 * @param   pUVM        The user mode VM handle.
    261261 * @param   pszName     Where to store the OS name. Empty string if not detected.
    262262 * @param   cchName     Size of the buffer.
    263263 */
    264 static DECLCALLBACK(int) dbgfR3OSDetect(PVM pVM, char *pszName, size_t cchName)
     264static DECLCALLBACK(int) dbgfR3OSDetect(PUVM pUVM, char *pszName, size_t cchName)
    265265{
    266266    /*
    267267     * Cycle thru the detection routines.
    268268     */
    269     PDBGFOS const pOldOS = pVM->dbgf.s.pCurOS;
    270     pVM->dbgf.s.pCurOS = NULL;
    271 
    272     for (PDBGFOS pNewOS = pVM->dbgf.s.pOSHead; pNewOS; pNewOS = pNewOS->pNext)
    273         if (pNewOS->pReg->pfnProbe(pVM, pNewOS->abData))
     269    PDBGFOS const pOldOS = pUVM->dbgf.s.pCurOS;
     270    pUVM->dbgf.s.pCurOS = NULL;
     271
     272    for (PDBGFOS pNewOS = pUVM->dbgf.s.pOSHead; pNewOS; pNewOS = pNewOS->pNext)
     273        if (pNewOS->pReg->pfnProbe(pUVM, pNewOS->abData))
    274274        {
    275275            int rc;
    276             pVM->dbgf.s.pCurOS = pNewOS;
     276            pUVM->dbgf.s.pCurOS = pNewOS;
    277277            if (pOldOS == pNewOS)
    278                 rc = pNewOS->pReg->pfnRefresh(pVM, pNewOS->abData);
     278                rc = pNewOS->pReg->pfnRefresh(pUVM, pNewOS->abData);
    279279            else
    280280            {
    281281                if (pOldOS)
    282                     pOldOS->pReg->pfnTerm(pVM, pNewOS->abData);
    283                 rc = pNewOS->pReg->pfnInit(pVM, pNewOS->abData);
     282                    pOldOS->pReg->pfnTerm(pUVM, pNewOS->abData);
     283                rc = pNewOS->pReg->pfnInit(pUVM, pNewOS->abData);
    284284            }
    285285            if (pszName && cchName)
     
    290290    /* not found */
    291291    if (pOldOS)
    292         pOldOS->pReg->pfnTerm(pVM, pOldOS->abData);
     292        pOldOS->pReg->pfnTerm(pUVM, pOldOS->abData);
    293293    return VINF_DBGF_OS_NOT_DETCTED;
    294294}
     
    305305 * @retval  VINF_DBGF_OS_NOT_DETCTED if we cannot figure it out.
    306306 *
    307  * @param   pVM         Pointer to the VM.
     307 * @param   pUVM        The user mode VM handle.
    308308 * @param   pszName     Where to store the OS name. Empty string if not detected.
    309309 * @param   cchName     Size of the buffer.
    310310 * @thread  Any.
    311311 */
    312 VMMR3DECL(int) DBGFR3OSDetect(PVM pVM, char *pszName, size_t cchName)
     312VMMR3DECL(int) DBGFR3OSDetect(PUVM pUVM, char *pszName, size_t cchName)
    313313{
    314314    AssertPtrNullReturn(pszName, VERR_INVALID_POINTER);
    315315    if (pszName && cchName)
    316316        *pszName = '\0';
     317    UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE);
    317318
    318319    /*
    319320     * Pass it on to EMT(0).
    320321     */
    321     return VMR3ReqPriorityCallWait(pVM, 0 /*idDstCpu*/, (PFNRT)dbgfR3OSDetect, 3, pVM, pszName, cchName);
     322    return VMR3ReqPriorityCallWaitU(pUVM, 0 /*idDstCpu*/, (PFNRT)dbgfR3OSDetect, 3, pUVM, pszName, cchName);
    322323}
    323324
     
    327328 *
    328329 * @returns VBox status code.
    329  * @param   pVM             Pointer to the VM.
     330 * @param   pUVM            The user mode VM handle.
    330331 * @param   pszName         Where to store the OS name. Optional.
    331332 * @param   cchName         The size of the name buffer.
     
    333334 * @param   cchVersion      The size of the version buffer.
    334335 */
    335 static DECLCALLBACK(int) dbgfR3OSQueryNameAndVersion(PVM pVM, char *pszName, size_t cchName, char *pszVersion, size_t cchVersion)
     336static DECLCALLBACK(int) dbgfR3OSQueryNameAndVersion(PUVM pUVM, char *pszName, size_t cchName, char *pszVersion, size_t cchVersion)
    336337{
    337338    /*
    338339     * Any known OS?
    339340     */
    340     if (pVM->dbgf.s.pCurOS)
     341    if (pUVM->dbgf.s.pCurOS)
    341342    {
    342343        int rc = VINF_SUCCESS;
    343344        if (pszName && cchName)
    344345        {
    345             size_t cch = strlen(pVM->dbgf.s.pCurOS->pReg->szName);
     346            size_t cch = strlen(pUVM->dbgf.s.pCurOS->pReg->szName);
    346347            if (cchName > cch)
    347                 memcpy(pszName, pVM->dbgf.s.pCurOS->pReg->szName, cch + 1);
     348                memcpy(pszName, pUVM->dbgf.s.pCurOS->pReg->szName, cch + 1);
    348349            else
    349350            {
    350                 memcpy(pszName, pVM->dbgf.s.pCurOS->pReg->szName, cchName - 1);
     351                memcpy(pszName, pUVM->dbgf.s.pCurOS->pReg->szName, cchName - 1);
    351352                pszName[cchName - 1] = '\0';
    352353                rc = VINF_BUFFER_OVERFLOW;
     
    356357        if (pszVersion && cchVersion)
    357358        {
    358             int rc2 = pVM->dbgf.s.pCurOS->pReg->pfnQueryVersion(pVM, pVM->dbgf.s.pCurOS->abData, pszVersion, cchVersion);
     359            int rc2 = pUVM->dbgf.s.pCurOS->pReg->pfnQueryVersion(pUVM, pUVM->dbgf.s.pCurOS->abData, pszVersion, cchVersion);
    359360            if (RT_FAILURE(rc2) || rc == VINF_SUCCESS)
    360361                rc = rc2;
     
    374375 *
    375376 * @returns VBox status code.
    376  * @param   pVM             Pointer to the VM.
     377 * @param   pUVM            The user mode VM handle.
    377378 * @param   pszName         Where to store the OS name. Optional.
    378379 * @param   cchName         The size of the name buffer.
     
    381382 * @thread  Any.
    382383 */
    383 VMMR3DECL(int) DBGFR3OSQueryNameAndVersion(PVM pVM, char *pszName, size_t cchName, char *pszVersion, size_t cchVersion)
    384 {
     384VMMR3DECL(int) DBGFR3OSQueryNameAndVersion(PUVM pUVM, char *pszName, size_t cchName, char *pszVersion, size_t cchVersion)
     385{
     386    UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE);
    385387    AssertPtrNullReturn(pszName, VERR_INVALID_POINTER);
    386388    AssertPtrNullReturn(pszVersion, VERR_INVALID_POINTER);
     
    397399     * Pass it on to EMT(0).
    398400     */
    399     return VMR3ReqPriorityCallWait(pVM, 0 /*idDstCpu*/,
    400                                    (PFNRT)dbgfR3OSQueryNameAndVersion, 5, pVM, pszName, cchName, pszVersion, cchVersion);
     401    return VMR3ReqPriorityCallWaitU(pUVM, 0 /*idDstCpu*/,
     402                                   (PFNRT)dbgfR3OSQueryNameAndVersion, 5, pUVM, pszName, cchName, pszVersion, cchVersion);
    401403}
    402404
     
    405407 * EMT worker for DBGFR3OSQueryInterface.
    406408 *
    407  * @param   pVM         Pointer to the VM.
    408  * @param   enmIf       The interface identifier.
    409  * @param   ppvIf       Where to store the interface pointer on success.
    410  */
    411 static DECLCALLBACK(void) dbgfR3OSQueryInterface(PVM pVM, DBGFOSINTERFACE enmIf, void **ppvIf)
    412 {
    413     if (pVM->dbgf.s.pCurOS)
    414     {
    415         *ppvIf = pVM->dbgf.s.pCurOS->pReg->pfnQueryInterface(pVM, pVM->dbgf.s.pCurOS->abData, enmIf);
     409 * @param   pUVM            The user mode VM handle.
     410 * @param   enmIf           The interface identifier.
     411 * @param   ppvIf           Where to store the interface pointer on success.
     412 */
     413static DECLCALLBACK(void) dbgfR3OSQueryInterface(PUVM pUVM, DBGFOSINTERFACE enmIf, void **ppvIf)
     414{
     415    if (pUVM->dbgf.s.pCurOS)
     416    {
     417        *ppvIf = pUVM->dbgf.s.pCurOS->pReg->pfnQueryInterface(pUVM, pUVM->dbgf.s.pCurOS->abData, enmIf);
    416418        if (*ppvIf)
    417419        {
     
    430432 * @returns Pointer to the digger interface on success, NULL if the interfaces isn't
    431433 *          available or no active guest OS digger.
    432  * @param   pVM         Pointer to the VM.
    433  * @param   enmIf       The interface identifier.
     434 * @param   pUVM            The user mode VM handle.
     435 * @param   enmIf           The interface identifier.
    434436 * @thread  Any.
    435437 */
    436 VMMR3DECL(void *) DBGFR3OSQueryInterface(PVM pVM, DBGFOSINTERFACE enmIf)
     438VMMR3DECL(void *) DBGFR3OSQueryInterface(PUVM pUVM, DBGFOSINTERFACE enmIf)
    437439{
    438440    AssertMsgReturn(enmIf > DBGFOSINTERFACE_INVALID && enmIf < DBGFOSINTERFACE_END, ("%d\n", enmIf), NULL);
     
    442444     */
    443445    void *pvIf = NULL;
    444     VMR3ReqPriorityCallVoidWaitU(pVM->pUVM, VMCPUID_ANY, (PFNRT)dbgfR3OSQueryInterface, 3, pVM, enmIf, &pvIf);
     446    VMR3ReqPriorityCallVoidWaitU(pUVM, VMCPUID_ANY, (PFNRT)dbgfR3OSQueryInterface, 3, pUVM, enmIf, &pvIf);
    445447    return pvIf;
    446448}
  • trunk/src/VBox/VMM/VMMR3/DBGFReg.cpp

    r41803 r44399  
    2525#include <VBox/vmm/mm.h>
    2626#include <VBox/vmm/vm.h>
     27#include <VBox/vmm/uvm.h>
    2728#include <VBox/param.h>
    2829#include <VBox/err.h>
     
    3738*******************************************************************************/
    3839/** Locks the register database for writing. */
    39 #define DBGF_REG_DB_LOCK_WRITE(pVM) \
     40#define DBGF_REG_DB_LOCK_WRITE(pUVM) \
    4041    do { \
    41         int rcSem = RTSemRWRequestWrite((pVM)->dbgf.s.hRegDbLock, RT_INDEFINITE_WAIT); \
     42        int rcSem = RTSemRWRequestWrite((pUVM)->dbgf.s.hRegDbLock, RT_INDEFINITE_WAIT); \
    4243        AssertRC(rcSem); \
    4344    } while (0)
    4445
    4546/** Unlocks the register database after writing. */
    46 #define DBGF_REG_DB_UNLOCK_WRITE(pVM) \
     47#define DBGF_REG_DB_UNLOCK_WRITE(pUVM) \
    4748    do { \
    48         int rcSem = RTSemRWReleaseWrite((pVM)->dbgf.s.hRegDbLock); \
     49        int rcSem = RTSemRWReleaseWrite((pUVM)->dbgf.s.hRegDbLock); \
    4950        AssertRC(rcSem); \
    5051    } while (0)
    5152
    5253/** Locks the register database for reading. */
    53 #define DBGF_REG_DB_LOCK_READ(pVM) \
     54#define DBGF_REG_DB_LOCK_READ(pUVM) \
    5455    do { \
    55         int rcSem = RTSemRWRequestRead((pVM)->dbgf.s.hRegDbLock, RT_INDEFINITE_WAIT); \
     56        int rcSem = RTSemRWRequestRead((pUVM)->dbgf.s.hRegDbLock, RT_INDEFINITE_WAIT); \
    5657        AssertRC(rcSem); \
    5758    } while (0)
    5859
    5960/** Unlocks the register database after reading. */
    60 #define DBGF_REG_DB_UNLOCK_READ(pVM) \
     61#define DBGF_REG_DB_UNLOCK_READ(pUVM) \
    6162    do { \
    62         int rcSem = RTSemRWReleaseRead((pVM)->dbgf.s.hRegDbLock); \
     63        int rcSem = RTSemRWReleaseRead((pUVM)->dbgf.s.hRegDbLock); \
    6364        AssertRC(rcSem); \
    6465    } while (0)
     
    161162    /** The number of entries in the output array. */
    162163    size_t          cRegs;
    163     /** The current register number when enumerating the string space. */
     164    /** The current register number when enumerating the string space.
     165     * @remarks Only used by EMT(0). */
    164166    size_t          iReg;
    165167} DBGFR3REGNMQUERYALLARGS;
     
    174176typedef struct DBGFR3REGPRINTFARGS
    175177{
    176     /** Pointer to the VM. */
    177     PVM         pVM;
     178    /** The user mode VM handle. */
     179    PUVM        pUVM;
    178180    /** The target CPU. */
    179181    VMCPUID     idCpu;
     
    204206 *
    205207 * @returns VBox status code.
    206  * @param   pVM                 Pointer to the VM.
    207  */
    208 int dbgfR3RegInit(PVM pVM)
    209 {
    210     int rc = VINF_SUCCESS;
    211     if (!pVM->dbgf.s.fRegDbInitialized)
    212     {
    213         rc = RTSemRWCreate(&pVM->dbgf.s.hRegDbLock);
    214         pVM->dbgf.s.fRegDbInitialized = RT_SUCCESS(rc);
     208 * @param   pUVM                The user mode VM handle.
     209 */
     210int dbgfR3RegInit(PUVM pUVM)
     211{
     212    int  rc  = VINF_SUCCESS;
     213    if (!pUVM->dbgf.s.fRegDbInitialized)
     214    {
     215        rc = RTSemRWCreate(&pUVM->dbgf.s.hRegDbLock);
     216        pUVM->dbgf.s.fRegDbInitialized = RT_SUCCESS(rc);
    215217    }
    216218    return rc;
     
    221223 * Terminates the register database.
    222224 *
    223  * @param   pVM                 Pointer to the VM.
    224  */
    225 void dbgfR3RegTerm(PVM pVM)
    226 {
    227     RTSemRWDestroy(pVM->dbgf.s.hRegDbLock);
    228     pVM->dbgf.s.hRegDbLock = NIL_RTSEMRW;
    229     pVM->dbgf.s.fRegDbInitialized = false;
     225 * @param   pUVM                The user mode VM handle.
     226 */
     227void dbgfR3RegTerm(PUVM pUVM)
     228{
     229    RTSemRWDestroy(pUVM->dbgf.s.hRegDbLock);
     230    pUVM->dbgf.s.hRegDbLock = NIL_RTSEMRW;
     231    pUVM->dbgf.s.fRegDbInitialized = false;
    230232}
    231233
     
    262264 *
    263265 * @returns VBox status code.
    264  * @param   pVM                 Pointer to the VM.
     266 * @param   pUVM                The user mode VM handle.
    265267 * @param   paRegisters         The register descriptors.
    266268 * @param   enmType             The set type.
     
    270272 *                              pszPrefix when creating the set name.
    271273 */
    272 static int dbgfR3RegRegisterCommon(PVM pVM, PCDBGFREGDESC paRegisters, DBGFREGSETTYPE enmType, void *pvUserArg,
     274static int dbgfR3RegRegisterCommon(PUVM pUVM, PCDBGFREGDESC paRegisters, DBGFREGSETTYPE enmType, void *pvUserArg,
    273275                                   const char *pszPrefix, uint32_t iInstance)
    274276{
     
    338340
    339341    /* Check the instance number of the CPUs. */
    340     AssertReturn(enmType != DBGFREGSETTYPE_CPU || iInstance < pVM->cCpus, VERR_INVALID_CPU_ID);
     342    AssertReturn(enmType != DBGFREGSETTYPE_CPU || iInstance < pUVM->cCpus, VERR_INVALID_CPU_ID);
    341343
    342344    /*
     
    348350    cbRegSet += cLookupRecs * sizeof(DBGFREGLOOKUP);
    349351
    350     PDBGFREGSET pRegSet = (PDBGFREGSET)MMR3HeapAllocZ(pVM, MM_TAG_DBGF_REG, cbRegSet);
     352    PDBGFREGSET pRegSet = (PDBGFREGSET)MMR3HeapAllocZU(pUVM, MM_TAG_DBGF_REG, cbRegSet);
    351353    if (!pRegSet)
    352354        return VERR_NO_MEMORY;
     
    382384    {
    383385        strcpy(pszReg, paRegisters[iDesc].pszName);
    384         pLookupRec->Core.pszString = MMR3HeapStrDup(pVM, MM_TAG_DBGF_REG, szName);
     386        pLookupRec->Core.pszString = MMR3HeapStrDupU(pUVM, MM_TAG_DBGF_REG, szName);
    385387        if (!pLookupRec->Core.pszString)
    386388            rc = VERR_NO_STR_MEMORY;
     
    411413                {
    412414                    strcpy(pszSub, paSubFields[iSubField].pszName);
    413                     pLookupRec->Core.pszString = MMR3HeapStrDup(pVM, MM_TAG_DBGF_REG, szName);
     415                    pLookupRec->Core.pszString = MMR3HeapStrDupU(pUVM, MM_TAG_DBGF_REG, szName);
    414416                    if (!pLookupRec->Core.pszString)
    415417                        rc = VERR_NO_STR_MEMORY;
     
    432434            /* The alias record. */
    433435            strcpy(pszReg, pszRegName);
    434             pLookupRec->Core.pszString = MMR3HeapStrDup(pVM, MM_TAG_DBGF_REG, szName);
     436            pLookupRec->Core.pszString = MMR3HeapStrDupU(pUVM, MM_TAG_DBGF_REG, szName);
    435437            if (!pLookupRec->Core.pszString)
    436438                rc = VERR_NO_STR_MEMORY;
     
    450452         * the CPU register set cache.
    451453         */
    452         DBGF_REG_DB_LOCK_WRITE(pVM);
    453 
    454         bool fInserted = RTStrSpaceInsert(&pVM->dbgf.s.RegSetSpace, &pRegSet->Core);
     454        DBGF_REG_DB_LOCK_WRITE(pUVM);
     455
     456        bool fInserted = RTStrSpaceInsert(&pUVM->dbgf.s.RegSetSpace, &pRegSet->Core);
    455457        if (fInserted)
    456458        {
    457             pVM->dbgf.s.cRegs += pRegSet->cDescs;
     459            pUVM->dbgf.s.cRegs += pRegSet->cDescs;
    458460            if (enmType == DBGFREGSETTYPE_CPU)
    459461            {
    460462                if (pRegSet->cDescs > DBGFREG_ALL_COUNT)
    461                     pVM->dbgf.s.cRegs -= pRegSet->cDescs - DBGFREG_ALL_COUNT;
     463                    pUVM->dbgf.s.cRegs -= pRegSet->cDescs - DBGFREG_ALL_COUNT;
    462464                if (!strcmp(pszPrefix, "cpu"))
    463                     pVM->aCpus[iInstance].dbgf.s.pGuestRegSet = pRegSet;
     465                    pUVM->aCpus[iInstance].dbgf.s.pGuestRegSet = pRegSet;
    464466                else
    465                     pVM->aCpus[iInstance].dbgf.s.pHyperRegSet = pRegSet;
     467                    pUVM->aCpus[iInstance].dbgf.s.pHyperRegSet = pRegSet;
    466468            }
    467469
     
    470472            while (iLookupRec-- > 0)
    471473            {
    472                 bool fInserted2 = RTStrSpaceInsert(&pVM->dbgf.s.RegSpace, &paLookupRecs[iLookupRec].Core);
     474                bool fInserted2 = RTStrSpaceInsert(&pUVM->dbgf.s.RegSpace, &paLookupRecs[iLookupRec].Core);
    473475                AssertMsg(fInserted2, ("'%s'", paLookupRecs[iLookupRec].Core.pszString)); NOREF(fInserted2);
    474476            }
    475477
    476             DBGF_REG_DB_UNLOCK_WRITE(pVM);
     478            DBGF_REG_DB_UNLOCK_WRITE(pUVM);
    477479            return VINF_SUCCESS;
    478480        }
    479481
    480         DBGF_REG_DB_UNLOCK_WRITE(pVM);
     482        DBGF_REG_DB_UNLOCK_WRITE(pUVM);
    481483        rc = VERR_DUPLICATE;
    482484    }
     
    505507VMMR3_INT_DECL(int) DBGFR3RegRegisterCpu(PVM pVM, PVMCPU pVCpu, PCDBGFREGDESC paRegisters, bool fGuestRegs)
    506508{
    507     if (!pVM->dbgf.s.fRegDbInitialized)
    508     {
    509         int rc = dbgfR3RegInit(pVM);
     509    PUVM pUVM = pVM->pUVM;
     510    if (!pUVM->dbgf.s.fRegDbInitialized)
     511    {
     512        int rc = dbgfR3RegInit(pUVM);
    510513        if (RT_FAILURE(rc))
    511514            return rc;
    512515    }
    513516
    514     return dbgfR3RegRegisterCommon(pVM, paRegisters, DBGFREGSETTYPE_CPU, pVCpu, fGuestRegs ? "cpu" : "hypercpu", pVCpu->idCpu);
     517    return dbgfR3RegRegisterCommon(pUVM, paRegisters, DBGFREGSETTYPE_CPU, pVCpu,
     518                                   fGuestRegs ? "cpu" : "hypercpu", pVCpu->idCpu);
    515519}
    516520
     
    525529 *                              the standard name.
    526530 */
    527 VMMR3DECL(int) DBGFR3RegRegisterDevice(PVM pVM, PCDBGFREGDESC paRegisters, PPDMDEVINS pDevIns, const char *pszPrefix, uint32_t iInstance)
    528 {
    529     VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
     531VMMR3_INT_DECL(int) DBGFR3RegRegisterDevice(PVM pVM, PCDBGFREGDESC paRegisters, PPDMDEVINS pDevIns, const char *pszPrefix,
     532                                            uint32_t iInstance)
     533{
    530534    AssertPtrReturn(paRegisters, VERR_INVALID_POINTER);
    531535    AssertPtrReturn(pDevIns, VERR_INVALID_POINTER);
    532536    AssertPtrReturn(pszPrefix, VERR_INVALID_POINTER);
    533537
    534     return dbgfR3RegRegisterCommon(pVM, paRegisters, DBGFREGSETTYPE_DEVICE, pDevIns, pszPrefix, iInstance);
     538    return dbgfR3RegRegisterCommon(pVM->pUVM, paRegisters, DBGFREGSETTYPE_DEVICE, pDevIns, pszPrefix, iInstance);
    535539}
    536540
     
    782786 * @retval  VINF_DBGF_ZERO_EXTENDED_REGISTER
    783787 *
    784  * @param   pVM                 Pointer to the VM.
     788 * @param   pUVM                The user mode VM handle.
    785789 * @param   idCpu               The virtual CPU ID.
    786790 * @param   enmReg              The register to query.
     
    790794 * @param   pValue              Where to return the register value.
    791795 */
    792 static DECLCALLBACK(int) dbgfR3RegCpuQueryWorkerOnCpu(PVM pVM, VMCPUID idCpu, DBGFREG enmReg, DBGFREGVALTYPE enmType,
     796static DECLCALLBACK(int) dbgfR3RegCpuQueryWorkerOnCpu(PUVM pUVM, VMCPUID idCpu, DBGFREG enmReg, DBGFREGVALTYPE enmType,
    793797                                                      bool fGuestRegs, PDBGFREGVAL pValue)
    794798{
    795799    int rc = VINF_SUCCESS;
    796     DBGF_REG_DB_LOCK_READ(pVM);
     800    DBGF_REG_DB_LOCK_READ(pUVM);
    797801
    798802    /*
     
    800804     */
    801805    PDBGFREGSET pSet = fGuestRegs
    802                      ? pVM->aCpus[idCpu].dbgf.s.pGuestRegSet
    803                      : pVM->aCpus[idCpu].dbgf.s.pHyperRegSet;
     806                     ? pUVM->aCpus[idCpu].dbgf.s.pGuestRegSet
     807                     : pUVM->aCpus[idCpu].dbgf.s.pHyperRegSet;
    804808    if (RT_LIKELY(pSet))
    805809    {
     
    831835        rc = VERR_INVALID_CPU_ID;
    832836
    833     DBGF_REG_DB_UNLOCK_READ(pVM);
     837    DBGF_REG_DB_UNLOCK_READ(pUVM);
    834838    return rc;
    835839}
     
    848852 * @retval  VINF_DBGF_ZERO_EXTENDED_REGISTER
    849853 *
    850  * @param   pVM                 Pointer to the VM.
     854 * @param   pUVM                The user mode VM handle.
    851855 * @param   idCpu               The virtual CPU ID.  Can be OR'ed with
    852856 *                              DBGFREG_HYPER_VMCPUID.
     
    855859 * @param   pValue              Where to return the register value.
    856860 */
    857 static int dbgfR3RegCpuQueryWorker(PVM pVM, VMCPUID idCpu, DBGFREG enmReg, DBGFREGVALTYPE enmType, PDBGFREGVAL pValue)
    858 {
    859     VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
     861static int dbgfR3RegCpuQueryWorker(PUVM pUVM, VMCPUID idCpu, DBGFREG enmReg, DBGFREGVALTYPE enmType, PDBGFREGVAL pValue)
     862{
     863    UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE);
     864    VM_ASSERT_VALID_EXT_RETURN(pUVM->pVM, VERR_INVALID_VM_HANDLE);
    860865    AssertMsgReturn(enmReg >= DBGFREG_AL && enmReg <= DBGFREG_END, ("%d\n", enmReg), VERR_INVALID_PARAMETER);
    861866
    862867    bool const fGuestRegs = !(idCpu & DBGFREG_HYPER_VMCPUID);
    863868    idCpu &= ~DBGFREG_HYPER_VMCPUID;
    864     AssertReturn(idCpu < pVM->cCpus, VERR_INVALID_CPU_ID);
    865 
    866     return VMR3ReqPriorityCallWait(pVM, idCpu, (PFNRT)dbgfR3RegCpuQueryWorkerOnCpu, 6,
    867                                    pVM, idCpu, enmReg, enmType, fGuestRegs, pValue);
     869    AssertReturn(idCpu < pUVM->cCpus, VERR_INVALID_CPU_ID);
     870
     871    return VMR3ReqPriorityCallWaitU(pUVM, idCpu, (PFNRT)dbgfR3RegCpuQueryWorkerOnCpu, 6,
     872                                    pUVM, idCpu, enmReg, enmType, fGuestRegs, pValue);
    868873}
    869874
     
    879884 * @retval  VINF_DBGF_TRUNCATED_REGISTER
    880885 *
    881  * @param   pVM                 Pointer to the VM.
     886 * @param   pUVM                The user mode VM handle.
    882887 * @param   idCpu               The target CPU ID. Can be OR'ed with
    883888 *                              DBGFREG_HYPER_VMCPUID.
     
    885890 * @param   pu8                 Where to store the register value.
    886891 */
    887 VMMR3DECL(int) DBGFR3RegCpuQueryU8(PVM pVM, VMCPUID idCpu, DBGFREG enmReg, uint8_t *pu8)
     892VMMR3DECL(int) DBGFR3RegCpuQueryU8(PUVM pUVM, VMCPUID idCpu, DBGFREG enmReg, uint8_t *pu8)
    888893{
    889894    DBGFREGVAL Value;
    890     int rc = dbgfR3RegCpuQueryWorker(pVM, idCpu, enmReg, DBGFREGVALTYPE_U8, &Value);
     895    int rc = dbgfR3RegCpuQueryWorker(pUVM, idCpu, enmReg, DBGFREGVALTYPE_U8, &Value);
    891896    if (RT_SUCCESS(rc))
    892897        *pu8 = Value.u8;
     
    908913 * @retval  VINF_DBGF_ZERO_EXTENDED_REGISTER
    909914 *
    910  * @param   pVM                 Pointer to the VM.
     915 * @param   pUVM                The user mode VM handle.
    911916 * @param   idCpu               The target CPU ID.  Can be OR'ed with
    912917 *                              DBGFREG_HYPER_VMCPUID.
     
    914919 * @param   pu16                Where to store the register value.
    915920 */
    916 VMMR3DECL(int) DBGFR3RegCpuQueryU16(PVM pVM, VMCPUID idCpu, DBGFREG enmReg, uint16_t *pu16)
     921VMMR3DECL(int) DBGFR3RegCpuQueryU16(PUVM pUVM, VMCPUID idCpu, DBGFREG enmReg, uint16_t *pu16)
    917922{
    918923    DBGFREGVAL Value;
    919     int rc = dbgfR3RegCpuQueryWorker(pVM, idCpu, enmReg, DBGFREGVALTYPE_U16, &Value);
     924    int rc = dbgfR3RegCpuQueryWorker(pUVM, idCpu, enmReg, DBGFREGVALTYPE_U16, &Value);
    920925    if (RT_SUCCESS(rc))
    921926        *pu16 = Value.u16;
     
    937942 * @retval  VINF_DBGF_ZERO_EXTENDED_REGISTER
    938943 *
    939  * @param   pVM                 Pointer to the VM.
     944 * @param   pUVM                The user mode VM handle.
    940945 * @param   idCpu               The target CPU ID.  Can be OR'ed with
    941946 *                              DBGFREG_HYPER_VMCPUID.
     
    943948 * @param   pu32                Where to store the register value.
    944949 */
    945 VMMR3DECL(int) DBGFR3RegCpuQueryU32(PVM pVM, VMCPUID idCpu, DBGFREG enmReg, uint32_t *pu32)
     950VMMR3DECL(int) DBGFR3RegCpuQueryU32(PUVM pUVM, VMCPUID idCpu, DBGFREG enmReg, uint32_t *pu32)
    946951{
    947952    DBGFREGVAL Value;
    948     int rc = dbgfR3RegCpuQueryWorker(pVM, idCpu, enmReg, DBGFREGVALTYPE_U32, &Value);
     953    int rc = dbgfR3RegCpuQueryWorker(pUVM, idCpu, enmReg, DBGFREGVALTYPE_U32, &Value);
    949954    if (RT_SUCCESS(rc))
    950955        *pu32 = Value.u32;
     
    966971 * @retval  VINF_DBGF_ZERO_EXTENDED_REGISTER
    967972 *
    968  * @param   pVM                 Pointer to the VM.
     973 * @param   pUVM                The user mode VM handle.
    969974 * @param   idCpu               The target CPU ID.  Can be OR'ed with
    970975 *                              DBGFREG_HYPER_VMCPUID.
     
    972977 * @param   pu64                Where to store the register value.
    973978 */
    974 VMMR3DECL(int) DBGFR3RegCpuQueryU64(PVM pVM, VMCPUID idCpu, DBGFREG enmReg, uint64_t *pu64)
     979VMMR3DECL(int) DBGFR3RegCpuQueryU64(PUVM pUVM, VMCPUID idCpu, DBGFREG enmReg, uint64_t *pu64)
    975980{
    976981    DBGFREGVAL Value;
    977     int rc = dbgfR3RegCpuQueryWorker(pVM, idCpu, enmReg, DBGFREGVALTYPE_U64, &Value);
     982    int rc = dbgfR3RegCpuQueryWorker(pUVM, idCpu, enmReg, DBGFREGVALTYPE_U64, &Value);
    978983    if (RT_SUCCESS(rc))
    979984        *pu64 = Value.u64;
     
    10081013
    10091014
    1010 static DECLCALLBACK(int) dbgfR3RegCpuQueryBatchWorker(PVM pVM, VMCPUID idCpu, PDBGFREGENTRY paRegs, size_t cRegs)
     1015static DECLCALLBACK(int) dbgfR3RegCpuQueryBatchWorker(PUVM pUVM, VMCPUID idCpu, PDBGFREGENTRY paRegs, size_t cRegs)
    10111016{
    10121017#if 0
    1013     PVMCPU    pVCpu = &pVM->aCpus[idCpu];
     1018    PVMCPU    pVCpu = &pUVM->pVM->aCpus[idCpu];
    10141019    PCCPUMCTX pCtx  = CPUMQueryGuestCtxPtr(pVCpu);
    10151020
     
    10711076 * @retval  VERR_DBGF_REGISTER_NOT_FOUND
    10721077 *
    1073  * @param   pVM                 Pointer to the VM.
     1078 * @param   pUVM                The user mode VM handle.
    10741079 * @param   idCpu               The target CPU ID.  Can be OR'ed with
    10751080 *                              DBGFREG_HYPER_VMCPUID.
     
    10811086 * @param   cRegs               The number of entries in @a paRegs.
    10821087 */
    1083 VMMR3DECL(int) DBGFR3RegCpuQueryBatch(PVM pVM, VMCPUID idCpu, PDBGFREGENTRY paRegs, size_t cRegs)
    1084 {
    1085     VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
    1086     AssertReturn(idCpu < pVM->cCpus, VERR_INVALID_CPU_ID);
     1088VMMR3DECL(int) DBGFR3RegCpuQueryBatch(PUVM pUVM, VMCPUID idCpu, PDBGFREGENTRY paRegs, size_t cRegs)
     1089{
     1090    UVM_ASSERT_VALID_EXT_RETURN(pUVM, NULL);
     1091    VM_ASSERT_VALID_EXT_RETURN(pUVM->pVM, NULL);
     1092    AssertReturn(idCpu < pUVM->cCpus, VERR_INVALID_CPU_ID);
    10871093    if (!cRegs)
    10881094        return VINF_SUCCESS;
     
    10961102    }
    10971103
    1098     return VMR3ReqCallWait(pVM, idCpu, (PFNRT)dbgfR3RegCpuQueryBatchWorker, 4, pVM, idCpu, paRegs, cRegs);
     1104    return VMR3ReqCallWaitU(pUVM, idCpu, (PFNRT)dbgfR3RegCpuQueryBatchWorker, 4, pUVM, idCpu, paRegs, cRegs);
    10991105}
    11001106
     
    11071113 * @retval  VERR_INVALID_CPU_ID
    11081114 *
    1109  * @param   pVM                 Pointer to the VM.
     1115 * @param   pUVM                The user mode VM handle.
    11101116 * @param   idCpu               The target CPU ID.  Can be OR'ed with
    11111117 *                              DBGFREG_HYPER_VMCPUID.
     
    11181124 *                              recommended value is DBGFREG_ALL_COUNT.
    11191125 */
    1120 VMMR3DECL(int) DBGFR3RegCpuQueryAll(PVM pVM, VMCPUID idCpu, PDBGFREGENTRY paRegs, size_t cRegs)
     1126VMMR3DECL(int) DBGFR3RegCpuQueryAll(PUVM pUVM, VMCPUID idCpu, PDBGFREGENTRY paRegs, size_t cRegs)
    11211127{
    11221128    /*
    11231129     * Validate input.
    11241130     */
    1125     VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
    1126     AssertReturn(idCpu < pVM->cCpus, VERR_INVALID_CPU_ID);
     1131    UVM_ASSERT_VALID_EXT_RETURN(pUVM, NULL);
     1132    VM_ASSERT_VALID_EXT_RETURN(pUVM->pVM, NULL);
     1133    AssertReturn(idCpu < pUVM->cCpus, VERR_INVALID_CPU_ID);
    11271134    if (!cRegs)
    11281135        return VINF_SUCCESS;
     
    11421149        paRegs[iReg++].enmReg = DBGFREG_END;
    11431150
    1144     return VMR3ReqCallWait(pVM, idCpu, (PFNRT)dbgfR3RegCpuQueryBatchWorker, 4, pVM, idCpu, paRegs, cRegs);
     1151    return VMR3ReqCallWaitU(pUVM, idCpu, (PFNRT)dbgfR3RegCpuQueryBatchWorker, 4, pUVM, idCpu, paRegs, cRegs);
    11451152}
    11461153
     
    11531160 *          parameters are invalid.
    11541161 *
    1155  * @param   pVM                 Pointer to the VM.
     1162 * @param   pUVM                The user mode VM handle.
    11561163 * @param   enmReg              The register identifier.
    11571164 * @param   enmType             The register type.  This is for sort out
     
    11591166 *                              the standard name.
    11601167 */
    1161 VMMR3DECL(const char *) DBGFR3RegCpuName(PVM pVM, DBGFREG enmReg, DBGFREGVALTYPE enmType)
     1168VMMR3DECL(const char *) DBGFR3RegCpuName(PUVM pUVM, DBGFREG enmReg, DBGFREGVALTYPE enmType)
    11621169{
    11631170    AssertReturn(enmReg >= DBGFREG_AL && enmReg < DBGFREG_END, NULL);
    11641171    AssertReturn(enmType >= DBGFREGVALTYPE_INVALID && enmType < DBGFREGVALTYPE_END, NULL);
    1165     VM_ASSERT_VALID_EXT_RETURN(pVM, NULL);
    1166 
    1167     PCDBGFREGSET    pSet    = pVM->aCpus[0].dbgf.s.pGuestRegSet;
     1172    UVM_ASSERT_VALID_EXT_RETURN(pUVM, NULL);
     1173    VM_ASSERT_VALID_EXT_RETURN(pUVM->pVM, NULL);
     1174
     1175    PCDBGFREGSET    pSet    = pUVM->aCpus[0].dbgf.s.pGuestRegSet;
    11681176    if (RT_UNLIKELY(!pSet))
    11691177        return NULL;
     
    12211229 *
    12221230 * @returns Lookup record.
    1223  * @param   pVM                 Pointer to the VM.
     1231 * @param   pUVM                The user mode VM handle.
    12241232 * @param   idDefCpu            The default CPU ID set.
    12251233 * @param   pszReg              The register name.
     
    12271235 *                              hypervisor CPU registers if clear.
    12281236 */
    1229 static PCDBGFREGLOOKUP dbgfR3RegResolve(PVM pVM, VMCPUID idDefCpu, const char *pszReg, bool fGuestRegs)
    1230 {
    1231     DBGF_REG_DB_LOCK_READ(pVM);
     1237static PCDBGFREGLOOKUP dbgfR3RegResolve(PUVM pUVM, VMCPUID idDefCpu, const char *pszReg, bool fGuestRegs)
     1238{
     1239    DBGF_REG_DB_LOCK_READ(pUVM);
    12321240
    12331241    /* Try looking up the name without any case folding or cpu prefixing. */
    1234     PCDBGFREGLOOKUP pLookupRec = (PCDBGFREGLOOKUP)RTStrSpaceGet(&pVM->dbgf.s.RegSpace, pszReg);
     1242    PRTSTRSPACE pRegSpace = &pUVM->dbgf.s.RegSpace;
     1243    PCDBGFREGLOOKUP pLookupRec = (PCDBGFREGLOOKUP)RTStrSpaceGet(pRegSpace, pszReg);
    12351244    if (!pLookupRec)
    12361245    {
     
    12401249        ssize_t cchFolded = dbgfR3RegCopyToLower(pszReg, RTSTR_MAX, szName, sizeof(szName) - DBGF_REG_MAX_NAME);
    12411250        if (cchFolded > 0)
    1242             pLookupRec = (PCDBGFREGLOOKUP)RTStrSpaceGet(&pVM->dbgf.s.RegSpace, szName);
     1251            pLookupRec = (PCDBGFREGLOOKUP)RTStrSpaceGet(pRegSpace, szName);
    12431252        if (   !pLookupRec
    12441253            && cchFolded >= 0
     
    12481257            size_t cchCpuSet = RTStrPrintf(szName, sizeof(szName), fGuestRegs ? "cpu%u." : "hypercpu%u.", idDefCpu);
    12491258            dbgfR3RegCopyToLower(pszReg, RTSTR_MAX, &szName[cchCpuSet], sizeof(szName) - cchCpuSet);
    1250             pLookupRec = (PCDBGFREGLOOKUP)RTStrSpaceGet(&pVM->dbgf.s.RegSpace, szName);
     1259            pLookupRec = (PCDBGFREGLOOKUP)RTStrSpaceGet(pRegSpace, szName);
    12511260        }
    12521261    }
    12531262
    1254     DBGF_REG_DB_UNLOCK_READ(pVM);
     1263    DBGF_REG_DB_UNLOCK_READ(pUVM);
    12551264    return pLookupRec;
    12561265}
     
    12641273 * @retval  VERR_DBGF_REGISTER_NOT_FOUND if not found.
    12651274 *
    1266  * @param   pVM                 Pointer to the VM.
     1275 * @param   pUVM                The user mode VM handle.
    12671276 * @param   idDefCpu            The default CPU.
    12681277 * @param   pszReg              The registe name.
    12691278 */
    1270 VMMR3DECL(int) DBGFR3RegNmValidate(PVM pVM, VMCPUID idDefCpu, const char *pszReg)
     1279VMMR3DECL(int) DBGFR3RegNmValidate(PUVM pUVM, VMCPUID idDefCpu, const char *pszReg)
    12711280{
    12721281    /*
    12731282     * Validate input.
    12741283     */
    1275     VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
    1276     AssertReturn((idDefCpu & ~DBGFREG_HYPER_VMCPUID) < pVM->cCpus || idDefCpu == VMCPUID_ANY, VERR_INVALID_CPU_ID);
     1284    UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE);
     1285    VM_ASSERT_VALID_EXT_RETURN(pUVM->pVM, VERR_INVALID_VM_HANDLE);
     1286    AssertReturn((idDefCpu & ~DBGFREG_HYPER_VMCPUID) < pUVM->cCpus || idDefCpu == VMCPUID_ANY, VERR_INVALID_CPU_ID);
    12771287    AssertPtrReturn(pszReg, VERR_INVALID_POINTER);
    12781288
     
    12811291     */
    12821292    bool const fGuestRegs = !(idDefCpu & DBGFREG_HYPER_VMCPUID) && idDefCpu != VMCPUID_ANY;
    1283     PCDBGFREGLOOKUP pLookupRec = dbgfR3RegResolve(pVM, idDefCpu, pszReg, fGuestRegs);
     1293    PCDBGFREGLOOKUP pLookupRec = dbgfR3RegResolve(pUVM, idDefCpu, pszReg, fGuestRegs);
    12841294    if (!pLookupRec)
    12851295        return VERR_DBGF_REGISTER_NOT_FOUND;
     
    12941304 * @returns VBox status code.
    12951305 *
    1296  * @param   pVM                 Pointer to the VM.
     1306 * @param   pUVM                The user mode VM handle.
    12971307 * @param   pLookupRec          The register lookup record.
    12981308 * @param   enmType             The desired return type.
     
    13011311 *                              Optional.
    13021312 */
    1303 static DECLCALLBACK(int) dbgfR3RegNmQueryWorkerOnCpu(PVM pVM, PCDBGFREGLOOKUP pLookupRec, DBGFREGVALTYPE enmType,
     1313static DECLCALLBACK(int) dbgfR3RegNmQueryWorkerOnCpu(PUVM pUVM, PCDBGFREGLOOKUP pLookupRec, DBGFREGVALTYPE enmType,
    13041314                                                     PDBGFREGVAL pValue, PDBGFREGVALTYPE penmType)
    13051315{
     
    13101320    int                 rc;
    13111321
    1312     NOREF(pVM);
     1322    NOREF(pUVM);
    13131323
    13141324    /*
     
    14091419 * @retval  VINF_DBGF_ZERO_EXTENDED_REGISTER
    14101420 *
    1411  * @param   pVM                 Pointer to the VM.
     1421 * @param   pUVM                The user mode VM handle.
    14121422 * @param   idDefCpu            The virtual CPU ID for the default CPU register
    14131423 *                              set.  Can be OR'ed with DBGFREG_HYPER_VMCPUID.
     
    14181428 *                              Optional.
    14191429 */
    1420 static int dbgfR3RegNmQueryWorker(PVM pVM, VMCPUID idDefCpu, const char *pszReg, DBGFREGVALTYPE enmType,
     1430static int dbgfR3RegNmQueryWorker(PUVM pUVM, VMCPUID idDefCpu, const char *pszReg, DBGFREGVALTYPE enmType,
    14211431                                  PDBGFREGVAL pValue, PDBGFREGVALTYPE penmType)
    14221432{
     
    14241434     * Validate input.
    14251435     */
    1426     VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
    1427     AssertReturn((idDefCpu & ~DBGFREG_HYPER_VMCPUID) < pVM->cCpus || idDefCpu == VMCPUID_ANY, VERR_INVALID_CPU_ID);
     1436    UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE);
     1437    VM_ASSERT_VALID_EXT_RETURN(pUVM->pVM, VERR_INVALID_VM_HANDLE);
     1438    AssertReturn((idDefCpu & ~DBGFREG_HYPER_VMCPUID) < pUVM->cCpus || idDefCpu == VMCPUID_ANY, VERR_INVALID_CPU_ID);
    14281439    AssertPtrReturn(pszReg, VERR_INVALID_POINTER);
    14291440
     
    14351446     */
    14361447    bool const fGuestRegs = !(idDefCpu & DBGFREG_HYPER_VMCPUID) && idDefCpu != VMCPUID_ANY;
    1437     PCDBGFREGLOOKUP pLookupRec = dbgfR3RegResolve(pVM, idDefCpu, pszReg, fGuestRegs);
     1448    PCDBGFREGLOOKUP pLookupRec = dbgfR3RegResolve(pUVM, idDefCpu, pszReg, fGuestRegs);
    14381449    if (pLookupRec)
    14391450    {
     
    14421453        else if (idDefCpu != VMCPUID_ANY)
    14431454            idDefCpu &= ~DBGFREG_HYPER_VMCPUID;
    1444         return VMR3ReqPriorityCallWait(pVM, idDefCpu, (PFNRT)dbgfR3RegNmQueryWorkerOnCpu, 5, pVM, pLookupRec, enmType, pValue, penmType);
     1455        return VMR3ReqPriorityCallWaitU(pUVM, idDefCpu, (PFNRT)dbgfR3RegNmQueryWorkerOnCpu, 5,
     1456                                        pUVM, pLookupRec, enmType, pValue, penmType);
    14451457    }
    14461458    return VERR_DBGF_REGISTER_NOT_FOUND;
     
    14561468 * @retval  VERR_DBGF_REGISTER_NOT_FOUND
    14571469 *
    1458  * @param   pVM                 Pointer to the VM.
     1470 * @param   pUVM                The user mode VM handle.
    14591471 * @param   idDefCpu            The default target CPU ID, VMCPUID_ANY if not
    14601472 *                              applicable. Can be OR'ed with
     
    14661478 * @param   penmType            Where to store the register value type.
    14671479 */
    1468 VMMR3DECL(int) DBGFR3RegNmQuery(PVM pVM, VMCPUID idDefCpu, const char *pszReg, PDBGFREGVAL pValue, PDBGFREGVALTYPE penmType)
    1469 {
    1470     return dbgfR3RegNmQueryWorker(pVM, idDefCpu, pszReg, DBGFREGVALTYPE_END, pValue, penmType);
     1480VMMR3DECL(int) DBGFR3RegNmQuery(PUVM pUVM, VMCPUID idDefCpu, const char *pszReg, PDBGFREGVAL pValue, PDBGFREGVALTYPE penmType)
     1481{
     1482    return dbgfR3RegNmQueryWorker(pUVM, idDefCpu, pszReg, DBGFREGVALTYPE_END, pValue, penmType);
    14711483}
    14721484
     
    14821494 * @retval  VINF_DBGF_TRUNCATED_REGISTER
    14831495 *
    1484  * @param   pVM                 Pointer to the VM.
     1496 * @param   pUVM                The user mode VM handle.
    14851497 * @param   idDefCpu            The default target CPU ID, VMCPUID_ANY if not
    14861498 *                              applicable. Can be OR'ed with
     
    14911503 * @param   pu8                 Where to store the register value.
    14921504 */
    1493 VMMR3DECL(int) DBGFR3RegNmQueryU8(PVM pVM, VMCPUID idDefCpu, const char *pszReg, uint8_t *pu8)
     1505VMMR3DECL(int) DBGFR3RegNmQueryU8(PUVM pUVM, VMCPUID idDefCpu, const char *pszReg, uint8_t *pu8)
    14941506{
    14951507    DBGFREGVAL Value;
    1496     int rc = dbgfR3RegNmQueryWorker(pVM, idDefCpu, pszReg, DBGFREGVALTYPE_U8, &Value, NULL);
     1508    int rc = dbgfR3RegNmQueryWorker(pUVM, idDefCpu, pszReg, DBGFREGVALTYPE_U8, &Value, NULL);
    14971509    if (RT_SUCCESS(rc))
    14981510        *pu8 = Value.u8;
     
    15141526 * @retval  VINF_DBGF_ZERO_EXTENDED_REGISTER
    15151527 *
    1516  * @param   pVM                 Pointer to the VM.
     1528 * @param   pUVM                The user mode VM handle.
    15171529 * @param   idDefCpu            The default target CPU ID, VMCPUID_ANY if not
    15181530 *                              applicable.  Can be OR'ed with
     
    15231535 * @param   pu16                Where to store the register value.
    15241536 */
    1525 VMMR3DECL(int) DBGFR3RegNmQueryU16(PVM pVM, VMCPUID idDefCpu, const char *pszReg, uint16_t *pu16)
     1537VMMR3DECL(int) DBGFR3RegNmQueryU16(PUVM pUVM, VMCPUID idDefCpu, const char *pszReg, uint16_t *pu16)
    15261538{
    15271539    DBGFREGVAL Value;
    1528     int rc = dbgfR3RegNmQueryWorker(pVM, idDefCpu, pszReg, DBGFREGVALTYPE_U16, &Value, NULL);
     1540    int rc = dbgfR3RegNmQueryWorker(pUVM, idDefCpu, pszReg, DBGFREGVALTYPE_U16, &Value, NULL);
    15291541    if (RT_SUCCESS(rc))
    15301542        *pu16 = Value.u16;
     
    15461558 * @retval  VINF_DBGF_ZERO_EXTENDED_REGISTER
    15471559 *
    1548  * @param   pVM                 Pointer to the VM.
     1560 * @param   pUVM                The user mode VM handle.
    15491561 * @param   idDefCpu            The default target CPU ID, VMCPUID_ANY if not
    15501562 *                              applicable.  Can be OR'ed with
     
    15551567 * @param   pu32                Where to store the register value.
    15561568 */
    1557 VMMR3DECL(int) DBGFR3RegNmQueryU32(PVM pVM, VMCPUID idDefCpu, const char *pszReg, uint32_t *pu32)
     1569VMMR3DECL(int) DBGFR3RegNmQueryU32(PUVM pUVM, VMCPUID idDefCpu, const char *pszReg, uint32_t *pu32)
    15581570{
    15591571    DBGFREGVAL Value;
    1560     int rc = dbgfR3RegNmQueryWorker(pVM, idDefCpu, pszReg, DBGFREGVALTYPE_U32, &Value, NULL);
     1572    int rc = dbgfR3RegNmQueryWorker(pUVM, idDefCpu, pszReg, DBGFREGVALTYPE_U32, &Value, NULL);
    15611573    if (RT_SUCCESS(rc))
    15621574        *pu32 = Value.u32;
     
    15781590 * @retval  VINF_DBGF_ZERO_EXTENDED_REGISTER
    15791591 *
    1580  * @param   pVM                 Pointer to the VM.
     1592 * @param   pUVM                The user mode VM handle.
    15811593 * @param   idDefCpu            The default target CPU ID, VMCPUID_ANY if not
    15821594 *                              applicable.  Can be OR'ed with
     
    15871599 * @param   pu64                Where to store the register value.
    15881600 */
    1589 VMMR3DECL(int) DBGFR3RegNmQueryU64(PVM pVM, VMCPUID idDefCpu, const char *pszReg, uint64_t *pu64)
     1601VMMR3DECL(int) DBGFR3RegNmQueryU64(PUVM pUVM, VMCPUID idDefCpu, const char *pszReg, uint64_t *pu64)
    15901602{
    15911603    DBGFREGVAL Value;
    1592     int rc = dbgfR3RegNmQueryWorker(pVM, idDefCpu, pszReg, DBGFREGVALTYPE_U64, &Value, NULL);
     1604    int rc = dbgfR3RegNmQueryWorker(pUVM, idDefCpu, pszReg, DBGFREGVALTYPE_U64, &Value, NULL);
    15931605    if (RT_SUCCESS(rc))
    15941606        *pu64 = Value.u64;
     
    16101622 * @retval  VINF_DBGF_ZERO_EXTENDED_REGISTER
    16111623 *
    1612  * @param   pVM                 Pointer to the VM.
     1624 * @param   pUVM                The user mode VM handle.
    16131625 * @param   idDefCpu            The default target CPU ID, VMCPUID_ANY if not
    16141626 *                              applicable.  Can be OR'ed with
     
    16191631 * @param   pu128               Where to store the register value.
    16201632 */
    1621 VMMR3DECL(int) DBGFR3RegNmQueryU128(PVM pVM, VMCPUID idDefCpu, const char *pszReg, PRTUINT128U pu128)
     1633VMMR3DECL(int) DBGFR3RegNmQueryU128(PUVM pUVM, VMCPUID idDefCpu, const char *pszReg, PRTUINT128U pu128)
    16221634{
    16231635    DBGFREGVAL Value;
    1624     int rc = dbgfR3RegNmQueryWorker(pVM, idDefCpu, pszReg, DBGFREGVALTYPE_U128, &Value, NULL);
     1636    int rc = dbgfR3RegNmQueryWorker(pUVM, idDefCpu, pszReg, DBGFREGVALTYPE_U128, &Value, NULL);
    16251637    if (RT_SUCCESS(rc))
    16261638        *pu128 = Value.u128;
     
    16431655 * @retval  VINF_DBGF_ZERO_EXTENDED_REGISTER
    16441656 *
    1645  * @param   pVM                 Pointer to the VM.
     1657 * @param   pUVM                The user mode VM handle.
    16461658 * @param   idDefCpu            The default target CPU ID, VMCPUID_ANY if not
    16471659 *                              applicable.  Can be OR'ed with
     
    16521664 * @param   plrd                Where to store the register value.
    16531665 */
    1654 VMMR3DECL(int) DBGFR3RegNmQueryLrd(PVM pVM, VMCPUID idDefCpu, const char *pszReg, long double *plrd)
     1666VMMR3DECL(int) DBGFR3RegNmQueryLrd(PUVM pUVM, VMCPUID idDefCpu, const char *pszReg, long double *plrd)
    16551667{
    16561668    DBGFREGVAL Value;
    1657     int rc = dbgfR3RegNmQueryWorker(pVM, idDefCpu, pszReg, DBGFREGVALTYPE_R80, &Value, NULL);
     1669    int rc = dbgfR3RegNmQueryWorker(pUVM, idDefCpu, pszReg, DBGFREGVALTYPE_R80, &Value, NULL);
    16581670    if (RT_SUCCESS(rc))
    16591671        *plrd = Value.lrd;
     
    16761688 * @retval  VINF_DBGF_ZERO_EXTENDED_REGISTER
    16771689 *
    1678  * @param   pVM                 Pointer to the VM.
     1690 * @param   pUVM                The user mode VM handle.
    16791691 * @param   idDefCpu            The default target CPU ID, VMCPUID_ANY if not
    16801692 *                              applicable.  Can be OR'ed with
     
    16861698 * @param   pu32Limit           Where to store the register limit value.
    16871699 */
    1688 VMMR3DECL(int) DBGFR3RegNmQueryXdtr(PVM pVM, VMCPUID idDefCpu, const char *pszReg, uint64_t *pu64Base, uint32_t *pu32Limit)
     1700VMMR3DECL(int) DBGFR3RegNmQueryXdtr(PUVM pUVM, VMCPUID idDefCpu, const char *pszReg, uint64_t *pu64Base, uint32_t *pu32Limit)
    16891701{
    16901702    DBGFREGVAL Value;
    1691     int rc = dbgfR3RegNmQueryWorker(pVM, idDefCpu, pszReg, DBGFREGVALTYPE_DTR, &Value, NULL);
     1703    int rc = dbgfR3RegNmQueryWorker(pUVM, idDefCpu, pszReg, DBGFREGVALTYPE_DTR, &Value, NULL);
    16921704    if (RT_SUCCESS(rc))
    16931705    {
     
    17041716
    17051717
    1706 /// @todo VMMR3DECL(int) DBGFR3RegNmQueryBatch(PVM pVM,VMCPUID idDefCpu, DBGFREGENTRYNM paRegs, size_t cRegs);
     1718/// @todo VMMR3DECL(int) DBGFR3RegNmQueryBatch(PUVM pUVM,VMCPUID idDefCpu, DBGFREGENTRYNM paRegs, size_t cRegs);
    17071719
    17081720
     
    17111723 *
    17121724 * @returns VBox status code.
    1713  * @param   pVM                 Pointer to the VM.
     1725 * @param   pUVM                The user mode VM handle.
    17141726 * @param   pcRegs              Where to return the register count.
    17151727 */
    1716 VMMR3DECL(int) DBGFR3RegNmQueryAllCount(PVM pVM, size_t *pcRegs)
    1717 {
    1718     VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
    1719     *pcRegs = pVM->dbgf.s.cRegs;
     1728VMMR3DECL(int) DBGFR3RegNmQueryAllCount(PUVM pUVM, size_t *pcRegs)
     1729{
     1730    UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE);
     1731    *pcRegs = pUVM->dbgf.s.cRegs;
    17201732    return VINF_SUCCESS;
    17211733}
     
    18031815    PDBGFREGENTRYNM             paRegs = pArgs->paRegs;
    18041816    size_t const                cRegs  = pArgs->cRegs;
    1805 
    1806     DBGF_REG_DB_LOCK_READ(pVM);
     1817    PUVM                        pUVM   = pVM->pUVM;
     1818    PUVMCPU                     pUVCpu = pVCpu->pUVCpu;
     1819
     1820    DBGF_REG_DB_LOCK_READ(pUVM);
    18071821
    18081822    /*
     
    18101824     */
    18111825    size_t iCpuReg = pVCpu->idCpu * DBGFREG_ALL_COUNT;
    1812     if (pVCpu->dbgf.s.pGuestRegSet)
     1826    if (pUVCpu->dbgf.s.pGuestRegSet)
    18131827    {
    18141828        if (iCpuReg < cRegs)
    1815             dbgfR3RegNmQueryAllInSet(pVCpu->dbgf.s.pGuestRegSet, DBGFREG_ALL_COUNT, &paRegs[iCpuReg], cRegs - iCpuReg);
     1829            dbgfR3RegNmQueryAllInSet(pUVCpu->dbgf.s.pGuestRegSet, DBGFREG_ALL_COUNT, &paRegs[iCpuReg], cRegs - iCpuReg);
    18161830    }
    18171831    else
     
    18211835     * My hypervisor CPU registers.
    18221836     */
    1823     iCpuReg = pVM->cCpus * DBGFREG_ALL_COUNT + pVCpu->idCpu * DBGFREG_ALL_COUNT;
    1824     if (pVCpu->dbgf.s.pHyperRegSet)
     1837    iCpuReg = pUVM->cCpus * DBGFREG_ALL_COUNT + pUVCpu->idCpu * DBGFREG_ALL_COUNT;
     1838    if (pUVCpu->dbgf.s.pHyperRegSet)
    18251839    {
    18261840        if (iCpuReg < cRegs)
    1827             dbgfR3RegNmQueryAllInSet(pVCpu->dbgf.s.pHyperRegSet, DBGFREG_ALL_COUNT, &paRegs[iCpuReg], cRegs - iCpuReg);
     1841            dbgfR3RegNmQueryAllInSet(pUVCpu->dbgf.s.pHyperRegSet, DBGFREG_ALL_COUNT, &paRegs[iCpuReg], cRegs - iCpuReg);
    18281842    }
    18291843    else
     
    18331847     * The primary CPU does all the other registers.
    18341848     */
    1835     if (pVCpu->idCpu == 0)
    1836     {
    1837         pArgs->iReg = pVM->cCpus * DBGFREG_ALL_COUNT * 2;
    1838         RTStrSpaceEnumerate(&pVM->dbgf.s.RegSetSpace, dbgfR3RegNmQueryAllEnum, pArgs);
     1849    if (pUVCpu->idCpu == 0)
     1850    {
     1851        pArgs->iReg = pUVM->cCpus * DBGFREG_ALL_COUNT * 2;
     1852        RTStrSpaceEnumerate(&pUVM->dbgf.s.RegSetSpace, dbgfR3RegNmQueryAllEnum, pArgs);
    18391853        dbgfR3RegNmQueryAllPadEntries(paRegs, cRegs, pArgs->iReg, cRegs);
    18401854    }
    18411855
    1842     DBGF_REG_DB_UNLOCK_READ(pVM);
     1856    DBGF_REG_DB_UNLOCK_READ(pUVM);
    18431857    return VINF_SUCCESS; /* Ignore errors. */
    18441858}
     
    18491863 *
    18501864 * @returns VBox status code.
    1851  * @param   pVM                 Pointer to the VM.
     1865 * @param   pUVM                The user mode VM handle.
    18521866 * @param   paRegs              The output register value array.  The register
    18531867 *                              name string is read only and shall not be freed
     
    18571871 *                              DBGFR3RegNmQueryAllCount.
    18581872 */
    1859 VMMR3DECL(int) DBGFR3RegNmQueryAll(PVM pVM, PDBGFREGENTRYNM paRegs, size_t cRegs)
    1860 {
     1873VMMR3DECL(int) DBGFR3RegNmQueryAll(PUVM pUVM, PDBGFREGENTRYNM paRegs, size_t cRegs)
     1874{
     1875    UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE);
     1876    PVM pVM = pUVM->pVM;
    18611877    VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
    18621878    AssertPtrReturn(paRegs, VERR_INVALID_POINTER);
     
    18711887
    18721888
    1873 VMMR3DECL(int) DBGFR3RegNmSet(PVM pVM, VMCPUID idDefCpu, const char *pszReg, PCDBGFREGVAL pValue, DBGFREGVALTYPE enmType)
    1874 {
    1875     NOREF(pVM); NOREF(idDefCpu); NOREF(pszReg); NOREF(pValue); NOREF(enmType);
     1889VMMR3DECL(int) DBGFR3RegNmSet(PUVM pUVM, VMCPUID idDefCpu, const char *pszReg, PCDBGFREGVAL pValue, DBGFREGVALTYPE enmType)
     1890{
     1891    NOREF(pUVM); NOREF(idDefCpu); NOREF(pszReg); NOREF(pValue); NOREF(enmType);
    18761892    return VERR_NOT_IMPLEMENTED;
    18771893}
     
    19231939
    19241940
    1925 
    19261941/**
    19271942 * Format a register value, extended version.
     
    19391954 * @param   fFlags          String formatting flags, RTSTR_F_XXX.
    19401955 */
    1941 VMMDECL(ssize_t) DBGFR3RegFormatValueEx(char *pszBuf, size_t cbBuf, PCDBGFREGVAL pValue, DBGFREGVALTYPE enmType,
    1942                                         unsigned uBase, signed int cchWidth, signed int cchPrecision, uint32_t fFlags)
     1956VMMR3DECL(ssize_t) DBGFR3RegFormatValueEx(char *pszBuf, size_t cbBuf, PCDBGFREGVAL pValue, DBGFREGVALTYPE enmType,
     1957                                          unsigned uBase, signed int cchWidth, signed int cchPrecision, uint32_t fFlags)
    19431958{
    19441959    /*
     
    19761991 * @param   fSpecial        Same as RTSTR_F_SPECIAL.
    19771992 */
    1978 VMMDECL(ssize_t) DBGFR3RegFormatValue(char *pszBuf, size_t cbBuf, PCDBGFREGVAL pValue, DBGFREGVALTYPE enmType, bool fSpecial)
     1993VMMR3DECL(ssize_t) DBGFR3RegFormatValue(char *pszBuf, size_t cbBuf, PCDBGFREGVAL pValue, DBGFREGVALTYPE enmType, bool fSpecial)
    19791994{
    19801995    int cchWidth = 0;
     
    20212036    DBGFREGVAL      Value;
    20222037    DBGFREGVALTYPE  enmType;
    2023     int rc = dbgfR3RegNmQueryWorkerOnCpu(pThis->pVM, pLookupRec, DBGFREGVALTYPE_END, &Value, &enmType);
     2038    int rc = dbgfR3RegNmQueryWorkerOnCpu(pThis->pUVM, pLookupRec, DBGFREGVALTYPE_END, &Value, &enmType);
    20242039    if (RT_FAILURE(rc))
    20252040    {
     
    21142129    DBGFREGVAL      Value;
    21152130    DBGFREGVALTYPE  enmType;
    2116     int rc = dbgfR3RegNmQueryWorkerOnCpu(pThis->pVM, pLookupRec, DBGFREGVALTYPE_END, &Value, &enmType);
     2131    int rc = dbgfR3RegNmQueryWorkerOnCpu(pThis->pUVM, pLookupRec, DBGFREGVALTYPE_END, &Value, &enmType);
    21172132    if (RT_FAILURE(rc))
    21182133    {
     
    21772192     * input string termination.
    21782193     */
     2194    PRTSTRSPACE pRegSpace = &pThis->pUVM->dbgf.s.RegSpace;
    21792195    /* Try looking up the name without any case folding or cpu prefixing. */
    2180     PCDBGFREGLOOKUP pLookupRec = (PCDBGFREGLOOKUP)RTStrSpaceGetN(&pThis->pVM->dbgf.s.RegSpace, pachReg, cchReg);
     2196    PCDBGFREGLOOKUP pLookupRec = (PCDBGFREGLOOKUP)RTStrSpaceGetN(pRegSpace, pachReg, cchReg);
    21812197    if (!pLookupRec)
    21822198    {
     
    21852201        ssize_t cchFolded = dbgfR3RegCopyToLower(pachReg, cchReg, szName, sizeof(szName) - DBGF_REG_MAX_NAME);
    21862202        if (cchFolded > 0)
    2187             pLookupRec = (PCDBGFREGLOOKUP)RTStrSpaceGet(&pThis->pVM->dbgf.s.RegSpace, szName);
     2203            pLookupRec = (PCDBGFREGLOOKUP)RTStrSpaceGet(pRegSpace, szName);
    21882204        if (   !pLookupRec
    21892205            && cchFolded >= 0
     
    21932209            size_t cchCpuSet = RTStrPrintf(szName, sizeof(szName), pThis->fGuestRegs ? "cpu%u." : "hypercpu%u.", pThis->idCpu);
    21942210            dbgfR3RegCopyToLower(pachReg, cchReg, &szName[cchCpuSet], sizeof(szName) - cchCpuSet);
    2195             pLookupRec = (PCDBGFREGLOOKUP)RTStrSpaceGet(&pThis->pVM->dbgf.s.RegSpace, szName);
     2211            pLookupRec = (PCDBGFREGLOOKUP)RTStrSpaceGet(pRegSpace, szName);
    21962212        }
    21972213    }
     
    22702286static DECLCALLBACK(int) dbgfR3RegPrintfWorkerOnCpu(PDBGFR3REGPRINTFARGS pArgs)
    22712287{
    2272     DBGF_REG_DB_LOCK_READ(pArgs->pVM);
     2288    DBGF_REG_DB_LOCK_READ(pArgs->pUVM);
    22732289    RTStrFormatV(dbgfR3RegPrintfCbOutput, pArgs, dbgfR3RegPrintfCbFormat, pArgs, pArgs->pszFormat, pArgs->va);
    2274     DBGF_REG_DB_UNLOCK_READ(pArgs->pVM);
     2290    DBGF_REG_DB_UNLOCK_READ(pArgs->pUVM);
    22752291    return pArgs->rc;
    22762292}
     
    22832299 *
    22842300 * @returns VBox status code.
    2285  * @param   pVM                 Pointer to the VM.
     2301 * @param   pUVM                The user mode VM handle.
    22862302 * @param   idCpu               The CPU ID of any CPU registers that may be
    22872303 *                              printed, pass VMCPUID_ANY if not applicable.
     
    22922308 * @param   va                  Other format arguments.
    22932309 */
    2294 VMMR3DECL(int) DBGFR3RegPrintfV(PVM pVM, VMCPUID idCpu, char *pszBuf, size_t cbBuf, const char *pszFormat, va_list va)
     2310VMMR3DECL(int) DBGFR3RegPrintfV(PUVM pUVM, VMCPUID idCpu, char *pszBuf, size_t cbBuf, const char *pszFormat, va_list va)
    22952311{
    22962312    AssertPtrReturn(pszBuf, VERR_INVALID_POINTER);
     
    22982314    *pszBuf = '\0';
    22992315
    2300     VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
    2301     AssertReturn((idCpu & ~DBGFREG_HYPER_VMCPUID) < pVM->cCpus || idCpu == VMCPUID_ANY, VERR_INVALID_CPU_ID);
     2316    UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE);
     2317    AssertReturn((idCpu & ~DBGFREG_HYPER_VMCPUID) < pUVM->cCpus || idCpu == VMCPUID_ANY, VERR_INVALID_CPU_ID);
    23022318    AssertPtrReturn(pszFormat, VERR_INVALID_POINTER);
    23032319
     
    23072323     */
    23082324    DBGFR3REGPRINTFARGS Args;
    2309     Args.pVM        = pVM;
     2325    Args.pUVM       = pUVM;
    23102326    Args.idCpu      = idCpu != VMCPUID_ANY ? idCpu & ~DBGFREG_HYPER_VMCPUID : idCpu;
    23112327    Args.fGuestRegs = idCpu != VMCPUID_ANY && !(idCpu & DBGFREG_HYPER_VMCPUID);
     
    23162332    Args.cchLeftBuf = cbBuf - 1;
    23172333    Args.rc         = VINF_SUCCESS;
    2318     int rc = VMR3ReqPriorityCallWait(pVM, Args.idCpu, (PFNRT)dbgfR3RegPrintfWorkerOnCpu, 1, &Args);
     2334    int rc = VMR3ReqPriorityCallWaitU(pUVM, Args.idCpu, (PFNRT)dbgfR3RegPrintfWorkerOnCpu, 1, &Args);
    23192335    va_end(Args.va);
    23202336    return rc;
     
    23282344 *
    23292345 * @returns VBox status code.
    2330  * @param   pVM                 Pointer to the VM.
     2346 * @param   pUVM                The user mode VM handle.
    23312347 * @param   idCpu               The CPU ID of any CPU registers that may be
    23322348 *                              printed, pass VMCPUID_ANY if not applicable.
     
    23402356 * @param   ...                 Other format arguments.
    23412357 */
    2342 VMMR3DECL(int) DBGFR3RegPrintf(PVM pVM, VMCPUID idCpu, char *pszBuf, size_t cbBuf, const char *pszFormat, ...)
     2358VMMR3DECL(int) DBGFR3RegPrintf(PUVM pUVM, VMCPUID idCpu, char *pszBuf, size_t cbBuf, const char *pszFormat, ...)
    23432359{
    23442360    va_list va;
    23452361    va_start(va, pszFormat);
    2346     int rc = DBGFR3RegPrintfV(pVM, idCpu, pszBuf, cbBuf, pszFormat, va);
     2362    int rc = DBGFR3RegPrintfV(pUVM, idCpu, pszBuf, cbBuf, pszFormat, va);
    23472363    va_end(va);
    23482364    return rc;
  • trunk/src/VBox/VMM/VMMR3/DBGFStack.cpp

    r42449 r44399  
    2626#include "DBGFInternal.h"
    2727#include <VBox/vmm/vm.h>
     28#include <VBox/vmm/uvm.h>
    2829#include <VBox/err.h>
    2930#include <VBox/log.h>
     
    3839 * Read stack memory.
    3940 */
    40 DECLINLINE(int) dbgfR3Read(PVM pVM, VMCPUID idCpu, void *pvBuf, PCDBGFADDRESS pSrcAddr, size_t cb, size_t *pcbRead)
    41 {
    42     int rc = DBGFR3MemRead(pVM, idCpu, pSrcAddr, pvBuf, cb);
     41DECLINLINE(int) dbgfR3Read(PUVM pUVM, VMCPUID idCpu, void *pvBuf, PCDBGFADDRESS pSrcAddr, size_t cb, size_t *pcbRead)
     42{
     43    int rc = DBGFR3MemRead(pUVM, idCpu, pSrcAddr, pvBuf, cb);
    4344    if (RT_FAILURE(rc))
    4445    {
     
    4849        {
    4950            DBGFADDRESS Addr = *pSrcAddr;
    50             rc = DBGFR3MemRead(pVM, idCpu, DBGFR3AddrAdd(&Addr, cbRead), (uint8_t *)pvBuf + cbRead, 1);
     51            rc = DBGFR3MemRead(pUVM, idCpu, DBGFR3AddrAdd(&Addr, cbRead), (uint8_t *)pvBuf + cbRead, 1);
    5152            if (RT_FAILURE(rc))
    5253                break;
     
    7778 *       unwind tables).
    7879 */
    79 static int dbgfR3StackWalk(PVM pVM, VMCPUID idCpu, RTDBGAS hAs, PDBGFSTACKFRAME pFrame)
     80static int dbgfR3StackWalk(PUVM pUVM, VMCPUID idCpu, RTDBGAS hAs, PDBGFSTACKFRAME pFrame)
    8081{
    8182    /*
     
    136137
    137138    Assert(DBGFADDRESS_IS_VALID(&pFrame->AddrFrame));
    138     int rc = dbgfR3Read(pVM, idCpu, u.pv,
     139    int rc = dbgfR3Read(pUVM, idCpu, u.pv,
    139140                        pFrame->fFlags & DBGFSTACKFRAME_FLAGS_ALL_VALID
    140141                        ? &pFrame->AddrReturnFrame
     
    156157        if (DBGFADDRESS_IS_VALID(&pFrame->AddrPC))
    157158        {
    158             pFrame->pSymPC  = DBGFR3AsSymbolByAddrA(pVM, hAs, &pFrame->AddrPC, NULL /*offDisp*/, NULL /*phMod*/);
    159             pFrame->pLinePC = DBGFR3LineByAddrAlloc(pVM, pFrame->AddrPC.FlatPtr, NULL);
     159            pFrame->pSymPC  = DBGFR3AsSymbolByAddrA(pUVM, hAs, &pFrame->AddrPC, NULL /*offDisp*/, NULL /*phMod*/);
     160            pFrame->pLinePC = DBGFR3LineByAddrAlloc(pUVM, pFrame->AddrPC.FlatPtr, NULL);
    160161        }
    161162    }
     
    203204            }
    204205            else
    205                 DBGFR3AddrFromFlat(pVM, &pFrame->AddrReturnPC, *uRet.pu16);
     206                DBGFR3AddrFromFlat(pUVM, &pFrame->AddrReturnPC, *uRet.pu16);
    206207            break;
    207208        case DBGFRETURNTYPE_NEAR32:
     
    212213            }
    213214            else
    214                 DBGFR3AddrFromFlat(pVM, &pFrame->AddrReturnPC, *uRet.pu32);
     215                DBGFR3AddrFromFlat(pUVM, &pFrame->AddrReturnPC, *uRet.pu32);
    215216            break;
    216217        case DBGFRETURNTYPE_NEAR64:
     
    221222            }
    222223            else
    223                 DBGFR3AddrFromFlat(pVM, &pFrame->AddrReturnPC, *uRet.pu64);
     224                DBGFR3AddrFromFlat(pUVM, &pFrame->AddrReturnPC, *uRet.pu64);
    224225            break;
    225226        case DBGFRETURNTYPE_FAR16:
    226             DBGFR3AddrFromSelOff(pVM, idCpu, &pFrame->AddrReturnPC, uRet.pu16[1], uRet.pu16[0]);
     227            DBGFR3AddrFromSelOff(pUVM, idCpu, &pFrame->AddrReturnPC, uRet.pu16[1], uRet.pu16[0]);
    227228            break;
    228229        case DBGFRETURNTYPE_FAR32:
    229             DBGFR3AddrFromSelOff(pVM, idCpu, &pFrame->AddrReturnPC, uRet.pu16[2], uRet.pu32[0]);
     230            DBGFR3AddrFromSelOff(pUVM, idCpu, &pFrame->AddrReturnPC, uRet.pu16[2], uRet.pu32[0]);
    230231            break;
    231232        case DBGFRETURNTYPE_FAR64:
    232             DBGFR3AddrFromSelOff(pVM, idCpu, &pFrame->AddrReturnPC, uRet.pu16[4], uRet.pu64[0]);
     233            DBGFR3AddrFromSelOff(pUVM, idCpu, &pFrame->AddrReturnPC, uRet.pu16[4], uRet.pu64[0]);
    233234            break;
    234235        case DBGFRETURNTYPE_IRET16:
    235             DBGFR3AddrFromSelOff(pVM, idCpu, &pFrame->AddrReturnPC, uRet.pu16[1], uRet.pu16[0]);
     236            DBGFR3AddrFromSelOff(pUVM, idCpu, &pFrame->AddrReturnPC, uRet.pu16[1], uRet.pu16[0]);
    236237            break;
    237238        case DBGFRETURNTYPE_IRET32:
    238             DBGFR3AddrFromSelOff(pVM, idCpu, &pFrame->AddrReturnPC, uRet.pu16[2], uRet.pu32[0]);
     239            DBGFR3AddrFromSelOff(pUVM, idCpu, &pFrame->AddrReturnPC, uRet.pu16[2], uRet.pu32[0]);
    239240            break;
    240241        case DBGFRETURNTYPE_IRET32_PRIV:
    241             DBGFR3AddrFromSelOff(pVM, idCpu, &pFrame->AddrReturnPC, uRet.pu16[2], uRet.pu32[0]);
     242            DBGFR3AddrFromSelOff(pUVM, idCpu, &pFrame->AddrReturnPC, uRet.pu16[2], uRet.pu32[0]);
    242243            break;
    243244        case DBGFRETURNTYPE_IRET32_V86:
    244             DBGFR3AddrFromSelOff(pVM, idCpu, &pFrame->AddrReturnPC, uRet.pu16[2], uRet.pu32[0]);
     245            DBGFR3AddrFromSelOff(pUVM, idCpu, &pFrame->AddrReturnPC, uRet.pu16[2], uRet.pu32[0]);
    245246            break;
    246247        case DBGFRETURNTYPE_IRET64:
    247             DBGFR3AddrFromSelOff(pVM, idCpu, &pFrame->AddrReturnPC, uRet.pu16[4], uRet.pu64[0]);
     248            DBGFR3AddrFromSelOff(pUVM, idCpu, &pFrame->AddrReturnPC, uRet.pu16[4], uRet.pu64[0]);
    248249            break;
    249250        default:
     
    252253    }
    253254
    254     pFrame->pSymReturnPC  = DBGFR3AsSymbolByAddrA(pVM, hAs, &pFrame->AddrReturnPC, NULL /*offDisp*/, NULL /*phMod*/);
    255     pFrame->pLineReturnPC = DBGFR3LineByAddrAlloc(pVM, pFrame->AddrReturnPC.FlatPtr, NULL);
     255    pFrame->pSymReturnPC  = DBGFR3AsSymbolByAddrA(pUVM, hAs, &pFrame->AddrReturnPC, NULL /*offDisp*/, NULL /*phMod*/);
     256    pFrame->pLineReturnPC = DBGFR3LineByAddrAlloc(pUVM, pFrame->AddrReturnPC.FlatPtr, NULL);
    256257
    257258    /*
     
    278279 * Walks the entire stack allocating memory as we walk.
    279280 */
    280 static DECLCALLBACK(int) dbgfR3StackWalkCtxFull(PVM pVM, VMCPUID idCpu, PCCPUMCTXCORE pCtxCore, RTDBGAS hAs,
     281static DECLCALLBACK(int) dbgfR3StackWalkCtxFull(PUVM pUVM, VMCPUID idCpu, PCCPUMCTXCORE pCtxCore, RTDBGAS hAs,
    281282                                                DBGFCODETYPE enmCodeType,
    282283                                                PCDBGFADDRESS pAddrFrame,
     
    287288{
    288289    /* alloc first frame. */
    289     PDBGFSTACKFRAME pCur = (PDBGFSTACKFRAME)MMR3HeapAllocZ(pVM, MM_TAG_DBGF_STACK, sizeof(*pCur));
     290    PDBGFSTACKFRAME pCur = (PDBGFSTACKFRAME)MMR3HeapAllocZU(pUVM, MM_TAG_DBGF_STACK, sizeof(*pCur));
    290291    if (!pCur)
    291292        return VERR_NO_MEMORY;
     
    301302        pCur->AddrPC = *pAddrPC;
    302303    else if (enmCodeType != DBGFCODETYPE_GUEST)
    303         DBGFR3AddrFromFlat(pVM, &pCur->AddrPC, pCtxCore->rip);
     304        DBGFR3AddrFromFlat(pUVM, &pCur->AddrPC, pCtxCore->rip);
    304305    else
    305         rc = DBGFR3AddrFromSelOff(pVM, idCpu, &pCur->AddrPC, pCtxCore->cs.Sel, pCtxCore->rip);
     306        rc = DBGFR3AddrFromSelOff(pUVM, idCpu, &pCur->AddrPC, pCtxCore->cs.Sel, pCtxCore->rip);
    306307    if (RT_SUCCESS(rc))
    307308    {
     
    329330        else
    330331        {
    331             PVMCPU pVCpu = VMMGetCpuById(pVM, idCpu);
     332            PVMCPU pVCpu = VMMGetCpuById(pUVM->pVM, idCpu);
    332333            CPUMMODE CpuMode = CPUMGetGuestMode(pVCpu);
    333334            if (CpuMode == CPUMMODE_REAL)
     
    343344            pCur->AddrStack = *pAddrStack;
    344345        else if (enmCodeType != DBGFCODETYPE_GUEST)
    345             DBGFR3AddrFromFlat(pVM, &pCur->AddrStack, pCtxCore->rsp & fAddrMask);
     346            DBGFR3AddrFromFlat(pUVM, &pCur->AddrStack, pCtxCore->rsp & fAddrMask);
    346347        else
    347             rc = DBGFR3AddrFromSelOff(pVM, idCpu, &pCur->AddrStack, pCtxCore->ss.Sel, pCtxCore->rsp & fAddrMask);
     348            rc = DBGFR3AddrFromSelOff(pUVM, idCpu, &pCur->AddrStack, pCtxCore->ss.Sel, pCtxCore->rsp & fAddrMask);
    348349
    349350        if (pAddrFrame)
    350351            pCur->AddrFrame = *pAddrFrame;
    351352        else if (enmCodeType != DBGFCODETYPE_GUEST)
    352             DBGFR3AddrFromFlat(pVM, &pCur->AddrFrame, pCtxCore->rbp & fAddrMask);
     353            DBGFR3AddrFromFlat(pUVM, &pCur->AddrFrame, pCtxCore->rbp & fAddrMask);
    353354        else if (RT_SUCCESS(rc))
    354             rc = DBGFR3AddrFromSelOff(pVM, idCpu, &pCur->AddrFrame, pCtxCore->ss.Sel, pCtxCore->rbp & fAddrMask);
     355            rc = DBGFR3AddrFromSelOff(pUVM, idCpu, &pCur->AddrFrame, pCtxCore->ss.Sel, pCtxCore->rbp & fAddrMask);
    355356    }
    356357    else
     
    361362     */
    362363    if (RT_SUCCESS(rc))
    363         rc = dbgfR3StackWalk(pVM, idCpu, hAs, pCur);
     364        rc = dbgfR3StackWalk(pUVM, idCpu, hAs, pCur);
    364365    if (RT_FAILURE(rc))
    365366    {
     
    375376    {
    376377        /* try walk. */
    377         rc = dbgfR3StackWalk(pVM, idCpu, hAs, &Next);
     378        rc = dbgfR3StackWalk(pUVM, idCpu, hAs, &Next);
    378379        if (RT_FAILURE(rc))
    379380            break;
    380381
    381382        /* add the next frame to the chain. */
    382         PDBGFSTACKFRAME pNext = (PDBGFSTACKFRAME)MMR3HeapAlloc(pVM, MM_TAG_DBGF_STACK, sizeof(*pNext));
     383        PDBGFSTACKFRAME pNext = (PDBGFSTACKFRAME)MMR3HeapAllocU(pUVM, MM_TAG_DBGF_STACK, sizeof(*pNext));
    383384        if (!pNext)
    384385        {
     
    415416 * DBGFR3StackWalkBeginGuest and DBGFR3StackWalkBeginHyper.
    416417 */
    417 static int dbgfR3StackWalkBeginCommon(PVM pVM,
     418static int dbgfR3StackWalkBeginCommon(PUVM pUVM,
    418419                                      VMCPUID idCpu,
    419420                                      DBGFCODETYPE enmCodeType,
     
    428429     */
    429430    *ppFirstFrame = NULL;
     431    UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE);
     432    PVM pVM = pUVM->pVM;
    430433    VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
    431434    AssertReturn(idCpu < pVM->cCpus, VERR_INVALID_CPU_ID);
    432435    if (pAddrFrame)
    433         AssertReturn(DBGFR3AddrIsValid(pVM, pAddrFrame), VERR_INVALID_PARAMETER);
     436        AssertReturn(DBGFR3AddrIsValid(pUVM, pAddrFrame), VERR_INVALID_PARAMETER);
    434437    if (pAddrStack)
    435         AssertReturn(DBGFR3AddrIsValid(pVM, pAddrStack), VERR_INVALID_PARAMETER);
     438        AssertReturn(DBGFR3AddrIsValid(pUVM, pAddrStack), VERR_INVALID_PARAMETER);
    436439    if (pAddrPC)
    437         AssertReturn(DBGFR3AddrIsValid(pVM, pAddrPC), VERR_INVALID_PARAMETER);
     440        AssertReturn(DBGFR3AddrIsValid(pUVM, pAddrPC), VERR_INVALID_PARAMETER);
    438441    AssertReturn(enmReturnType >= DBGFRETURNTYPE_INVALID && enmReturnType < DBGFRETURNTYPE_END, VERR_INVALID_PARAMETER);
    439442
     
    460463            AssertFailedReturn(VERR_INVALID_PARAMETER);
    461464    }
    462     return VMR3ReqPriorityCallWait(pVM, idCpu, (PFNRT)dbgfR3StackWalkCtxFull, 10,
    463                                    pVM, idCpu, pCtxCore, hAs, enmCodeType,
    464                                    pAddrFrame, pAddrStack, pAddrPC, enmReturnType, ppFirstFrame);
     465    return VMR3ReqPriorityCallWaitU(pUVM, idCpu, (PFNRT)dbgfR3StackWalkCtxFull, 10,
     466                                    pUVM, idCpu, pCtxCore, hAs, enmCodeType,
     467                                    pAddrFrame, pAddrStack, pAddrPC, enmReturnType, ppFirstFrame);
    465468}
    466469
     
    476479 * @returns VERR_NO_MEMORY if we're out of memory.
    477480 *
    478  * @param   pVM             Pointer to the VM.
     481 * @param   pUVM            The user mode VM handle.
    479482 * @param   idCpu           The ID of the virtual CPU which stack we want to walk.
    480483 * @param   enmCodeType     Code type
     
    485488 * @param   ppFirstFrame    Where to return the pointer to the first info frame.
    486489 */
    487 VMMR3DECL(int) DBGFR3StackWalkBeginEx(PVM pVM,
     490VMMR3DECL(int) DBGFR3StackWalkBeginEx(PUVM pUVM,
    488491                                      VMCPUID idCpu,
    489492                                      DBGFCODETYPE enmCodeType,
     
    494497                                      PCDBGFSTACKFRAME *ppFirstFrame)
    495498{
    496     return dbgfR3StackWalkBeginCommon(pVM, idCpu, enmCodeType, pAddrFrame, pAddrStack, pAddrPC, enmReturnType, ppFirstFrame);
     499    return dbgfR3StackWalkBeginCommon(pUVM, idCpu, enmCodeType, pAddrFrame, pAddrStack, pAddrPC, enmReturnType, ppFirstFrame);
    497500}
    498501
     
    508511 * @returns VERR_NO_MEMORY if we're out of memory.
    509512 *
    510  * @param   pVM             Pointer to the VM.
     513 * @param   pUVM            The user mode VM handle.
    511514 * @param   idCpu           The ID of the virtual CPU which stack we want to walk.
    512515 * @param   enmCodeType     Code type
    513516 * @param   ppFirstFrame    Where to return the pointer to the first info frame.
    514517 */
    515 VMMR3DECL(int) DBGFR3StackWalkBegin(PVM pVM, VMCPUID idCpu, DBGFCODETYPE enmCodeType, PCDBGFSTACKFRAME *ppFirstFrame)
    516 {
    517     return dbgfR3StackWalkBeginCommon(pVM, idCpu, enmCodeType, NULL, NULL, NULL, DBGFRETURNTYPE_INVALID, ppFirstFrame);
     518VMMR3DECL(int) DBGFR3StackWalkBegin(PUVM pUVM, VMCPUID idCpu, DBGFCODETYPE enmCodeType, PCDBGFSTACKFRAME *ppFirstFrame)
     519{
     520    return dbgfR3StackWalkBeginCommon(pUVM, idCpu, enmCodeType, NULL, NULL, NULL, DBGFRETURNTYPE_INVALID, ppFirstFrame);
    518521}
    519522
  • trunk/src/VBox/VMM/VMMR3/DBGFSym.cpp

    r41965 r44399  
    3333#include "DBGFInternal.h"
    3434#include <VBox/vmm/vm.h>
     35#include <VBox/vmm/uvm.h>
    3536#include <VBox/err.h>
    3637#include <VBox/log.h>
     
    321322             * Execute the command.
    322323             */
    323             rc = DBGFR3ModuleLoad(pVM, pszFilename, offDelta, pszModule, ModuleAddress, cbModule);
     324            rc = DBGFR3ModuleLoad(pVM->pUVM, pszFilename, offDelta, pszModule, ModuleAddress, cbModule);
    324325            AssertMsgRCReturn(rc, ("pszFilename=%s offDelta=%RGv pszModule=%s ModuleAddress=%RGv cbModule=%RGv\n",
    325326                                   pszFilename, offDelta, pszModule, ModuleAddress, cbModule), rc);
     
    356357            AssertMsgRCReturn(rc, ("rc=%Rrc querying the 'Address' attribute of '/DBGF/loadsyms/%s'!\n", rc, szCmdName), rc);
    357358            DBGFADDRESS ModAddr;
    358             DBGFR3AddrFromFlat(pVM, &ModAddr, GCPtrAddr);
     359            DBGFR3AddrFromFlat(pVM->pUVM, &ModAddr, GCPtrAddr);
    359360
    360361            /* Name (optional) */
     
    376377             * Execute the command.
    377378             */
    378             rc = DBGFR3AsLoadMap(pVM, DBGF_AS_GLOBAL, pszFilename, pszModName, &ModAddr,
     379            rc = DBGFR3AsLoadMap(pVM->pUVM, DBGF_AS_GLOBAL, pszFilename, pszModName, &ModAddr,
    379380                                 iSeg == UINT32_MAX ? NIL_RTDBGSEGIDX : iSeg, offSubtrahend, 0 /*fFlags*/);
    380381            AssertMsgRCReturn(rc, ("pszFilename=%s pszModName=%s ModAddr=%RGv offSubtrahend=%#x iSeg=%#x\n",
     
    690691 *
    691692 * @returns VBox status.
    692  * @param   pVM             Pointer to the VM.
     693 * @param   pUVM            The user mode VM handle.
    693694 * @param   pszFilename     Path to the file containing the symbol information.
    694695 *                          This can be the executable image, a flat symbol file of some kind or stripped debug info.
     
    700701 *                          Ignored when pszName is NULL.
    701702 */
    702 VMMR3DECL(int) DBGFR3ModuleLoad(PVM pVM, const char *pszFilename, RTGCUINTPTR AddressDelta, const char *pszName,
     703VMMR3DECL(int) DBGFR3ModuleLoad(PUVM pUVM, const char *pszFilename, RTGCUINTPTR AddressDelta, const char *pszName,
    703704                                RTGCUINTPTR ModuleAddress, unsigned cbImage)
    704705{
     
    708709     * Lazy init.
    709710     */
     711    UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE);
     712    PVM pVM = pUVM->pVM;
     713    VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
    710714    if (!pVM->dbgf.s.fSymInited)
    711715    {
     
    807811 * @param   pszName         The module name.
    808812 */
    809 VMMR3DECL(void) DBGFR3ModuleRelocate(PVM pVM, RTGCUINTPTR OldImageBase, RTGCUINTPTR NewImageBase, RTGCUINTPTR cbImage,
    810                                       const char *pszFilename, const char *pszName)
     813VMMR3_INT_DECL(void) DBGFR3ModuleRelocate(PVM pVM, RTGCUINTPTR OldImageBase, RTGCUINTPTR NewImageBase, RTGCUINTPTR cbImage,
     814                                          const char *pszFilename, const char *pszName)
    811815{
    812816#ifdef HAVE_DBGHELP
     
    839843 * @param   pszSymbol       Symbol name.
    840844 */
    841 VMMR3DECL(int) DBGFR3SymbolAdd(PVM pVM, RTGCUINTPTR ModuleAddress, RTGCUINTPTR SymbolAddress, RTUINT cbSymbol,
    842                                const char *pszSymbol)
     845VMMR3_INT_DECL(int) DBGFR3SymbolAdd(PVM pVM, RTGCUINTPTR ModuleAddress, RTGCUINTPTR SymbolAddress, RTUINT cbSymbol,
     846                                    const char *pszSymbol)
    843847{
    844848    /*
     
    881885 * @param   pSymbol             Where to store the symbol info.
    882886 */
    883 VMMR3DECL(int) DBGFR3SymbolByAddr(PVM pVM, RTGCUINTPTR Address, PRTGCINTPTR poffDisplacement, PDBGFSYMBOL pSymbol)
     887VMMR3_INT_DECL(int) DBGFR3SymbolByAddr(PVM pVM, RTGCUINTPTR Address, PRTGCINTPTR poffDisplacement, PDBGFSYMBOL pSymbol)
    884888{
    885889    /*
     
    969973 * @param   pSymbol             Where to store the symbol info.
    970974 */
    971 VMMR3DECL(int) DBGFR3SymbolByName(PVM pVM, const char *pszSymbol, PDBGFSYMBOL pSymbol)
     975VMMR3_INT_DECL(int) DBGFR3SymbolByName(PVM pVM, const char *pszSymbol, PDBGFSYMBOL pSymbol)
    972976{
    973977    /*
     
    10211025 *
    10221026 * @returns VBox status.
    1023  * @param   pVM                 Pointer to the VM.
     1027 * @param   pUVM                The user mode VM handle.
    10241028 * @param   Address             Address.
    10251029 * @param   poffDisplacement    Where to store the line displacement from Address.
    10261030 * @param   pLine               Where to store the line info.
    10271031 */
    1028 VMMR3DECL(int) DBGFR3LineByAddr(PVM pVM, RTGCUINTPTR Address, PRTGCINTPTR poffDisplacement, PDBGFLINE pLine)
     1032VMMR3DECL(int) DBGFR3LineByAddr(PUVM pUVM, RTGCUINTPTR Address, PRTGCINTPTR poffDisplacement, PDBGFLINE pLine)
    10291033{
    10301034    /*
    10311035     * Lazy init.
    10321036     */
     1037    UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE);
     1038    PVM pVM = pUVM->pVM;
     1039    VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
    10331040    if (!pVM->dbgf.s.fSymInited)
    10341041    {
     
    10671074 *
    10681075 * @returns VBox status code.
    1069  * @param   pVM             Pointer to the VM.
     1076 * @param   pUVM            The user mode VM handle.
    10701077 * @param   pLine           The line to duplicate.
    10711078 */
    1072 static PDBGFLINE dbgfR3LineDup(PVM pVM, PCDBGFLINE pLine)
     1079static PDBGFLINE dbgfR3LineDup(PUVM pUVM, PCDBGFLINE pLine)
    10731080{
    10741081    size_t cb = strlen(pLine->szFilename) + RT_OFFSETOF(DBGFLINE, szFilename[1]);
    1075     PDBGFLINE pDup = (PDBGFLINE)MMR3HeapAlloc(pVM, MM_TAG_DBGF_LINE_DUP, cb);
     1082    PDBGFLINE pDup = (PDBGFLINE)MMR3HeapAllocU(pUVM, MM_TAG_DBGF_LINE_DUP, cb);
    10761083    if (pDup)
    10771084        memcpy(pDup, pLine, cb);
     
    10851092 * @returns Pointer to the line. Must be freed using DBGFR3LineFree().
    10861093 * @returns NULL if the line was not found or if we're out of memory.
    1087  * @param   pVM                 Pointer to the VM.
     1094 * @param   pUVM                The user mode VM handle.
    10881095 * @param   Address             Address.
    10891096 * @param   poffDisplacement    Where to store the line displacement from Address.
    10901097 */
    1091 VMMR3DECL(PDBGFLINE) DBGFR3LineByAddrAlloc(PVM pVM, RTGCUINTPTR Address, PRTGCINTPTR poffDisplacement)
     1098VMMR3DECL(PDBGFLINE) DBGFR3LineByAddrAlloc(PUVM pUVM, RTGCUINTPTR Address, PRTGCINTPTR poffDisplacement)
    10921099{
    10931100    DBGFLINE Line;
    1094     int rc = DBGFR3LineByAddr(pVM, Address, poffDisplacement, &Line);
     1101    int rc = DBGFR3LineByAddr(pUVM, Address, poffDisplacement, &Line);
    10951102    if (RT_FAILURE(rc))
    10961103        return NULL;
    1097     return dbgfR3LineDup(pVM, &Line);
     1104    return dbgfR3LineDup(pUVM, &Line);
    10981105}
    10991106
     
    11041111 * @param   pLine           Pointer to the line.
    11051112 */
    1106 VMMR3DECL(void) DBGFR3LineFree(PDBGFLINE pLine)
     1113VMMR3_INT_DECL(void) DBGFR3LineFree(PDBGFLINE pLine)
    11071114{
    11081115    if (pLine)
  • trunk/src/VBox/VMM/VMMR3/EM.cpp

    r44375 r44399  
    11821182    {
    11831183        DBGFR3PrgStep(pVCpu);
    1184         DBGFR3DisasInstrCurrentLog(pVCpu, "RSS: ");
     1184        DBGFR3_DISAS_INSTR_CUR_LOG(pVCpu, "RSS: ");
    11851185        emR3RemStep(pVM, pVCpu);
    11861186        if (emR3Reschedule(pVM, pVCpu, pVCpu->em.s.pCtx) != EMSTATE_REM)
  • trunk/src/VBox/VMM/VMMR3/EMHM.cpp

    r44340 r44399  
    137137    {
    138138        DBGFR3PrgStep(pVCpu);
    139         DBGFR3DisasInstrCurrentLog(pVCpu, "RSS: ");
     139        DBGFR3_DISAS_INSTR_CUR_LOG(pVCpu, "RSS: ");
    140140        rc = emR3HmStep(pVM, pVCpu);
    141141        if (    rc != VINF_SUCCESS
     
    189189    if (pszPrefix)
    190190    {
    191         DBGFR3InfoLog(pVM, "cpumguest", pszPrefix);
    192         DBGFR3DisasInstrCurrentLog(pVCpu, pszPrefix);
     191        DBGFR3_INFO_LOG(pVM, "cpumguest", pszPrefix);
     192        DBGFR3_DISAS_INSTR_CUR_LOG(pVCpu, pszPrefix);
    193193    }
    194194#endif /* LOG_ENABLED */
  • trunk/src/VBox/VMM/VMMR3/EMRaw.cpp

    r44375 r44399  
    237237    {
    238238        DBGFR3PrgStep(pVCpu);
    239         DBGFR3DisasInstrCurrentLog(pVCpu, "RSS: ");
     239        DBGFR3_DISAS_INSTR_CUR_LOG(pVCpu, "RSS: ");
    240240        rc = emR3RawStep(pVM, pVCpu);
    241241        if (rc != VINF_SUCCESS)
     
    285285    if (pszPrefix)
    286286    {
    287         DBGFR3InfoLog(pVM, "cpumguest", pszPrefix);
    288         DBGFR3DisasInstrCurrentLog(pVCpu, pszPrefix);
     287        DBGFR3_INFO_LOG(pVM, "cpumguest", pszPrefix);
     288        DBGFR3_DISAS_INSTR_CUR_LOG(pVCpu, pszPrefix);
    289289    }
    290290#endif /* LOG_ENABLED */
     
    634634
    635635#ifdef LOG_ENABLED
    636     DBGFR3InfoLog(pVM, "cpumguest", "Guest trap");
    637     DBGFR3DisasInstrCurrentLog(pVCpu, "Guest trap");
     636    DBGFR3_INFO_LOG(pVM, "cpumguest", "Guest trap");
     637    DBGFR3_DISAS_INSTR_CUR_LOG(pVCpu, "Guest trap");
    638638
    639639    /* Get guest page information. */
     
    687687                if (RT_SUCCESS(rc))
    688688                {
    689                     DBGFR3DisasInstrCurrentLog(pVCpu, "Patched sysenter instruction");
     689                    DBGFR3_DISAS_INSTR_CUR_LOG(pVCpu, "Patched sysenter instruction");
    690690                    return VINF_EM_RESCHEDULE_RAW;
    691691                }
     
    770770    {
    771771#ifdef LOG_ENABLED
    772         DBGFR3InfoLog(pVM, "cpumguest", "Trap in patch code");
    773         DBGFR3DisasInstrCurrentLog(pVCpu, "Patch code");
     772        DBGFR3_INFO_LOG(pVM, "cpumguest", "Trap in patch code");
     773        DBGFR3_DISAS_INSTR_CUR_LOG(pVCpu, "Patch code");
    774774
    775775        DISCPUSTATE Cpu;
     
    924924        {
    925925#ifdef LOG_ENABLED
    926             DBGFR3InfoLog(pVM, "cpumguest", "PRIV");
     926            DBGFR3_INFO_LOG(pVM, "cpumguest", "PRIV");
    927927#endif
    928928            AssertMsgFailed(("FATAL ERROR: executing random instruction inside generated patch jump %08x\n", pCtx->eip));
     
    938938            {
    939939#ifdef LOG_ENABLED
    940                 DBGFR3InfoLog(pVM, "cpumguest", "PRIV");
     940                DBGFR3_INFO_LOG(pVM, "cpumguest", "PRIV");
    941941#endif
    942                 DBGFR3DisasInstrCurrentLog(pVCpu, "Patched privileged instruction");
     942                DBGFR3_DISAS_INSTR_CUR_LOG(pVCpu, "Patched privileged instruction");
    943943                return VINF_SUCCESS;
    944944            }
     
    949949    if (!PATMIsPatchGCAddr(pVM, pCtx->eip))
    950950    {
    951         DBGFR3InfoLog(pVM, "cpumguest", "PRIV");
    952         DBGFR3DisasInstrCurrentLog(pVCpu, "Privileged instr: ");
     951        DBGFR3_INFO_LOG(pVM, "cpumguest", "PRIV");
     952        DBGFR3_DISAS_INSTR_CUR_LOG(pVCpu, "Privileged instr: ");
    953953    }
    954954#endif
     
    10891089                    if (PATMIsPatchGCAddr(pVM, pCtx->eip))
    10901090                    {
    1091                         DBGFR3InfoLog(pVM, "cpumguest", "PRIV");
    1092                         DBGFR3DisasInstrCurrentLog(pVCpu, "Privileged instr: ");
     1091                        DBGFR3_INFO_LOG(pVM, "cpumguest", "PRIV");
     1092                        DBGFR3_DISAS_INSTR_CUR_LOG(pVCpu, "Privileged instr: ");
    10931093                    }
    10941094#endif
  • trunk/src/VBox/VMM/VMMR3/HM.cpp

    r44373 r44399  
    17651765        char            szOutput[256];
    17661766
    1767         rc = DBGFR3DisasInstrEx(pVM, pVCpu->idCpu, CPUMGetGuestCS(pVCpu), pInstrGC, DBGF_DISAS_FLAGS_DEFAULT_MODE,
     1767        rc = DBGFR3DisasInstrEx(pVM->pUVM, pVCpu->idCpu, CPUMGetGuestCS(pVCpu), pInstrGC, DBGF_DISAS_FLAGS_DEFAULT_MODE,
    17681768                                szOutput, sizeof(szOutput), NULL);
    17691769        if (RT_SUCCESS(rc))
     
    17891789
    17901790#ifdef LOG_ENABLED
    1791         rc = DBGFR3DisasInstrEx(pVM, pVCpu->idCpu, CPUMGetGuestCS(pVCpu), pInstrGC, DBGF_DISAS_FLAGS_DEFAULT_MODE,
     1791        rc = DBGFR3DisasInstrEx(pVM->pUVM, pVCpu->idCpu, CPUMGetGuestCS(pVCpu), pInstrGC, DBGF_DISAS_FLAGS_DEFAULT_MODE,
    17921792                                szOutput, sizeof(szOutput), NULL);
    17931793        if (RT_SUCCESS(rc))
     
    19201920     * Disassembler the instruction and get cracking.
    19211921     */
    1922     DBGFR3DisasInstrCurrentLog(pVCpu, "hmR3ReplaceTprInstr");
     1922    DBGFR3_DISAS_INSTR_CUR_LOG(pVCpu, "hmR3ReplaceTprInstr");
    19231923    PDISCPUSTATE    pDis = &pVCpu->hm.s.DisState;
    19241924    uint32_t        cbOp;
     
    19761976            pCtx->rip += cbOp;
    19771977            rc = EMInterpretDisasCurrent(pVM, pVCpu, pDis, &cbOp);
    1978             DBGFR3DisasInstrCurrentLog(pVCpu, "Following read");
     1978            DBGFR3_DISAS_INSTR_CUR_LOG(pVCpu, "Following read");
    19791979            pCtx->rip = uSavedRip;
    19801980
     
    20892089
    20902090    Log(("hmR3PatchTprInstr: rip=%RGv idxPatch=%u\n", pCtx->rip, idx));
    2091     DBGFR3DisasInstrCurrentLog(pVCpu, "hmR3PatchTprInstr");
     2091    DBGFR3_DISAS_INSTR_CUR_LOG(pVCpu, "hmR3PatchTprInstr");
    20922092
    20932093    /*
     
    22312231            {
    22322232                char     szOutput[256];
    2233                 rc = DBGFR3DisasInstrEx(pVM, pVCpu->idCpu, pCtx->cs.Sel, GCPtrInstr, DBGF_DISAS_FLAGS_DEFAULT_MODE,
     2233                rc = DBGFR3DisasInstrEx(pVM->pUVM, pVCpu->idCpu, pCtx->cs.Sel, GCPtrInstr, DBGF_DISAS_FLAGS_DEFAULT_MODE,
    22342234                                        szOutput, sizeof(szOutput), &cbCurInstr);
    22352235                if (RT_SUCCESS(rc))
     
    22472247            AssertRC(rc);
    22482248
    2249             DBGFR3DisasInstrCurrentLog(pVCpu, "Jump");
     2249            DBGFR3_DISAS_INSTR_CUR_LOG(pVCpu, "Jump");
    22502250
    22512251            pVM->hm.s.pFreeGuestPatchMem += off;
  • trunk/src/VBox/VMM/VMMR3/IOM.cpp

    r43387 r44399  
    577577
    578578        /* conflict. */
    579         DBGFR3Info(pVM, "ioport", NULL, NULL);
     579        DBGFR3Info(pVM->pUVM, "ioport", NULL, NULL);
    580580        AssertMsgFailed(("Port range %#x-%#x (%s) conflicts with existing range(s)!\n", PortStart, (unsigned)PortStart + cPorts - 1, pszDesc));
    581581        MMHyperFree(pVM, pRange);
     
    14871487            /* bail out */
    14881488            IOM_UNLOCK(pVM);
    1489             DBGFR3Info(pVM, "mmio", NULL, NULL);
     1489            DBGFR3Info(pVM->pUVM, "mmio", NULL, NULL);
    14901490            AssertMsgFailed(("This cannot happen!\n"));
    14911491            rc = VERR_IOM_IOPORT_IPE_3;
  • trunk/src/VBox/VMM/VMMR3/PATM.cpp

    r44362 r44399  
    114114#ifdef VBOX_WITH_DEBUGGER
    115115static DECLCALLBACK(int) DisableAllPatches(PAVLOU32NODECORE pNode, void *pVM);
    116 static DECLCALLBACK(int) patmr3CmdOn(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
    117 static DECLCALLBACK(int) patmr3CmdOff(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
     116static FNDBGCCMD    patmr3CmdOn;
     117static FNDBGCCMD    patmr3CmdOff;
    118118
    119119/** Command descriptors. */
     
    61426142#ifdef DEBUG
    61436143        char szBuf[256];
    6144         DBGFR3DisasInstrEx(pVM, pVCpu->idCpu, pCtx->cs.Sel, pCurPatchInstrGC, DBGF_DISAS_FLAGS_DEFAULT_MODE,
     6144        DBGFR3DisasInstrEx(pVM->pUVM, pVCpu->idCpu, pCtx->cs.Sel, pCurPatchInstrGC, DBGF_DISAS_FLAGS_DEFAULT_MODE,
    61456145                           szBuf, sizeof(szBuf), NULL);
    61466146        Log(("DIRTY: %s\n", szBuf));
     
    62056205#ifdef DEBUG
    62066206                char szBuf[256];
    6207                 DBGFR3DisasInstrEx(pVM, pVCpu->idCpu, pCtx->cs.Sel, pCurInstrGC, DBGF_DISAS_FLAGS_DEFAULT_MODE,
     6207                DBGFR3DisasInstrEx(pVM->pUVM, pVCpu->idCpu, pCtx->cs.Sel, pCurInstrGC, DBGF_DISAS_FLAGS_DEFAULT_MODE,
    62086208                                   szBuf, sizeof(szBuf), NULL);
    62096209                Log(("NEW:   %s\n", szBuf));
     
    62216221#ifdef DEBUG
    62226222                char szBuf[256];
    6223                 DBGFR3DisasInstrEx(pVM, pVCpu->idCpu, pCtx->cs.Sel, pCurInstrGC, DBGF_DISAS_FLAGS_DEFAULT_MODE,
     6223                DBGFR3DisasInstrEx(pVM->pUVM, pVCpu->idCpu, pCtx->cs.Sel, pCurInstrGC, DBGF_DISAS_FLAGS_DEFAULT_MODE,
    62246224                                   szBuf, sizeof(szBuf), NULL);
    62256225                Log(("NEW:   %s (FAILED)\n", szBuf));
     
    62586258#ifdef DEBUG
    62596259                            char szBuf[256];
    6260                             DBGFR3DisasInstrEx(pVM, pVCpu->idCpu, pCtx->cs.Sel, pCurPatchInstrGC, DBGF_DISAS_FLAGS_DEFAULT_MODE,
    6261                                                szBuf, sizeof(szBuf), NULL);
     6260                            DBGFR3DisasInstrEx(pVM->pUVM, pVCpu->idCpu, pCtx->cs.Sel, pCurPatchInstrGC,
     6261                                               DBGF_DISAS_FLAGS_DEFAULT_MODE, szBuf, sizeof(szBuf), NULL);
    62626262                            Log(("FILL:  %s\n", szBuf));
    62636263#endif
     
    62706270#ifdef DEBUG
    62716271                                char szBuf[256];
    6272                                 DBGFR3DisasInstrEx(pVM, pVCpu->idCpu, pCtx->cs.Sel, pCurPatchInstrGC + i,
     6272                                DBGFR3DisasInstrEx(pVM->pUVM, pVCpu->idCpu, pCtx->cs.Sel, pCurPatchInstrGC + i,
    62736273                                                   DBGF_DISAS_FLAGS_DEFAULT_MODE, szBuf, sizeof(szBuf), NULL);
    62746274                                Log(("FILL:  %s\n", szBuf));
     
    64626462
    64636463        char szBuf[256];
    6464         DBGFR3DisasInstrEx(pVM, pVCpu->idCpu, pCtx->cs.Sel, pEip, DBGF_DISAS_FLAGS_DEFAULT_MODE, szBuf, sizeof(szBuf), NULL);
     6464        DBGFR3DisasInstrEx(pVM->pUVM, pVCpu->idCpu, pCtx->cs.Sel, pEip, DBGF_DISAS_FLAGS_DEFAULT_MODE, szBuf, sizeof(szBuf), NULL);
    64656465
    64666466        /* Very bad. We crashed in emitted code. Probably stack? */
     
    65796579
    65806580    Log2(("pPatchBlockGC %RRv - pEip %RRv corresponding GC address %RRv\n", PATCHCODE_PTR_GC(&pPatch->patch), pEip, pNewEip));
    6581     DBGFR3DisasInstrLog(pVCpu, pCtx->cs.Sel, pNewEip, "PATCHRET: ");
     6581    DBGFR3_DISAS_INSTR_LOG(pVCpu, pCtx->cs.Sel, pNewEip, "PATCHRET: ");
    65826582    if (pNewEip >= pPatch->patch.pPrivInstrGC && pNewEip < pPatch->patch.pPrivInstrGC + pPatch->patch.cbPatchJump)
    65836583    {
     
    67656765
    67666766#endif /* VBOX_WITH_STATISTICS */
    6767 
    67686767#ifdef VBOX_WITH_DEBUGGER
     6768
    67696769/**
    67706770 * The '.patmoff' command.
     
    67776777 * @param   cArgs       Number of arguments in the array.
    67786778 */
    6779 static DECLCALLBACK(int) patmr3CmdOff(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
     6779static DECLCALLBACK(int) patmr3CmdOff(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
    67806780{
    67816781    /*
    67826782     * Validate input.
    67836783     */
    6784     NOREF(pCmd); NOREF(cArgs); NOREF(paArgs);
    6785     if (!pVM)
    6786         return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "error: The command requires VM to be selected.\n");
     6784    NOREF(cArgs); NOREF(paArgs);
     6785    DBGC_CMDHLP_REQ_UVM_RET(pCmdHlp, pCmd, pUVM);
     6786    PVM pVM = pUVM->pVM;
     6787    VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
    67876788
    67886789    RTAvloU32DoWithAll(&pVM->patm.s.PatchLookupTreeHC->PatchTree, true, DisableAllPatches, pVM);
     
    68016802 * @param   cArgs       Number of arguments in the array.
    68026803 */
    6803 static DECLCALLBACK(int) patmr3CmdOn(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
     6804static DECLCALLBACK(int) patmr3CmdOn(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
    68046805{
    68056806    /*
    68066807     * Validate input.
    68076808     */
    6808     NOREF(pCmd); NOREF(cArgs); NOREF(paArgs);
    6809     if (!pVM)
    6810         return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "error: The command requires VM to be selected.\n");
     6809    NOREF(cArgs); NOREF(paArgs);
     6810    DBGC_CMDHLP_REQ_UVM_RET(pCmdHlp, pCmd, pUVM);
     6811    PVM pVM = pUVM->pVM;
     6812    VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
    68116813
    68126814    PATMR3AllowPatching(pVM->pUVM, true);
     
    68146816    return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "Patching enabled\n");
    68156817}
    6816 #endif
     6818
     6819#endif /* VBOX_WITH_DEBUGGER */
  • trunk/src/VBox/VMM/VMMR3/PDM.cpp

    r44358 r44399  
    659659
    660660        TMR3TimerDestroyDevice(pVM, pDevIns);
    661         //SSMR3DeregisterDriver(pVM, pDevIns, NULL, 0);
     661        SSMR3DeregisterDevice(pVM, pDevIns, NULL, 0);
    662662        pdmR3CritSectDeleteDevice(pVM, pDevIns);
    663         //pdmR3ThreadDestroyDevice(pVM, pDevIns);
    664         //PDMR3QueueDestroyDevice(pVM, pDevIns);
     663        pdmR3ThreadDestroyDevice(pVM, pDevIns);
     664        PDMR3QueueDestroyDevice(pVM, pDevIns);
    665665        PGMR3PhysMMIO2Deregister(pVM, pDevIns, UINT32_MAX);
    666666#ifdef VBOX_WITH_PDM_ASYNC_COMPLETION
    667667        pdmR3AsyncCompletionTemplateDestroyDevice(pVM, pDevIns);
    668668#endif
     669        DBGFR3InfoDeregisterDevice(pVM, pDevIns, NULL);
    669670    }
    670671
  • trunk/src/VBox/VMM/VMMR3/PDMAsyncCompletionFile.cpp

    r43625 r44399  
    4949*******************************************************************************/
    5050#ifdef VBOX_WITH_DEBUGGER
    51 static DECLCALLBACK(int) pdmacEpFileErrorInject(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR pArgs, unsigned cArgs);
     51static FNDBGCCMD pdmacEpFileErrorInject;
    5252# ifdef PDM_ASYNC_COMPLETION_FILE_WITH_DELAY
    53 static DECLCALLBACK(int) pdmacEpFileDelayInject(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR pArgs, unsigned cArgs);
     53static FNDBGCCMD pdmacEpFileDelayInject;
    5454# endif
    5555#endif
     
    611611
    612612/**
    613  * Error inject callback.
     613 * @callback_method_impl{FNDBGCCMD, The '.injecterror' command.}
    614614 */
    615 static DECLCALLBACK(int) pdmacEpFileErrorInject(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR pArgs, unsigned cArgs)
     615static DECLCALLBACK(int) pdmacEpFileErrorInject(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR pArgs, unsigned cArgs)
    616616{
    617617    /*
    618618     * Validate input.
    619619     */
    620     DBGC_CMDHLP_REQ_VM_RET(pCmdHlp, pCmd, pVM);
     620    DBGC_CMDHLP_REQ_UVM_RET(pCmdHlp, pCmd, pUVM);
    621621    DBGC_CMDHLP_ASSERT_PARSER_RET(pCmdHlp, pCmd, -1, cArgs == 3);
    622622    DBGC_CMDHLP_ASSERT_PARSER_RET(pCmdHlp, pCmd, 0, pArgs[0].enmType == DBGCVAR_TYPE_STRING);
     
    625625
    626626    PPDMASYNCCOMPLETIONEPCLASSFILE pEpClassFile;
    627     pEpClassFile = (PPDMASYNCCOMPLETIONEPCLASSFILE)pVM->pUVM->pdm.s.apAsyncCompletionEndpointClass[PDMASYNCCOMPLETIONEPCLASSTYPE_FILE];
     627    pEpClassFile = (PPDMASYNCCOMPLETIONEPCLASSFILE)pUVM->pdm.s.apAsyncCompletionEndpointClass[PDMASYNCCOMPLETIONEPCLASSTYPE_FILE];
    628628
    629629    /* Syntax is "read|write <filename> <status code>" */
     
    640640        return DBGCCmdHlpFail(pCmdHlp, pCmd, "The status code '%lld' is out of range", pArgs[0].u.u64Number);
    641641
    642 
    643642    /*
    644643     * Search for the matching endpoint.
     
    677676# ifdef PDM_ASYNC_COMPLETION_FILE_WITH_DELAY
    678677/**
    679  * Delay inject callback.
     678 * @callback_method_impl{FNDBGCCMD, The '.injectdelay' command.}
    680679 */
    681 static DECLCALLBACK(int) pdmacEpFileDelayInject(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR pArgs, unsigned cArgs)
     680static DECLCALLBACK(int) pdmacEpFileDelayInject(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR pArgs, unsigned cArgs)
    682681{
    683682    /*
    684683     * Validate input.
    685684     */
    686     DBGC_CMDHLP_REQ_VM_RET(pCmdHlp, pCmd, pVM);
     685    DBGC_CMDHLP_REQ_UVM_RET(pCmdHlp, pCmd, pUVM);
    687686    DBGC_CMDHLP_ASSERT_PARSER_RET(pCmdHlp, pCmd, -1, cArgs >= 3);
    688687    DBGC_CMDHLP_ASSERT_PARSER_RET(pCmdHlp, pCmd, 0, pArgs[0].enmType == DBGCVAR_TYPE_STRING);
     
    691690
    692691    PPDMASYNCCOMPLETIONEPCLASSFILE pEpClassFile;
    693     pEpClassFile = (PPDMASYNCCOMPLETIONEPCLASSFILE)pVM->pUVM->pdm.s.apAsyncCompletionEndpointClass[PDMASYNCCOMPLETIONEPCLASSTYPE_FILE];
     692    pEpClassFile = (PPDMASYNCCOMPLETIONEPCLASSFILE)pUVM->pdm.s.apAsyncCompletionEndpointClass[PDMASYNCCOMPLETIONEPCLASSTYPE_FILE];
    694693
    695694    /* Syntax is "read|write|flush|any <filename> <delay> [reqs]" */
  • trunk/src/VBox/VMM/VMMR3/PGM.cpp

    r44393 r44399  
    661661
    662662#ifdef VBOX_WITH_DEBUGGER
    663 /** @todo Convert the first two commands to 'info' items. */
    664 static DECLCALLBACK(int)  pgmR3CmdRam(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
    665 static DECLCALLBACK(int)  pgmR3CmdError(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
    666 static DECLCALLBACK(int)  pgmR3CmdSync(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
    667 static DECLCALLBACK(int)  pgmR3CmdSyncAlways(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
     663static FNDBGCCMD          pgmR3CmdError;
     664static FNDBGCCMD          pgmR3CmdSync;
     665static FNDBGCCMD          pgmR3CmdSyncAlways;
    668666# ifdef VBOX_STRICT
    669 static DECLCALLBACK(int)  pgmR3CmdAssertCR3(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
     667static FNDBGCCMD          pgmR3CmdAssertCR3;
    670668# endif
    671 static DECLCALLBACK(int)  pgmR3CmdPhysToFile(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
     669static FNDBGCCMD          pgmR3CmdPhysToFile;
    672670#endif
    673671
     
    704702{
    705703    /* pszCmd,  cArgsMin, cArgsMax, paArgDesc,                cArgDescs, fFlags, pfnHandler          pszSyntax,          ....pszDescription */
    706     { "pgmram",        0, 0,        NULL,                     0,         0,      pgmR3CmdRam,        "",                     "Display the ram ranges." },
    707704    { "pgmsync",       0, 0,        NULL,                     0,         0,      pgmR3CmdSync,       "",                     "Sync the CR3 page." },
    708705    { "pgmerror",      0, 1,        &g_aPgmErrorArgs[0],      1,         0,      pgmR3CmdError,      "",                     "Enables inject runtime of errors into parts of PGM." },
     
    25352532
    25362533#ifdef DEBUG
    2537     DBGFR3InfoLog(pVM, "mappings", NULL);
    2538     DBGFR3InfoLog(pVM, "handlers", "all nostat");
     2534    DBGFR3_INFO_LOG(pVM, "mappings", NULL);
     2535    DBGFR3_INFO_LOG(pVM, "handlers", "all nostat");
    25392536#endif
    25402537
     
    27202717                        pCur->pszDesc);
    27212718}
     2719
    27222720
    27232721/**
     
    36973695
    36983696/**
    3699  * The '.pgmram' command.
    3700  *
    3701  * @returns VBox status.
    3702  * @param   pCmd        Pointer to the command descriptor (as registered).
    3703  * @param   pCmdHlp     Pointer to command helper functions.
    3704  * @param   pVM         Pointer to the current VM (if any).
    3705  * @param   paArgs      Pointer to (readonly) array of arguments.
    3706  * @param   cArgs       Number of arguments in the array.
    3707  */
    3708 static DECLCALLBACK(int) pgmR3CmdRam(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
     3697 * @callback_method_impl{FNDBGCCMD, The '.pgmerror' and '.pgmerroroff' commands.}
     3698 */
     3699static DECLCALLBACK(int)  pgmR3CmdError(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
    37093700{
    37103701    /*
    37113702     * Validate input.
    37123703     */
    3713     NOREF(pCmd); NOREF(paArgs); NOREF(cArgs);
    3714     if (!pVM)
    3715         return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "error: The command requires a VM to be selected.\n");
    3716     if (!pVM->pgm.s.pRamRangesXR3)
    3717         return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "Sorry, no Ram is registered.\n");
    3718 
    3719     /*
    3720      * Dump the ranges.
    3721      */
    3722     int rc = pCmdHlp->pfnPrintf(pCmdHlp, NULL, "From     - To (incl) pvHC\n");
    3723     PPGMRAMRANGE pRam;
    3724     for (pRam = pVM->pgm.s.pRamRangesXR3; pRam; pRam = pRam->pNextR3)
    3725     {
    3726         rc = pCmdHlp->pfnPrintf(pCmdHlp, NULL,
    3727             "%RGp - %RGp  %p\n",
    3728             pRam->GCPhys, pRam->GCPhysLast, pRam->pvR3);
    3729         if (RT_FAILURE(rc))
    3730             return rc;
    3731     }
    3732 
    3733     return VINF_SUCCESS;
    3734 }
    3735 
    3736 
    3737 /**
    3738  * The '.pgmerror' and '.pgmerroroff' commands.
    3739  *
    3740  * @returns VBox status.
    3741  * @param   pCmd        Pointer to the command descriptor (as registered).
    3742  * @param   pCmdHlp     Pointer to command helper functions.
    3743  * @param   pVM         Pointer to the current VM (if any).
    3744  * @param   paArgs      Pointer to (readonly) array of arguments.
    3745  * @param   cArgs       Number of arguments in the array.
    3746  */
    3747 static DECLCALLBACK(int)  pgmR3CmdError(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
    3748 {
    3749     /*
    3750      * Validate input.
    3751      */
    3752     if (!pVM)
    3753         return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "error: The command requires a VM to be selected.\n");
    3754     AssertReturn(cArgs == 0 || (cArgs == 1 && paArgs[0].enmType == DBGCVAR_TYPE_STRING),
    3755                  pCmdHlp->pfnPrintf(pCmdHlp, NULL, "error: Hit bug in the parser.\n"));
     3704    DBGC_CMDHLP_REQ_UVM_RET(pCmdHlp, pCmd, pUVM);
     3705    PVM pVM = pUVM->pVM;
     3706    DBGC_CMDHLP_ASSERT_PARSER_RET(pCmdHlp, pCmd, 0, cArgs == 0 || (cArgs == 1 && paArgs[0].enmType == DBGCVAR_TYPE_STRING));
    37563707
    37573708    if (!cArgs)
     
    37603711         * Print the list of error injection locations with status.
    37613712         */
    3762         pCmdHlp->pfnPrintf(pCmdHlp, NULL, "PGM error inject locations:\n");
    3763         pCmdHlp->pfnPrintf(pCmdHlp, NULL, "  handy - %RTbool\n", pVM->pgm.s.fErrInjHandyPages);
     3713        DBGCCmdHlpPrintf(pCmdHlp, "PGM error inject locations:\n");
     3714        DBGCCmdHlpPrintf(pCmdHlp, "  handy - %RTbool\n", pVM->pgm.s.fErrInjHandyPages);
    37643715    }
    37653716    else
    37663717    {
    3767 
    37683718        /*
    37693719         * String switch on where to inject the error.
     
    37743724            ASMAtomicWriteBool(&pVM->pgm.s.fErrInjHandyPages, fNewState);
    37753725        else
    3776             return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "error: Invalid 'where' value: %s.\n", pszWhere);
    3777         pCmdHlp->pfnPrintf(pCmdHlp, NULL, "done\n");
     3726            return DBGCCmdHlpPrintf(pCmdHlp, "error: Invalid 'where' value: %s.\n", pszWhere);
     3727        DBGCCmdHlpPrintf(pCmdHlp, "done\n");
    37783728    }
    37793729    return VINF_SUCCESS;
     
    37823732
    37833733/**
    3784  * The '.pgmsync' command.
    3785  *
    3786  * @returns VBox status.
    3787  * @param   pCmd        Pointer to the command descriptor (as registered).
    3788  * @param   pCmdHlp     Pointer to command helper functions.
    3789  * @param   pVM         Pointer to the current VM (if any).
    3790  * @param   paArgs      Pointer to (readonly) array of arguments.
    3791  * @param   cArgs       Number of arguments in the array.
    3792  */
    3793 static DECLCALLBACK(int) pgmR3CmdSync(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
    3794 {
    3795     /** @todo SMP support */
    3796 
     3734 * @callback_method_impl{FNDBGCCMD, The '.pgmsync' command.}
     3735 */
     3736static DECLCALLBACK(int) pgmR3CmdSync(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
     3737{
    37973738    /*
    37983739     * Validate input.
    37993740     */
    38003741    NOREF(pCmd); NOREF(paArgs); NOREF(cArgs);
    3801     if (!pVM)
    3802         return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "error: The command requires a VM to be selected.\n");
    3803 
    3804     PVMCPU pVCpu = &pVM->aCpus[0];
     3742    DBGC_CMDHLP_REQ_UVM_RET(pCmdHlp, pCmd, pUVM);
     3743    PVMCPU pVCpu = VMMR3GetCpuByIdU(pUVM, DBGCCmdHlpGetCurrentCpu(pCmdHlp));
     3744    if (!pVCpu)
     3745        return DBGCCmdHlpFail(pCmdHlp, pCmd, "Invalid CPU ID");
    38053746
    38063747    /*
     
    38093750    VMCPU_FF_SET(pVCpu, VMCPU_FF_PGM_SYNC_CR3);
    38103751
    3811     int rc = pCmdHlp->pfnPrintf(pCmdHlp, NULL, "Forcing page directory sync.\n");
     3752    int rc = DBGCCmdHlpPrintf(pCmdHlp, "Forcing page directory sync.\n");
    38123753    if (RT_FAILURE(rc))
    38133754        return rc;
     
    38163757}
    38173758
    3818 
    38193759#ifdef VBOX_STRICT
     3760
    38203761/**
    3821  * The '.pgmassertcr3' command.
    3822  *
    3823  * @returns VBox status.
    3824  * @param   pCmd        Pointer to the command descriptor (as registered).
    3825  * @param   pCmdHlp     Pointer to command helper functions.
    3826  * @param   pVM         Pointer to the current VM (if any).
    3827  * @param   paArgs      Pointer to (readonly) array of arguments.
    3828  * @param   cArgs       Number of arguments in the array.
    3829  */
    3830 static DECLCALLBACK(int) pgmR3CmdAssertCR3(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
    3831 {
    3832     /** @todo SMP support!! */
    3833 
     3762 * EMT callback for pgmR3CmdAssertCR3.
     3763 *
     3764 * @returns VBox status code.
     3765 * @param   pUVM        The user mode VM handle.
     3766 * @param   pcErrors    Where to return the error count.
     3767 */
     3768static DECLCALLBACK(int) pgmR3CmdAssertCR3EmtWorker(PUVM pUVM, unsigned *pcErrors)
     3769{
     3770    PVM     pVM   = pUVM->pVM;
     3771    VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
     3772    PVMCPU  pVCpu = VMMGetCpu(pVM);
     3773
     3774    *pcErrors = PGMAssertCR3(pVM, pVCpu, CPUMGetGuestCR3(pVCpu), CPUMGetGuestCR4(pVCpu));
     3775
     3776    return VINF_SUCCESS;
     3777}
     3778
     3779
     3780/**
     3781 * @callback_method_impl{FNDBGCCMD, The '.pgmassertcr3' command.}
     3782 */
     3783static DECLCALLBACK(int) pgmR3CmdAssertCR3(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
     3784{
    38343785    /*
    38353786     * Validate input.
    38363787     */
    38373788    NOREF(pCmd); NOREF(paArgs); NOREF(cArgs);
    3838     if (!pVM)
    3839         return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "error: The command requires a VM to be selected.\n");
    3840 
    3841     PVMCPU pVCpu = &pVM->aCpus[0];
    3842 
    3843     int rc = pCmdHlp->pfnPrintf(pCmdHlp, NULL, "Checking shadow CR3 page tables for consistency.\n");
     3789    DBGC_CMDHLP_REQ_UVM_RET(pCmdHlp, pCmd, pUVM);
     3790
     3791    int rc = DBGCCmdHlpPrintf(pCmdHlp, "Checking shadow CR3 page tables for consistency.\n");
    38443792    if (RT_FAILURE(rc))
    38453793        return rc;
    38463794
    3847     PGMAssertCR3(pVM, pVCpu, CPUMGetGuestCR3(pVCpu), CPUMGetGuestCR4(pVCpu));
    3848 
    3849     return VINF_SUCCESS;
     3795    unsigned cErrors = 0;
     3796    rc = VMR3ReqCallWaitU(pUVM, DBGCCmdHlpGetCurrentCpu(pCmdHlp), (PFNRT)pgmR3CmdAssertCR3EmtWorker, 2, pUVM, &cErrors);
     3797    if (RT_FAILURE(rc))
     3798        return DBGCCmdHlpFail(pCmdHlp, pCmd, "VMR3ReqCallWaitU failed: %Rrc", rc);
     3799    if (cErrors > 0)
     3800        return DBGCCmdHlpFail(pCmdHlp, pCmd, "PGMAssertCR3: %u error(s)", cErrors);
     3801    return DBGCCmdHlpPrintf(pCmdHlp, "PGMAssertCR3: OK\n");
    38503802}
     3803
    38513804#endif /* VBOX_STRICT */
    38523805
    3853 
    38543806/**
    3855  * The '.pgmsyncalways' command.
    3856  *
    3857  * @returns VBox status.
    3858  * @param   pCmd        Pointer to the command descriptor (as registered).
    3859  * @param   pCmdHlp     Pointer to command helper functions.
    3860  * @param   pVM         Pointer to the current VM (if any).
    3861  * @param   paArgs      Pointer to (readonly) array of arguments.
    3862  * @param   cArgs       Number of arguments in the array.
    3863  */
    3864 static DECLCALLBACK(int) pgmR3CmdSyncAlways(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
    3865 {
    3866     /** @todo SMP support!! */
    3867     PVMCPU pVCpu = &pVM->aCpus[0];
    3868 
     3807 * @callback_method_impl{FNDBGCCMD, The '.pgmsyncalways' command.}
     3808 */
     3809static DECLCALLBACK(int) pgmR3CmdSyncAlways(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
     3810{
    38693811    /*
    38703812     * Validate input.
    38713813     */
    38723814    NOREF(pCmd); NOREF(paArgs); NOREF(cArgs);
    3873     if (!pVM)
    3874         return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "error: The command requires a VM to be selected.\n");
     3815    DBGC_CMDHLP_REQ_UVM_RET(pCmdHlp, pCmd, pUVM);
     3816    PVMCPU pVCpu = VMMR3GetCpuByIdU(pUVM, DBGCCmdHlpGetCurrentCpu(pCmdHlp));
     3817    if (!pVCpu)
     3818        return DBGCCmdHlpFail(pCmdHlp, pCmd, "Invalid CPU ID");
    38753819
    38763820    /*
    38773821     * Force page directory sync.
    38783822     */
     3823    int rc;
    38793824    if (pVCpu->pgm.s.fSyncFlags & PGM_SYNC_ALWAYS)
    38803825    {
    38813826        ASMAtomicAndU32(&pVCpu->pgm.s.fSyncFlags, ~PGM_SYNC_ALWAYS);
    3882         return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "Disabled permanent forced page directory syncing.\n");
     3827        rc = DBGCCmdHlpPrintf(pCmdHlp, "Disabled permanent forced page directory syncing.\n");
    38833828    }
    38843829    else
     
    38863831        ASMAtomicOrU32(&pVCpu->pgm.s.fSyncFlags, PGM_SYNC_ALWAYS);
    38873832        VMCPU_FF_SET(pVCpu, VMCPU_FF_PGM_SYNC_CR3);
    3888         return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "Enabled permanent forced page directory syncing.\n");
    3889     }
     3833        rc = DBGCCmdHlpPrintf(pCmdHlp, "Enabled permanent forced page directory syncing.\n");
     3834    }
     3835    return rc;
    38903836}
    38913837
    38923838
    38933839/**
    3894  * The '.pgmphystofile' command.
    3895  *
    3896  * @returns VBox status.
    3897  * @param   pCmd        Pointer to the command descriptor (as registered).
    3898  * @param   pCmdHlp     Pointer to command helper functions.
    3899  * @param   pVM         Pointer to the current VM (if any).
    3900  * @param   paArgs      Pointer to (readonly) array of arguments.
    3901  * @param   cArgs       Number of arguments in the array.
    3902  */
    3903 static DECLCALLBACK(int) pgmR3CmdPhysToFile(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
     3840 * @callback_method_impl{FNDBGCCMD, The '.pgmphystofile' command.}
     3841 */
     3842static DECLCALLBACK(int) pgmR3CmdPhysToFile(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
    39043843{
    39053844    /*
     
    39073846     */
    39083847    NOREF(pCmd);
    3909     if (!pVM)
    3910         return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "error: The command requires a VM to be selected.\n");
    3911     if (    cArgs < 1
    3912         ||  cArgs > 2
    3913         ||  paArgs[0].enmType != DBGCVAR_TYPE_STRING
    3914         ||  (   cArgs > 1
    3915              && paArgs[1].enmType != DBGCVAR_TYPE_STRING))
    3916         return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "error: parser error, invalid arguments.\n");
    3917     if (    cArgs >= 2
    3918         &&  strcmp(paArgs[1].u.pszString, "nozero"))
    3919         return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "error: Invalid 2nd argument '%s', must be 'nozero'.\n", paArgs[1].u.pszString);
     3848    DBGC_CMDHLP_REQ_UVM_RET(pCmdHlp, pCmd, pUVM);
     3849    PVM pVM = pUVM->pVM;
     3850    DBGC_CMDHLP_ASSERT_PARSER_RET(pCmdHlp, pCmd, 0, cArgs == 1 || cArgs == 2);
     3851    DBGC_CMDHLP_ASSERT_PARSER_RET(pCmdHlp, pCmd, 0, paArgs[0].enmType != DBGCVAR_TYPE_STRING);
     3852    if (cArgs == 2)
     3853    {
     3854        DBGC_CMDHLP_ASSERT_PARSER_RET(pCmdHlp, pCmd, 1, paArgs[2].enmType != DBGCVAR_TYPE_STRING);
     3855        if (strcmp(paArgs[1].u.pszString, "nozero"))
     3856            return DBGCCmdHlpFail(pCmdHlp, pCmd, "Invalid 2nd argument '%s', must be 'nozero'.\n", paArgs[1].u.pszString);
     3857    }
    39203858    bool fIncZeroPgs = cArgs < 2;
    39213859
     
    39263864    int rc = RTFileOpen(&hFile, paArgs[0].u.pszString, RTFILE_O_WRITE | RTFILE_O_CREATE_REPLACE | RTFILE_O_DENY_WRITE);
    39273865    if (RT_FAILURE(rc))
    3928         return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "error: RTFileOpen(,'%s',) -> %Rrc.\n", paArgs[0].u.pszString, rc);
     3866        return DBGCCmdHlpPrintf(pCmdHlp, "error: RTFileOpen(,'%s',) -> %Rrc.\n", paArgs[0].u.pszString, rc);
    39293867
    39303868    uint32_t cbRamHole = 0;
    3931     CFGMR3QueryU32Def(CFGMR3GetRoot(pVM), "RamHoleSize", &cbRamHole, MM_RAM_HOLE_SIZE_DEFAULT);
     3869    CFGMR3QueryU32Def(CFGMR3GetRootU(pUVM), "RamHoleSize", &cbRamHole, MM_RAM_HOLE_SIZE_DEFAULT);
    39323870    uint64_t cbRam     = 0;
    3933     CFGMR3QueryU64Def(CFGMR3GetRoot(pVM), "RamSize", &cbRam, 0);
     3871    CFGMR3QueryU64Def(CFGMR3GetRootU(pUVM), "RamSize", &cbRam, 0);
    39343872    RTGCPHYS GCPhysEnd = cbRam + cbRamHole;
    39353873
     
    39663904                    rc = RTFileWrite(hFile, abZeroPg, PAGE_SIZE, NULL);
    39673905                    if (RT_FAILURE(rc))
    3968                         pCmdHlp->pfnPrintf(pCmdHlp, NULL, "error: RTFileWrite -> %Rrc at GCPhys=%RGp.\n", rc, GCPhys);
     3906                        DBGCCmdHlpPrintf(pCmdHlp, "error: RTFileWrite -> %Rrc at GCPhys=%RGp.\n", rc, GCPhys);
    39693907                }
    39703908            }
     
    39863924                            PGMPhysReleasePageMappingLock(pVM, &Lock);
    39873925                            if (RT_FAILURE(rc))
    3988                                 pCmdHlp->pfnPrintf(pCmdHlp, NULL, "error: RTFileWrite -> %Rrc at GCPhys=%RGp.\n", rc, GCPhys);
     3926                                DBGCCmdHlpPrintf(pCmdHlp, "error: RTFileWrite -> %Rrc at GCPhys=%RGp.\n", rc, GCPhys);
    39893927                        }
    39903928                        else
    3991                             pCmdHlp->pfnPrintf(pCmdHlp, NULL, "error: PGMPhysGCPhys2CCPtrReadOnly -> %Rrc at GCPhys=%RGp.\n", rc, GCPhys);
     3929                            DBGCCmdHlpPrintf(pCmdHlp, "error: PGMPhysGCPhys2CCPtrReadOnly -> %Rrc at GCPhys=%RGp.\n", rc, GCPhys);
    39923930                        break;
    39933931                    }
     
    40013939                            rc = RTFileWrite(hFile, abZeroPg, PAGE_SIZE, NULL);
    40023940                            if (RT_FAILURE(rc))
    4003                                 pCmdHlp->pfnPrintf(pCmdHlp, NULL, "error: RTFileWrite -> %Rrc at GCPhys=%RGp.\n", rc, GCPhys);
     3941                                DBGCCmdHlpPrintf(pCmdHlp, "error: RTFileWrite -> %Rrc at GCPhys=%RGp.\n", rc, GCPhys);
    40043942                        }
    40053943                        break;
     
    40173955    RTFileClose(hFile);
    40183956    if (RT_SUCCESS(rc))
    4019         return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "Successfully saved physical memory to '%s'.\n", paArgs[0].u.pszString);
     3957        return DBGCCmdHlpPrintf(pCmdHlp, "Successfully saved physical memory to '%s'.\n", paArgs[0].u.pszString);
    40203958    return VINF_SUCCESS;
    40213959}
  • trunk/src/VBox/VMM/VMMR3/PGMDbg.cpp

    r41965 r44399  
    55
    66/*
    7  * Copyright (C) 2006-2010 Oracle Corporation
     7 * Copyright (C) 2006-2013 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    2424#include "PGMInternal.h"
    2525#include <VBox/vmm/vm.h>
     26#include <VBox/vmm/uvm.h>
    2627#include "PGMInline.h"
    2728#include <iprt/assert.h>
     
    103104 * @retval  VERR_INVALID_POINTER if the pointer is not within the GC physical memory.
    104105 *
    105  * @param   pVM         Pointer to the VM.
     106 * @param   pUVM        The user mode VM handle.
    106107 * @param   R3Ptr       The R3 pointer to convert.
    107108 * @param   pGCPhys     Where to store the GC physical address on success.
    108109 */
    109 VMMR3DECL(int) PGMR3DbgR3Ptr2GCPhys(PVM pVM, RTR3PTR R3Ptr, PRTGCPHYS pGCPhys)
    110 {
    111     NOREF(pVM); NOREF(R3Ptr);
     110VMMR3DECL(int) PGMR3DbgR3Ptr2GCPhys(PUVM pUVM, RTR3PTR R3Ptr, PRTGCPHYS pGCPhys)
     111{
     112    NOREF(pUVM); NOREF(R3Ptr);
    112113    *pGCPhys = NIL_RTGCPHYS;
    113114    return VERR_NOT_IMPLEMENTED;
     
    125126 * @retval  VERR_INVALID_POINTER if the pointer is not within the GC physical memory.
    126127 *
    127  * @param   pVM         Pointer to the VM.
     128 * @param   pUVM        The user mode VM handle.
    128129 * @param   R3Ptr       The R3 pointer to convert.
    129130 * @param   pHCPhys     Where to store the HC physical address on success.
    130131 */
    131 VMMR3DECL(int) PGMR3DbgR3Ptr2HCPhys(PVM pVM, RTR3PTR R3Ptr, PRTHCPHYS pHCPhys)
    132 {
    133     NOREF(pVM); NOREF(R3Ptr);
     132VMMR3DECL(int) PGMR3DbgR3Ptr2HCPhys(PUVM pUVM, RTR3PTR R3Ptr, PRTHCPHYS pHCPhys)
     133{
     134    NOREF(pUVM); NOREF(R3Ptr);
    134135    *pHCPhys = NIL_RTHCPHYS;
    135136    return VERR_NOT_IMPLEMENTED;
     
    146147 * @retval  VERR_INVALID_POINTER if the HC physical address is not within the GC physical memory.
    147148 *
    148  * @param   pVM     Pointer to the VM.
     149 * @param   pUVM        The user mode VM handle.
    149150 * @param   HCPhys  The HC physical address to convert.
    150151 * @param   pGCPhys Where to store the GC physical address on success.
    151152 */
    152 VMMR3DECL(int) PGMR3DbgHCPhys2GCPhys(PVM pVM, RTHCPHYS HCPhys, PRTGCPHYS pGCPhys)
    153 {
     153VMMR3DECL(int) PGMR3DbgHCPhys2GCPhys(PUVM pUVM, RTHCPHYS HCPhys, PRTGCPHYS pGCPhys)
     154{
     155    UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE);
     156    VM_ASSERT_VALID_EXT_RETURN(pUVM->pVM, VERR_INVALID_VM_HANDLE);
     157
    154158    /*
    155159     * Validate and adjust the input a bit.
     
    162166        return VERR_INVALID_POINTER;
    163167
    164     for (PPGMRAMRANGE pRam = pVM->pgm.s.CTX_SUFF(pRamRangesX);
     168    for (PPGMRAMRANGE pRam = pUVM->pVM->pgm.s.CTX_SUFF(pRamRangesX);
    165169         pRam;
    166170         pRam = pRam->CTX_SUFF(pNext))
     
    193197 * @todo    Unused?
    194198 */
    195 VMMR3DECL(int) PGMR3DbgReadGCPhys(PVM pVM, void *pvDst, RTGCPHYS GCPhysSrc, size_t cb, uint32_t fFlags, size_t *pcbRead)
     199VMMR3_INT_DECL(int) PGMR3DbgReadGCPhys(PVM pVM, void *pvDst, RTGCPHYS GCPhysSrc, size_t cb, uint32_t fFlags, size_t *pcbRead)
    196200{
    197201    /* validate */
     
    244248 * @todo    Unused?
    245249 */
    246 VMMR3DECL(int) PGMR3DbgWriteGCPhys(PVM pVM, RTGCPHYS GCPhysDst, const void *pvSrc, size_t cb, uint32_t fFlags, size_t *pcbWritten)
     250VMMR3_INT_DECL(int) PGMR3DbgWriteGCPhys(PVM pVM, RTGCPHYS GCPhysDst, const void *pvSrc, size_t cb, uint32_t fFlags, size_t *pcbWritten)
    247251{
    248252    /* validate */
     
    295299 * @todo    Unused?
    296300 */
    297 VMMR3DECL(int) PGMR3DbgReadGCPtr(PVM pVM, void *pvDst, RTGCPTR GCPtrSrc, size_t cb, uint32_t fFlags, size_t *pcbRead)
     301VMMR3_INT_DECL(int) PGMR3DbgReadGCPtr(PVM pVM, void *pvDst, RTGCPTR GCPtrSrc, size_t cb, uint32_t fFlags, size_t *pcbRead)
    298302{
    299303    /* validate */
     
    351355 * @todo    Unused?
    352356 */
    353 VMMR3DECL(int) PGMR3DbgWriteGCPtr(PVM pVM, RTGCPTR GCPtrDst, void const *pvSrc, size_t cb, uint32_t fFlags, size_t *pcbWritten)
     357VMMR3_INT_DECL(int) PGMR3DbgWriteGCPtr(PVM pVM, RTGCPTR GCPtrDst, void const *pvSrc, size_t cb, uint32_t fFlags, size_t *pcbWritten)
    354358{
    355359    /* validate */
     
    570574 * @param   pGCPhysHit      Where to store the address of the first occurrence on success.
    571575 */
    572 VMMR3DECL(int) PGMR3DbgScanPhysical(PVM pVM, RTGCPHYS GCPhys, RTGCPHYS cbRange, RTGCPHYS GCPhysAlign,
    573                                     const uint8_t *pabNeedle, size_t cbNeedle, PRTGCPHYS pGCPhysHit)
     576VMMR3_INT_DECL(int) PGMR3DbgScanPhysical(PVM pVM, RTGCPHYS GCPhys, RTGCPHYS cbRange, RTGCPHYS GCPhysAlign,
     577                                         const uint8_t *pabNeedle, size_t cbNeedle, PRTGCPHYS pGCPhysHit)
    574578{
    575579    /*
     
    730734 * @param   pGCPtrHit       Where to store the address of the first occurrence on success.
    731735 */
    732 VMMR3DECL(int) PGMR3DbgScanVirtual(PVM pVM, PVMCPU pVCpu, RTGCPTR GCPtr, RTGCPTR cbRange, RTGCPTR GCPtrAlign,
    733                                    const uint8_t *pabNeedle, size_t cbNeedle, PRTGCUINTPTR pGCPtrHit)
     736VMMR3_INT_DECL(int) PGMR3DbgScanVirtual(PVM pVM, PVMCPU pVCpu, RTGCPTR GCPtr, RTGCPTR cbRange, RTGCPTR GCPtrAlign,
     737                                        const uint8_t *pabNeedle, size_t cbNeedle, PRTGCUINTPTR pGCPtrHit)
    734738{
    735739    VMCPU_ASSERT_EMT(pVCpu);
     
    10381042    char        szPage[80];
    10391043    RTGCPHYS    GCPhys;
    1040     int rc = PGMR3DbgHCPhys2GCPhys(pState->pVM, HCPhys, &GCPhys);
     1044    int rc = PGMR3DbgHCPhys2GCPhys(pState->pVM->pUVM, HCPhys, &GCPhys);
    10411045    if (RT_SUCCESS(rc))
    10421046    {
     
    16811685        fFlags |= DBGFPGDMP_FLAGS_LME;
    16821686
    1683     return DBGFR3PagingDumpEx(pVM, pVCpu->idCpu, fFlags, cr3, 0, fLongMode ? UINT64_MAX : UINT32_MAX, cMaxDepth, pHlp);
     1687    return DBGFR3PagingDumpEx(pVM->pUVM, pVCpu->idCpu, fFlags, cr3, 0, fLongMode ? UINT64_MAX : UINT32_MAX, cMaxDepth, pHlp);
    16841688}
    16851689
  • trunk/src/VBox/VMM/VMMR3/PGMPool.cpp

    r43387 r44399  
    55
    66/*
    7  * Copyright (C) 2006-2007 Oracle Corporation
     7 * Copyright (C) 2006-2013 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    101101#include "PGMInternal.h"
    102102#include <VBox/vmm/vm.h>
     103#include <VBox/vmm/uvm.h>
    103104#include "PGMInline.h"
    104105
     
    115116static DECLCALLBACK(int) pgmR3PoolAccessHandler(PVM pVM, RTGCPHYS GCPhys, void *pvPhys, void *pvBuf, size_t cbBuf, PGMACCESSTYPE enmAccessType, void *pvUser);
    116117#ifdef VBOX_WITH_DEBUGGER
    117 static DECLCALLBACK(int)  pgmR3PoolCmdCheck(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
     118static FNDBGCCMD pgmR3PoolCmdCheck;
    118119#endif
    119120
     
    978979#ifdef VBOX_WITH_DEBUGGER
    979980/**
    980  * The '.pgmpoolcheck' command.
    981  *
    982  * @returns VBox status.
    983  * @param   pCmd        Pointer to the command descriptor (as registered).
    984  * @param   pCmdHlp     Pointer to command helper functions.
    985  * @param   pVM         Pointer to the current VM (if any).
    986  * @param   paArgs      Pointer to (readonly) array of arguments.
    987  * @param   cArgs       Number of arguments in the array.
    988  */
    989 static DECLCALLBACK(int) pgmR3PoolCmdCheck(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
     981 * @callback_method_impl{FNDBGCCMD, The '.pgmpoolcheck' command.}
     982 */
     983static DECLCALLBACK(int) pgmR3PoolCmdCheck(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
    990984{
    991     DBGC_CMDHLP_REQ_VM_RET(pCmdHlp, pCmd, pVM);
     985    DBGC_CMDHLP_REQ_UVM_RET(pCmdHlp, pCmd, pUVM);
     986    PVM pVM = pUVM->pVM;
     987    VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
    992988    DBGC_CMDHLP_ASSERT_PARSER_RET(pCmdHlp, pCmd, -1, cArgs == 0);
    993989    uint32_t cErrors = 0;
  • trunk/src/VBox/VMM/VMMR3/SELM.cpp

    r43872 r44399  
    26412641VMMR3DECL(void) SELMR3DumpHyperGDT(PVM pVM)
    26422642{
    2643     DBGFR3Info(pVM, "gdt", NULL, NULL);
     2643    DBGFR3Info(pVM->pUVM, "gdt", NULL, NULL);
    26442644}
    26452645
     
    26522652VMMR3DECL(void) SELMR3DumpHyperLDT(PVM pVM)
    26532653{
    2654     DBGFR3Info(pVM, "ldt", NULL, NULL);
     2654    DBGFR3Info(pVM->pUVM, "ldt", NULL, NULL);
    26552655}
    26562656
     
    26632663VMMR3DECL(void) SELMR3DumpGuestGDT(PVM pVM)
    26642664{
    2665     DBGFR3Info(pVM, "gdtguest", NULL, NULL);
     2665    DBGFR3Info(pVM->pUVM, "gdtguest", NULL, NULL);
    26662666}
    26672667
     
    26742674VMMR3DECL(void) SELMR3DumpGuestLDT(PVM pVM)
    26752675{
    2676     DBGFR3Info(pVM, "ldtguest", NULL, NULL);
    2677 }
    2678 
     2676    DBGFR3Info(pVM->pUVM, "ldtguest", NULL, NULL);
     2677}
     2678
  • trunk/src/VBox/VMM/VMMR3/STAM.cpp

    r44347 r44399  
    55
    66/*
    7  * Copyright (C) 2006-2007 Oracle Corporation
     7 * Copyright (C) 2006-2013 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    7272typedef struct STAMR3PRINTONEARGS
    7373{
    74     PVM pVM;
    75     void *pvArg;
     74    PUVM        pUVM;
     75    void       *pvArg;
    7676    DECLCALLBACKMEMBER(void, pfnPrintf)(struct STAMR3PRINTONEARGS *pvArg, const char *pszFormat, ...);
    7777} STAMR3PRINTONEARGS, *PSTAMR3PRINTONEARGS;
     
    151151
    152152#ifdef VBOX_WITH_DEBUGGER
    153 static DECLCALLBACK(int)    stamR3CmdStats(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
     153static FNDBGCCMD            stamR3CmdStats;
    154154static DECLCALLBACK(void)   stamR3EnumDbgfPrintf(PSTAMR3PRINTONEARGS pArgs, const char *pszFormat, ...);
    155 static DECLCALLBACK(int)    stamR3CmdStatsReset(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
     155static FNDBGCCMD            stamR3CmdStatsReset;
    156156#endif
    157157
     
    12811281
    12821282    STAMR3PRINTONEARGS Args;
    1283     Args.pVM = pUVM->pVM;
     1283    Args.pUVM = pUVM;
    12841284    Args.pvArg = NULL;
    12851285    Args.pfnPrintf = stamR3EnumLogPrintf;
     
    13211321
    13221322    STAMR3PRINTONEARGS Args;
    1323     Args.pVM = pUVM->pVM;
     1323    Args.pUVM = pUVM;
    13241324    Args.pvArg = NULL;
    13251325    Args.pfnPrintf = stamR3EnumRelLogPrintf;
     
    13601360
    13611361    STAMR3PRINTONEARGS Args;
    1362     Args.pVM = pUVM->pVM;
     1362    Args.pUVM = pUVM;
    13631363    Args.pvArg = NULL;
    13641364    Args.pfnPrintf = stamR3EnumPrintf;
     
    14311431        {
    14321432            char szBuf[512];
    1433             pDesc->u.Callback.pfnPrint(pArgs->pVM, pDesc->u.Callback.pvSample, szBuf, sizeof(szBuf));
     1433            pDesc->u.Callback.pfnPrint(pArgs->pUVM->pVM, pDesc->u.Callback.pvSample, szBuf, sizeof(szBuf));
    14341434            pArgs->pfnPrintf(pArgs, "%-32s %s %s\n", pDesc->pszName, szBuf, STAMR3GetUnit(pDesc->enmUnit));
    14351435            break;
     
    19141914
    19151915/**
    1916  * The '.stats' command.
    1917  *
    1918  * @returns VBox status.
    1919  * @param   pCmd        Pointer to the command descriptor (as registered).
    1920  * @param   pCmdHlp     Pointer to command helper functions.
    1921  * @param   pVM         Pointer to the current VM (if any).
    1922  * @param   paArgs      Pointer to (readonly) array of arguments.
    1923  * @param   cArgs       Number of arguments in the array.
    1924  */
    1925 static DECLCALLBACK(int) stamR3CmdStats(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
     1916 * @callback_method_impl{FNDBGCCMD, The '.stats' command.}
     1917 */
     1918static DECLCALLBACK(int) stamR3CmdStats(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
    19261919{
    19271920    /*
    19281921     * Validate input.
    19291922     */
    1930     DBGC_CMDHLP_REQ_VM_RET(pCmdHlp, pCmd, pVM);
    1931     PUVM pUVM = pVM->pUVM;
     1923    DBGC_CMDHLP_REQ_UVM_RET(pCmdHlp, pCmd, pUVM);
    19321924    if (!pUVM->stam.s.pHead)
    19331925        return DBGCCmdHlpFail(pCmdHlp, pCmd, "No statistics present");
     
    19371929     */
    19381930    STAMR3PRINTONEARGS Args;
    1939     Args.pVM        = pVM;
     1931    Args.pUVM       = pUVM;
    19401932    Args.pvArg      = pCmdHlp;
    19411933    Args.pfnPrintf  = stamR3EnumDbgfPrintf;
     
    19651957
    19661958/**
    1967  * The '.statsreset' command.
    1968  *
    1969  * @returns VBox status.
    1970  * @param   pCmd        Pointer to the command descriptor (as registered).
    1971  * @param   pCmdHlp     Pointer to command helper functions.
    1972  * @param   pVM         Pointer to the current VM (if any).
    1973  * @param   paArgs      Pointer to (readonly) array of arguments.
    1974  * @param   cArgs       Number of arguments in the array.
    1975  */
    1976 static DECLCALLBACK(int) stamR3CmdStatsReset(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
     1959 * @callback_method_impl{FNDBGCCMD, The '.statsreset' command.}
     1960 */
     1961static DECLCALLBACK(int) stamR3CmdStatsReset(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
    19771962{
    19781963    /*
    19791964     * Validate input.
    19801965     */
    1981     DBGC_CMDHLP_REQ_VM_RET(pCmdHlp, pCmd, pVM);
    1982     PUVM pUVM = pVM->pUVM;
     1966    DBGC_CMDHLP_REQ_UVM_RET(pCmdHlp, pCmd, pUVM);
    19831967    if (!pUVM->stam.s.pHead)
    19841968        return DBGCCmdHlpFail(pCmdHlp, pCmd, "No statistics present");
  • trunk/src/VBox/VMM/VMMR3/TRPM.cpp

    r44118 r44399  
    15101510
    15111511# ifdef LOG_ENABLED
    1512         DBGFR3InfoLog(pVM, "cpumguest", "TRPMInject");
    1513         DBGFR3DisasInstrCurrentLog(pVCpu, "TRPMInject");
     1512        DBGFR3_INFO_LOG(pVM, "cpumguest", "TRPMInject");
     1513        DBGFR3_DISAS_INSTR_CUR_LOG(pVCpu, "TRPMInject");
    15141514# endif
    15151515
  • trunk/src/VBox/VMM/VMMR3/VM.cpp

    r44393 r44399  
    730730                             */
    731731                            void *pvUser = NULL;
    732                             rc = DBGCTcpCreate(pVM, &pvUser);
     732                            rc = DBGCTcpCreate(pUVM, &pvUser);
    733733                            if (    RT_SUCCESS(rc)
    734734                                ||  rc == VERR_NET_ADDRESS_IN_USE)
     
    760760                                }
    761761#ifdef VBOX_WITH_DEBUGGER
    762                                 DBGCTcpTerminate(pVM, pUVM->vm.s.pvDBGC);
     762                                DBGCTcpTerminate(pUVM, pUVM->vm.s.pvDBGC);
    763763                                pUVM->vm.s.pvDBGC = NULL;
    764764                            }
     
    22012201            bool fOldBuffered = RTLogRelSetBuffering(true /*fBuffered*/);
    22022202            RTLogRelPrintf("****************** Guest state at power off ******************\n");
    2203             DBGFR3Info(pVM, "cpumguest", "verbose", DBGFR3InfoLogRelHlp());
     2203            DBGFR3Info(pVM->pUVM, "cpumguest", "verbose", DBGFR3InfoLogRelHlp());
    22042204            RTLogRelPrintf("***\n");
    2205             DBGFR3Info(pVM, "mode", NULL, DBGFR3InfoLogRelHlp());
     2205            DBGFR3Info(pVM->pUVM, "mode", NULL, DBGFR3InfoLogRelHlp());
    22062206            RTLogRelPrintf("***\n");
    2207             DBGFR3Info(pVM, "activetimers", NULL, DBGFR3InfoLogRelHlp());
     2207            DBGFR3Info(pVM->pUVM, "activetimers", NULL, DBGFR3InfoLogRelHlp());
    22082208            RTLogRelPrintf("***\n");
    2209             DBGFR3Info(pVM, "gdt", NULL, DBGFR3InfoLogRelHlp());
     2209            DBGFR3Info(pVM->pUVM, "gdt", NULL, DBGFR3InfoLogRelHlp());
    22102210            /** @todo dump guest call stack. */
    22112211#if 1 // "temporary" while debugging #1589
     
    23972397        AssertRC(rc);
    23982398#ifdef VBOX_WITH_DEBUGGER
    2399         rc = DBGCTcpTerminate(pVM, pUVM->vm.s.pvDBGC);
     2399        rc = DBGCTcpTerminate(pUVM, pUVM->vm.s.pvDBGC);
    24002400        pUVM->vm.s.pvDBGC = NULL;
    24012401#endif
     
    27162716         */
    27172717        RTLogPrintf("\n\nThe VM was reset:\n");
    2718         DBGFR3Info(pVM, "cpum", "verbose", NULL);
     2718        DBGFR3Info(pVM->pUVM, "cpum", "verbose", NULL);
    27192719#endif
    27202720
     
    37843784
    37853785/**
     3786 * Sets the error message.
     3787 *
     3788 * @returns rc. Meaning you can do:
     3789 *    @code
     3790 *    return VM_SET_ERROR_U(pUVM, VERR_OF_YOUR_CHOICE, "descriptive message");
     3791 *    @endcode
     3792 * @param   pUVM            The user mode VM handle.
     3793 * @param   rc              VBox status code.
     3794 * @param   RT_SRC_POS_DECL Use RT_SRC_POS.
     3795 * @param   pszFormat       Error message format string.
     3796 * @param   ...             Error message arguments.
     3797 * @thread  Any
     3798 */
     3799VMMR3DECL(int) VMR3SetError(PUVM pUVM, int rc, RT_SRC_POS_DECL, const char *pszFormat, ...)
     3800{
     3801    va_list va;
     3802    va_start(va, pszFormat);
     3803    int rcRet = VMR3SetErrorV(pUVM, rc, pszFile, iLine, pszFunction, pszFormat, va);
     3804    va_end(va);
     3805    return rcRet;
     3806}
     3807
     3808
     3809/**
     3810 * Sets the error message.
     3811 *
     3812 * @returns rc. Meaning you can do:
     3813 *    @code
     3814 *    return VM_SET_ERROR_U(pUVM, VERR_OF_YOUR_CHOICE, "descriptive message");
     3815 *    @endcode
     3816 * @param   pUVM            The user mode VM handle.
     3817 * @param   rc              VBox status code.
     3818 * @param   RT_SRC_POS_DECL Use RT_SRC_POS.
     3819 * @param   pszFormat       Error message format string.
     3820 * @param   va              Error message arguments.
     3821 * @thread  Any
     3822 */
     3823VMMR3DECL(int) VMR3SetErrorV(PUVM pUVM, int rc, RT_SRC_POS_DECL, const char *pszFormat, va_list va)
     3824{
     3825    UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE);
     3826    VM_ASSERT_VALID_EXT_RETURN(pUVM->pVM, VERR_INVALID_VM_HANDLE);
     3827    return VMSetErrorV(pUVM->pVM, rc, pszFile, iLine, pszFunction, pszFormat, va);
     3828}
     3829
     3830
     3831
     3832/**
    37863833 * Registers a VM runtime error callback.
    37873834 *
  • trunk/src/VBox/VMM/VMMR3/VMMGuruMeditation.cpp

    r43387 r44399  
    415415
    416416                    PCDBGFSTACKFRAME pFirstFrame;
    417                     rc2 = DBGFR3StackWalkBeginEx(pVM, pVCpu->idCpu, DBGFCODETYPE_RING0, &ebp, &esp, &pc,
     417                    rc2 = DBGFR3StackWalkBeginEx(pVM->pUVM, pVCpu->idCpu, DBGFCODETYPE_RING0, &ebp, &esp, &pc,
    418418                                                 DBGFRETURNTYPE_INVALID, &pFirstFrame);
    419419                    if (RT_SUCCESS(rc2))
     
    527527                /* Disassemble the instruction. */
    528528                char szInstr[256];
    529                 rc2 = DBGFR3DisasInstrEx(pVM, pVCpu->idCpu, 0, 0, DBGF_DISAS_FLAGS_CURRENT_HYPER | DBGF_DISAS_FLAGS_DEFAULT_MODE,
     529                rc2 = DBGFR3DisasInstrEx(pVM->pUVM, pVCpu->idCpu, 0, 0,
     530                                         DBGF_DISAS_FLAGS_CURRENT_HYPER | DBGF_DISAS_FLAGS_DEFAULT_MODE,
    530531                                         &szInstr[0], sizeof(szInstr), NULL);
    531532                if (RT_SUCCESS(rc2))
     
    538539                                "!!\n"
    539540                                "!!\n");
    540                 rc2 = DBGFR3Info(pVM, "cpumhyper", "verbose", pHlp);
     541                rc2 = DBGFR3Info(pVM->pUVM, "cpumhyper", "verbose", pHlp);
    541542                fDoneHyper = true;
    542543
    543544                /* Callstack. */
    544545                PCDBGFSTACKFRAME pFirstFrame;
    545                 rc2 = DBGFR3StackWalkBegin(pVM, pVCpu->idCpu, DBGFCODETYPE_HYPER, &pFirstFrame);
     546                rc2 = DBGFR3StackWalkBegin(pVM->pUVM, pVCpu->idCpu, DBGFCODETYPE_HYPER, &pFirstFrame);
    546547                if (RT_SUCCESS(rc2))
    547548                {
     
    599600        case VERR_IEM_ASPECT_NOT_IMPLEMENTED:
    600601        {
    601             DBGFR3Info(pVM, "cpumguest", NULL, pHlp);
    602             DBGFR3Info(pVM, "cpumguestinstr", NULL, pHlp);
     602            DBGFR3Info(pVM->pUVM, "cpumguest", NULL, pHlp);
     603            DBGFR3Info(pVM->pUVM, "cpumguestinstr", NULL, pHlp);
    603604            break;
    604605        }
     
    643644                        "!!\n",
    644645                        aInfo[i].pszInfo, aInfo[i].pszArgs);
    645         DBGFR3Info(pVM, aInfo[i].pszInfo, aInfo[i].pszArgs, pHlp);
     646        DBGFR3Info(pVM->pUVM, aInfo[i].pszInfo, aInfo[i].pszArgs, pHlp);
    646647    }
    647648
  • trunk/src/VBox/VMM/VMMR3/VMMTests.cpp

    r43864 r44399  
    189189#ifdef VBOX_WITH_RAW_MODE
    190190    PVMCPU pVCpu = &pVM->aCpus[0];
     191    PUVM   pUVM  = pVM->pUVM;
    191192
    192193# ifdef NO_SUPCALLR0VMM
     
    251252        RTPrintf("VMM: testing hardware bp at 0x10000 (not hit)\n");
    252253        DBGFADDRESS Addr;
    253         DBGFR3AddrFromFlat(pVM, &Addr, 0x10000);
     254        DBGFR3AddrFromFlat(pUVM, &Addr, 0x10000);
    254255        RTUINT iBp0;
    255         rc = DBGFR3BpSetReg(pVM, &Addr, 0,  ~(uint64_t)0, X86_DR7_RW_EO, 1, &iBp0);
     256        rc = DBGFR3BpSetReg(pUVM, &Addr, 0,  ~(uint64_t)0, X86_DR7_RW_EO, 1, &iBp0);
    256257        AssertReleaseRC(rc);
    257258        rc = vmmR3DoGCTest(pVM, VMMGC_DO_TESTCASE_NOP, 0);
     
    264265        /* a bad one at VMMGCEntry */
    265266        RTPrintf("VMM: testing hardware bp at VMMGCEntry (hit)\n");
    266         DBGFR3AddrFromFlat(pVM, &Addr, RCPtrEP);
     267        DBGFR3AddrFromFlat(pUVM, &Addr, RCPtrEP);
    267268        RTUINT iBp1;
    268         rc = DBGFR3BpSetReg(pVM, &Addr, 0,  ~(uint64_t)0, X86_DR7_RW_EO, 1, &iBp1);
     269        rc = DBGFR3BpSetReg(pUVM, &Addr, 0,  ~(uint64_t)0, X86_DR7_RW_EO, 1, &iBp1);
    269270        AssertReleaseRC(rc);
    270271        rc = vmmR3DoGCTest(pVM, VMMGC_DO_TESTCASE_NOP, 0);
     
    318319
    319320        /* done, clear it */
    320         if (    RT_FAILURE(DBGFR3BpClear(pVM, iBp0))
    321             ||  RT_FAILURE(DBGFR3BpClear(pVM, iBp1)))
     321        if (    RT_FAILURE(DBGFR3BpClear(pUVM, iBp0))
     322            ||  RT_FAILURE(DBGFR3BpClear(pUVM, iBp1)))
    322323        {
    323324            RTPrintf("VMM: Failed to clear breakpoints!\n");
  • trunk/src/VBox/VMM/VMMRZ/DBGFRZ.cpp

    r41965 r44399  
    4343 * @param   uDr6        The DR6 register value.
    4444 */
    45 VMMRZDECL(int) DBGFRZTrap01Handler(PVM pVM, PVMCPU pVCpu, PCPUMCTXCORE pRegFrame, RTGCUINTREG uDr6)
     45VMMRZ_INT_DECL(int) DBGFRZTrap01Handler(PVM pVM, PVMCPU pVCpu, PCPUMCTXCORE pRegFrame, RTGCUINTREG uDr6)
    4646{
    4747#ifdef IN_RC
     
    110110 * @param   pRegFrame   Pointer to the register frame for the trap.
    111111 */
    112 VMMRZDECL(int) DBGFRZTrap03Handler(PVM pVM, PVMCPU pVCpu, PCPUMCTXCORE pRegFrame)
     112VMMRZ_INT_DECL(int) DBGFRZTrap03Handler(PVM pVM, PVMCPU pVCpu, PCPUMCTXCORE pRegFrame)
    113113{
    114114#ifdef IN_RC
  • trunk/src/VBox/VMM/include/DBGFInternal.h

    r39154 r44399  
    233233    DBGFCMDDATA                 VMMCmdData;
    234234
    235     /** List of registered info handlers. */
    236     R3PTRTYPE(PDBGFINFO)        pInfoFirst;
    237     /** Critical section protecting the above list. */
    238     RTCRITSECT                  InfoCritSect;
    239 
    240235    /** Range tree containing the loaded symbols of the a VM.
    241236     * This tree will never have blind spots. */
     
    259254     * @remark This is currently a fixed size array for reasons of simplicity. */
    260255    DBGFBP                      aBreakpoints[32];
    261 
     256} DBGF;
     257/** Pointer to DBGF Data. */
     258typedef DBGF *PDBGF;
     259
     260
     261/** Converts a DBGFCPU pointer into a VM pointer. */
     262#define DBGFCPU_2_VM(pDbgfCpu) ((PVM)((uint8_t *)(pDbgfCpu) + (pDbgfCpu)->offVM))
     263
     264/**
     265 * The per CPU data for DBGF.
     266 */
     267typedef struct DBGFCPU
     268{
     269    /** The offset into the VM structure.
     270     * @see DBGFCPU_2_VM(). */
     271    uint32_t                offVM;
     272
     273    /** Current active breakpoint (id).
     274     * This is ~0U if not active. It is set when a execution engine
     275     * encounters a breakpoint and returns VINF_EM_DBG_BREAKPOINT. This is
     276     * currently not used for REM breakpoints because of the lazy coupling
     277     * between VBox and REM. */
     278    uint32_t                iActiveBp;
     279    /** Set if we're singlestepping in raw mode.
     280     * This is checked and cleared in the \#DB handler. */
     281    bool                    fSingleSteppingRaw;
     282
     283    /** Padding the structure to 16 bytes. */
     284    bool                    afReserved[7];
     285} DBGFCPU;
     286/** Pointer to DBGFCPU data. */
     287typedef DBGFCPU *PDBGFCPU;
     288
     289
     290/**
     291 * The DBGF data kept in the UVM.
     292 */
     293typedef struct DBGFUSERPERVM
     294{
    262295    /** The address space database lock. */
    263296    RTSEMRW                     hAsDbLock;
     
    293326    /** The head of the Guest OS digger instances. */
    294327    R3PTRTYPE(PDBGFOS)          pOSHead;
    295 } DBGF;
    296 /** Pointer to DBGF Data. */
    297 typedef DBGF *PDBGF;
    298 
    299 
    300 /** Converts a DBGFCPU pointer into a VM pointer. */
    301 #define DBGFCPU_2_VM(pDbgfCpu) ((PVM)((uint8_t *)(pDbgfCpu) + (pDbgfCpu)->offVM))
    302 
    303 /**
    304  * The per CPU data for DBGF.
    305  */
    306 typedef struct DBGFCPU
    307 {
    308     /** The offset into the VM structure.
    309      * @see DBGFCPU_2_VM(). */
    310     uint32_t                offVM;
    311 
    312     /** Current active breakpoint (id).
    313      * This is ~0U if not active. It is set when a execution engine
    314      * encounters a breakpoint and returns VINF_EM_DBG_BREAKPOINT. This is
    315      * currently not used for REM breakpoints because of the lazy coupling
    316      * between VBox and REM. */
    317     uint32_t                iActiveBp;
    318     /** Set if we're singlestepping in raw mode.
    319      * This is checked and cleared in the \#DB handler. */
    320     bool                    fSingleSteppingRaw;
    321 
    322     /** Padding the structure to 16 bytes. */
    323     bool                    afReserved[7];
    324 
     328
     329    /** List of registered info handlers. */
     330    R3PTRTYPE(PDBGFINFO)        pInfoFirst;
     331    /** Critical section protecting the above list. */
     332    RTCRITSECT                  InfoCritSect;
     333
     334} DBGFUSERPERVM;
     335
     336/**
     337 * The per-CPU DBGF data kept in the UVM.
     338 */
     339typedef struct DBGFUSERPERVMCPU
     340{
    325341    /** The guest register set for this CPU.  Can be NULL. */
    326342    R3PTRTYPE(struct DBGFREGSET *) pGuestRegSet;
    327343    /** The hypervisor register set for this CPU.  Can be NULL. */
    328344    R3PTRTYPE(struct DBGFREGSET *) pHyperRegSet;
    329 } DBGFCPU;
    330 /** Pointer to DBGFCPU data. */
    331 typedef DBGFCPU *PDBGFCPU;
    332 
    333 
    334 int  dbgfR3AsInit(PVM pVM);
    335 void dbgfR3AsTerm(PVM pVM);
    336 void dbgfR3AsRelocate(PVM pVM, RTGCUINTPTR offDelta);
     345} DBGFUSERPERVMCPU;
     346
     347
     348int  dbgfR3AsInit(PUVM pUVM);
     349void dbgfR3AsTerm(PUVM pUVM);
     350void dbgfR3AsRelocate(PUVM pUVM, RTGCUINTPTR offDelta);
    337351int  dbgfR3BpInit(PVM pVM);
    338 int  dbgfR3InfoInit(PVM pVM);
    339 int  dbgfR3InfoTerm(PVM pVM);
    340 void dbgfR3OSTerm(PVM pVM);
    341 int  dbgfR3RegInit(PVM pVM);
    342 void dbgfR3RegTerm(PVM pVM);
     352int  dbgfR3InfoInit(PUVM pUVM);
     353int  dbgfR3InfoTerm(PUVM pUVM);
     354void dbgfR3OSTerm(PUVM pUVM);
     355int  dbgfR3RegInit(PUVM pUVM);
     356void dbgfR3RegTerm(PUVM pUVM);
    343357int  dbgfR3SymInit(PVM pVM);
    344358int  dbgfR3SymTerm(PVM pVM);
  • trunk/src/VBox/VMM/testcase/tstAnimate.cpp

    r44387 r44399  
    881881                        rc = EMR3SetExecutionPolicy(pUVM, EMEXECPOLICY_RECOMPILE_RING0, true); AssertReleaseRC(rc);
    882882                        rc = EMR3SetExecutionPolicy(pUVM, EMEXECPOLICY_RECOMPILE_RING3, true); AssertReleaseRC(rc);
    883                         DBGFR3Info(pVM, "cpumguest", "verbose", NULL);
     883                        DBGFR3Info(pUVM, "cpumguest", "verbose", NULL);
    884884                        if (fPowerOn)
    885885                            rc = VMR3PowerOn(pUVM);
     
    903903                     */
    904904                    RTPrintf("info: entering debugger...\n");
    905                     DBGFR3Info(pVM, "cpumguest", "verbose", NULL);
     905                    DBGFR3Info(pUVM, "cpumguest", "verbose", NULL);
    906906                    signal(SIGINT, SigInterrupt);
    907907                    while (!g_fSignaled)
  • trunk/src/VBox/VMM/testcase/tstMicro.cpp

    r44347 r44399  
    255255        return rc;
    256256    }
    257     DBGFR3PagingDumpEx(pVM, 0 /*idCpu*/, DBGFPGDMP_FLAGS_CURRENT_CR3 | DBGFPGDMP_FLAGS_CURRENT_MODE
     257    DBGFR3PagingDumpEx(pVM->pUVM, 0 /*idCpu*/, DBGFPGDMP_FLAGS_CURRENT_CR3 | DBGFPGDMP_FLAGS_CURRENT_MODE
    258258                       | DBGFPGDMP_FLAGS_SHADOW | DBGFPGDMP_FLAGS_HEADER | DBGFPGDMP_FLAGS_PRINT_CR3,
    259259                       0 /*cr3*/, 0 /*u64FirstAddr*/, UINT64_MAX /*u64LastAddr*/, 99 /*cMaxDepth*/, NULL);
  • trunk/src/VBox/VMM/testcase/tstVMStruct.h

    r43658 r44399  
    219219    GEN_CHECK_OFF(DBGF, enmVMMCmd);
    220220    GEN_CHECK_OFF(DBGF, VMMCmdData);
    221     GEN_CHECK_OFF(DBGF, pInfoFirst);
    222     GEN_CHECK_OFF(DBGF, InfoCritSect);
     221    //GEN_CHECK_OFF(DBGF, pInfoFirst);
     222    //GEN_CHECK_OFF(DBGF, InfoCritSect);
    223223    GEN_CHECK_OFF(DBGF, SymbolTree);
    224224    GEN_CHECK_OFF(DBGF, pSymbolSpace);
     
    228228    GEN_CHECK_OFF(DBGF, aHwBreakpoints);
    229229    GEN_CHECK_OFF(DBGF, aBreakpoints);
    230     GEN_CHECK_OFF(DBGF, hAsDbLock);
    231     GEN_CHECK_OFF(DBGF, hRegDbLock);
    232     GEN_CHECK_OFF(DBGF, RegSetSpace);
    233     GEN_CHECK_OFF(DBGF, pCurOS);
     230    //GEN_CHECK_OFF(DBGF, hAsDbLock);
     231    //GEN_CHECK_OFF(DBGF, hRegDbLock);
     232    //GEN_CHECK_OFF(DBGF, RegSetSpace);
     233    //GEN_CHECK_OFF(DBGF, pCurOS);
    234234    GEN_CHECK_SIZE(DBGFEVENT);
    235235
     
    237237    GEN_CHECK_OFF(DBGFCPU, iActiveBp);
    238238    GEN_CHECK_OFF(DBGFCPU, fSingleSteppingRaw);
    239     GEN_CHECK_OFF(DBGFCPU, pGuestRegSet);
    240     GEN_CHECK_OFF(DBGFCPU, pHyperRegSet);
     239    //GEN_CHECK_OFF(DBGFCPU, pGuestRegSet);
     240    //GEN_CHECK_OFF(DBGFCPU, pHyperRegSet);
    241241
    242242    GEN_CHECK_SIZE(EM);
  • trunk/src/recompiler/VBoxREMWrapper.cpp

    r44362 r44399  
    615615static const REMPARMDESC g_aArgsDBGFR3DisasInstrEx[] =
    616616{
    617     { REMPARMDESC_FLAGS_INT,        sizeof(PVM),                NULL },
     617    { REMPARMDESC_FLAGS_INT,        sizeof(PUVM),               NULL },
    618618    { REMPARMDESC_FLAGS_INT,        sizeof(VMCPUID),            NULL },
    619619    { REMPARMDESC_FLAGS_INT,        sizeof(RTSEL),              NULL },
     
    631631static const REMPARMDESC g_aArgsDBGFR3Info[] =
    632632{
    633     { REMPARMDESC_FLAGS_INT,        sizeof(PVM),                NULL },
     633    { REMPARMDESC_FLAGS_INT,        sizeof(PUVM),               NULL },
    634634    { REMPARMDESC_FLAGS_INT,        sizeof(const char *),       NULL },
    635635    { REMPARMDESC_FLAGS_INT,        sizeof(const char *),       NULL },
     
    638638static const REMPARMDESC g_aArgsDBGFR3AsSymbolByAddr[] =
    639639{
    640     { REMPARMDESC_FLAGS_INT,        sizeof(PVM),                NULL },
     640    { REMPARMDESC_FLAGS_INT,        sizeof(PUVM),               NULL },
    641641    { REMPARMDESC_FLAGS_INT,        sizeof(RTDBGAS),            NULL },
    642642    { REMPARMDESC_FLAGS_INT,        sizeof(PCDBGFADDRESS),      NULL },
     
    647647static const REMPARMDESC g_aArgsDBGFR3AddrFromFlat[] =
    648648{
    649     { REMPARMDESC_FLAGS_INT,        sizeof(PVM),                NULL },
     649    { REMPARMDESC_FLAGS_INT,        sizeof(PUVM),               NULL },
    650650    { REMPARMDESC_FLAGS_INT,        sizeof(PDBGFADDRESS),       NULL },
    651651    { REMPARMDESC_FLAGS_INT,        sizeof(RTGCUINTPTR),        NULL }
  • trunk/src/recompiler/VBoxRecompiler.c

    r44330 r44399  
    4545#include "REMInternal.h"
    4646#include <VBox/vmm/vm.h>
     47#include <VBox/vmm/uvm.h>
    4748#include <VBox/param.h>
    4849#include <VBox/err.h>
     
    193194 * Debugger commands.
    194195 */
    195 static DECLCALLBACK(int) remR3CmdDisasEnableStepping(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);
     196static FNDBGCCMD remR3CmdDisasEnableStepping;;
    196197
    197198/** '.remstep' arguments. */
     
    11211122         */
    11221123        remR3StateUpdate(pVM, pVCpu);
    1123         DBGFR3Info(pVM, "cpumguest", NULL, NULL);
     1124        DBGFR3Info(pVM->pUVM, "cpumguest", NULL, NULL);
    11241125        szBuf[0] = '\0';
    1125         rc = DBGFR3DisasInstrEx(pVM,
     1126        rc = DBGFR3DisasInstrEx(pVM->pUVM,
    11261127                                pVCpu->idCpu,
    11271128                                0, /* Sel */
     
    34903491            "*** handlers\n",
    34913492            (RTGCPTR)pTLBEntry->addr_code, (RTGCPHYS)pTLBEntry->addend, (RTGCPTR)addr, pVM->rem.s.iHandlerMemType, pVM->rem.s.iMMIOMemType, (RTGCPHYS)ioTLBEntry));
    3492     DBGFR3Info(pVM, "handlers", NULL, DBGFR3InfoLogRelHlp());
     3493    DBGFR3Info(pVM->pUVM, "handlers", NULL, DBGFR3InfoLogRelHlp());
    34933494    LogRel(("*** mmio\n"));
    3494     DBGFR3Info(pVM, "mmio", NULL, DBGFR3InfoLogRelHlp());
     3495    DBGFR3Info(pVM->pUVM, "mmio", NULL, DBGFR3InfoLogRelHlp());
    34953496    LogRel(("*** phys\n"));
    3496     DBGFR3Info(pVM, "phys", NULL, DBGFR3InfoLogRelHlp());
     3497    DBGFR3Info(pVM->pUVM, "phys", NULL, DBGFR3InfoLogRelHlp());
    34973498    cpu_abort(env, "Trying to execute code with memory type addr_code=%RGv addend=%RGp at %RGv. (iHandlerMemType=%#x iMMIOMemType=%#x)\n",
    34983499              (RTGCPTR)pTLBEntry->addr_code, (RTGCPHYS)pTLBEntry->addend, (RTGCPTR)addr, pVM->rem.s.iHandlerMemType, pVM->rem.s.iMMIOMemType);
     
    39233924 * External Debugger Command: .remstep [on|off|1|0]
    39243925 */
    3925 static DECLCALLBACK(int) remR3CmdDisasEnableStepping(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs)
     3926static DECLCALLBACK(int) remR3CmdDisasEnableStepping(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs)
    39263927{
    39273928    int rc;
     3929    PVM pVM = pUVM->pVM;
    39283930
    39293931    if (cArgs == 0)
     
    39883990     */
    39893991    if (fLog2)
    3990         DBGFR3InfoLog(pVM, "cpumguest", pszPrefix);
     3992        DBGFR3_INFO_LOG(pVM, "cpumguest", pszPrefix);
    39913993
    39923994    /*
     
    39984000        char    szBuf[256];
    39994001        szBuf[0] = '\0';
    4000         int rc = DBGFR3DisasInstrEx(pVCpu->pVMR3,
     4002        int rc = DBGFR3DisasInstrEx(pVCpu->pVMR3->pUVM,
    40014003                                    pVCpu->idCpu,
    40024004                                    0, /* Sel */
     
    40924094            char        szBuf[256];
    40934095            uint32_t    cbInstr;
    4094             int rc = DBGFR3DisasInstrEx(pVM,
     4096            int rc = DBGFR3DisasInstrEx(pVM->pUVM,
    40954097                                        pVCpu->idCpu,
    40964098                                        cs,
     
    41314133    DBGFADDRESS Addr;
    41324134
    4133     int rc = DBGFR3AsSymbolByAddr(pVM, DBGF_AS_GLOBAL, DBGFR3AddrFromFlat(pVM, &Addr, orig_addr), &off, &Sym, NULL /*phMod*/);
     4135    int rc = DBGFR3AsSymbolByAddr(pVM->pUVM, DBGF_AS_GLOBAL, DBGFR3AddrFromFlat(pVM->pUVM, &Addr, orig_addr),
     4136                                  &off, &Sym, NULL /*phMod*/);
    41344137    if (RT_SUCCESS(rc))
    41354138    {
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette