- Timestamp:
- Jan 27, 2013 9:12:53 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 72 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/dbg.h
r41573 r44399 8 8 9 9 /* 10 * Copyright (C) 2006-20 07Oracle Corporation10 * Copyright (C) 2006-2013 Oracle Corporation 11 11 * 12 12 * This file is part of VirtualBox Open Source Edition (OSE), as … … 478 478 * @returns VBox status code appropriate to return from a command. 479 479 * @param pCmdHlp Pointer to the command callback structure. 480 * @param pVM VM handle if GC or physical HC address.481 480 * @param pvBuffer Where to store the read data. 482 481 * @param cbRead Number of bytes to read. … … 488 487 * will cause failure. 489 488 */ 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); 491 490 492 491 /** … … 495 494 * @returns VBox status code appropriate to return from a command. 496 495 * @param pCmdHlp Pointer to the command callback structure. 497 * @param pVM VM handle if GC or physical HC address.498 496 * @param pvBuffer What to write. 499 497 * @param cbWrite Number of bytes to write. … … 503 501 * might have been written to the specified address. 504 502 */ 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); 506 504 507 505 /** … … 721 719 * @copydoc FNDBGCHLPMEMREAD 722 720 */ 723 DECLINLINE(int) DBGCCmdHlpMemRead(PDBGCCMDHLP pCmdHlp, PVM pVM,void *pvBuffer, size_t cbRead, PCDBGCVAR pVarPointer, size_t *pcbRead)724 { 725 return pCmdHlp->pfnMemRead(pCmdHlp, p VM, pvBuffer, cbRead, pVarPointer, pcbRead);721 DECLINLINE(int) DBGCCmdHlpMemRead(PDBGCCMDHLP pCmdHlp, void *pvBuffer, size_t cbRead, PCDBGCVAR pVarPointer, size_t *pcbRead) 722 { 723 return pCmdHlp->pfnMemRead(pCmdHlp, pvBuffer, cbRead, pVarPointer, pcbRead); 726 724 } 727 725 … … 818 816 /** Assert+return like macro that the VM handle is present. 819 817 * 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) \ 821 819 do { \ 822 if (!(p VM)) \820 if (!(pUVM)) \ 823 821 return DBGCCmdHlpFail(pCmdHlp, pCmd, "No VM selected"); \ 824 822 } while (0) … … 927 925 * @param pCmd Pointer to the command descriptor (as registered). 928 926 * @param pCmdHlp Pointer to command helper functions. 929 * @param p VM Pointer to the current VM (if any).927 * @param pUVM The user mode VM handle, can in theory be NULL. 930 928 * @param paArgs Pointer to (readonly) array of arguments. 931 929 * @param cArgs Number of arguments in the array. 932 930 */ 933 typedef DECLCALLBACK(int) FNDBGCCMD(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, P VM pVM, PCDBGCVAR paArgs, unsigned cArgs);931 typedef DECLCALLBACK(int) FNDBGCCMD(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs); 934 932 /** Pointer to a FNDBGCCMD() function. */ 935 933 typedef FNDBGCCMD *PFNDBGCCMD; … … 976 974 * @param pCmd Pointer to the command descriptor (as registered). 977 975 * @param pCmdHlp Pointer to command helper functions. 978 * @param p VM Pointer to the current VM (if any).976 * @param pUVM The user mode VM handle, can in theory be NULL. 979 977 * @param paArgs Pointer to (readonly) array of arguments. 980 978 * @param cArgs Number of arguments in the array. 981 979 * @param pResult Where to return the result. 982 980 */ 983 typedef DECLCALLBACK(int) FNDBGCFUNC(PCDBGCFUNC pFunc, PDBGCCMDHLP pCmdHlp, P VM pVM, PCDBGCVAR paArgs, unsigned cArgs,981 typedef DECLCALLBACK(int) FNDBGCFUNC(PCDBGCFUNC pFunc, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs, 984 982 PDBGCVAR pResult); 985 983 /** Pointer to a FNDBGCFUNC() function. */ … … 1092 1090 } DBGCBACK; 1093 1091 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 */ 1092 DBGDECL(int) DBGCCreate(PUVM pUVM, PDBGCBACK pBack, unsigned fFlags); 1123 1093 DBGDECL(int) DBGCRegisterCommands(PCDBGCCMD paCommands, unsigned cCommands); 1124 1125 1126 /**1127 * Deregister one or more external commands previously registered by1128 * DBGCRegisterCommands().1129 *1130 * @returns VBox status.1131 * @param paCommands Pointer to an array of command descriptors1132 * as given to DBGCRegisterCommands().1133 * @param cCommands Number of commands.1134 */1135 1094 DBGDECL(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); 1095 DBGDECL(int) DBGCTcpCreate(PUVM pUVM, void **ppvUser); 1096 DBGDECL(int) DBGCTcpTerminate(PUVM pUVM, void *pvData); 1155 1097 1156 1098 … … 1190 1132 * 1191 1133 * @param enmOperation The operation. 1192 * @param p VM The VM handle. This may be NULL.1134 * @param pUVM The user mode VM handle. This may be NULL. 1193 1135 * @param uArg Extra argument. 1194 1136 */ 1195 typedef DECLCALLBACK(int) FNDBGCPLUGIN(DBGCPLUGINOP enmOperation, P VM pVM, uintptr_t uArg);1137 typedef DECLCALLBACK(int) FNDBGCPLUGIN(DBGCPLUGINOP enmOperation, PUVM pUVM, uintptr_t uArg); 1196 1138 /** Pointer to a FNDBGCPLUGIN. */ 1197 1139 typedef FNDBGCPLUGIN *PFNDBGCPLUGIN; 1198 1140 1199 1141 /** @copydoc FNDBGCPLUGIN */ 1200 DECLEXPORT(int) DBGCPlugInEntry(DBGCPLUGINOP enmOperation, P VM pVM, uintptr_t uArg);1142 DECLEXPORT(int) DBGCPlugInEntry(DBGCPLUGINOP enmOperation, PUVM pUVM, uintptr_t uArg); 1201 1143 1202 1144 #endif /* IN_RING3 */ -
trunk/include/VBox/vmm/dbgf.h
r44373 r44399 47 47 * @{ 48 48 */ 49 VMMRZ DECL(int) DBGFRZTrap01Handler(PVM pVM, PVMCPU pVCpu, PCPUMCTXCORE pRegFrame, RTGCUINTREG uDr6);50 VMMRZ DECL(int) DBGFRZTrap03Handler(PVM pVM, PVMCPU pVCpu, PCPUMCTXCORE pRegFrame);49 VMMRZ_INT_DECL(int) DBGFRZTrap01Handler(PVM pVM, PVMCPU pVCpu, PCPUMCTXCORE pRegFrame, RTGCUINTREG uDr6); 50 VMMRZ_INT_DECL(int) DBGFRZTrap03Handler(PVM pVM, PVMCPU pVCpu, PCPUMCTXCORE pRegFrame); 51 51 /** @} */ 52 52 #endif … … 115 115 /** @} */ 116 116 117 VMMR3DECL(int) DBGFR3AddrFromSelOff(P VM pVM, VMCPUID idCpu, PDBGFADDRESS pAddress, RTSEL Sel, RTUINTPTR off);118 VMMR3DECL(int) DBGFR3AddrFromSelInfoOff(P VM pVM, PDBGFADDRESS pAddress, PCDBGFSELINFO pSelInfo, RTUINTPTR off);119 VMMR3DECL(PDBGFADDRESS) DBGFR3AddrFromFlat(P VM pVM, PDBGFADDRESS pAddress, RTGCUINTPTR FlatPtr);120 VMMR3DECL(PDBGFADDRESS) DBGFR3AddrFromPhys(P VM pVM, PDBGFADDRESS pAddress, RTGCPHYS PhysAddr);121 VMMR3DECL(bool) DBGFR3AddrIsValid(P VM pVM, PCDBGFADDRESS pAddress);122 VMMR3DECL(int) DBGFR3AddrToPhys(P VM pVM, VMCPUID idCpu, PDBGFADDRESS pAddress, PRTGCPHYS pGCPhys);123 VMMR3DECL(int) DBGFR3AddrToHostPhys(P VM pVM, VMCPUID idCpu, PDBGFADDRESS pAddress, PRTHCPHYS pHCPhys);124 VMMR3DECL(int) DBGFR3AddrToVolatileR3Ptr(P VM pVM, VMCPUID idCpu, PDBGFADDRESS pAddress, bool fReadOnly, void **ppvR3Ptr);117 VMMR3DECL(int) DBGFR3AddrFromSelOff(PUVM pUVM, VMCPUID idCpu, PDBGFADDRESS pAddress, RTSEL Sel, RTUINTPTR off); 118 VMMR3DECL(int) DBGFR3AddrFromSelInfoOff(PUVM pUVM, PDBGFADDRESS pAddress, PCDBGFSELINFO pSelInfo, RTUINTPTR off); 119 VMMR3DECL(PDBGFADDRESS) DBGFR3AddrFromFlat(PUVM pUVM, PDBGFADDRESS pAddress, RTGCUINTPTR FlatPtr); 120 VMMR3DECL(PDBGFADDRESS) DBGFR3AddrFromPhys(PUVM pUVM, PDBGFADDRESS pAddress, RTGCPHYS PhysAddr); 121 VMMR3DECL(bool) DBGFR3AddrIsValid(PUVM pUVM, PCDBGFADDRESS pAddress); 122 VMMR3DECL(int) DBGFR3AddrToPhys(PUVM pUVM, VMCPUID idCpu, PDBGFADDRESS pAddress, PRTGCPHYS pGCPhys); 123 VMMR3DECL(int) DBGFR3AddrToHostPhys(PUVM pUVM, VMCPUID idCpu, PDBGFADDRESS pAddress, PRTHCPHYS pHCPhys); 124 VMMR3DECL(int) DBGFR3AddrToVolatileR3Ptr(PUVM pUVM, VMCPUID idCpu, PDBGFADDRESS pAddress, bool fReadOnly, void **ppvR3Ptr); 125 125 VMMR3DECL(PDBGFADDRESS) DBGFR3AddrAdd(PDBGFADDRESS pAddress, RTGCUINTPTR uAddend); 126 126 VMMR3DECL(PDBGFADDRESS) DBGFR3AddrSub(PDBGFADDRESS pAddress, RTGCUINTPTR uSubtrahend); … … 282 282 # endif 283 283 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); 284 VMMR3_INT_DECL(int) DBGFR3Init(PVM pVM); 285 VMMR3_INT_DECL(int) DBGFR3Term(PVM pVM); 286 VMMR3_INT_DECL(void) DBGFR3Relocate(PVM pVM, RTGCINTPTR offDelta); 287 VMMR3_INT_DECL(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, 290 const char *pszFunction, const char *pszFormat, ...); 291 VMMR3DECL(int) DBGFR3EventSrcV(PVM pVM, DBGFEVENTTYPE enmEvent, const char *pszFile, unsigned uLine, 292 const char *pszFunction, const char *pszFormat, va_list args); 293 VMMR3_INT_DECL(int) DBGFR3EventAssertion(PVM pVM, DBGFEVENTTYPE enmEvent, const char *pszMsg1, const char *pszMsg2); 294 VMMR3_INT_DECL(int) DBGFR3EventBreakpoint(PVM pVM, DBGFEVENTTYPE enmEvent); 295 VMMR3_INT_DECL(int) DBGFR3PrgStep(PVMCPU pVCpu); 296 297 VMMR3DECL(int) DBGFR3Attach(PUVM pUVM); 298 VMMR3DECL(int) DBGFR3Detach(PUVM pUVM); 299 VMMR3DECL(int) DBGFR3EventWait(PUVM pUVM, RTMSINTERVAL cMillies, PCDBGFEVENT *ppEvent); 300 VMMR3DECL(int) DBGFR3Halt(PUVM pUVM); 301 VMMR3DECL(bool) DBGFR3IsHalted(PUVM pUVM); 302 VMMR3DECL(bool) DBGFR3CanWait(PUVM pUVM); 303 VMMR3DECL(int) DBGFR3Resume(PUVM pUVM); 304 VMMR3DECL(int) DBGFR3Step(PUVM pUVM, VMCPUID idCpu); 305 VMMR3DECL(int) DBGFR3InjectNMI(PUVM pUVM, VMCPUID idCpu); 303 306 304 307 #endif /* IN_RING3 */ … … 386 389 387 390 #ifdef IN_RING3 /* The breakpoint management API is only available in ring-3. */ 388 VMMR3DECL(int) DBGFR3BpSet(P VM pVM, PCDBGFADDRESS pAddress, uint64_t iHitTrigger, uint64_t iHitDisable, uint32_t *piBp);389 VMMR3DECL(int) DBGFR3BpSetReg(P VM pVM, PCDBGFADDRESS pAddress, uint64_t iHitTrigger, uint64_t iHitDisable,391 VMMR3DECL(int) DBGFR3BpSet(PUVM pUVM, PCDBGFADDRESS pAddress, uint64_t iHitTrigger, uint64_t iHitDisable, uint32_t *piBp); 392 VMMR3DECL(int) DBGFR3BpSetReg(PUVM pUVM, PCDBGFADDRESS pAddress, uint64_t iHitTrigger, uint64_t iHitDisable, 390 393 uint8_t fType, uint8_t cb, uint32_t *piBp); 391 VMMR3DECL(int) DBGFR3BpSetREM(P VM pVM, PCDBGFADDRESS pAddress, uint64_t iHitTrigger, uint64_t iHitDisable, uint32_t *piBp);392 VMMR3DECL(int) DBGFR3BpClear(P VM pVM, uint32_t iBp);393 VMMR3DECL(int) DBGFR3BpEnable(P VM pVM, uint32_t iBp);394 VMMR3DECL(int) DBGFR3BpDisable(P VM pVM, uint32_t iBp);394 VMMR3DECL(int) DBGFR3BpSetREM(PUVM pUVM, PCDBGFADDRESS pAddress, uint64_t iHitTrigger, uint64_t iHitDisable, uint32_t *piBp); 395 VMMR3DECL(int) DBGFR3BpClear(PUVM pUVM, uint32_t iBp); 396 VMMR3DECL(int) DBGFR3BpEnable(PUVM pUVM, uint32_t iBp); 397 VMMR3DECL(int) DBGFR3BpDisable(PUVM pUVM, uint32_t iBp); 395 398 396 399 /** … … 398 401 * 399 402 * @returns VBox status code. Any failure will stop the enumeration. 400 * @param p VM The VM handle.403 * @param pUVM The user mode VM handle. 401 404 * @param pvUser The user argument. 402 405 * @param pBp Pointer to the breakpoint information. (readonly) 403 406 */ 404 typedef DECLCALLBACK(int) FNDBGFBPENUM(P VM pVM, void *pvUser, PCDBGFBP pBp);407 typedef DECLCALLBACK(int) FNDBGFBPENUM(PUVM pUVM, void *pvUser, PCDBGFBP pBp); 405 408 /** Pointer to a breakpoint enumeration callback function. */ 406 409 typedef FNDBGFBPENUM *PFNDBGFBPENUM; 407 410 408 VMMR3DECL(int) DBGFR3BpEnum(PVM pVM, PFNDBGFBPENUM pfnCallback, void *pvUser);411 VMMR3DECL(int) DBGFR3BpEnum(PUVM pUVM, PFNDBGFBPENUM pfnCallback, void *pvUser); 409 412 #endif /* IN_RING3 */ 410 413 411 VMM DECL(RTGCUINTREG)DBGFBpGetDR7(PVM pVM);412 VMM DECL(RTGCUINTREG)DBGFBpGetDR0(PVM pVM);413 VMM DECL(RTGCUINTREG)DBGFBpGetDR1(PVM pVM);414 VMM DECL(RTGCUINTREG)DBGFBpGetDR2(PVM pVM);415 VMM DECL(RTGCUINTREG)DBGFBpGetDR3(PVM pVM);416 VMM DECL(bool)DBGFIsStepping(PVMCPU pVCpu);414 VMM_INT_DECL(RTGCUINTREG) DBGFBpGetDR7(PVM pVM); 415 VMM_INT_DECL(RTGCUINTREG) DBGFBpGetDR0(PVM pVM); 416 VMM_INT_DECL(RTGCUINTREG) DBGFBpGetDR1(PVM pVM); 417 VMM_INT_DECL(RTGCUINTREG) DBGFBpGetDR2(PVM pVM); 418 VMM_INT_DECL(RTGCUINTREG) DBGFBpGetDR3(PVM pVM); 419 VMM_INT_DECL(bool) DBGFIsStepping(PVMCPU pVCpu); 417 420 418 421 419 422 #ifdef IN_RING3 /* The CPU mode API only works in ring-3. */ 420 VMMR3DECL(CPUMMODE) DBGFR3CpuGetMode(PVM pVM, VMCPUID idCpu); 423 VMMR3DECL(CPUMMODE) DBGFR3CpuGetMode(PUVM pUVM, VMCPUID idCpu); 424 VMMR3DECL(VMCPUID) DBGFR3CpuGetCount(PUVM pUVM); 421 425 #endif 422 426 … … 512 516 /** @} */ 513 517 514 VMMR3 DECL(int) DBGFR3InfoRegisterDevice(PVM pVM, const char *pszName, const char *pszDesc, PFNDBGFHANDLERDEV pfnHandler, PPDMDEVINS pDevIns);515 VMMR3 DECL(int) DBGFR3InfoRegisterDriver(PVM pVM, const char *pszName, const char *pszDesc, PFNDBGFHANDLERDRV pfnHandler, PPDMDRVINS pDrvIns);516 VMMR3 DECL(int) DBGFR3InfoRegisterInternal(PVM pVM, const char *pszName, const char *pszDesc, PFNDBGFHANDLERINT pfnHandler);517 VMMR3 DECL(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 VMMR3 DECL(int) DBGFR3InfoDeregisterDevice(PVM pVM, PPDMDEVINS pDevIns, const char *pszName);520 VMMR3 DECL(int) DBGFR3InfoDeregisterDriver(PVM pVM, PPDMDRVINS pDrvIns, const char *pszName);521 VMMR3 DECL(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 VMMR3 DECL(int) DBGFR3InfoMulti(PVM pVM, const char *pszIncludePat, const char *pszExcludePat,528 const char *pszSepFmt, PCDBGFINFOHLP pHlp);518 VMMR3_INT_DECL(int) DBGFR3InfoRegisterDevice(PVM pVM, const char *pszName, const char *pszDesc, PFNDBGFHANDLERDEV pfnHandler, PPDMDEVINS pDevIns); 519 VMMR3_INT_DECL(int) DBGFR3InfoRegisterDriver(PVM pVM, const char *pszName, const char *pszDesc, PFNDBGFHANDLERDRV pfnHandler, PPDMDRVINS pDrvIns); 520 VMMR3_INT_DECL(int) DBGFR3InfoRegisterInternal(PVM pVM, const char *pszName, const char *pszDesc, PFNDBGFHANDLERINT pfnHandler); 521 VMMR3_INT_DECL(int) DBGFR3InfoRegisterInternalEx(PVM pVM, const char *pszName, const char *pszDesc, PFNDBGFHANDLERINT pfnHandler, uint32_t fFlags); 522 VMMR3DECL(int) DBGFR3InfoRegisterExternal(PUVM pUVM, const char *pszName, const char *pszDesc, PFNDBGFHANDLEREXT pfnHandler, void *pvUser); 523 VMMR3_INT_DECL(int) DBGFR3InfoDeregisterDevice(PVM pVM, PPDMDEVINS pDevIns, const char *pszName); 524 VMMR3_INT_DECL(int) DBGFR3InfoDeregisterDriver(PVM pVM, PPDMDRVINS pDrvIns, const char *pszName); 525 VMMR3_INT_DECL(int) DBGFR3InfoDeregisterInternal(PVM pVM, const char *pszName); 526 VMMR3DECL(int) DBGFR3InfoDeregisterExternal(PUVM pUVM, const char *pszName); 527 VMMR3DECL(int) DBGFR3Info(PUVM pUVM, const char *pszName, const char *pszArgs, PCDBGFINFOHLP pHlp); 528 VMMR3DECL(int) DBGFR3InfoEx(PUVM pUVM, VMCPUID idCpu, const char *pszName, const char *pszArgs, PCDBGFINFOHLP pHlp); 529 VMMR3DECL(int) DBGFR3InfoLogRel(PUVM pUVM, const char *pszName, const char *pszArgs); 530 VMMR3DECL(int) DBGFR3InfoStdErr(PUVM pUVM, const char *pszName, const char *pszArgs); 531 VMMR3_INT_DECL(int) DBGFR3InfoMulti(PVM pVM, const char *pszIncludePat, const char *pszExcludePat, 532 const char *pszSepFmt, PCDBGFINFOHLP pHlp); 529 533 530 534 /** @def DBGFR3InfoLog 531 535 * Display a piece of info writing to the log if enabled. 532 536 * 533 * @param pVMVM handle.534 * @param pszNameThe identifier of the info to display.535 * @param pszArgsArguments 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. 536 540 */ 537 541 #ifdef LOG_ENABLED 538 # define DBGFR3InfoLog(pVM, pszName,pszArgs) \542 # define DBGFR3_INFO_LOG(a_pVM, a_pszName, a_pszArgs) \ 539 543 do { \ 540 544 if (LogIsEnabled()) \ 541 DBGFR3Info( pVM, pszName,pszArgs, NULL); \545 DBGFR3Info((a_pVM)->pUVM, a_pszName, a_pszArgs, NULL); \ 542 546 } while (0) 543 547 #else 544 # define DBGFR3InfoLog(pVM, pszName,pszArgs) do { } while (0)548 # define DBGFR3_INFO_LOG(a_pVM, a_pszName, a_pszArgs) do { } while (0) 545 549 #endif 546 550 … … 551 555 * A status code indicating failure will end the enumeration 552 556 * and DBGFR3InfoEnum will return with that status code. 553 * @param p VMVM handle.557 * @param pUVM The user mode VM handle. 554 558 * @param pszName Info identifier name. 555 559 * @param pszDesc The description. 556 560 */ 557 typedef DECLCALLBACK(int) FNDBGFINFOENUM(P VM pVM, const char *pszName, const char *pszDesc, void *pvUser);561 typedef DECLCALLBACK(int) FNDBGFINFOENUM(PUVM pUVM, const char *pszName, const char *pszDesc, void *pvUser); 558 562 /** Pointer to a FNDBGFINFOENUM function. */ 559 563 typedef FNDBGFINFOENUM *PFNDBGFINFOENUM; 560 564 561 VMMR3DECL(int) DBGFR3InfoEnum(P VM pVM, PFNDBGFINFOENUM pfnCallback, void *pvUser);565 VMMR3DECL(int) DBGFR3InfoEnum(PUVM pUVM, PFNDBGFINFOENUM pfnCallback, void *pvUser); 562 566 VMMR3DECL(PCDBGFINFOHLP) DBGFR3InfoLogHlp(void); 563 567 VMMR3DECL(PCDBGFINFOHLP) DBGFR3InfoLogRelHlp(void); … … 567 571 568 572 #ifdef IN_RING3 /* The log contrl API only works in ring-3. */ 569 VMMR3DECL(int) DBGFR3LogModifyGroups(P VM pVM, const char *pszGroupSettings);570 VMMR3DECL(int) DBGFR3LogModifyFlags(P VM pVM, const char *pszFlagSettings);571 VMMR3DECL(int) DBGFR3LogModifyDestinations(P VM pVM, const char *pszDestSettings);573 VMMR3DECL(int) DBGFR3LogModifyGroups(PUVM pUVM, const char *pszGroupSettings); 574 VMMR3DECL(int) DBGFR3LogModifyFlags(PUVM pUVM, const char *pszFlagSettings); 575 VMMR3DECL(int) DBGFR3LogModifyDestinations(PUVM pUVM, const char *pszDestSettings); 572 576 #endif /* IN_RING3 */ 573 577 … … 652 656 /** @} */ 653 657 654 VMMR3DECL(int) DBGFR3AsAdd(P VM pVM, RTDBGAS hDbgAs, RTPROCESS ProcId);655 VMMR3DECL(int) DBGFR3AsDelete(P VM pVM, RTDBGAS hDbgAs);656 VMMR3DECL(int) DBGFR3AsSetAlias(P VM pVM, RTDBGAS hAlias, RTDBGAS hAliasFor);657 VMMR3DECL(RTDBGAS) DBGFR3AsResolve(P VM pVM, RTDBGAS hAlias);658 VMMR3DECL(RTDBGAS) DBGFR3AsResolveAndRetain(P VM pVM, RTDBGAS hAlias);659 VMMR3DECL(RTDBGAS) DBGFR3AsQueryByName(P VM pVM, const char *pszName);660 VMMR3DECL(RTDBGAS) DBGFR3AsQueryByPid(P VM pVM, RTPROCESS ProcId);661 662 VMMR3DECL(int) DBGFR3AsLoadImage(P VM pVM, RTDBGAS hDbgAs, const char *pszFilename, const char *pszModName, PCDBGFADDRESS pModAddress, RTDBGSEGIDX iModSeg, uint32_t fFlags);663 VMMR3DECL(int) DBGFR3AsLoadMap(P VM pVM, RTDBGAS hDbgAs, const char *pszFilename, const char *pszModName, PCDBGFADDRESS pModAddress, RTDBGSEGIDX iModSeg, RTGCUINTPTR uSubtrahend, uint32_t fFlags);664 VMMR3DECL(int) DBGFR3AsLinkModule(P VM pVM, RTDBGAS hDbgAs, RTDBGMOD hMod, PCDBGFADDRESS pModAddress, RTDBGSEGIDX iModSeg, uint32_t fFlags);665 666 VMMR3DECL(int) DBGFR3AsSymbolByAddr(P VM pVM, RTDBGAS hDbgAs, PCDBGFADDRESS pAddress, PRTGCINTPTR poffDisp, PRTDBGSYMBOL pSymbol, PRTDBGMOD phMod);667 VMMR3DECL(PRTDBGSYMBOL) DBGFR3AsSymbolByAddrA(P VM pVM, RTDBGAS hDbgAs, PCDBGFADDRESS pAddress, PRTGCINTPTR poffDisp, PRTDBGMOD phMod);668 VMMR3DECL(int) DBGFR3AsSymbolByName(P VM pVM, RTDBGAS hDbgAs, const char *pszSymbol, PRTDBGSYMBOL pSymbol, PRTDBGMOD phMod);658 VMMR3DECL(int) DBGFR3AsAdd(PUVM pUVM, RTDBGAS hDbgAs, RTPROCESS ProcId); 659 VMMR3DECL(int) DBGFR3AsDelete(PUVM pUVM, RTDBGAS hDbgAs); 660 VMMR3DECL(int) DBGFR3AsSetAlias(PUVM pUVM, RTDBGAS hAlias, RTDBGAS hAliasFor); 661 VMMR3DECL(RTDBGAS) DBGFR3AsResolve(PUVM pUVM, RTDBGAS hAlias); 662 VMMR3DECL(RTDBGAS) DBGFR3AsResolveAndRetain(PUVM pUVM, RTDBGAS hAlias); 663 VMMR3DECL(RTDBGAS) DBGFR3AsQueryByName(PUVM pUVM, const char *pszName); 664 VMMR3DECL(RTDBGAS) DBGFR3AsQueryByPid(PUVM pUVM, RTPROCESS ProcId); 665 666 VMMR3DECL(int) DBGFR3AsLoadImage(PUVM pUVM, RTDBGAS hDbgAs, const char *pszFilename, const char *pszModName, PCDBGFADDRESS pModAddress, RTDBGSEGIDX iModSeg, uint32_t fFlags); 667 VMMR3DECL(int) DBGFR3AsLoadMap(PUVM pUVM, RTDBGAS hDbgAs, const char *pszFilename, const char *pszModName, PCDBGFADDRESS pModAddress, RTDBGSEGIDX iModSeg, RTGCUINTPTR uSubtrahend, uint32_t fFlags); 668 VMMR3DECL(int) DBGFR3AsLinkModule(PUVM pUVM, RTDBGAS hDbgAs, RTDBGMOD hMod, PCDBGFADDRESS pModAddress, RTDBGSEGIDX iModSeg, uint32_t fFlags); 669 670 VMMR3DECL(int) DBGFR3AsSymbolByAddr(PUVM pUVM, RTDBGAS hDbgAs, PCDBGFADDRESS pAddress, PRTGCINTPTR poffDisp, PRTDBGSYMBOL pSymbol, PRTDBGMOD phMod); 671 VMMR3DECL(PRTDBGSYMBOL) DBGFR3AsSymbolByAddrA(PUVM pUVM, RTDBGAS hDbgAs, PCDBGFADDRESS pAddress, PRTGCINTPTR poffDisp, PRTDBGMOD phMod); 672 VMMR3DECL(int) DBGFR3AsSymbolByName(PUVM pUVM, RTDBGAS hDbgAs, const char *pszSymbol, PRTDBGSYMBOL pSymbol, PRTDBGMOD phMod); 669 673 670 674 /* The following are soon to be obsoleted: */ 671 VMMR3DECL(int) DBGFR3ModuleLoad(P VM pVM, const char *pszFilename, RTGCUINTPTR AddressDelta, const char *pszName, RTGCUINTPTR ModuleAddress, unsigned cbImage);672 VMMR3 DECL(void)DBGFR3ModuleRelocate(PVM pVM, RTGCUINTPTR OldImageBase, RTGCUINTPTR NewImageBase, RTGCUINTPTR cbImage,675 VMMR3DECL(int) DBGFR3ModuleLoad(PUVM pUVM, const char *pszFilename, RTGCUINTPTR AddressDelta, const char *pszName, RTGCUINTPTR ModuleAddress, unsigned cbImage); 676 VMMR3_INT_DECL(void) DBGFR3ModuleRelocate(PVM pVM, RTGCUINTPTR OldImageBase, RTGCUINTPTR NewImageBase, RTGCUINTPTR cbImage, 673 677 const char *pszFilename, const char *pszName); 674 VMMR3 DECL(int)DBGFR3SymbolAdd(PVM pVM, RTGCUINTPTR ModuleAddress, RTGCUINTPTR SymbolAddress, RTUINT cbSymbol, const char *pszSymbol);675 VMMR3 DECL(int)DBGFR3SymbolByAddr(PVM pVM, RTGCUINTPTR Address, PRTGCINTPTR poffDisplacement, PDBGFSYMBOL pSymbol);676 VMMR3 DECL(int)DBGFR3SymbolByName(PVM pVM, const char *pszSymbol, PDBGFSYMBOL pSymbol);677 678 VMMR3DECL(int) DBGFR3LineByAddr(P VM pVM, RTGCUINTPTR Address, PRTGCINTPTR poffDisplacement, PDBGFLINE pLine);679 VMMR3DECL(PDBGFLINE) DBGFR3LineByAddrAlloc(P VM pVM, RTGCUINTPTR Address, PRTGCINTPTR poffDisplacement);680 VMMR3 DECL(void)DBGFR3LineFree(PDBGFLINE pLine);678 VMMR3_INT_DECL(int) DBGFR3SymbolAdd(PVM pVM, RTGCUINTPTR ModuleAddress, RTGCUINTPTR SymbolAddress, RTUINT cbSymbol, const char *pszSymbol); 679 VMMR3_INT_DECL(int) DBGFR3SymbolByAddr(PVM pVM, RTGCUINTPTR Address, PRTGCINTPTR poffDisplacement, PDBGFSYMBOL pSymbol); 680 VMMR3_INT_DECL(int) DBGFR3SymbolByName(PVM pVM, const char *pszSymbol, PDBGFSYMBOL pSymbol); 681 682 VMMR3DECL(int) DBGFR3LineByAddr(PUVM pUVM, RTGCUINTPTR Address, PRTGCINTPTR poffDisplacement, PDBGFLINE pLine); 683 VMMR3DECL(PDBGFLINE) DBGFR3LineByAddrAlloc(PUVM pUVM, RTGCUINTPTR Address, PRTGCINTPTR poffDisplacement); 684 VMMR3_INT_DECL(void) DBGFR3LineFree(PDBGFLINE pLine); 681 685 682 686 #endif /* IN_RING3 */ … … 848 852 /** @} */ 849 853 850 VMMR3DECL(int) DBGFR3StackWalkBegin(PVM pVM, VMCPUID idCpu, DBGFCODETYPE enmCodeType, PCDBGFSTACKFRAME *ppFirstFrame); 851 VMMR3DECL(int) DBGFR3StackWalkBeginEx(PVM pVM, VMCPUID idCpu, DBGFCODETYPE enmCodeType, PCDBGFADDRESS pAddrFrame, 854 VMMR3DECL(int) DBGFR3StackWalkBegin(PUVM pUVM, VMCPUID idCpu, DBGFCODETYPE enmCodeType, 855 PCDBGFSTACKFRAME *ppFirstFrame); 856 VMMR3DECL(int) DBGFR3StackWalkBeginEx(PUVM pUVM, VMCPUID idCpu, DBGFCODETYPE enmCodeType, PCDBGFADDRESS pAddrFrame, 852 857 PCDBGFADDRESS pAddrStack,PCDBGFADDRESS pAddrPC, 853 858 DBGFRETURNTYPE enmReturnType, PCDBGFSTACKFRAME *ppFirstFrame); … … 893 898 #define DBGF_SEL_FLAT 1 894 899 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 VMMR3 DECL(int) DBGFR3DisasInstrCurrent(PVMCPU pVCpu, char *pszOutput, uint32_t cbOutput);898 VMMR3DECL(int) DBGFR3DisasInstrCurrentLogInternal(PVMCPU pVCpu, const char *pszPrefix);900 VMMR3DECL(int) DBGFR3DisasInstrEx(PUVM pUVM, VMCPUID idCpu, RTSEL Sel, RTGCPTR GCPtr, uint32_t fFlags, 901 char *pszOutput, uint32_t cbOutput, uint32_t *pcbInstr); 902 VMMR3_INT_DECL(int) DBGFR3DisasInstrCurrent(PVMCPU pVCpu, char *pszOutput, uint32_t cbOutput); 903 VMMR3DECL(int) DBGFR3DisasInstrCurrentLogInternal(PVMCPU pVCpu, const char *pszPrefix); 899 904 900 905 /** @def DBGFR3DisasInstrCurrentLog … … 903 908 */ 904 909 #ifdef LOG_ENABLED 905 # define DBGFR3 DisasInstrCurrentLog(pVCpu, pszPrefix) \910 # define DBGFR3_DISAS_INSTR_CUR_LOG(pVCpu, pszPrefix) \ 906 911 do { \ 907 912 if (LogIsEnabled()) \ … … 909 914 } while (0) 910 915 #else 911 # define DBGFR3 DisasInstrCurrentLog(pVCpu, pszPrefix) do { } while (0)916 # define DBGFR3_DISAS_INSTR_CUR_LOG(pVCpu, pszPrefix) do { } while (0) 912 917 #endif 913 918 … … 920 925 */ 921 926 # ifdef LOG_ENABLED 922 # define DBGFR3 DisasInstrLog(pVCpu, Sel, GCPtr, pszPrefix) \927 # define DBGFR3_DISAS_INSTR_LOG(pVCpu, Sel, GCPtr, pszPrefix) \ 923 928 do { \ 924 929 if (LogIsEnabled()) \ … … 926 931 } while (0) 927 932 # else 928 # define DBGFR3 DisasInstrLog(pVCpu, Sel, GCPtr, pszPrefix) do { } while (0)933 # define DBGFR3_DISAS_INSTR_LOG(pVCpu, Sel, GCPtr, pszPrefix) do { } while (0) 929 934 # endif 930 935 #endif … … 932 937 933 938 #ifdef IN_RING3 934 VMMR3DECL(int) DBGFR3MemScan(P VM pVM, VMCPUID idCpu, PCDBGFADDRESS pAddress, RTGCUINTPTR cbRange, RTGCUINTPTR uAlign,939 VMMR3DECL(int) DBGFR3MemScan(PUVM pUVM, VMCPUID idCpu, PCDBGFADDRESS pAddress, RTGCUINTPTR cbRange, RTGCUINTPTR uAlign, 935 940 const void *pvNeedle, size_t cbNeedle, PDBGFADDRESS pHitAddress); 936 VMMR3DECL(int) DBGFR3MemRead(P VM pVM, VMCPUID idCpu, PCDBGFADDRESS pAddress, void *pvBuf, size_t cbRead);937 VMMR3DECL(int) DBGFR3MemReadString(P VM pVM, VMCPUID idCpu, PCDBGFADDRESS pAddress, char *pszBuf, size_t cbBuf);938 VMMR3DECL(int) DBGFR3MemWrite(P VM pVM, VMCPUID idCpu, PCDBGFADDRESS pAddress, void const *pvBuf, size_t cbRead);941 VMMR3DECL(int) DBGFR3MemRead(PUVM pUVM, VMCPUID idCpu, PCDBGFADDRESS pAddress, void *pvBuf, size_t cbRead); 942 VMMR3DECL(int) DBGFR3MemReadString(PUVM pUVM, VMCPUID idCpu, PCDBGFADDRESS pAddress, char *pszBuf, size_t cbBuf); 943 VMMR3DECL(int) DBGFR3MemWrite(PUVM pUVM, VMCPUID idCpu, PCDBGFADDRESS pAddress, void const *pvBuf, size_t cbRead); 939 944 #endif 940 945 … … 981 986 #define DBGFPGDMP_FLAGS_MODE_MASK UINT32_C(0x00000f32) 982 987 /** @} */ 983 VMMDECL(int) DBGFR3PagingDumpEx(P VM pVM, VMCPUID idCpu, uint32_t fFlags, uint64_t cr3, uint64_t u64FirstAddr,988 VMMDECL(int) DBGFR3PagingDumpEx(PUVM pUVM, VMCPUID idCpu, uint32_t fFlags, uint64_t cr3, uint64_t u64FirstAddr, 984 989 uint64_t u64LastAddr, uint32_t cMaxDepth, PCDBGFINFOHLP pHlp); 985 990 … … 995 1000 #define DBGFSELQI_FLAGS_DT_ADJ_64BIT_MODE UINT32_C(2) 996 1001 /** @} */ 997 VMMR3DECL(int) DBGFR3SelQueryInfo(P VM pVM, VMCPUID idCpu, RTSEL Sel, uint32_t fFlags, PDBGFSELINFO pSelInfo);1002 VMMR3DECL(int) DBGFR3SelQueryInfo(PUVM pUVM, VMCPUID idCpu, RTSEL Sel, uint32_t fFlags, PDBGFSELINFO pSelInfo); 998 1003 999 1004 … … 1432 1437 #define DBGFREG_HYPER_VMCPUID UINT32_C(0x01000000) 1433 1438 1434 VMMR3DECL(int) DBGFR3RegCpuQueryU8( P VM pVM, VMCPUID idCpu, DBGFREG enmReg, uint8_t *pu8);1435 VMMR3DECL(int) DBGFR3RegCpuQueryU16( P VM pVM, VMCPUID idCpu, DBGFREG enmReg, uint16_t *pu16);1436 VMMR3DECL(int) DBGFR3RegCpuQueryU32( P VM pVM, VMCPUID idCpu, DBGFREG enmReg, uint32_t *pu32);1437 VMMR3DECL(int) DBGFR3RegCpuQueryU64( P VM pVM, VMCPUID idCpu, DBGFREG enmReg, uint64_t *pu64);1438 VMMR3DECL(int) DBGFR3RegCpuQueryU128(P VM pVM, VMCPUID idCpu, DBGFREG enmReg, uint128_t *pu128);1439 VMMR3DECL(int) DBGFR3RegCpuQueryLrd( P VM pVM, VMCPUID idCpu, DBGFREG enmReg, long double *plrd);1440 VMMR3DECL(int) DBGFR3RegCpuQueryXdtr(P VM pVM, VMCPUID idCpu, DBGFREG enmReg, uint64_t *pu64Base, uint16_t *pu16Limit);1439 VMMR3DECL(int) DBGFR3RegCpuQueryU8( PUVM pUVM, VMCPUID idCpu, DBGFREG enmReg, uint8_t *pu8); 1440 VMMR3DECL(int) DBGFR3RegCpuQueryU16( PUVM pUVM, VMCPUID idCpu, DBGFREG enmReg, uint16_t *pu16); 1441 VMMR3DECL(int) DBGFR3RegCpuQueryU32( PUVM pUVM, VMCPUID idCpu, DBGFREG enmReg, uint32_t *pu32); 1442 VMMR3DECL(int) DBGFR3RegCpuQueryU64( PUVM pUVM, VMCPUID idCpu, DBGFREG enmReg, uint64_t *pu64); 1443 VMMR3DECL(int) DBGFR3RegCpuQueryU128(PUVM pUVM, VMCPUID idCpu, DBGFREG enmReg, uint128_t *pu128); 1444 VMMR3DECL(int) DBGFR3RegCpuQueryLrd( PUVM pUVM, VMCPUID idCpu, DBGFREG enmReg, long double *plrd); 1445 VMMR3DECL(int) DBGFR3RegCpuQueryXdtr(PUVM pUVM, VMCPUID idCpu, DBGFREG enmReg, uint64_t *pu64Base, uint16_t *pu16Limit); 1441 1446 #if 0 1442 VMMR3DECL(int) DBGFR3RegCpuQueryBatch(P VM pVM,VMCPUID idCpu, PDBGFREGENTRY paRegs, size_t cRegs);1443 VMMR3DECL(int) DBGFR3RegCpuQueryAll( P VM pVM, VMCPUID idCpu, PDBGFREGENTRY paRegs, size_t cRegs);1444 1445 VMMR3DECL(int) DBGFR3RegCpuSetU8( P VM pVM, VMCPUID idCpu, DBGFREG enmReg, uint8_t u8);1446 VMMR3DECL(int) DBGFR3RegCpuSetU16( P VM pVM, VMCPUID idCpu, DBGFREG enmReg, uint16_t u16);1447 VMMR3DECL(int) DBGFR3RegCpuSetU32( P VM pVM, VMCPUID idCpu, DBGFREG enmReg, uint32_t u32);1448 VMMR3DECL(int) DBGFR3RegCpuSetU64( P VM pVM, VMCPUID idCpu, DBGFREG enmReg, uint64_t u64);1449 VMMR3DECL(int) DBGFR3RegCpuSetU128( P VM pVM, VMCPUID idCpu, DBGFREG enmReg, uint128_t u128);1450 VMMR3DECL(int) DBGFR3RegCpuSetLrd( P VM pVM, VMCPUID idCpu, DBGFREG enmReg, long double lrd);1451 VMMR3DECL(int) DBGFR3RegCpuSetBatch( P VM pVM, VMCPUID idCpu, PCDBGFREGENTRY paRegs, size_t cRegs);1447 VMMR3DECL(int) DBGFR3RegCpuQueryBatch(PUVM pUVM,VMCPUID idCpu, PDBGFREGENTRY paRegs, size_t cRegs); 1448 VMMR3DECL(int) DBGFR3RegCpuQueryAll( PUVM pUVM, VMCPUID idCpu, PDBGFREGENTRY paRegs, size_t cRegs); 1449 1450 VMMR3DECL(int) DBGFR3RegCpuSetU8( PUVM pUVM, VMCPUID idCpu, DBGFREG enmReg, uint8_t u8); 1451 VMMR3DECL(int) DBGFR3RegCpuSetU16( PUVM pUVM, VMCPUID idCpu, DBGFREG enmReg, uint16_t u16); 1452 VMMR3DECL(int) DBGFR3RegCpuSetU32( PUVM pUVM, VMCPUID idCpu, DBGFREG enmReg, uint32_t u32); 1453 VMMR3DECL(int) DBGFR3RegCpuSetU64( PUVM pUVM, VMCPUID idCpu, DBGFREG enmReg, uint64_t u64); 1454 VMMR3DECL(int) DBGFR3RegCpuSetU128( PUVM pUVM, VMCPUID idCpu, DBGFREG enmReg, uint128_t u128); 1455 VMMR3DECL(int) DBGFR3RegCpuSetLrd( PUVM pUVM, VMCPUID idCpu, DBGFREG enmReg, long double lrd); 1456 VMMR3DECL(int) DBGFR3RegCpuSetBatch( PUVM pUVM, VMCPUID idCpu, PCDBGFREGENTRY paRegs, size_t cRegs); 1452 1457 #endif 1453 1458 1454 VMMR3DECL(const char *) DBGFR3RegCpuName(P VM pVM, DBGFREG enmReg, DBGFREGVALTYPE enmType);1459 VMMR3DECL(const char *) DBGFR3RegCpuName(PUVM pUVM, DBGFREG enmReg, DBGFREGVALTYPE enmType); 1455 1460 1456 1461 VMMR3_INT_DECL(int) DBGFR3RegRegisterCpu(PVM pVM, PVMCPU pVCpu, PCDBGFREGDESC paRegisters, bool fGuestRegs); 1457 VMMR3 DECL(int)DBGFR3RegRegisterDevice(PVM pVM, PCDBGFREGDESC paRegisters, PPDMDEVINS pDevIns, const char *pszPrefix, uint32_t iInstance);1462 VMMR3_INT_DECL(int) DBGFR3RegRegisterDevice(PVM pVM, PCDBGFREGDESC paRegisters, PPDMDEVINS pDevIns, const char *pszPrefix, uint32_t iInstance); 1458 1463 1459 1464 /** … … 1474 1479 typedef DBGFREGENTRYNM const *PCDBGFREGENTRYNM; 1475 1480 1476 VMMR3DECL(int) DBGFR3RegNmValidate( P VM pVM, VMCPUID idDefCpu, const char *pszReg);1477 1478 VMMR3DECL(int) DBGFR3RegNmQuery( P VM pVM, VMCPUID idDefCpu, const char *pszReg, PDBGFREGVAL pValue, PDBGFREGVALTYPE penmType);1479 VMMR3DECL(int) DBGFR3RegNmQueryU8( P VM pVM, VMCPUID idDefCpu, const char *pszReg, uint8_t *pu8);1480 VMMR3DECL(int) DBGFR3RegNmQueryU16( P VM pVM, VMCPUID idDefCpu, const char *pszReg, uint16_t *pu16);1481 VMMR3DECL(int) DBGFR3RegNmQueryU32( P VM pVM, VMCPUID idDefCpu, const char *pszReg, uint32_t *pu32);1482 VMMR3DECL(int) DBGFR3RegNmQueryU64( P VM pVM, VMCPUID idDefCpu, const char *pszReg, uint64_t *pu64);1483 VMMR3DECL(int) DBGFR3RegNmQueryU128(P VM pVM, VMCPUID idDefCpu, const char *pszReg, PRTUINT128U pu128);1484 /*VMMR3DECL(int) DBGFR3RegNmQueryLrd( P VM pVM, VMCPUID idDefCpu, const char *pszReg, long double *plrd);*/1485 VMMR3DECL(int) DBGFR3RegNmQueryXdtr(P VM pVM, VMCPUID idDefCpu, const char *pszReg, uint64_t *pu64Base, uint16_t *pu16Limit);1486 VMMR3DECL(int) DBGFR3RegNmQueryBatch(P VM pVM,VMCPUID idDefCpu, PDBGFREGENTRYNM paRegs, size_t cRegs);1487 VMMR3DECL(int) DBGFR3RegNmQueryAllCount(P VM pVM, size_t *pcRegs);1488 VMMR3DECL(int) DBGFR3RegNmQueryAll( P VM pVM, PDBGFREGENTRYNM paRegs, size_t cRegs);1489 1490 VMMR3DECL(int) DBGFR3RegNmSet( P VM pVM, VMCPUID idDefCpu, const char *pszReg, PCDBGFREGVAL pValue, DBGFREGVALTYPE enmType);1491 VMMR3DECL(int) DBGFR3RegNmSetU8( P VM pVM, VMCPUID idDefCpu, const char *pszReg, uint8_t u8);1492 VMMR3DECL(int) DBGFR3RegNmSetU16( P VM pVM, VMCPUID idDefCpu, const char *pszReg, uint16_t u16);1493 VMMR3DECL(int) DBGFR3RegNmSetU32( P VM pVM, VMCPUID idDefCpu, const char *pszReg, uint32_t u32);1494 VMMR3DECL(int) DBGFR3RegNmSetU64( P VM pVM, VMCPUID idDefCpu, const char *pszReg, uint64_t u64);1495 VMMR3DECL(int) DBGFR3RegNmSetU128( P VM pVM, VMCPUID idDefCpu, const char *pszReg, RTUINT128U u128);1496 VMMR3DECL(int) DBGFR3RegNmSetLrd( P VM pVM, VMCPUID idDefCpu, const char *pszReg, long double lrd);1497 VMMR3DECL(int) DBGFR3RegNmSetBatch( P VM pVM, VMCPUID idDefCpu, PCDBGFREGENTRYNM paRegs, size_t cRegs);1481 VMMR3DECL(int) DBGFR3RegNmValidate( PUVM pUVM, VMCPUID idDefCpu, const char *pszReg); 1482 1483 VMMR3DECL(int) DBGFR3RegNmQuery( PUVM pUVM, VMCPUID idDefCpu, const char *pszReg, PDBGFREGVAL pValue, PDBGFREGVALTYPE penmType); 1484 VMMR3DECL(int) DBGFR3RegNmQueryU8( PUVM pUVM, VMCPUID idDefCpu, const char *pszReg, uint8_t *pu8); 1485 VMMR3DECL(int) DBGFR3RegNmQueryU16( PUVM pUVM, VMCPUID idDefCpu, const char *pszReg, uint16_t *pu16); 1486 VMMR3DECL(int) DBGFR3RegNmQueryU32( PUVM pUVM, VMCPUID idDefCpu, const char *pszReg, uint32_t *pu32); 1487 VMMR3DECL(int) DBGFR3RegNmQueryU64( PUVM pUVM, VMCPUID idDefCpu, const char *pszReg, uint64_t *pu64); 1488 VMMR3DECL(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);*/ 1490 VMMR3DECL(int) DBGFR3RegNmQueryXdtr(PUVM pUVM, VMCPUID idDefCpu, const char *pszReg, uint64_t *pu64Base, uint16_t *pu16Limit); 1491 VMMR3DECL(int) DBGFR3RegNmQueryBatch(PUVM pUVM,VMCPUID idDefCpu, PDBGFREGENTRYNM paRegs, size_t cRegs); 1492 VMMR3DECL(int) DBGFR3RegNmQueryAllCount(PUVM pUVM, size_t *pcRegs); 1493 VMMR3DECL(int) DBGFR3RegNmQueryAll( PUVM pUVM, PDBGFREGENTRYNM paRegs, size_t cRegs); 1494 1495 VMMR3DECL(int) DBGFR3RegNmSet( PUVM pUVM, VMCPUID idDefCpu, const char *pszReg, PCDBGFREGVAL pValue, DBGFREGVALTYPE enmType); 1496 VMMR3DECL(int) DBGFR3RegNmSetU8( PUVM pUVM, VMCPUID idDefCpu, const char *pszReg, uint8_t u8); 1497 VMMR3DECL(int) DBGFR3RegNmSetU16( PUVM pUVM, VMCPUID idDefCpu, const char *pszReg, uint16_t u16); 1498 VMMR3DECL(int) DBGFR3RegNmSetU32( PUVM pUVM, VMCPUID idDefCpu, const char *pszReg, uint32_t u32); 1499 VMMR3DECL(int) DBGFR3RegNmSetU64( PUVM pUVM, VMCPUID idDefCpu, const char *pszReg, uint64_t u64); 1500 VMMR3DECL(int) DBGFR3RegNmSetU128( PUVM pUVM, VMCPUID idDefCpu, const char *pszReg, RTUINT128U u128); 1501 VMMR3DECL(int) DBGFR3RegNmSetLrd( PUVM pUVM, VMCPUID idDefCpu, const char *pszReg, long double lrd); 1502 VMMR3DECL(int) DBGFR3RegNmSetBatch( PUVM pUVM, VMCPUID idDefCpu, PCDBGFREGENTRYNM paRegs, size_t cRegs); 1498 1503 1499 1504 /** @todo add enumeration methods. */ 1500 1505 1501 VMMR3DECL(int) DBGFR3RegPrintf( P VM pVM, VMCPUID idDefCpu, char *pszBuf, size_t cbBuf, const char *pszFormat, ...);1502 VMMR3DECL(int) DBGFR3RegPrintfV(P VM pVM, VMCPUID idDefCpu, char *pszBuf, size_t cbBuf, const char *pszFormat, va_list va);1506 VMMR3DECL(int) DBGFR3RegPrintf( PUVM pUVM, VMCPUID idDefCpu, char *pszBuf, size_t cbBuf, const char *pszFormat, ...); 1507 VMMR3DECL(int) DBGFR3RegPrintfV(PUVM pUVM, VMCPUID idDefCpu, char *pszBuf, size_t cbBuf, const char *pszFormat, va_list va); 1503 1508 1504 1509 … … 1548 1553 * 1549 1554 * @returns VBox status code. 1550 * @param p VM Pointer to the shared VM structure.1555 * @param pUVM The user mode VM handle. 1551 1556 * @param pvData Pointer to the instance data. 1552 1557 */ 1553 DECLCALLBACKMEMBER(int, pfnConstruct)(P VM pVM, void *pvData);1558 DECLCALLBACKMEMBER(int, pfnConstruct)(PUVM pUVM, void *pvData); 1554 1559 1555 1560 /** 1556 1561 * Destroys the instance. 1557 1562 * 1558 * @param p VM Pointer to the shared VM structure.1563 * @param pUVM The user mode VM handle. 1559 1564 * @param pvData Pointer to the instance data. 1560 1565 */ 1561 DECLCALLBACKMEMBER(void, pfnDestruct)(P VM pVM, void *pvData);1566 DECLCALLBACKMEMBER(void, pfnDestruct)(PUVM pUVM, void *pvData); 1562 1567 1563 1568 /** … … 1568 1573 * 1569 1574 * @returns true if is an OS handled by this module, otherwise false. 1570 * @param p VM Pointer to the shared VM structure.1575 * @param pUVM The user mode VM handle. 1571 1576 * @param pvData Pointer to the instance data. 1572 1577 */ 1573 DECLCALLBACKMEMBER(bool, pfnProbe)(P VM pVM, void *pvData);1578 DECLCALLBACKMEMBER(bool, pfnProbe)(PUVM pUVM, void *pvData); 1574 1579 1575 1580 /** … … 1579 1584 * 1580 1585 * @returns VBox status code. 1581 * @param p VM Pointer to the shared VM structure.1586 * @param pUVM The user mode VM handle. 1582 1587 * @param pvData Pointer to the instance data. 1583 1588 */ 1584 DECLCALLBACKMEMBER(int, pfnInit)(P VM pVM, void *pvData);1589 DECLCALLBACKMEMBER(int, pfnInit)(PUVM pUVM, void *pvData); 1585 1590 1586 1591 /** … … 1590 1595 * 1591 1596 * @returns VBox status code. 1592 * @param p VM Pointer to the shared VM structure.1597 * @param pUVM The user mode VM handle. 1593 1598 * @param pvData Pointer to the instance data. 1594 1599 */ 1595 DECLCALLBACKMEMBER(int, pfnRefresh)(P VM pVM, void *pvData);1600 DECLCALLBACKMEMBER(int, pfnRefresh)(PUVM pUVM, void *pvData); 1596 1601 1597 1602 /** … … 1601 1606 * This is called after pfnProbe and if needed before pfnDestruct. 1602 1607 * 1603 * @param p VM Pointer to the shared VM structure.1608 * @param pUVM The user mode VM handle. 1604 1609 * @param pvData Pointer to the instance data. 1605 1610 */ 1606 DECLCALLBACKMEMBER(void, pfnTerm)(P VM pVM, void *pvData);1611 DECLCALLBACKMEMBER(void, pfnTerm)(PUVM pUVM, void *pvData); 1607 1612 1608 1613 /** … … 1612 1617 * 1613 1618 * @returns VBox status code. 1614 * @param p VM Pointer to the shared VM structure.1619 * @param pUVM The user mode VM handle. 1615 1620 * @param pvData Pointer to the instance data. 1616 1621 * @param pszVersion Where to store the version string. 1617 1622 * @param cchVersion The size of the version string buffer. 1618 1623 */ 1619 DECLCALLBACKMEMBER(int, pfnQueryVersion)(P VM pVM, void *pvData, char *pszVersion, size_t cchVersion);1624 DECLCALLBACKMEMBER(int, pfnQueryVersion)(PUVM pUVM, void *pvData, char *pszVersion, size_t cchVersion); 1620 1625 1621 1626 /** … … 1625 1630 * 1626 1631 * @returns Pointer to the interface if available, NULL if not available. 1627 * @param p VM Pointer to the shared VM structure.1632 * @param pUVM The user mode VM handle. 1628 1633 * @param pvData Pointer to the instance data. 1629 1634 * @param enmIf The interface identifier. 1630 1635 */ 1631 DECLCALLBACKMEMBER(void *, pfnQueryInterface)(P VM pVM, void *pvData, DBGFOSINTERFACE enmIf);1636 DECLCALLBACKMEMBER(void *, pfnQueryInterface)(PUVM pUVM, void *pvData, DBGFOSINTERFACE enmIf); 1632 1637 1633 1638 /** Trailing magic (DBGFOSREG_MAGIC). */ … … 1642 1647 #define DBGFOSREG_MAGIC 0x19830808 1643 1648 1644 VMMR3DECL(int) DBGFR3OSRegister(P VM pVM, PCDBGFOSREG pReg);1645 VMMR3DECL(int) DBGFR3OSDeregister(P VM pVM, PCDBGFOSREG pReg);1646 VMMR3DECL(int) DBGFR3OSDetect(P VM pVM, char *pszName, size_t cchName);1647 VMMR3DECL(int) DBGFR3OSQueryNameAndVersion(P VM pVM, char *pszName, size_t cchName, char *pszVersion, size_t cchVersion);1648 VMMR3DECL(void *) DBGFR3OSQueryInterface(P VM pVM, DBGFOSINTERFACE enmIf);1649 1650 1651 VMMR3DECL(int) DBGFR3CoreWrite(P VM pVM, const char *pszFilename, bool fReplaceFile);1649 VMMR3DECL(int) DBGFR3OSRegister(PUVM pUVM, PCDBGFOSREG pReg); 1650 VMMR3DECL(int) DBGFR3OSDeregister(PUVM pUVM, PCDBGFOSREG pReg); 1651 VMMR3DECL(int) DBGFR3OSDetect(PUVM pUVM, char *pszName, size_t cchName); 1652 VMMR3DECL(int) DBGFR3OSQueryNameAndVersion(PUVM pUVM, char *pszName, size_t cchName, char *pszVersion, size_t cchVersion); 1653 VMMR3DECL(void *) DBGFR3OSQueryInterface(PUVM pUVM, DBGFOSINTERFACE enmIf); 1654 1655 1656 VMMR3DECL(int) DBGFR3CoreWrite(PUVM pUVM, const char *pszFilename, bool fReplaceFile); 1652 1657 1653 1658 /** @} */ -
trunk/include/VBox/vmm/pgm.h
r44347 r44399 4 4 5 5 /* 6 * Copyright (C) 2006-201 0Oracle Corporation6 * Copyright (C) 2006-2013 Oracle Corporation 7 7 * 8 8 * This file is part of VirtualBox Open Source Edition (OSE), as … … 555 555 VMMR3DECL(int) PGMR3CheckIntegrity(PVM pVM); 556 556 557 VMMR3DECL(int) PGMR3DbgR3Ptr2GCPhys(P VM pVM, RTR3PTR R3Ptr, PRTGCPHYS pGCPhys);558 VMMR3DECL(int) PGMR3DbgR3Ptr2HCPhys(P VM pVM, RTR3PTR R3Ptr, PRTHCPHYS pHCPhys);559 VMMR3DECL(int) PGMR3DbgHCPhys2GCPhys(P VM pVM, RTHCPHYS HCPhys, PRTGCPHYS pGCPhys);560 VMMR3 DECL(int)PGMR3DbgReadGCPhys(PVM pVM, void *pvDst, RTGCPHYS GCPhysSrc, size_t cb, uint32_t fFlags, size_t *pcbRead);561 VMMR3 DECL(int)PGMR3DbgWriteGCPhys(PVM pVM, RTGCPHYS GCPhysDst, const void *pvSrc, size_t cb, uint32_t fFlags, size_t *pcbWritten);562 VMMR3 DECL(int)PGMR3DbgReadGCPtr(PVM pVM, void *pvDst, RTGCPTR GCPtrSrc, size_t cb, uint32_t fFlags, size_t *pcbRead);563 VMMR3 DECL(int)PGMR3DbgWriteGCPtr(PVM pVM, RTGCPTR GCPtrDst, void const *pvSrc, size_t cb, uint32_t fFlags, size_t *pcbWritten);564 VMMR3 DECL(int)PGMR3DbgScanPhysical(PVM pVM, RTGCPHYS GCPhys, RTGCPHYS cbRange, RTGCPHYS GCPhysAlign, const uint8_t *pabNeedle, size_t cbNeedle, PRTGCPHYS pGCPhysHit);565 VMMR3 DECL(int)PGMR3DbgScanVirtual(PVM pVM, PVMCPU pVCpu, RTGCPTR GCPtr, RTGCPTR cbRange, RTGCPTR GCPtrAlign, const uint8_t *pabNeedle, size_t cbNeedle, PRTGCUINTPTR pGCPhysHit);557 VMMR3DECL(int) PGMR3DbgR3Ptr2GCPhys(PUVM pUVM, RTR3PTR R3Ptr, PRTGCPHYS pGCPhys); 558 VMMR3DECL(int) PGMR3DbgR3Ptr2HCPhys(PUVM pUVM, RTR3PTR R3Ptr, PRTHCPHYS pHCPhys); 559 VMMR3DECL(int) PGMR3DbgHCPhys2GCPhys(PUVM pUVM, RTHCPHYS HCPhys, PRTGCPHYS pGCPhys); 560 VMMR3_INT_DECL(int) PGMR3DbgReadGCPhys(PVM pVM, void *pvDst, RTGCPHYS GCPhysSrc, size_t cb, uint32_t fFlags, size_t *pcbRead); 561 VMMR3_INT_DECL(int) PGMR3DbgWriteGCPhys(PVM pVM, RTGCPHYS GCPhysDst, const void *pvSrc, size_t cb, uint32_t fFlags, size_t *pcbWritten); 562 VMMR3_INT_DECL(int) PGMR3DbgReadGCPtr(PVM pVM, void *pvDst, RTGCPTR GCPtrSrc, size_t cb, uint32_t fFlags, size_t *pcbRead); 563 VMMR3_INT_DECL(int) PGMR3DbgWriteGCPtr(PVM pVM, RTGCPTR GCPtrDst, void const *pvSrc, size_t cb, uint32_t fFlags, size_t *pcbWritten); 564 VMMR3_INT_DECL(int) PGMR3DbgScanPhysical(PVM pVM, RTGCPHYS GCPhys, RTGCPHYS cbRange, RTGCPHYS GCPhysAlign, const uint8_t *pabNeedle, size_t cbNeedle, PRTGCPHYS pGCPhysHit); 565 VMMR3_INT_DECL(int) PGMR3DbgScanVirtual(PVM pVM, PVMCPU pVCpu, RTGCPTR GCPtr, RTGCPTR cbRange, RTGCPTR GCPtrAlign, const uint8_t *pabNeedle, size_t cbNeedle, PRTGCUINTPTR pGCPhysHit); 566 566 VMMR3_INT_DECL(int) PGMR3DumpHierarchyShw(PVM pVM, uint64_t cr3, uint32_t fFlags, uint64_t u64FirstAddr, uint64_t u64LastAddr, uint32_t cMaxDepth, PCDBGFINFOHLP pHlp); 567 567 VMMR3_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 56 56 uint8_t padding[512]; 57 57 } 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 58 68 } UVMCPU; 59 69 AssertCompileMemberAlignment(UVMCPU, vm, 32); … … 127 137 } stam; 128 138 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 129 148 /** Per virtual CPU data. */ 130 149 UVMCPU aCpus[1]; -
trunk/include/VBox/vmm/vmapi.h
r44393 r44399 105 105 typedef FNVMATERROR *PFNVMATERROR; 106 106 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);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); 109 109 110 110 /** @def VM_SET_ERROR … … 122 122 */ 123 123 #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)) 124 139 125 140 … … 366 381 VMMR3DECL(int) VMR3AtErrorRegister(PUVM pUVM, PFNVMATERROR pfnAtError, void *pvUser); 367 382 VMMR3DECL(int) VMR3AtErrorDeregister(PUVM pUVM, PFNVMATERROR pfnAtError, void *pvUser); 383 VMMR3DECL(int) VMR3SetError(PUVM pUVM, int rc, RT_SRC_POS_DECL, const char *pszFormat, ...); 384 VMMR3DECL(int) VMR3SetErrorV(PUVM pUVM, int rc, RT_SRC_POS_DECL, const char *pszFormat, va_list va); 368 385 VMMR3_INT_DECL(void) VMR3SetErrorWorker(PVM pVM); 369 386 VMMR3_INT_DECL(uint32_t) VMR3GetErrorCount(PUVM pUVM); -
trunk/src/VBox/Debugger/DBGCCmdHlp.cpp
r41573 r44399 316 316 * @interface_method_impl{DBGCCMDHLP,pfnMemRead} 317 317 */ 318 static DECLCALLBACK(int) dbgcHlpMemRead(PDBGCCMDHLP pCmdHlp, PVM pVM,void *pvBuffer, size_t cbRead, PCDBGCVAR pVarPointer, size_t *pcbRead)318 static DECLCALLBACK(int) dbgcHlpMemRead(PDBGCCMDHLP pCmdHlp, void *pvBuffer, size_t cbRead, PCDBGCVAR pVarPointer, size_t *pcbRead) 319 319 { 320 320 PDBGC pDbgc = DBGC_CMDHLP2DBGC(pCmdHlp); … … 341 341 case DBGCVAR_TYPE_GC_FAR: 342 342 /* Use DBGFR3AddrFromSelOff for the conversion. */ 343 Assert(pDbgc->p VM);344 rc = DBGFR3AddrFromSelOff(pDbgc->p VM, 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); 345 345 if (RT_FAILURE(rc)) 346 346 return rc; … … 350 350 { 351 351 DBGFSELINFO SelInfo; 352 rc = DBGFR3SelQueryInfo(pDbgc->p VM, pDbgc->idCpu, Address.Sel,352 rc = DBGFR3SelQueryInfo(pDbgc->pUVM, pDbgc->idCpu, Address.Sel, 353 353 DBGFSELQI_FLAGS_DT_GUEST | DBGFSELQI_FLAGS_DT_ADJ_64BIT_MODE, &SelInfo); 354 354 if (RT_SUCCESS(rc)) … … 419 419 { 420 420 case DBGCVAR_TYPE_GC_FLAT: 421 rc = DBGFR3MemRead(pDbgc->p VM, pDbgc->idCpu,422 DBGFR3AddrFromFlat(p VM, &Address, Var.u.GCFlat),421 rc = DBGFR3MemRead(pDbgc->pUVM, pDbgc->idCpu, 422 DBGFR3AddrFromFlat(pDbgc->pUVM, &Address, Var.u.GCFlat), 423 423 pvBuffer, cb); 424 424 break; 425 425 426 426 case DBGCVAR_TYPE_GC_PHYS: 427 rc = DBGFR3MemRead(pDbgc->p VM, pDbgc->idCpu,428 DBGFR3AddrFromPhys(p VM, &Address, Var.u.GCPhys),427 rc = DBGFR3MemRead(pDbgc->pUVM, pDbgc->idCpu, 428 DBGFR3AddrFromPhys(pDbgc->pUVM, &Address, Var.u.GCPhys), 429 429 pvBuffer, cb); 430 430 break; … … 488 488 * @interface_method_impl{DBGCCMDHLP,pfnMemWrite} 489 489 */ 490 static DECLCALLBACK(int) dbgcHlpMemWrite(PDBGCCMDHLP pCmdHlp, PVM pVM,const void *pvBuffer, size_t cbWrite, PCDBGCVAR pVarPointer, size_t *pcbWritten)490 static DECLCALLBACK(int) dbgcHlpMemWrite(PDBGCCMDHLP pCmdHlp, const void *pvBuffer, size_t cbWrite, PCDBGCVAR pVarPointer, size_t *pcbWritten) 491 491 { 492 492 PDBGC pDbgc = DBGC_CMDHLP2DBGC(pCmdHlp); … … 514 514 { 515 515 /* Use DBGFR3AddrFromSelOff for the conversion. */ 516 Assert(pDbgc->p VM);517 rc = DBGFR3AddrFromSelOff(pDbgc->p VM, 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); 518 518 if (RT_FAILURE(rc)) 519 519 return rc; … … 523 523 { 524 524 DBGFSELINFO SelInfo; 525 rc = DBGFR3SelQueryInfo(pDbgc->p VM, pDbgc->idCpu, Address.Sel,525 rc = DBGFR3SelQueryInfo(pDbgc->pUVM, pDbgc->idCpu, Address.Sel, 526 526 DBGFSELQI_FLAGS_DT_GUEST | DBGFSELQI_FLAGS_DT_ADJ_64BIT_MODE, &SelInfo); 527 527 if (RT_SUCCESS(rc)) … … 556 556 /* fall thru */ 557 557 case DBGCVAR_TYPE_GC_FLAT: 558 rc = DBGFR3MemWrite(p VM, pDbgc->idCpu,559 DBGFR3AddrFromFlat(p VM, &Address, Var.u.GCFlat),558 rc = DBGFR3MemWrite(pDbgc->pUVM, pDbgc->idCpu, 559 DBGFR3AddrFromFlat(pDbgc->pUVM, &Address, Var.u.GCFlat), 560 560 pvBuffer, cbWrite); 561 561 if (pcbWritten && RT_SUCCESS(rc)) … … 564 564 565 565 case DBGCVAR_TYPE_GC_PHYS: 566 rc = DBGFR3MemWrite(p VM, pDbgc->idCpu,567 DBGFR3AddrFromPhys(p VM, &Address, Var.u.GCPhys),566 rc = DBGFR3MemWrite(pDbgc->pUVM, pDbgc->idCpu, 567 DBGFR3AddrFromPhys(pDbgc->pUVM, &Address, Var.u.GCPhys), 568 568 pvBuffer, cbWrite); 569 569 if (pcbWritten && RT_SUCCESS(rc)) … … 734 734 { 735 735 case DBGCVAR_TYPE_GC_FLAT: 736 DBGFR3AddrFromFlat(pDbgc->p VM, pAddress, pVar->u.GCFlat);736 DBGFR3AddrFromFlat(pDbgc->pUVM, pAddress, pVar->u.GCFlat); 737 737 return VINF_SUCCESS; 738 738 739 739 case DBGCVAR_TYPE_NUMBER: 740 DBGFR3AddrFromFlat(pDbgc->p VM, pAddress, (RTGCUINTPTR)pVar->u.u64Number);740 DBGFR3AddrFromFlat(pDbgc->pUVM, pAddress, (RTGCUINTPTR)pVar->u.u64Number); 741 741 return VINF_SUCCESS; 742 742 743 743 case DBGCVAR_TYPE_GC_FAR: 744 return DBGFR3AddrFromSelOff(pDbgc->p VM, 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); 745 745 746 746 case DBGCVAR_TYPE_GC_PHYS: 747 DBGFR3AddrFromPhys(pDbgc->p VM, pAddress, pVar->u.GCPhys);747 DBGFR3AddrFromPhys(pDbgc->pUVM, pAddress, pVar->u.GCPhys); 748 748 return VINF_SUCCESS; 749 749 … … 923 923 int rc; 924 924 925 Assert(pDbgc->p VM);925 Assert(pDbgc->pUVM); 926 926 927 927 *pResult = InVar; … … 939 939 case DBGCVAR_TYPE_GC_PHYS: 940 940 pResult->enmType = DBGCVAR_TYPE_GC_PHYS; 941 rc = DBGFR3AddrToPhys(pDbgc->p VM, pDbgc->idCpu,942 DBGFR3AddrFromFlat(pDbgc->p VM, &Address, pArg->u.GCFlat),941 rc = DBGFR3AddrToPhys(pDbgc->pUVM, pDbgc->idCpu, 942 DBGFR3AddrFromFlat(pDbgc->pUVM, &Address, pArg->u.GCFlat), 943 943 &pResult->u.GCPhys); 944 944 if (RT_SUCCESS(rc)) … … 948 948 case DBGCVAR_TYPE_HC_FLAT: 949 949 pResult->enmType = DBGCVAR_TYPE_HC_FLAT; 950 rc = DBGFR3AddrToVolatileR3Ptr(pDbgc->p VM, pDbgc->idCpu,951 DBGFR3AddrFromFlat(pDbgc->p VM, &Address, pArg->u.GCFlat),950 rc = DBGFR3AddrToVolatileR3Ptr(pDbgc->pUVM, pDbgc->idCpu, 951 DBGFR3AddrFromFlat(pDbgc->pUVM, &Address, pArg->u.GCFlat), 952 952 false /*fReadOnly */, 953 953 &pResult->u.pvHCFlat); … … 958 958 case DBGCVAR_TYPE_HC_PHYS: 959 959 pResult->enmType = DBGCVAR_TYPE_HC_PHYS; 960 rc = DBGFR3AddrToHostPhys(pDbgc->p VM, pDbgc->idCpu,961 DBGFR3AddrFromFlat(pDbgc->p VM, &Address, pArg->u.GCFlat),960 rc = DBGFR3AddrToHostPhys(pDbgc->pUVM, pDbgc->idCpu, 961 DBGFR3AddrFromFlat(pDbgc->pUVM, &Address, pArg->u.GCFlat), 962 962 &pResult->u.GCPhys); 963 963 if (RT_SUCCESS(rc)) … … 984 984 { 985 985 case DBGCVAR_TYPE_GC_FLAT: 986 rc = DBGFR3AddrFromSelOff(pDbgc->p VM, 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); 987 987 if (RT_SUCCESS(rc)) 988 988 { … … 997 997 998 998 case DBGCVAR_TYPE_GC_PHYS: 999 rc = DBGFR3AddrFromSelOff(pDbgc->p VM, 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); 1000 1000 if (RT_SUCCESS(rc)) 1001 1001 { 1002 1002 pResult->enmType = DBGCVAR_TYPE_GC_PHYS; 1003 rc = DBGFR3AddrToPhys(pDbgc->p VM, pDbgc->idCpu, &Address, &pResult->u.GCPhys);1003 rc = DBGFR3AddrToPhys(pDbgc->pUVM, pDbgc->idCpu, &Address, &pResult->u.GCPhys); 1004 1004 if (RT_SUCCESS(rc)) 1005 1005 return VINF_SUCCESS; … … 1008 1008 1009 1009 case DBGCVAR_TYPE_HC_FLAT: 1010 rc = DBGFR3AddrFromSelOff(pDbgc->p VM, 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); 1011 1011 if (RT_SUCCESS(rc)) 1012 1012 { 1013 1013 pResult->enmType = DBGCVAR_TYPE_HC_FLAT; 1014 rc = DBGFR3AddrToVolatileR3Ptr(pDbgc->p VM, pDbgc->idCpu, &Address,1014 rc = DBGFR3AddrToVolatileR3Ptr(pDbgc->pUVM, pDbgc->idCpu, &Address, 1015 1015 false /*fReadOnly*/, &pResult->u.pvHCFlat); 1016 1016 if (RT_SUCCESS(rc)) … … 1020 1020 1021 1021 case DBGCVAR_TYPE_HC_PHYS: 1022 rc = DBGFR3AddrFromSelOff(pDbgc->p VM, 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); 1023 1023 if (RT_SUCCESS(rc)) 1024 1024 { 1025 1025 pResult->enmType = DBGCVAR_TYPE_HC_PHYS; 1026 rc = DBGFR3AddrToHostPhys(pDbgc->p VM, pDbgc->idCpu, &Address, &pResult->u.GCPhys);1026 rc = DBGFR3AddrToHostPhys(pDbgc->pUVM, pDbgc->idCpu, &Address, &pResult->u.GCPhys); 1027 1027 if (RT_SUCCESS(rc)) 1028 1028 return VINF_SUCCESS; … … 1060 1060 case DBGCVAR_TYPE_HC_FLAT: 1061 1061 pResult->enmType = DBGCVAR_TYPE_HC_FLAT; 1062 rc = DBGFR3AddrToVolatileR3Ptr(pDbgc->p VM, pDbgc->idCpu,1063 DBGFR3AddrFromPhys(pDbgc->p VM, &Address, pArg->u.GCPhys),1062 rc = DBGFR3AddrToVolatileR3Ptr(pDbgc->pUVM, pDbgc->idCpu, 1063 DBGFR3AddrFromPhys(pDbgc->pUVM, &Address, pArg->u.GCPhys), 1064 1064 false /*fReadOnly */, 1065 1065 &pResult->u.pvHCFlat); … … 1070 1070 case DBGCVAR_TYPE_HC_PHYS: 1071 1071 pResult->enmType = DBGCVAR_TYPE_HC_PHYS; 1072 rc = DBGFR3AddrToHostPhys(pDbgc->p VM, pDbgc->idCpu,1073 DBGFR3AddrFromPhys(pDbgc->p VM, &Address, pArg->u.GCPhys),1072 rc = DBGFR3AddrToHostPhys(pDbgc->pUVM, pDbgc->idCpu, 1073 DBGFR3AddrFromPhys(pDbgc->pUVM, &Address, pArg->u.GCPhys), 1074 1074 &pResult->u.HCPhys); 1075 1075 if (RT_SUCCESS(rc)) … … 1103 1103 case DBGCVAR_TYPE_GC_PHYS: 1104 1104 pResult->enmType = DBGCVAR_TYPE_GC_PHYS; 1105 rc = PGMR3DbgR3Ptr2GCPhys(pDbgc->p VM, pArg->u.pvHCFlat, &pResult->u.GCPhys);1105 rc = PGMR3DbgR3Ptr2GCPhys(pDbgc->pUVM, pArg->u.pvHCFlat, &pResult->u.GCPhys); 1106 1106 if (RT_SUCCESS(rc)) 1107 1107 return VINF_SUCCESS; … … 1114 1114 case DBGCVAR_TYPE_HC_PHYS: 1115 1115 pResult->enmType = DBGCVAR_TYPE_HC_PHYS; 1116 rc = PGMR3DbgR3Ptr2HCPhys(pDbgc->p VM, pArg->u.pvHCFlat, &pResult->u.HCPhys);1116 rc = PGMR3DbgR3Ptr2HCPhys(pDbgc->pUVM, pArg->u.pvHCFlat, &pResult->u.HCPhys); 1117 1117 if (RT_SUCCESS(rc)) 1118 1118 return VINF_SUCCESS; … … 1146 1146 case DBGCVAR_TYPE_GC_PHYS: 1147 1147 pResult->enmType = DBGCVAR_TYPE_GC_PHYS; 1148 rc = PGMR3DbgHCPhys2GCPhys(pDbgc->p VM, pArg->u.HCPhys, &pResult->u.GCPhys);1148 rc = PGMR3DbgHCPhys2GCPhys(pDbgc->pUVM, pArg->u.HCPhys, &pResult->u.GCPhys); 1149 1149 if (RT_SUCCESS(rc)) 1150 1150 return VINF_SUCCESS; … … 1310 1310 if (pDbgc->fRegCtxGuest) 1311 1311 { 1312 if (pDbgc->p VM)1313 enmMode = DBGFR3CpuGetMode(pDbgc->p VM, DBGCCmdHlpGetCurrentCpu(pCmdHlp));1312 if (pDbgc->pUVM) 1313 enmMode = DBGFR3CpuGetMode(pDbgc->pUVM, DBGCCmdHlpGetCurrentCpu(pCmdHlp)); 1314 1314 if (enmMode == CPUMMODE_INVALID) 1315 1315 #if HC_ARCH_BITS == 64 -
trunk/src/VBox/Debugger/DBGCCommands.cpp
r41938 r44399 48 48 * Internal Functions * 49 49 *******************************************************************************/ 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);50 static FNDBGCCMD dbgcCmdHelp; 51 static FNDBGCCMD dbgcCmdQuit; 52 static FNDBGCCMD dbgcCmdStop; 53 static FNDBGCCMD dbgcCmdDetect; 54 static FNDBGCCMD dbgcCmdCpu; 55 static FNDBGCCMD dbgcCmdInfo; 56 static FNDBGCCMD dbgcCmdLog; 57 static FNDBGCCMD dbgcCmdLogDest; 58 static FNDBGCCMD dbgcCmdLogFlags; 59 static FNDBGCCMD dbgcCmdFormat; 60 static FNDBGCCMD dbgcCmdLoadImage; 61 static FNDBGCCMD dbgcCmdLoadMap; 62 static FNDBGCCMD dbgcCmdLoadSeg; 63 static FNDBGCCMD dbgcCmdLoadSyms; 64 static FNDBGCCMD dbgcCmdSet; 65 static FNDBGCCMD dbgcCmdUnset; 66 static FNDBGCCMD dbgcCmdLoadVars; 67 static FNDBGCCMD dbgcCmdShowVars; 68 static FNDBGCCMD dbgcCmdLoadPlugIn; 69 static FNDBGCCMD dbgcCmdUnloadPlugIn; 70 static FNDBGCCMD dbgcCmdShowPlugIns; 71 static FNDBGCCMD dbgcCmdHarakiri; 72 static FNDBGCCMD dbgcCmdEcho; 73 static FNDBGCCMD dbgcCmdRunScript; 74 static FNDBGCCMD dbgcCmdWriteCore; 75 75 76 76 … … 718 718 719 719 /** 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 */ 722 static DECLCALLBACK(int) dbgcCmdHelp(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs) 730 723 { 731 724 PDBGC pDbgc = DBGC_CMDHLP2DBGC(pCmdHlp); … … 833 826 834 827 NOREF(pCmd); 835 NOREF(p VM);828 NOREF(pUVM); 836 829 return rc; 837 830 } … … 839 832 840 833 /** 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 */ 836 static DECLCALLBACK(int) dbgcCmdQuit(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs) 837 { 838 DBGCCmdHlpPrintf(pCmdHlp, "Quitting console...\n"); 853 839 NOREF(pCmd); 854 NOREF(p VM);840 NOREF(pUVM); 855 841 NOREF(paArgs); 856 842 NOREF(cArgs); … … 860 846 861 847 /** 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 */ 850 static DECLCALLBACK(int) dbgcCmdStop(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs) 872 851 { 873 852 /* … … 875 854 */ 876 855 int rc; 877 if (DBGFR3IsHalted(p VM))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"); 879 858 else 880 859 { 881 rc = DBGFR3Halt(p VM);860 rc = DBGFR3Halt(pUVM); 882 861 if (RT_SUCCESS(rc)) 883 862 rc = VWRN_DBGC_CMD_PENDING; 884 863 else 885 rc = pCmdHlp->pfnVBoxError(pCmdHlp, rc, "Executing DBGFR3Halt().");864 rc = DBGCCmdHlpVBoxError(pCmdHlp, rc, "Executing DBGFR3Halt()."); 886 865 } 887 866 … … 892 871 893 872 /** 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 */ 875 static DECLCALLBACK(int) dbgcCmdEcho(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs) 904 876 { 905 877 /* … … 910 882 { 911 883 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); 913 885 if (RT_FAILURE(rc)) 914 886 return rc; 915 887 } 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 */ 896 static DECLCALLBACK(int) dbgcCmdRunScript(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs) 932 897 { 933 898 /* check that the parser did what it's supposed to do. */ 934 899 if ( cArgs != 1 935 900 || paArgs[0].enmType != DBGCVAR_TYPE_STRING) 936 return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "parser error\n");901 return DBGCCmdHlpPrintf(pCmdHlp, "parser error\n"); 937 902 938 903 /** @todo Load the script here, but someone else should do the actual … … 945 910 FILE *pFile = fopen(pszFilename, "r"); 946 911 if (!pFile) 947 return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "Failed to open '%s'.\n", pszFilename);912 return DBGCCmdHlpPrintf(pCmdHlp, "Failed to open '%s'.\n", pszFilename); 948 913 949 914 /* … … 959 924 if (pszEnd == &szLine[sizeof(szLine) - 1]) 960 925 { 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); 962 927 break; 963 928 } … … 990 955 { 991 956 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); 993 958 break; 994 959 } 995 960 if (rc == VWRN_DBGC_CMD_PENDING) 996 961 { 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); 998 963 break; 999 964 } … … 1002 967 fclose(pFile); 1003 968 1004 NOREF(pCmd); NOREF(p VM);969 NOREF(pCmd); NOREF(pUVM); 1005 970 return rc; 1006 971 } … … 1008 973 1009 974 /** 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 */ 977 static DECLCALLBACK(int) dbgcCmdDetect(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs) 1020 978 { 1021 979 /* check that the parser did what it's supposed to do. */ 1022 980 if (cArgs != 0) 1023 return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "parser error\n");981 return DBGCCmdHlpPrintf(pCmdHlp, "parser error\n"); 1024 982 1025 983 /* … … 1027 985 */ 1028 986 char szName[64]; 1029 int rc = DBGFR3OSDetect(p VM, szName, sizeof(szName));987 int rc = DBGFR3OSDetect(pUVM, szName, sizeof(szName)); 1030 988 if (RT_FAILURE(rc)) 1031 return pCmdHlp->pfnVBoxError(pCmdHlp, rc, "Executing DBGFR3OSDetect().");989 return DBGCCmdHlpVBoxError(pCmdHlp, rc, "Executing DBGFR3OSDetect()."); 1032 990 if (rc == VINF_SUCCESS) 1033 991 { 1034 rc = pCmdHlp->pfnPrintf(pCmdHlp, NULL, "Guest OS: %s\n", szName);992 rc = DBGCCmdHlpPrintf(pCmdHlp, "Guest OS: %s\n", szName); 1035 993 char szVersion[512]; 1036 int rc2 = DBGFR3OSQueryNameAndVersion(p VM, NULL, 0, szVersion, sizeof(szVersion));994 int rc2 = DBGFR3OSQueryNameAndVersion(pUVM, NULL, 0, szVersion, sizeof(szVersion)); 1037 995 if (RT_SUCCESS(rc2)) 1038 rc = pCmdHlp->pfnPrintf(pCmdHlp, NULL, "Version : %s\n", szVersion);996 rc = DBGCCmdHlpPrintf(pCmdHlp, "Version : %s\n", szVersion); 1039 997 } 1040 998 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"); 1042 1000 NOREF(pCmd); NOREF(paArgs); 1043 1001 return rc; … … 1046 1004 1047 1005 /** 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 */ 1008 static DECLCALLBACK(int) dbgcCmdCpu(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs) 1058 1009 { 1059 1010 PDBGC pDbgc = DBGC_CMDHLP2DBGC(pCmdHlp); … … 1063 1014 && ( cArgs != 1 1064 1015 || 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); 1068 1018 1069 1019 int rc; 1070 1020 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); 1072 1022 else 1073 1023 { 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); 1078 1028 else 1079 1029 { 1080 rc = pCmdHlp->pfnPrintf(pCmdHlp, NULL, "Changed CPU from %u to %u.\n",1030 rc = DBGCCmdHlpPrintf(pCmdHlp, "Changed CPU from %u to %u.\n", 1081 1031 pDbgc->idCpu, (VMCPUID)paArgs[0].u.u64Number); 1082 1032 pDbgc->idCpu = (VMCPUID)paArgs[0].u.u64Number; … … 1088 1038 1089 1039 /** 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 */ 1042 static DECLCALLBACK(int) dbgcCmdInfo(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs) 1100 1043 { 1101 1044 PDBGC pDbgc = DBGC_CMDHLP2DBGC(pCmdHlp); … … 1108 1051 || paArgs[0].enmType != DBGCVAR_TYPE_STRING 1109 1052 || 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); 1113 1055 1114 1056 /* 1115 1057 * Dump it. 1116 1058 */ 1117 int rc = DBGFR3InfoEx(p VM, pDbgc->idCpu,1059 int rc = DBGFR3InfoEx(pUVM, pDbgc->idCpu, 1118 1060 paArgs[0].u.pszString, 1119 1061 cArgs == 2 ? paArgs[1].u.pszString : NULL, 1120 1062 DBGCCmdHlpGetDbgfOutputHlp(pCmdHlp)); 1121 1063 if (RT_FAILURE(rc)) 1122 return pCmdHlp->pfnVBoxError(pCmdHlp, rc, "DBGFR3InfoEx()\n");1064 return DBGCCmdHlpVBoxError(pCmdHlp, rc, "DBGFR3InfoEx()\n"); 1123 1065 1124 1066 NOREF(pCmd); … … 1128 1070 1129 1071 /** 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 */ 1074 static DECLCALLBACK(int) dbgcCmdLog(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs) 1075 { 1076 int rc = DBGFR3LogModifyGroups(pUVM, paArgs[0].u.pszString); 1142 1077 if (RT_SUCCESS(rc)) 1143 1078 return VINF_SUCCESS; 1144 1079 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 */ 1087 static DECLCALLBACK(int) dbgcCmdLogDest(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs) 1088 { 1089 int rc = DBGFR3LogModifyDestinations(pUVM, paArgs[0].u.pszString); 1162 1090 if (RT_SUCCESS(rc)) 1163 1091 return VINF_SUCCESS; 1164 1092 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 */ 1100 static DECLCALLBACK(int) dbgcCmdLogFlags(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs) 1101 { 1102 int rc = DBGFR3LogModifyFlags(pUVM, paArgs[0].u.pszString); 1182 1103 if (RT_SUCCESS(rc)) 1183 1104 return VINF_SUCCESS; 1184 1105 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 */ 1113 static DECLCALLBACK(int) dbgcCmdFormat(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs) 1200 1114 { 1201 1115 LogFlow(("dbgcCmdFormat\n")); … … 1211 1125 { 1212 1126 case DBGCVAR_TYPE_UNKNOWN: 1213 rc = pCmdHlp->pfnPrintf(pCmdHlp, NULL,1127 rc = DBGCCmdHlpPrintf(pCmdHlp, 1214 1128 "Unknown variable type!\n"); 1215 1129 break; 1216 1130 case DBGCVAR_TYPE_GC_FLAT: 1217 1131 if (paArgs[iArg].enmRangeType != DBGCVAR_RANGE_NONE) 1218 rc = pCmdHlp->pfnPrintf(pCmdHlp, NULL,1132 rc = DBGCCmdHlpPrintf(pCmdHlp, 1219 1133 "Guest flat address: %%%08x range %lld %s\n", 1220 1134 paArgs[iArg].u.GCFlat, … … 1222 1136 apszRangeDesc[paArgs[iArg].enmRangeType]); 1223 1137 else 1224 rc = pCmdHlp->pfnPrintf(pCmdHlp, NULL,1138 rc = DBGCCmdHlpPrintf(pCmdHlp, 1225 1139 "Guest flat address: %%%08x\n", 1226 1140 paArgs[iArg].u.GCFlat); … … 1228 1142 case DBGCVAR_TYPE_GC_FAR: 1229 1143 if (paArgs[iArg].enmRangeType != DBGCVAR_RANGE_NONE) 1230 rc = pCmdHlp->pfnPrintf(pCmdHlp, NULL,1144 rc = DBGCCmdHlpPrintf(pCmdHlp, 1231 1145 "Guest far address: %04x:%08x range %lld %s\n", 1232 1146 paArgs[iArg].u.GCFar.sel, … … 1235 1149 apszRangeDesc[paArgs[iArg].enmRangeType]); 1236 1150 else 1237 rc = pCmdHlp->pfnPrintf(pCmdHlp, NULL,1151 rc = DBGCCmdHlpPrintf(pCmdHlp, 1238 1152 "Guest far address: %04x:%08x\n", 1239 1153 paArgs[iArg].u.GCFar.sel, … … 1242 1156 case DBGCVAR_TYPE_GC_PHYS: 1243 1157 if (paArgs[iArg].enmRangeType != DBGCVAR_RANGE_NONE) 1244 rc = pCmdHlp->pfnPrintf(pCmdHlp, NULL,1158 rc = DBGCCmdHlpPrintf(pCmdHlp, 1245 1159 "Guest physical address: %%%%%08x range %lld %s\n", 1246 1160 paArgs[iArg].u.GCPhys, … … 1248 1162 apszRangeDesc[paArgs[iArg].enmRangeType]); 1249 1163 else 1250 rc = pCmdHlp->pfnPrintf(pCmdHlp, NULL,1164 rc = DBGCCmdHlpPrintf(pCmdHlp, 1251 1165 "Guest physical address: %%%%%08x\n", 1252 1166 paArgs[iArg].u.GCPhys); … … 1254 1168 case DBGCVAR_TYPE_HC_FLAT: 1255 1169 if (paArgs[iArg].enmRangeType != DBGCVAR_RANGE_NONE) 1256 rc = pCmdHlp->pfnPrintf(pCmdHlp, NULL,1170 rc = DBGCCmdHlpPrintf(pCmdHlp, 1257 1171 "Host flat address: %%%08x range %lld %s\n", 1258 1172 paArgs[iArg].u.pvHCFlat, … … 1260 1174 apszRangeDesc[paArgs[iArg].enmRangeType]); 1261 1175 else 1262 rc = pCmdHlp->pfnPrintf(pCmdHlp, NULL,1176 rc = DBGCCmdHlpPrintf(pCmdHlp, 1263 1177 "Host flat address: %%%08x\n", 1264 1178 paArgs[iArg].u.pvHCFlat); … … 1266 1180 case DBGCVAR_TYPE_HC_PHYS: 1267 1181 if (paArgs[iArg].enmRangeType != DBGCVAR_RANGE_NONE) 1268 rc = pCmdHlp->pfnPrintf(pCmdHlp, NULL,1182 rc = DBGCCmdHlpPrintf(pCmdHlp, 1269 1183 "Host physical address: %RHp range %lld %s\n", 1270 1184 paArgs[iArg].u.HCPhys, … … 1272 1186 apszRangeDesc[paArgs[iArg].enmRangeType]); 1273 1187 else 1274 rc = pCmdHlp->pfnPrintf(pCmdHlp, NULL,1188 rc = DBGCCmdHlpPrintf(pCmdHlp, 1275 1189 "Host physical address: %RHp\n", 1276 1190 paArgs[iArg].u.HCPhys); … … 1278 1192 1279 1193 case DBGCVAR_TYPE_STRING: 1280 rc = pCmdHlp->pfnPrintf(pCmdHlp, NULL,1194 rc = DBGCCmdHlpPrintf(pCmdHlp, 1281 1195 "String, %lld bytes long: %s\n", 1282 1196 paArgs[iArg].u64Range, … … 1285 1199 1286 1200 case DBGCVAR_TYPE_SYMBOL: 1287 rc = pCmdHlp->pfnPrintf(pCmdHlp, NULL,1201 rc = DBGCCmdHlpPrintf(pCmdHlp, 1288 1202 "Symbol, %lld bytes long: %s\n", 1289 1203 paArgs[iArg].u64Range, … … 1293 1207 case DBGCVAR_TYPE_NUMBER: 1294 1208 if (paArgs[iArg].enmRangeType != DBGCVAR_RANGE_NONE) 1295 rc = pCmdHlp->pfnPrintf(pCmdHlp, NULL,1209 rc = DBGCCmdHlpPrintf(pCmdHlp, 1296 1210 "Number: hex %llx dec 0i%lld oct 0t%llo range %lld %s\n", 1297 1211 paArgs[iArg].u.u64Number, … … 1301 1215 apszRangeDesc[paArgs[iArg].enmRangeType]); 1302 1216 else 1303 rc = pCmdHlp->pfnPrintf(pCmdHlp, NULL,1217 rc = DBGCCmdHlpPrintf(pCmdHlp, 1304 1218 "Number: hex %llx dec 0i%lld oct 0t%llo\n", 1305 1219 paArgs[iArg].u.u64Number, … … 1309 1223 1310 1224 default: 1311 rc = pCmdHlp->pfnPrintf(pCmdHlp, NULL,1225 rc = DBGCCmdHlpPrintf(pCmdHlp, 1312 1226 "Invalid argument type %d\n", 1313 1227 paArgs[iArg].enmType); … … 1316 1230 } /* arg loop */ 1317 1231 1318 NOREF(pCmd); NOREF(p VM);1232 NOREF(pCmd); NOREF(pUVM); 1319 1233 return 0; 1320 1234 } … … 1322 1236 1323 1237 /** 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 */ 1240 static DECLCALLBACK(int) dbgcCmdLoadImage(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs) 1334 1241 { 1335 1242 /* … … 1348 1255 int rc = pCmdHlp->pfnVarToDbgfAddr(pCmdHlp, &paArgs[1], &ModAddress); 1349 1256 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]); 1351 1258 1352 1259 const char *pszModName = NULL; … … 1361 1268 */ 1362 1269 PDBGC pDbgc = DBGC_CMDHLP2DBGC(pCmdHlp); 1363 rc = DBGFR3AsLoadImage(p VM, pDbgc->hDbgAs, pszFilename, pszModName, &ModAddress, NIL_RTDBGSEGIDX, 0 /*fFlags*/);1270 rc = DBGFR3AsLoadImage(pUVM, pDbgc->hDbgAs, pszFilename, pszModName, &ModAddress, NIL_RTDBGSEGIDX, 0 /*fFlags*/); 1364 1271 if (RT_FAILURE(rc)) 1365 return pCmdHlp->pfnVBoxError(pCmdHlp, rc, "DBGFR3ModuleLoadImage(,,'%s','%s',%Dv,)\n",1366 1272 return DBGCCmdHlpVBoxError(pCmdHlp, rc, "DBGFR3ModuleLoadImage(,,'%s','%s',%Dv,)\n", 1273 pszFilename, pszModName, &paArgs[1]); 1367 1274 1368 1275 NOREF(pCmd); … … 1372 1279 1373 1280 /** 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 */ 1283 static DECLCALLBACK(int) dbgcCmdLoadMap(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs) 1384 1284 { 1385 1285 /* … … 1398 1298 int rc = pCmdHlp->pfnVarToDbgfAddr(pCmdHlp, &paArgs[1], &ModAddress); 1399 1299 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]); 1401 1301 1402 1302 const char *pszModName = NULL; … … 1421 1321 if ( iModSeg != paArgs[4].u.u64Number 1422 1322 || 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); 1424 1324 } 1425 1325 … … 1428 1328 */ 1429 1329 PDBGC pDbgc = DBGC_CMDHLP2DBGC(pCmdHlp); 1430 rc = DBGFR3AsLoadMap(p VM, pDbgc->hDbgAs, pszFilename, pszModName, &ModAddress, NIL_RTDBGSEGIDX, uSubtrahend, 0 /*fFlags*/);1330 rc = DBGFR3AsLoadMap(pUVM, pDbgc->hDbgAs, pszFilename, pszModName, &ModAddress, NIL_RTDBGSEGIDX, uSubtrahend, 0 /*fFlags*/); 1431 1331 if (RT_FAILURE(rc)) 1432 return pCmdHlp->pfnVBoxError(pCmdHlp, rc, "DBGFR3AsLoadMap(,,'%s','%s',%Dv,)\n",1433 1332 return DBGCCmdHlpVBoxError(pCmdHlp, rc, "DBGFR3AsLoadMap(,,'%s','%s',%Dv,)\n", 1333 pszFilename, pszModName, &paArgs[1]); 1434 1334 1435 1335 NOREF(pCmd); … … 1439 1339 1440 1340 /** 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 */ 1343 static DECLCALLBACK(int) dbgcCmdLoadSeg(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs) 1451 1344 { 1452 1345 /* … … 1466 1359 int rc = pCmdHlp->pfnVarToDbgfAddr(pCmdHlp, &paArgs[1], &ModAddress); 1467 1360 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]); 1469 1362 1470 1363 RTDBGSEGIDX iModSeg = (RTDBGSEGIDX)paArgs[1].u.u64Number; 1471 1364 if ( iModSeg != paArgs[2].u.u64Number 1472 1365 || 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); 1474 1367 1475 1368 const char *pszModName = NULL; … … 1484 1377 */ 1485 1378 PDBGC pDbgc = DBGC_CMDHLP2DBGC(pCmdHlp); 1486 rc = DBGFR3AsLoadImage(p VM, pDbgc->hDbgAs, pszFilename, pszModName, &ModAddress, iModSeg, 0 /*fFlags*/);1379 rc = DBGFR3AsLoadImage(pUVM, pDbgc->hDbgAs, pszFilename, pszModName, &ModAddress, iModSeg, 0 /*fFlags*/); 1487 1380 if (RT_FAILURE(rc)) 1488 return pCmdHlp->pfnVBoxError(pCmdHlp, rc, "DBGFR3ModuleLoadImage(,,'%s','%s',%Dv,)\n",1489 1381 return DBGCCmdHlpVBoxError(pCmdHlp, rc, "DBGFR3ModuleLoadImage(,,'%s','%s',%Dv,)\n", 1382 pszFilename, pszModName, &paArgs[1]); 1490 1383 1491 1384 NOREF(pCmd); … … 1495 1388 1496 1389 /** 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 */ 1392 static DECLCALLBACK(int) dbgcCmdLoadSyms(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs) 1507 1393 { 1508 1394 /* … … 1547 1433 int rc = DBGCCmdHlpEval(pCmdHlp, &AddrVar, "%%(%Dv)", &paArgs[iArg]); 1548 1434 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]); 1550 1436 ModuleAddress = paArgs[iArg].u.GCFlat; 1551 1437 iArg++; … … 1572 1458 * Call the debug info manager about this loading... 1573 1459 */ 1574 int rc = DBGFR3ModuleLoad(p VM, paArgs[0].u.pszString, Delta, pszModule, ModuleAddress, cbModule);1460 int rc = DBGFR3ModuleLoad(pUVM, paArgs[0].u.pszString, Delta, pszModule, ModuleAddress, cbModule); 1575 1461 if (RT_FAILURE(rc)) 1576 return pCmdHlp->pfnVBoxError(pCmdHlp, rc, "DBGInfoSymbolLoad(, '%s', %RGv, '%s', %RGv, 0)\n",1577 1462 return DBGCCmdHlpVBoxError(pCmdHlp, rc, "DBGInfoSymbolLoad(, '%s', %RGv, '%s', %RGv, 0)\n", 1463 paArgs[0].u.pszString, Delta, pszModule, ModuleAddress); 1578 1464 1579 1465 NOREF(pCmd); … … 1583 1469 1584 1470 /** 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 */ 1473 static DECLCALLBACK(int) dbgcCmdSet(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs) 1595 1474 { 1596 1475 PDBGC pDbgc = DBGC_CMDHLP2DBGC(pCmdHlp); … … 1607 1486 const char *pszVar = paArgs[0].u.pszString; 1608 1487 if (!RT_C_IS_ALPHA(*pszVar) || *pszVar == '_') 1609 return pCmdHlp->pfnPrintf(pCmdHlp, NULL,1488 return DBGCCmdHlpPrintf(pCmdHlp, 1610 1489 "syntax error: Invalid variable name '%s'. Variable names must match regex '[_a-zA-Z][_a-zA-Z0-9*'!", paArgs[0].u.pszString); 1611 1490 … … 1613 1492 *pszVar++; 1614 1493 if (*pszVar) 1615 return pCmdHlp->pfnPrintf(pCmdHlp, NULL,1494 return DBGCCmdHlpPrintf(pCmdHlp, 1616 1495 "syntax error: Invalid variable name '%s'. Variable names must match regex '[_a-zA-Z][_a-zA-Z0-9*]'!", paArgs[0].u.pszString); 1617 1496 … … 1671 1550 pDbgc->papVars[pDbgc->cVars++] = pVar; 1672 1551 1673 NOREF(pCmd); NOREF(p VM); NOREF(cArgs);1552 NOREF(pCmd); NOREF(pUVM); NOREF(cArgs); 1674 1553 return 0; 1675 1554 } … … 1677 1556 1678 1557 /** 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 */ 1560 static DECLCALLBACK(int) dbgcCmdUnset(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs) 1689 1561 { 1690 1562 PDBGC pDbgc = DBGC_CMDHLP2DBGC(pCmdHlp); … … 1721 1593 } /* arg loop */ 1722 1594 1723 NOREF(pCmd); NOREF(p VM);1595 NOREF(pCmd); NOREF(pUVM); 1724 1596 return 0; 1725 1597 } … … 1727 1599 1728 1600 /** 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 */ 1603 static DECLCALLBACK(int) dbgcCmdLoadVars(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs) 1739 1604 { 1740 1605 /* … … 1769 1634 && *psz != ';') 1770 1635 { 1771 pCmdHlp->pfnPrintf(pCmdHlp, NULL, "dbg: set %s", psz);1636 DBGCCmdHlpPrintf(pCmdHlp, "dbg: set %s", psz); 1772 1637 pCmdHlp->pfnExec(pCmdHlp, "set %s", psz); 1773 1638 } … … 1776 1641 } 1777 1642 else 1778 return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "Failed to open file '%s'.\n", paArgs[0].u.pszString);1779 1780 NOREF(pCmd); NOREF(p VM);1643 return DBGCCmdHlpPrintf(pCmdHlp, "Failed to open file '%s'.\n", paArgs[0].u.pszString); 1644 1645 NOREF(pCmd); NOREF(pUVM); 1781 1646 return 0; 1782 1647 } … … 1784 1649 1785 1650 /** 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 */ 1653 static DECLCALLBACK(int) dbgcCmdShowVars(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs) 1796 1654 { 1797 1655 PDBGC pDbgc = DBGC_CMDHLP2DBGC(pCmdHlp); … … 1799 1657 for (unsigned iVar = 0; iVar < pDbgc->cVars; iVar++) 1800 1658 { 1801 int rc = pCmdHlp->pfnPrintf(pCmdHlp, NULL, "%-20s ", &pDbgc->papVars[iVar]->szName);1659 int rc = DBGCCmdHlpPrintf(pCmdHlp, "%-20s ", &pDbgc->papVars[iVar]->szName); 1802 1660 if (!rc) 1803 rc = dbgcCmdFormat(pCmd, pCmdHlp, p VM, &pDbgc->papVars[iVar]->Var, 1);1661 rc = dbgcCmdFormat(pCmd, pCmdHlp, pUVM, &pDbgc->papVars[iVar]->Var, 1); 1804 1662 if (rc) 1805 1663 return rc; … … 2034 1892 * Try initialize it. 2035 1893 */ 2036 rc = pPlugIn->pfnEntry(DBGCPLUGINOP_INIT, pDbgc->p VM, VBOX_VERSION);1894 rc = pPlugIn->pfnEntry(DBGCPLUGINOP_INIT, pDbgc->pUVM, VBOX_VERSION); 2037 1895 if (RT_FAILURE(rc)) 2038 1896 { … … 2109 1967 2110 1968 /** 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 */ 1971 static DECLCALLBACK(int) dbgcCmdLoadPlugIn(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs) 2121 1972 { 2122 1973 PDBGC pDbgc = DBGC_CMDHLP2DBGC(pCmdHlp); … … 2165 2016 && pDbgc->pVM->enmVMState < VMSTATE_DESTROYING) 2166 2017 { 2167 pPlugIn->pfnEntry(DBGCPLUGINOP_TERM, pDbgc->p VM, 0);2018 pPlugIn->pfnEntry(DBGCPLUGINOP_TERM, pDbgc->pUVM, 0); 2168 2019 RTLdrClose(pPlugIn->hLdrMod); 2169 2020 } … … 2176 2027 2177 2028 /** 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 */ 2031 static DECLCALLBACK(int) dbgcCmdUnloadPlugIn(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs) 2188 2032 { 2189 2033 PDBGC pDbgc = DBGC_CMDHLP2DBGC(pCmdHlp); … … 2211 2055 * Terminate and unload it. 2212 2056 */ 2213 pPlugIn->pfnEntry(DBGCPLUGINOP_TERM, pDbgc->p VM, 0);2057 pPlugIn->pfnEntry(DBGCPLUGINOP_TERM, pDbgc->pUVM, 0); 2214 2058 RTLdrClose(pPlugIn->hLdrMod); 2215 2059 pPlugIn->hLdrMod = NIL_RTLDRMOD; … … 2228 2072 2229 2073 /** 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 */ 2076 static DECLCALLBACK(int) dbgcCmdShowPlugIns(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs) 2240 2077 { 2241 2078 PDBGC pDbgc = DBGC_CMDHLP2DBGC(pCmdHlp); … … 2258 2095 2259 2096 /** 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 */ 2099 static DECLCALLBACK(int) dbgcCmdHarakiri(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs) 2270 2100 { 2271 2101 Log(("dbgcCmdHarakiri\n")); 2272 2102 for (;;) 2273 2103 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 */ 2111 static DECLCALLBACK(int) dbgcCmdWriteCore(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs) 2289 2112 { 2290 2113 Log(("dbgcCmdWriteCore\n")); … … 2304 2127 return DBGCCmdHlpFail(pCmdHlp, pCmd, "Missing file path.\n"); 2305 2128 2306 int rc = DBGFR3CoreWrite(p VM, pszDumpPath, true /*fReplaceFile*/);2129 int rc = DBGFR3CoreWrite(pUVM, pszDumpPath, true /*fReplaceFile*/); 2307 2130 if (RT_FAILURE(rc)) 2308 2131 return DBGCCmdHlpFail(pCmdHlp, pCmd, "DBGFR3WriteCore failed. rc=%Rrc\n", rc); … … 2316 2139 * @callback_method_impl{The randu32() function implementation.} 2317 2140 */ 2318 static DECLCALLBACK(int) dbgcFuncRandU32(PCDBGCFUNC pFunc, PDBGCCMDHLP pCmdHlp, PVM p VM, PCDBGCVAR paArgs, uint32_t cArgs,2141 static DECLCALLBACK(int) dbgcFuncRandU32(PCDBGCFUNC pFunc, PDBGCCMDHLP pCmdHlp, PVM pUVM, PCDBGCVAR paArgs, uint32_t cArgs, 2319 2142 PDBGCVAR pResult) 2320 2143 { … … 2322 2145 uint32_t u32 = RTRandU32(); 2323 2146 DBGCVAR_INIT_NUMBER(pResult, u32); 2324 NOREF(pFunc); NOREF(pCmdHlp); NOREF(p VM); NOREF(paArgs);2147 NOREF(pFunc); NOREF(pCmdHlp); NOREF(pUVM); NOREF(paArgs); 2325 2148 return VINF_SUCCESS; 2326 2149 } -
trunk/src/VBox/Debugger/DBGCEmulateCodeView.cpp
r43325 r44399 5 5 6 6 /* 7 * Copyright (C) 2006-201 1Oracle Corporation7 * Copyright (C) 2006-2013 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 44 44 * Internal Functions * 45 45 *******************************************************************************/ 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);46 static FNDBGCCMD dbgcCmdBrkAccess; 47 static FNDBGCCMD dbgcCmdBrkClear; 48 static FNDBGCCMD dbgcCmdBrkDisable; 49 static FNDBGCCMD dbgcCmdBrkEnable; 50 static FNDBGCCMD dbgcCmdBrkList; 51 static FNDBGCCMD dbgcCmdBrkSet; 52 static FNDBGCCMD dbgcCmdBrkREM; 53 static FNDBGCCMD dbgcCmdDumpMem; 54 static FNDBGCCMD dbgcCmdDumpDT; 55 static FNDBGCCMD dbgcCmdDumpIDT; 56 static FNDBGCCMD dbgcCmdDumpPageDir; 57 static FNDBGCCMD dbgcCmdDumpPageDirBoth; 58 static FNDBGCCMD dbgcCmdDumpPageHierarchy; 59 static FNDBGCCMD dbgcCmdDumpPageTable; 60 static FNDBGCCMD dbgcCmdDumpPageTableBoth; 61 static FNDBGCCMD dbgcCmdDumpTSS; 62 static FNDBGCCMD dbgcCmdEditMem; 63 static FNDBGCCMD dbgcCmdGo; 64 static FNDBGCCMD dbgcCmdListModules; 65 static FNDBGCCMD dbgcCmdListNear; 66 static FNDBGCCMD dbgcCmdListSource; 67 static FNDBGCCMD dbgcCmdMemoryInfo; 68 static FNDBGCCMD dbgcCmdReg; 69 static FNDBGCCMD dbgcCmdRegGuest; 70 static FNDBGCCMD dbgcCmdRegHyper; 71 static FNDBGCCMD dbgcCmdRegTerse; 72 static FNDBGCCMD dbgcCmdSearchMem; 73 static FNDBGCCMD dbgcCmdSearchMemType; 74 static FNDBGCCMD dbgcCmdStack; 75 static FNDBGCCMD dbgcCmdTrace; 76 static FNDBGCCMD dbgcCmdUnassemble; 77 77 78 78 … … 374 374 375 375 /** 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 */ 378 static DECLCALLBACK(int) dbgcCmdGo(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs) 379 { 380 DBGC_CMDHLP_REQ_UVM_RET(pCmdHlp, pCmd, pUVM); 388 381 389 382 /* 390 383 * Check if the VM is halted or not before trying to resume it. 391 384 */ 392 if (!DBGFR3IsHalted(p VM))385 if (!DBGFR3IsHalted(pUVM)) 393 386 return DBGCCmdHlpFail(pCmdHlp, pCmd, "The VM is already running"); 394 387 395 int rc = DBGFR3Resume(p VM);388 int rc = DBGFR3Resume(pUVM); 396 389 if (RT_FAILURE(rc)) 397 390 return DBGCCmdHlpFailRc(pCmdHlp, pCmd, rc, "DBGFR3Resume"); … … 403 396 404 397 /** 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 */ 400 static DECLCALLBACK(int) dbgcCmdBrkAccess(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs) 401 { 402 DBGC_CMDHLP_REQ_UVM_RET(pCmdHlp, pCmd, pUVM); 417 403 418 404 /* … … 486 472 */ 487 473 uint32_t iBp; 488 rc = DBGFR3BpSetReg(p VM, &Address, iHitTrigger, iHitDisable, fType, cb, &iBp);474 rc = DBGFR3BpSetReg(pUVM, &Address, iHitTrigger, iHitDisable, fType, cb, &iBp); 489 475 if (RT_SUCCESS(rc)) 490 476 { … … 499 485 return DBGCCmdHlpPrintf(pCmdHlp, "Updated access breakpoint %u at %RGv\n", iBp, Address.FlatPtr); 500 486 } 501 int rc2 = DBGFR3BpClear(pDbgc->p VM, iBp);487 int rc2 = DBGFR3BpClear(pDbgc->pUVM, iBp); 502 488 AssertRC(rc2); 503 489 } … … 507 493 508 494 /** 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 */ 497 static DECLCALLBACK(int) dbgcCmdBrkClear(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs) 498 { 499 DBGC_CMDHLP_REQ_UVM_RET(pCmdHlp, pCmd, pUVM); 521 500 522 501 /* … … 533 512 if (iBp == paArgs[iArg].u.u64Number) 534 513 { 535 int rc2 = DBGFR3BpClear(p VM, iBp);514 int rc2 = DBGFR3BpClear(pUVM, iBp); 536 515 if (RT_FAILURE(rc2)) 537 516 rc = DBGCCmdHlpFailRc(pCmdHlp, pCmd, rc2, "DBGFR3BpClear(,%#x)", iBp); … … 551 530 pBp = pBp->pNext; 552 531 553 int rc2 = DBGFR3BpClear(p VM, iBp);532 int rc2 = DBGFR3BpClear(pUVM, iBp); 554 533 if (RT_FAILURE(rc2)) 555 534 rc = DBGCCmdHlpFailRc(pCmdHlp, pCmd, rc2, "DBGFR3BpClear(,%#x)", iBp); … … 566 545 567 546 /** 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 */ 549 static DECLCALLBACK(int) dbgcCmdBrkDisable(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs) 578 550 { 579 551 /* … … 589 561 if (iBp == paArgs[iArg].u.u64Number) 590 562 { 591 rc = DBGFR3BpDisable(p VM, iBp);563 rc = DBGFR3BpDisable(pUVM, iBp); 592 564 if (RT_FAILURE(rc)) 593 565 rc = DBGCCmdHlpFailRc(pCmdHlp, pCmd, rc, "DBGFR3BpDisable failed for breakpoint %#x", iBp); … … 602 574 for (PDBGCBP pBp = pDbgc->pFirstBp; pBp; pBp = pBp->pNext) 603 575 { 604 int rc2 = DBGFR3BpDisable(p VM, pBp->iBp);576 int rc2 = DBGFR3BpDisable(pUVM, pBp->iBp); 605 577 if (RT_FAILURE(rc2)) 606 578 rc = DBGCCmdHlpFailRc(pCmdHlp, pCmd, rc2, "DBGFR3BpDisable failed for breakpoint %#x", pBp->iBp); … … 615 587 616 588 /** 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 */ 591 static DECLCALLBACK(int) dbgcCmdBrkEnable(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs) 592 { 593 DBGC_CMDHLP_REQ_UVM_RET(pCmdHlp, pCmd, pUVM); 629 594 630 595 /* … … 640 605 if (iBp == paArgs[iArg].u.u64Number) 641 606 { 642 rc = DBGFR3BpEnable(p VM, iBp);607 rc = DBGFR3BpEnable(pUVM, iBp); 643 608 if (RT_FAILURE(rc)) 644 609 rc = DBGCCmdHlpFailRc(pCmdHlp, pCmd, rc, "DBGFR3BpEnable failed for breakpoint %#x", iBp); … … 653 618 for (PDBGCBP pBp = pDbgc->pFirstBp; pBp; pBp = pBp->pNext) 654 619 { 655 int rc2 = DBGFR3BpEnable(p VM, pBp->iBp);620 int rc2 = DBGFR3BpEnable(pUVM, pBp->iBp); 656 621 if (RT_FAILURE(rc2)) 657 622 rc = DBGCCmdHlpFailRc(pCmdHlp, pCmd, rc2, "DBGFR3BpEnable failed for breakpoint %#x", pBp->iBp); … … 669 634 * 670 635 * @returns VBox status code. Any failure will stop the enumeration. 671 * @param p VM The VM handle.636 * @param pUVM The user mode VM handle. 672 637 * @param pvUser The user argument. 673 638 * @param pBp Pointer to the breakpoint information. (readonly) 674 639 */ 675 static DECLCALLBACK(int) dbgcEnumBreakpointsCallback(P VM pVM, void *pvUser, PCDBGFBP pBp)640 static DECLCALLBACK(int) dbgcEnumBreakpointsCallback(PUVM pUVM, void *pvUser, PCDBGFBP pBp) 676 641 { 677 642 PDBGC pDbgc = (PDBGC)pvUser; … … 722 687 RTINTPTR off; 723 688 DBGFADDRESS Addr; 724 int rc = DBGFR3AsSymbolByAddr(p VM, 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); 725 690 if (RT_SUCCESS(rc)) 726 691 { … … 751 716 752 717 /** 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 */ 720 static DECLCALLBACK(int) dbgcCmdBrkList(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs) 721 { 722 DBGC_CMDHLP_REQ_UVM_RET(pCmdHlp, pCmd, pUVM); 765 723 DBGC_CMDHLP_ASSERT_PARSER_RET(pCmdHlp, pCmd, -1, cArgs == 0); 724 NOREF(paArgs); 766 725 767 726 /* … … 769 728 */ 770 729 PDBGC pDbgc = DBGC_CMDHLP2DBGC(pCmdHlp); 771 int rc = DBGFR3BpEnum(p VM, dbgcEnumBreakpointsCallback, pDbgc);730 int rc = DBGFR3BpEnum(pUVM, dbgcEnumBreakpointsCallback, pDbgc); 772 731 if (RT_FAILURE(rc)) 773 732 return DBGCCmdHlpFailRc(pCmdHlp, pCmd, rc, "DBGFR3BpEnum"); … … 777 736 778 737 /** 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 */ 740 static DECLCALLBACK(int) dbgcCmdBrkSet(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs) 789 741 { 790 742 /* … … 823 775 */ 824 776 uint32_t iBp; 825 rc = DBGFR3BpSet(p VM, &Address, iHitTrigger, iHitDisable, &iBp);777 rc = DBGFR3BpSet(pUVM, &Address, iHitTrigger, iHitDisable, &iBp); 826 778 if (RT_SUCCESS(rc)) 827 779 { … … 836 788 return DBGCCmdHlpPrintf(pCmdHlp, "Updated breakpoint %u at %RGv\n", iBp, Address.FlatPtr); 837 789 } 838 int rc2 = DBGFR3BpClear(pDbgc->p VM, iBp);790 int rc2 = DBGFR3BpClear(pDbgc->pUVM, iBp); 839 791 AssertRC(rc2); 840 792 } … … 844 796 845 797 /** 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 */ 800 static DECLCALLBACK(int) dbgcCmdBrkREM(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs) 856 801 { 857 802 /* … … 890 835 */ 891 836 uint32_t iBp; 892 rc = DBGFR3BpSetREM(p VM, &Address, iHitTrigger, iHitDisable, &iBp);837 rc = DBGFR3BpSetREM(pUVM, &Address, iHitTrigger, iHitDisable, &iBp); 893 838 if (RT_SUCCESS(rc)) 894 839 { … … 903 848 return DBGCCmdHlpPrintf(pCmdHlp, "Updated REM breakpoint %u at %RGv\n", iBp, Address.FlatPtr); 904 849 } 905 int rc2 = DBGFR3BpClear(pDbgc->p VM, iBp);850 int rc2 = DBGFR3BpClear(pDbgc->pUVM, iBp); 906 851 AssertRC(rc2); 907 852 } … … 911 856 912 857 /** 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 */ 860 static DECLCALLBACK(int) dbgcCmdUnassemble(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs) 923 861 { 924 862 PDBGC pDbgc = DBGC_CMDHLP2DBGC(pCmdHlp); … … 927 865 * Validate input. 928 866 */ 929 DBGC_CMDHLP_REQ_ VM_RET(pCmdHlp, pCmd, pVM);867 DBGC_CMDHLP_REQ_UVM_RET(pCmdHlp, pCmd, pUVM); 930 868 DBGC_CMDHLP_ASSERT_PARSER_RET(pCmdHlp, pCmd, -1, cArgs <= 1); 931 869 DBGC_CMDHLP_ASSERT_PARSER_RET(pCmdHlp, pCmd, 0, cArgs == 0 || DBGCVAR_ISPOINTER(paArgs[0].enmType)); … … 956 894 { 957 895 /** @todo Batch query CS, RIP & CPU mode. */ 958 PVMCPU pVCpu = VMM GetCpuById(pVM, pDbgc->idCpu);896 PVMCPU pVCpu = VMMR3GetCpuByIdU(pUVM, pDbgc->idCpu); 959 897 if ( pDbgc->fRegCtxGuest 960 898 && CPUMIsGuestIn64BitCode(pVCpu)) … … 1053 991 uint32_t cbInstr = 1; 1054 992 if (pDbgc->DisasmPos.enmType == DBGCVAR_TYPE_GC_FLAT) 1055 rc = DBGFR3DisasInstrEx(p VM, pDbgc->idCpu, DBGF_SEL_FLAT, pDbgc->DisasmPos.u.GCFlat, fFlags,993 rc = DBGFR3DisasInstrEx(pUVM, pDbgc->idCpu, DBGF_SEL_FLAT, pDbgc->DisasmPos.u.GCFlat, fFlags, 1056 994 &szDis[0], sizeof(szDis), &cbInstr); 1057 995 else 1058 rc = DBGFR3DisasInstrEx(p VM, 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, 1059 997 &szDis[0], sizeof(szDis), &cbInstr); 1060 998 if (RT_SUCCESS(rc)) … … 1097 1035 1098 1036 /** 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 */ 1039 static DECLCALLBACK(int) dbgcCmdListSource(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs) 1109 1040 { 1110 1041 PDBGC pDbgc = DBGC_CMDHLP2DBGC(pCmdHlp); … … 1113 1044 * Validate input. 1114 1045 */ 1115 if ( cArgs > 11116 || (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 (!p VM && !cArgs && !DBGCVAR_ISPOINTER(pDbgc->SourcePos.enmType))1119 return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "error: Don't know where to start disassembling...\n");1120 if (!p VM && 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"); 1122 1053 1123 1054 /* … … 1128 1059 if (!DBGCVAR_ISPOINTER(pDbgc->SourcePos.enmType)) 1129 1060 { 1130 PVMCPU pVCpu = VMM GetCpuById(pVM, pDbgc->idCpu);1061 PVMCPU pVCpu = VMMR3GetCpuByIdU(pUVM, pDbgc->idCpu); 1131 1062 pDbgc->SourcePos.enmType = DBGCVAR_TYPE_GC_FAR; 1132 1063 pDbgc->SourcePos.u.GCFar.off = pDbgc->fRegCtxGuest ? CPUMGetGuestEIP(pVCpu) : CPUMGetHyperEIP(pVCpu); … … 1198 1129 DBGFLINE Line; 1199 1130 RTGCINTPTR off; 1200 int rc = DBGFR3LineByAddr(p VM, pDbgc->SourcePos.u.GCFlat, &off, &Line);1131 int rc = DBGFR3LineByAddr(pUVM, pDbgc->SourcePos.u.GCFlat, &off, &Line); 1201 1132 if (RT_FAILURE(rc)) 1202 1133 return VINF_SUCCESS; … … 1289 1220 1290 1221 /** 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 */ 1224 static DECLCALLBACK(int) dbgcCmdReg(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs) 1301 1225 { 1302 1226 PDBGC pDbgc = DBGC_CMDHLP2DBGC(pCmdHlp); 1303 1227 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 */ 1237 static DECLCALLBACK(int) dbgcCmdRegCommon(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs, 1321 1238 const char *pszPrefix) 1322 1239 { 1323 1240 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_STRING1326 && 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); 1328 1245 1329 1246 /* … … 1348 1265 DBGFREGVALTYPE enmType; 1349 1266 DBGFREGVAL Value; 1350 int rc = DBGFR3RegNmQuery(p VM, idCpu, pszReg, &Value, &enmType);1267 int rc = DBGFR3RegNmQuery(pUVM, idCpu, pszReg, &Value, &enmType); 1351 1268 if (RT_FAILURE(rc)) 1352 1269 { … … 1374 1291 * Modify the register. 1375 1292 */ 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); 1379 1295 if (enmType != DBGFREGVALTYPE_DTR) 1380 1296 { … … 1391 1307 if (RT_SUCCESS(rc)) 1392 1308 { 1393 rc = DBGFR3RegNmSet(p VM, idCpu, pszReg, &Value, enmType);1309 rc = DBGFR3RegNmSet(pUVM, idCpu, pszReg, &Value, enmType); 1394 1310 if (RT_FAILURE(rc)) 1395 1311 rc = DBGCCmdHlpVBoxError(pCmdHlp, rc, "DBGFR3RegNmSet failed settings '%s%s': %Rrc\n", … … 1409 1325 1410 1326 /** 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 */ 1329 static DECLCALLBACK(int) dbgcCmdRegGuest(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs) 1421 1330 { 1422 1331 /* … … 1428 1337 bool const f64BitMode = !strcmp(pCmd->pszCmd, "rg64") 1429 1338 || ( !strcmp(pCmd->pszCmd, "rg32") 1430 && CPUMIsGuestIn64BitCode(VMM GetCpuById(pVM, pDbgc->idCpu)));1339 && CPUMIsGuestIn64BitCode(VMMR3GetCpuByIdU(pUVM, pDbgc->idCpu))); 1431 1340 char szDisAndRegs[8192]; 1432 1341 int rc; … … 1435 1344 { 1436 1345 if (f64BitMode) 1437 rc = DBGFR3RegPrintf(p VM, pDbgc->idCpu, &szDisAndRegs[0], sizeof(szDisAndRegs),1346 rc = DBGFR3RegPrintf(pUVM, pDbgc->idCpu, &szDisAndRegs[0], sizeof(szDisAndRegs), 1438 1347 "u %016VR{rip} L 0\n" 1439 1348 "rax=%016VR{rax} rbx=%016VR{rbx} rcx=%016VR{rcx} rdx=%016VR{rdx}\n" … … 1444 1353 "cs=%04VR{cs} ds=%04VR{ds} es=%04VR{es} fs=%04VR{fs} gs=%04VR{gs} ss=%04VR{ss} rflags=%08VR{rflags}\n"); 1445 1354 else 1446 rc = DBGFR3RegPrintf(p VM, pDbgc->idCpu, szDisAndRegs, sizeof(szDisAndRegs),1355 rc = DBGFR3RegPrintf(pUVM, pDbgc->idCpu, szDisAndRegs, sizeof(szDisAndRegs), 1447 1356 "u %04VR{cs}:%08VR{eip} L 0\n" 1448 1357 "eax=%08VR{eax} ebx=%08VR{ebx} ecx=%08VR{ecx} edx=%08VR{edx} esi=%08VR{esi} edi=%08VR{edi}\n" … … 1453 1362 { 1454 1363 if (f64BitMode) 1455 rc = DBGFR3RegPrintf(p VM, pDbgc->idCpu, &szDisAndRegs[0], sizeof(szDisAndRegs),1364 rc = DBGFR3RegPrintf(pUVM, pDbgc->idCpu, &szDisAndRegs[0], sizeof(szDisAndRegs), 1456 1365 "u %016VR{rip} L 0\n" 1457 1366 "rax=%016VR{rax} rbx=%016VR{rbx} rcx=%016VR{rcx} rdx=%016VR{rdx}\n" … … 1481 1390 ); 1482 1391 else 1483 rc = DBGFR3RegPrintf(p VM, pDbgc->idCpu, szDisAndRegs, sizeof(szDisAndRegs),1392 rc = DBGFR3RegPrintf(pUVM, pDbgc->idCpu, szDisAndRegs, sizeof(szDisAndRegs), 1484 1393 "u %04VR{cs}:%08VR{eip} L 0\n" 1485 1394 "eax=%08VR{eax} ebx=%08VR{ebx} ecx=%08VR{ecx} edx=%08VR{edx} esi=%08VR{esi} edi=%08VR{edi}\n" … … 1509 1418 return pCmdHlp->pfnExec(pCmdHlp, "%s", szDisAndRegs); 1510 1419 } 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 */ 1427 static DECLCALLBACK(int) dbgcCmdRegHyper(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs) 1526 1428 { 1527 1429 /* … … 1535 1437 1536 1438 if (pDbgc->fRegTerse) 1537 rc = DBGFR3RegPrintf(p VM, pDbgc->idCpu | DBGFREG_HYPER_VMCPUID, szDisAndRegs, sizeof(szDisAndRegs),1439 rc = DBGFR3RegPrintf(pUVM, pDbgc->idCpu | DBGFREG_HYPER_VMCPUID, szDisAndRegs, sizeof(szDisAndRegs), 1538 1440 "u %VR{cs}:%VR{eip} L 0\n" 1539 1441 ".eax=%08VR{eax} .ebx=%08VR{ebx} .ecx=%08VR{ecx} .edx=%08VR{edx} .esi=%08VR{esi} .edi=%08VR{edi}\n" … … 1541 1443 ".cs=%04VR{cs} .ds=%04VR{ds} .es=%04VR{es} .fs=%04VR{fs} .gs=%04VR{gs} .ss=%04VR{ss} .eflags=%08VR{eflags}\n"); 1542 1444 else 1543 rc = DBGFR3RegPrintf(p VM, pDbgc->idCpu | DBGFREG_HYPER_VMCPUID, szDisAndRegs, sizeof(szDisAndRegs),1445 rc = DBGFR3RegPrintf(pUVM, pDbgc->idCpu | DBGFREG_HYPER_VMCPUID, szDisAndRegs, sizeof(szDisAndRegs), 1544 1446 "u %04VR{cs}:%08VR{eip} L 0\n" 1545 1447 ".eax=%08VR{eax} .ebx=%08VR{ebx} .ecx=%08VR{ecx} .edx=%08VR{edx} .esi=%08VR{esi} .edi=%08VR{edi}\n" … … 1566 1468 return pCmdHlp->pfnExec(pCmdHlp, "%s", szDisAndRegs); 1567 1469 } 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 */ 1477 static DECLCALLBACK(int) dbgcCmdRegTerse(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs) 1478 { 1479 NOREF(pCmd); NOREF(pUVM); NOREF(paArgs); NOREF(cArgs); 1585 1480 1586 1481 PDBGC pDbgc = DBGC_CMDHLP2DBGC(pCmdHlp); … … 1591 1486 1592 1487 /** 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 */ 1490 static DECLCALLBACK(int) dbgcCmdTrace(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs) 1603 1491 { 1604 1492 PDBGC pDbgc = DBGC_CMDHLP2DBGC(pCmdHlp); 1605 1493 1606 int rc = DBGFR3Step(p VM, pDbgc->idCpu);1494 int rc = DBGFR3Step(pUVM, pDbgc->idCpu); 1607 1495 if (RT_SUCCESS(rc)) 1608 1496 pDbgc->fReady = false; … … 1616 1504 1617 1505 /** 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 */ 1508 static DECLCALLBACK(int) dbgcCmdStack(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs) 1628 1509 { 1629 1510 PDBGC pDbgc = DBGC_CMDHLP2DBGC(pCmdHlp); … … 1636 1517 bool const fGuest = pCmd->pszCmd[1] == 'g' 1637 1518 || (!pCmd->pszCmd[1] && pDbgc->fRegCtxGuest); 1638 rc = DBGFR3StackWalkBegin(p VM, pDbgc->idCpu, fGuest ? DBGFCODETYPE_GUEST : DBGFCODETYPE_HYPER, &pFirstFrame);1519 rc = DBGFR3StackWalkBegin(pUVM, pDbgc->idCpu, fGuest ? DBGFCODETYPE_GUEST : DBGFCODETYPE_HYPER, &pFirstFrame); 1639 1520 if (RT_FAILURE(rc)) 1640 1521 return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "Failed to begin stack walk, rc=%Rrc\n", rc); … … 2018 1899 2019 1900 /** 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 */ 1903 static DECLCALLBACK(int) dbgcCmdDumpDT(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs) 2030 1904 { 2031 1905 /* 2032 1906 * Validate input. 2033 1907 */ 2034 if (!pVM) 2035 return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "error: No VM.\n"); 1908 DBGC_CMDHLP_REQ_UVM_RET(pCmdHlp, pCmd, pUVM); 2036 1909 2037 1910 /* … … 2040 1913 */ 2041 1914 PDBGC pDbgc = DBGC_CMDHLP2DBGC(pCmdHlp); 2042 PVMCPU pVCpu = VMM GetCpuById(pVM, pDbgc->idCpu);1915 PVMCPU pVCpu = VMMR3GetCpuByIdU(pUVM, pDbgc->idCpu); 2043 1916 CPUMMODE enmMode = CPUMGetGuestMode(pVCpu); 2044 1917 bool fGdt = pCmd->pszCmd[1] == 'g'; … … 2067 1940 * argument is given, that that into account. 2068 1941 */ 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)); 2073 1943 uint64_t u64; 2074 1944 unsigned cSels = 1; … … 2099 1969 { 2100 1970 DBGFSELINFO SelInfo; 2101 int rc = DBGFR3SelQueryInfo(p VM, pDbgc->idCpu, Sel | SelTable, DBGFSELQI_FLAGS_DT_GUEST, &SelInfo);1971 int rc = DBGFR3SelQueryInfo(pUVM, pDbgc->idCpu, Sel | SelTable, DBGFSELQI_FLAGS_DT_GUEST, &SelInfo); 2102 1972 if (RT_SUCCESS(rc)) 2103 1973 { … … 2142 2012 2143 2013 /** 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 */ 2016 static DECLCALLBACK(int) dbgcCmdDumpIDT(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs) 2154 2017 { 2155 2018 /* 2156 2019 * Validate input. 2157 2020 */ 2158 if (!pVM) 2159 return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "error: No VM.\n"); 2021 DBGC_CMDHLP_REQ_UVM_RET(pCmdHlp, pCmd, pUVM); 2160 2022 2161 2023 /* … … 2164 2026 */ 2165 2027 PDBGC pDbgc = DBGC_CMDHLP2DBGC(pCmdHlp); 2166 PVMCPU pVCpu = VMM GetCpuById(pVM, pDbgc->idCpu);2028 PVMCPU pVCpu = VMMR3GetCpuByIdU(pUVM, pDbgc->idCpu); 2167 2029 uint16_t cbLimit; 2168 2030 RTGCUINTPTR GCPtrBase = CPUMGetGuestIDTR(pVCpu, &cbLimit); … … 2195 2057 for (unsigned i = 0; i < cArgs; i++) 2196 2058 { 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); 2200 2060 if (paArgs[i].u.u64Number < 256) 2201 2061 { … … 2227 2087 AddrVar.u.GCFlat = GCPtrBase + iInt * cbEntry; 2228 2088 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); 2230 2090 if (RT_FAILURE(rc)) 2231 2091 return pCmdHlp->pfnVBoxError(pCmdHlp, rc, "Reading IDT entry %#04x.\n", (unsigned)iInt); … … 2266 2126 2267 2127 /** 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 */ 2131 static DECLCALLBACK(int) dbgcCmdDumpMem(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs) 2278 2132 { 2279 2133 PDBGC pDbgc = DBGC_CMDHLP2DBGC(pCmdHlp); … … 2282 2136 * Validate input. 2283 2137 */ 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); 2289 2142 2290 2143 /* … … 2362 2215 size_t cbReq = RT_MIN((int)sizeof(achBuffer), cbLeft); 2363 2216 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); 2365 2218 if (RT_FAILURE(rc)) 2366 2219 { … … 2472 2325 static RTGCPHYS dbgcGetGuestPageMode(PDBGC pDbgc, bool *pfPAE, bool *pfLME, bool *pfPSE, bool *pfPGE, bool *pfNXE) 2473 2326 { 2474 PVMCPU pVCpu = VMM GetCpuById(pDbgc->pVM, pDbgc->idCpu);2327 PVMCPU pVCpu = VMMR3GetCpuByIdU(pDbgc->pUVM, pDbgc->idCpu); 2475 2328 RTGCUINTREG cr4 = CPUMGetGuestCR4(pVCpu); 2476 2329 *pfPSE = !!(cr4 & X86_CR4_PSE); … … 2503 2356 static RTHCPHYS dbgcGetShadowPageMode(PDBGC pDbgc, bool *pfPAE, bool *pfLME, bool *pfPSE, bool *pfPGE, bool *pfNXE) 2504 2357 { 2505 PVMCPU pVCpu = VMM GetCpuById(pDbgc->pVM, pDbgc->idCpu);2358 PVMCPU pVCpu = VMMR3GetCpuByIdU(pDbgc->pUVM, pDbgc->idCpu); 2506 2359 2507 2360 *pfPSE = true; … … 2534 2387 2535 2388 /** 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 */ 2392 static DECLCALLBACK(int) dbgcCmdDumpPageDir(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs) 2546 2393 { 2547 2394 PDBGC pDbgc = DBGC_CMDHLP2DBGC(pCmdHlp); … … 2550 2397 * Validate input. 2551 2398 */ 2552 if ( cArgs > 12553 || (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); 2559 2406 2560 2407 /* … … 2676 2523 VarCur.u.u64Number += (((uint64_t)VarGCPtr.u.GCFlat >> X86_PML4_SHIFT) & X86_PML4_MASK) * sizeof(X86PML4E); 2677 2524 X86PML4E Pml4e; 2678 rc = pCmdHlp->pfnMemRead(pCmdHlp, pVM,&Pml4e, sizeof(Pml4e), &VarCur, NULL);2525 rc = pCmdHlp->pfnMemRead(pCmdHlp, &Pml4e, sizeof(Pml4e), &VarCur, NULL); 2679 2526 if (RT_FAILURE(rc)) 2680 2527 return DBGCCmdHlpVBoxError(pCmdHlp, rc, "Reading PML4E memory at %DV.\n", &VarCur); … … 2690 2537 X86PDPE Pdpe; 2691 2538 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); 2693 2540 if (RT_FAILURE(rc)) 2694 2541 return DBGCCmdHlpVBoxError(pCmdHlp, rc, "Reading PDPE memory at %DV.\n", &VarCur); … … 2727 2574 X86PDEPAE Pde; 2728 2575 Pde.u = 0; 2729 rc = pCmdHlp->pfnMemRead(pCmdHlp, pVM,&Pde, cbEntry, &VarPDEAddr, NULL);2576 rc = pCmdHlp->pfnMemRead(pCmdHlp, &Pde, cbEntry, &VarPDEAddr, NULL); 2730 2577 if (RT_FAILURE(rc)) 2731 2578 return pCmdHlp->pfnVBoxError(pCmdHlp, rc, "Reading PDE memory at %DV.\n", &VarPDEAddr); … … 2794 2641 2795 2642 /** 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 */ 2645 static DECLCALLBACK(int) dbgcCmdDumpPageDirBoth(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs) 2646 { 2647 DBGC_CMDHLP_REQ_UVM_RET(pCmdHlp, pCmd, pUVM); 2809 2648 int rc1 = pCmdHlp->pfnExec(pCmdHlp, "dpdg %DV", &paArgs[0]); 2810 2649 int rc2 = pCmdHlp->pfnExec(pCmdHlp, "dpdh %DV", &paArgs[0]); … … 2817 2656 2818 2657 /** 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 */ 2660 static DECLCALLBACK(int) dbgcCmdDumpPageHierarchy(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs) 2829 2661 { 2830 2662 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); 2833 2664 2834 2665 /* … … 2931 2762 * Call the worker. 2932 2763 */ 2933 rc = DBGFR3PagingDumpEx(p VM, pDbgc->idCpu, fFlags, cr3, GCPtrFirst, GCPtrLast, 99 /*cMaxDepth*/,2764 rc = DBGFR3PagingDumpEx(pUVM, pDbgc->idCpu, fFlags, cr3, GCPtrFirst, GCPtrLast, 99 /*cMaxDepth*/, 2934 2765 DBGCCmdHlpGetDbgfOutputHlp(pCmdHlp)); 2935 2766 if (RT_FAILURE(rc)) … … 2941 2772 2942 2773 /** 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 */ 2776 static DECLCALLBACK(int) dbgcCmdDumpPageTable(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs) 2953 2777 { 2954 2778 PDBGC pDbgc = DBGC_CMDHLP2DBGC(pCmdHlp); … … 2957 2781 * Validate input. 2958 2782 */ 2959 if ( cArgs != 12960 || (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); 2966 2790 2967 2791 /* … … 3045 2869 VarCur.u.u64Number += (((uint64_t)VarGCPtr.u.GCFlat >> X86_PML4_SHIFT) & X86_PML4_MASK) * sizeof(X86PML4E); 3046 2870 X86PML4E Pml4e; 3047 rc = pCmdHlp->pfnMemRead(pCmdHlp, pVM,&Pml4e, sizeof(Pml4e), &VarCur, NULL);2871 rc = pCmdHlp->pfnMemRead(pCmdHlp, &Pml4e, sizeof(Pml4e), &VarCur, NULL); 3048 2872 if (RT_FAILURE(rc)) 3049 2873 return DBGCCmdHlpVBoxError(pCmdHlp, rc, "Reading PML4E memory at %DV.\n", &VarCur); … … 3059 2883 X86PDPE Pdpe; 3060 2884 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); 3062 2886 if (RT_FAILURE(rc)) 3063 2887 return DBGCCmdHlpVBoxError(pCmdHlp, rc, "Reading PDPE memory at %DV.\n", &VarCur); … … 3070 2894 X86PDEPAE Pde; 3071 2895 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); 3073 2897 if (RT_FAILURE(rc)) 3074 2898 return DBGCCmdHlpVBoxError(pCmdHlp, rc, "Reading PDE memory at %DV.\n", &VarCur); … … 3088 2912 X86PDE Pde; 3089 2913 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); 3091 2915 if (RT_FAILURE(rc)) 3092 2916 return DBGCCmdHlpVBoxError(pCmdHlp, rc, "Reading PDE memory at %DV.\n", &VarCur); … … 3120 2944 X86PTEPAE Pte; 3121 2945 Pte.u = 0; 3122 rc = pCmdHlp->pfnMemRead(pCmdHlp, pVM,&Pte, cbEntry, &VarPTEAddr, NULL);2946 rc = pCmdHlp->pfnMemRead(pCmdHlp, &Pte, cbEntry, &VarPTEAddr, NULL); 3123 2947 if (RT_FAILURE(rc)) 3124 2948 return DBGCCmdHlpVBoxError(pCmdHlp, rc, "Reading PTE memory at %DV.\n", &VarPTEAddr); … … 3169 2993 3170 2994 /** 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 */ 2997 static DECLCALLBACK(int) dbgcCmdDumpPageTableBoth(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs) 2998 { 2999 DBGC_CMDHLP_REQ_UVM_RET(pCmdHlp, pCmd, pUVM); 3184 3000 int rc1 = pCmdHlp->pfnExec(pCmdHlp, "dptg %DV", &paArgs[0]); 3185 3001 int rc2 = pCmdHlp->pfnExec(pCmdHlp, "dpth %DV", &paArgs[0]); … … 3192 3008 3193 3009 /** 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 */ 3012 static DECLCALLBACK(int) dbgcCmdDumpTSS(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs) 3204 3013 { 3205 3014 PDBGC pDbgc = DBGC_CMDHLP2DBGC(pCmdHlp); 3206 3015 int rc; 3207 3016 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); 3214 3022 3215 3023 /* … … 3233 3041 /** @todo consider querying the hidden bits instead (missing API). */ 3234 3042 uint16_t SelTR; 3235 rc = DBGFR3RegCpuQueryU16(p VM, pDbgc->idCpu, DBGFREG_TR, &SelTR);3043 rc = DBGFR3RegCpuQueryU16(pUVM, pDbgc->idCpu, DBGFREG_TR, &SelTR); 3236 3044 if (RT_FAILURE(rc)) 3237 3045 return DBGCCmdHlpFail(pCmdHlp, pCmd, "Failed to query TR, rc=%Rrc\n", rc); … … 3265 3073 SelTss = VarTssAddr.u.GCFar.sel; 3266 3074 DBGFSELINFO SelInfo; 3267 rc = DBGFR3SelQueryInfo(p VM, 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); 3268 3076 if (RT_FAILURE(rc)) 3269 3077 return DBGCCmdHlpFail(pCmdHlp, pCmd, "DBGFR3SelQueryInfo(,%u,%d,,) -> %Rrc.\n", … … 3307 3115 { 3308 3116 uint64_t uEfer; 3309 rc = DBGFR3RegCpuQueryU64(p VM, pDbgc->idCpu, DBGFREG_MSR_K6_EFER, &uEfer);3117 rc = DBGFR3RegCpuQueryU64(pUVM, pDbgc->idCpu, DBGFREG_MSR_K6_EFER, &uEfer); 3310 3118 if ( RT_FAILURE(rc) 3311 3119 || !(uEfer & MSR_K6_EFER_LMA) ) … … 3353 3161 uint8_t abBuf[_64K]; 3354 3162 size_t cbTssRead; 3355 rc = DBGCCmdHlpMemRead(pCmdHlp, pVM,abBuf, cbTss, &VarTssAddr, &cbTssRead);3163 rc = DBGCCmdHlpMemRead(pCmdHlp, abBuf, cbTss, &VarTssAddr, &cbTssRead); 3356 3164 if (RT_FAILURE(rc)) 3357 3165 return DBGCCmdHlpFail(pCmdHlp, pCmd, "Failed to read TSS at %Dv: %Rrc\n", &VarTssAddr, rc); … … 3526 3334 3527 3335 /** 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 */ 3338 static DECLCALLBACK(int) dbgcCmdMemoryInfo(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs) 3538 3339 { 3539 3340 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); 3543 3343 } 3544 3344 … … 3682 3482 3683 3483 /** 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 */ 3486 static DECLCALLBACK(int) dbgcCmdEditMem(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs) 3694 3487 { 3695 3488 PDBGC pDbgc = DBGC_CMDHLP2DBGC(pCmdHlp); … … 3699 3492 * Validate input. 3700 3493 */ 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)); 3704 3496 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); 3709 3499 3710 3500 /* … … 3728 3518 { 3729 3519 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); 3731 3521 if (RT_FAILURE(rc)) 3732 3522 return pCmdHlp->pfnVBoxError(pCmdHlp, rc, "Writing memory at %DV.\n", &Addr); … … 3752 3542 * @returns VBox status code. 3753 3543 * @param pCmdHlp The command helpers. 3754 * @param p VM The VM handle.3544 * @param pUVM The user mode VM handle. 3755 3545 * @param pAddress The address to start searching from. (undefined on output) 3756 3546 * @param cbRange The address range to search. Must not wrap. … … 3761 3551 * @param pResult Where to store the result if it's a function invocation. 3762 3552 */ 3763 static int dbgcCmdWorkerSearchMemDoIt(PDBGCCMDHLP pCmdHlp, P VM pVM, PDBGFADDRESS pAddress, RTGCUINTPTR cbRange,3553 static int dbgcCmdWorkerSearchMemDoIt(PDBGCCMDHLP pCmdHlp, PUVM pUVM, PDBGFADDRESS pAddress, RTGCUINTPTR cbRange, 3764 3554 const uint8_t *pabBytes, uint32_t cbBytes, 3765 3555 uint32_t cbUnit, uint64_t cMaxHits, PDBGCVAR pResult) … … 3775 3565 /* search */ 3776 3566 DBGFADDRESS HitAddress; 3777 int rc = DBGFR3MemScan(p VM, pDbgc->idCpu, pAddress, cbRange, 1, pabBytes, cbBytes, &HitAddress);3567 int rc = DBGFR3MemScan(pUVM, pDbgc->idCpu, pAddress, cbRange, 1, pabBytes, cbBytes, &HitAddress); 3778 3568 if (RT_FAILURE(rc)) 3779 3569 { … … 3839 3629 * @returns VBox status code. 3840 3630 * @param pCmdHlp Pointer to the command helper functions. 3841 * @param p VM Pointer to the current VM (if any).3631 * @param pUVM The user mode VM handle. 3842 3632 * @param pResult Where to store the result of a function invocation. 3843 3633 */ 3844 static int dbgcCmdWorkerSearchMemResume(PDBGCCMDHLP pCmdHlp, P VM pVM, PDBGCVAR pResult)3634 static int dbgcCmdWorkerSearchMemResume(PDBGCCMDHLP pCmdHlp, PUVM pUVM, PDBGCVAR pResult) 3845 3635 { 3846 3636 PDBGC pDbgc = DBGC_CMDHLP2DBGC(pCmdHlp); … … 3871 3661 cbRange = ~(RTGCUINTPTR)0 - pDbgc->SearchAddr.FlatPtr + !!pDbgc->SearchAddr.FlatPtr; 3872 3662 3873 return dbgcCmdWorkerSearchMemDoIt(pCmdHlp, p VM, &Address, cbRange, pDbgc->abSearch, pDbgc->cbSearch,3663 return dbgcCmdWorkerSearchMemDoIt(pCmdHlp, pUVM, &Address, cbRange, pDbgc->abSearch, pDbgc->cbSearch, 3874 3664 pDbgc->cbSearchUnit, pDbgc->cMaxSearchHits, pResult); 3875 3665 } … … 3881 3671 * @returns VBox status. 3882 3672 * @param pCmdHlp Pointer to the command helper functions. 3883 * @param p VM Pointer to the current VM (if any).3673 * @param pUVM The user mode VM handle. 3884 3674 * @param pAddress Where to start searching. If no range, search till end of address space. 3885 3675 * @param cMaxHits The maximum number of hits. … … 3889 3679 * @param pResult Where to store the result of a function invocation. 3890 3680 */ 3891 static int dbgcCmdWorkerSearchMem(PDBGCCMDHLP pCmdHlp, P VM pVM, PCDBGCVAR pAddress, uint64_t cMaxHits, char chType,3681 static int dbgcCmdWorkerSearchMem(PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR pAddress, uint64_t cMaxHits, char chType, 3892 3682 PCDBGCVAR paPatArgs, unsigned cPatArgs, PDBGCVAR pResult) 3893 3683 { … … 3950 3740 * Ok, do it. 3951 3741 */ 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 */ 3749 static DECLCALLBACK(int) dbgcCmdSearchMem(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs) 3967 3750 { 3968 3751 /* check that the parser did what it's supposed to do. */ … … 3975 3758 */ 3976 3759 if (cArgs == 0) 3977 return dbgcCmdWorkerSearchMemResume(pCmdHlp, p VM, NULL);3760 return dbgcCmdWorkerSearchMemResume(pCmdHlp, pUVM, NULL); 3978 3761 3979 3762 /* … … 3986 3769 3987 3770 /** 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 */ 3773 static DECLCALLBACK(int) dbgcCmdSearchMemType(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs) 3998 3774 { 3999 3775 /* 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); 4004 3778 } 4005 3779 … … 4010 3784 * @returns VBox status code. 4011 3785 * @param pCmdHlp Pointer to command helper functions. 4012 * @param p VM Pointer to the current VM (if any).3786 * @param pUVM The user mode VM handle. 4013 3787 * @param pArg Pointer to the address or symbol to lookup. 4014 3788 */ 4015 static int dbgcDoListNear(PDBGCCMDHLP pCmdHlp, P VM pVM, PCDBGCVAR pArg)3789 static int dbgcDoListNear(PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR pArg) 4016 3790 { 4017 3791 PDBGC pDbgc = DBGC_CMDHLP2DBGC(pCmdHlp); … … 4024 3798 * Lookup the symbol address. 4025 3799 */ 4026 rc = DBGFR3AsSymbolByName(p VM, pDbgc->hDbgAs, pArg->u.pszString, &Symbol, NULL);3800 rc = DBGFR3AsSymbolByName(pUVM, pDbgc->hDbgAs, pArg->u.pszString, &Symbol, NULL); 4027 3801 if (RT_FAILURE(rc)) 4028 3802 return pCmdHlp->pfnVBoxError(pCmdHlp, rc, "DBGFR3AsSymbolByName(,,%s,)\n", pArg->u.pszString); … … 4042 3816 RTINTPTR offDisp; 4043 3817 DBGFADDRESS Addr; 4044 rc = DBGFR3AsSymbolByAddr(p VM, 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); 4045 3819 if (RT_FAILURE(rc)) 4046 3820 return pCmdHlp->pfnVBoxError(pCmdHlp, rc, "DBGFR3ASymbolByAddr(,,%RGv,,)\n", AddrVar.u.GCFlat); … … 4063 3837 4064 3838 /** 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 */ 3841 static DECLCALLBACK(int) dbgcCmdListNear(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs) 4075 3842 { 4076 3843 if (!cArgs) … … 4083 3850 if (RT_FAILURE(rc)) 4084 3851 return pCmdHlp->pfnVBoxError(pCmdHlp, rc, "%%(cs:eip)\n"); 4085 return dbgcDoListNear(pCmdHlp, p VM, &AddrVar);3852 return dbgcDoListNear(pCmdHlp, pUVM, &AddrVar); 4086 3853 } 4087 3854 … … 4092 3859 for (unsigned iArg = 0; iArg < cArgs; iArg++) 4093 3860 { 4094 int rc = dbgcDoListNear(pCmdHlp, p VM, &paArgs[iArg]);3861 int rc = dbgcDoListNear(pCmdHlp, pUVM, &paArgs[iArg]); 4095 3862 if (RT_FAILURE(rc)) 4096 3863 return rc; … … 4120 3887 4121 3888 /** 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 */ 3891 static DECLCALLBACK(int) dbgcCmdListModules(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs) 4132 3892 { 4133 3893 bool const fMappings = pCmd->pszCmd[2] == 'o'; … … 4138 3898 * those matching the input. 4139 3899 */ 4140 RTDBGAS hAs = DBGFR3AsResolveAndRetain(p VM, pDbgc->hDbgAs);3900 RTDBGAS hAs = DBGFR3AsResolveAndRetain(pUVM, pDbgc->hDbgAs); 4141 3901 uint32_t cMods = RTDbgAsModuleCount(hAs); 4142 3902 for (uint32_t iMod = 0; iMod < cMods; iMod++) … … 4213 3973 * @callback_method_impl{Reads a unsigned 8-bit value.} 4214 3974 */ 4215 static DECLCALLBACK(int) dbgcFuncReadU8(PCDBGCFUNC pFunc, PDBGCCMDHLP pCmdHlp, P VM pVM, PCDBGCVAR paArgs, uint32_t cArgs,3975 static DECLCALLBACK(int) dbgcFuncReadU8(PCDBGCFUNC pFunc, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, uint32_t cArgs, 4216 3976 PDBGCVAR pResult) 4217 3977 { … … 4221 3981 4222 3982 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); 4224 3984 if (RT_FAILURE(rc)) 4225 3985 return rc; … … 4234 3994 * @callback_method_impl{Reads a unsigned 16-bit value.} 4235 3995 */ 4236 static DECLCALLBACK(int) dbgcFuncReadU16(PCDBGCFUNC pFunc, PDBGCCMDHLP pCmdHlp, P VM pVM, PCDBGCVAR paArgs, uint32_t cArgs,3996 static DECLCALLBACK(int) dbgcFuncReadU16(PCDBGCFUNC pFunc, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, uint32_t cArgs, 4237 3997 PDBGCVAR pResult) 4238 3998 { … … 4242 4002 4243 4003 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); 4245 4005 if (RT_FAILURE(rc)) 4246 4006 return rc; … … 4255 4015 * @callback_method_impl{Reads a unsigned 32-bit value.} 4256 4016 */ 4257 static DECLCALLBACK(int) dbgcFuncReadU32(PCDBGCFUNC pFunc, PDBGCCMDHLP pCmdHlp, P VM pVM, PCDBGCVAR paArgs, uint32_t cArgs,4017 static DECLCALLBACK(int) dbgcFuncReadU32(PCDBGCFUNC pFunc, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, uint32_t cArgs, 4258 4018 PDBGCVAR pResult) 4259 4019 { … … 4263 4023 4264 4024 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); 4266 4026 if (RT_FAILURE(rc)) 4267 4027 return rc; … … 4276 4036 * @callback_method_impl{Reads a unsigned 64-bit value.} 4277 4037 */ 4278 static DECLCALLBACK(int) dbgcFuncReadU64(PCDBGCFUNC pFunc, PDBGCCMDHLP pCmdHlp, P VM pVM, PCDBGCVAR paArgs, uint32_t cArgs,4038 static DECLCALLBACK(int) dbgcFuncReadU64(PCDBGCFUNC pFunc, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, uint32_t cArgs, 4279 4039 PDBGCVAR pResult) 4280 4040 { … … 4284 4044 4285 4045 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); 4287 4047 if (RT_FAILURE(rc)) 4288 4048 return rc; … … 4297 4057 * @callback_method_impl{Reads a unsigned pointer-sized value.} 4298 4058 */ 4299 static DECLCALLBACK(int) dbgcFuncReadPtr(PCDBGCFUNC pFunc, PDBGCCMDHLP pCmdHlp, P VM pVM, PCDBGCVAR paArgs, uint32_t cArgs,4059 static DECLCALLBACK(int) dbgcFuncReadPtr(PCDBGCFUNC pFunc, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, uint32_t cArgs, 4300 4060 PDBGCVAR pResult) 4301 4061 { … … 4306 4066 CPUMMODE enmMode = DBGCCmdHlpGetCpuMode(pCmdHlp); 4307 4067 if (enmMode == CPUMMODE_LONG) 4308 return dbgcFuncReadU64(pFunc, pCmdHlp, p VM, paArgs, cArgs, pResult);4309 return dbgcFuncReadU32(pFunc, pCmdHlp, p VM, paArgs, cArgs, pResult);4068 return dbgcFuncReadU64(pFunc, pCmdHlp, pUVM, paArgs, cArgs, pResult); 4069 return dbgcFuncReadU32(pFunc, pCmdHlp, pUVM, paArgs, cArgs, pResult); 4310 4070 } 4311 4071 … … 4314 4074 * @callback_method_impl{The hi(value) function implementation.} 4315 4075 */ 4316 static DECLCALLBACK(int) dbgcFuncHi(PCDBGCFUNC pFunc, PDBGCCMDHLP pCmdHlp, P VM pVM, PCDBGCVAR paArgs, uint32_t cArgs,4076 static DECLCALLBACK(int) dbgcFuncHi(PCDBGCFUNC pFunc, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, uint32_t cArgs, 4317 4077 PDBGCVAR pResult) 4318 4078 { … … 4334 4094 DBGCVAR_SET_RANGE(pResult, paArgs[0].enmRangeType, paArgs[0].u64Range); 4335 4095 4336 NOREF(pFunc); NOREF(pCmdHlp); NOREF(p VM);4096 NOREF(pFunc); NOREF(pCmdHlp); NOREF(pUVM); 4337 4097 return VINF_SUCCESS; 4338 4098 } … … 4342 4102 * @callback_method_impl{The low(value) function implementation.} 4343 4103 */ 4344 static DECLCALLBACK(int) dbgcFuncLow(PCDBGCFUNC pFunc, PDBGCCMDHLP pCmdHlp, P VM pVM, PCDBGCVAR paArgs, uint32_t cArgs,4104 static DECLCALLBACK(int) dbgcFuncLow(PCDBGCFUNC pFunc, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, uint32_t cArgs, 4345 4105 PDBGCVAR pResult) 4346 4106 { … … 4362 4122 DBGCVAR_SET_RANGE(pResult, paArgs[0].enmRangeType, paArgs[0].u64Range); 4363 4123 4364 NOREF(pFunc); NOREF(pCmdHlp); NOREF(p VM);4124 NOREF(pFunc); NOREF(pCmdHlp); NOREF(pUVM); 4365 4125 return VINF_SUCCESS; 4366 4126 } … … 4370 4130 * @callback_method_impl{The low(value) function implementation.} 4371 4131 */ 4372 static DECLCALLBACK(int) dbgcFuncNot(PCDBGCFUNC pFunc, PDBGCCMDHLP pCmdHlp, P VM pVM, PCDBGCVAR paArgs, uint32_t cArgs,4132 static DECLCALLBACK(int) dbgcFuncNot(PCDBGCFUNC pFunc, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, uint32_t cArgs, 4373 4133 PDBGCVAR pResult) 4374 4134 { 4375 4135 AssertReturn(cArgs == 1, VERR_DBGC_PARSE_BUG); 4376 NOREF(pFunc); NOREF(pCmdHlp); NOREF(p VM);4136 NOREF(pFunc); NOREF(pCmdHlp); NOREF(pUVM); 4377 4137 return DBGCCmdHlpEval(pCmdHlp, pResult, "!(%Dv)", &paArgs[0]); 4378 4138 } -
trunk/src/VBox/Debugger/DBGCEval.cpp
r41780 r44399 5 5 6 6 /* 7 * Copyright (C) 2006-201 2Oracle Corporation7 * Copyright (C) 2006-2013 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 434 434 pszArgs, &iArg, &cArgs); 435 435 if (RT_SUCCESS(rc)) 436 rc = pFunc->pfnHandler(pFunc, &pDbgc->CmdHlp, pDbgc->p VM, &pDbgc->aArgs[iArg], cArgs, pResult);436 rc = pFunc->pfnHandler(pFunc, &pDbgc->CmdHlp, pDbgc->pUVM, &pDbgc->aArgs[iArg], cArgs, pResult); 437 437 pDbgc->iArg = iArg; 438 438 return rc; … … 1371 1371 */ 1372 1372 if (!fNoExecute) 1373 rc = pCmd->pfnHandler(pCmd, &pDbgc->CmdHlp, pDbgc->p VM, &pDbgc->aArgs[iArg], cArgs);1373 rc = pCmd->pfnHandler(pCmd, &pDbgc->CmdHlp, pDbgc->pUVM, &pDbgc->aArgs[iArg], cArgs); 1374 1374 pDbgc->rcCmd = rc; 1375 1375 pDbgc->iArg = iArg; -
trunk/src/VBox/Debugger/DBGCFunctions.cpp
r41561 r44399 5 5 6 6 /* 7 * Copyright (C) 2006-201 2Oracle Corporation7 * Copyright (C) 2006-2013 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 45 45 * @callback_method_impl{The randu32() function implementation.} 46 46 */ 47 static DECLCALLBACK(int) dbgcFuncRandU32(PCDBGCFUNC pFunc, PDBGCCMDHLP pCmdHlp, P VM pVM, PCDBGCVAR paArgs, uint32_t cArgs,47 static DECLCALLBACK(int) dbgcFuncRandU32(PCDBGCFUNC pFunc, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, uint32_t cArgs, 48 48 PDBGCVAR pResult) 49 49 { … … 51 51 uint32_t u32 = RTRandU32(); 52 52 DBGCVAR_INIT_NUMBER(pResult, u32); 53 NOREF(pFunc); NOREF(pCmdHlp); NOREF(p VM); NOREF(paArgs);53 NOREF(pFunc); NOREF(pCmdHlp); NOREF(pUVM); NOREF(paArgs); 54 54 return VINF_SUCCESS; 55 55 } -
trunk/src/VBox/Debugger/DBGCInternal.h
r41561 r44399 112 112 /** Pointer to the current VM. */ 113 113 PVM pVM; 114 /** The user mode handle of the current VM. */ 115 PUVM pUVM; 114 116 /** The ID of current virtual CPU. */ 115 117 VMCPUID idCpu; -
trunk/src/VBox/Debugger/DBGCOps.cpp
r41573 r44399 462 462 if (enmCat == DBGCVAR_CAT_SYMBOL) 463 463 { 464 int rc = DBGFR3RegNmValidate(pDbgc->p VM, pDbgc->idCpu, pArg->u.pszString);464 int rc = DBGFR3RegNmValidate(pDbgc->pUVM, pDbgc->idCpu, pArg->u.pszString); 465 465 if (RT_SUCCESS(rc)) 466 466 DBGCVAR_INIT_STRING(pResult, pArg->u.pszString); … … 473 473 DBGFREGVALTYPE enmType; 474 474 DBGFREGVAL Value; 475 int rc = DBGFR3RegNmQuery(pDbgc->p VM, pDbgc->idCpu, pArg->u.pszString, &Value, &enmType);475 int rc = DBGFR3RegNmQuery(pDbgc->pUVM, pDbgc->idCpu, pArg->u.pszString, &Value, &enmType); 476 476 if (RT_SUCCESS(rc)) 477 477 { -
trunk/src/VBox/Debugger/DBGCTcp.cpp
r35628 r44399 5 5 6 6 /* 7 * Copyright (C) 2006-201 1Oracle Corporation7 * Copyright (C) 2006-2013 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 185 185 * @param pvUser The VM handle. 186 186 */ 187 static intdbgcTcpConnection(RTSOCKET Sock, void *pvUser)187 static DECLCALLBACK(int) dbgcTcpConnection(RTSOCKET Sock, void *pvUser) 188 188 { 189 189 LogFlow(("dbgcTcpConnection: connection! Sock=%d pvUser=%p\n", Sock, pvUser)); … … 199 199 DbgcTcp.fAlive = true; 200 200 DbgcTcp.Sock = Sock; 201 int rc = DBGCCreate((P VM)pvUser, &DbgcTcp.Back, 0);201 int rc = DBGCCreate((PUVM)pvUser, &DbgcTcp.Back, 0); 202 202 LogFlow(("dbgcTcpConnection: disconnect rc=%Rrc\n", rc)); 203 203 return rc; … … 209 209 * 210 210 * @returns VBox status. 211 * @param p VMVM handle.211 * @param pUVM The user mode VM handle. 212 212 * @param ppvData Where to store a pointer to the instance data. 213 213 */ 214 DBGDECL(int) DBGCTcpCreate(P VM pVM, void **ppvData)214 DBGDECL(int) DBGCTcpCreate(PUVM pUVM, void **ppvData) 215 215 { 216 216 /* 217 217 * Check what the configuration says. 218 218 */ 219 PCFGMNODE pKey = CFGMR3GetChild(CFGMR3GetRoot (pVM), "DBGC");219 PCFGMNODE pKey = CFGMR3GetChild(CFGMR3GetRootU(pUVM), "DBGC"); 220 220 bool fEnabled; 221 221 int rc = CFGMR3QueryBoolDef(pKey, "Enabled", &fEnabled, … … 227 227 ); 228 228 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\""); 230 230 231 231 if (!fEnabled) … … 241 241 rc = CFGMR3QueryU32Def(pKey, "Port", &u32Port, 5000); 242 242 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\""); 244 244 245 245 /* … … 249 249 rc = CFGMR3QueryStringDef(pKey, "Address", szAddress, sizeof(szAddress), ""); 250 250 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\""); 252 252 253 253 /* … … 255 255 */ 256 256 PRTTCPSERVER pServer; 257 rc = RTTcpServerCreate(szAddress, u32Port, RTTHREADTYPE_DEBUGGER, "DBGC", dbgcTcpConnection, p VM, &pServer);257 rc = RTTcpServerCreate(szAddress, u32Port, RTTHREADTYPE_DEBUGGER, "DBGC", dbgcTcpConnection, pUVM, &pServer); 258 258 if (RT_SUCCESS(rc)) 259 259 { … … 264 264 265 265 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"); 267 267 } 268 268 … … 272 272 * 273 273 * @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 */ 277 DBGDECL(int) DBGCTcpTerminate(PUVM pUVM, void *pvData) 277 278 { 278 279 /* -
trunk/src/VBox/Debugger/DBGConsole.cpp
r43394 r44399 5 5 6 6 /* 7 * Copyright (C) 2006-201 1Oracle Corporation7 * Copyright (C) 2006-2013 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 162 162 #include <VBox/dbg.h> 163 163 #include <VBox/vmm/dbgf.h> 164 #include <VBox/vmm/vmapi.h> /* VMR3GetVM() */ 164 165 #include <VBox/err.h> 165 166 #include <VBox/log.h> … … 259 260 */ 260 261 RTDBGSYMBOL Symbol; 261 rc = DBGFR3AsSymbolByName(pDbgc->p VM, pDbgc->hDbgAs, pszSymbol, &Symbol, NULL);262 rc = DBGFR3AsSymbolByName(pDbgc->pUVM, pDbgc->hDbgAs, pszSymbol, &Symbol, NULL); 262 263 if (RT_SUCCESS(rc)) 263 264 { … … 674 675 break; 675 676 } 676 if (RT_SUCCESS(rc) && DBGFR3IsHalted(pDbgc->p VM))677 if (RT_SUCCESS(rc) && DBGFR3IsHalted(pDbgc->pUVM)) 677 678 rc = pDbgc->CmdHlp.pfnExec(&pDbgc->CmdHlp, "r"); 678 679 else … … 810 811 for (;;) 811 812 { 812 if ( pDbgc->p VM813 && DBGFR3CanWait(pDbgc->p VM))813 if ( pDbgc->pUVM 814 && DBGFR3CanWait(pDbgc->pUVM)) 814 815 { 815 816 /* … … 817 818 */ 818 819 PCDBGFEVENT pEvent; 819 rc = DBGFR3EventWait(pDbgc->p VM, pDbgc->fLog ? 1 : 32, &pEvent);820 rc = DBGFR3EventWait(pDbgc->pUVM, pDbgc->fLog ? 1 : 32, &pEvent); 820 821 if (RT_SUCCESS(rc)) 821 822 { … … 891 892 pDbgc->pBack = pBack; 892 893 pDbgc->pVM = NULL; 894 pDbgc->pUVM = NULL; 893 895 pDbgc->idCpu = 0; 894 896 pDbgc->hDbgAs = DBGF_AS_GLOBAL; … … 954 956 955 957 /* Detach from the VM. */ 956 if (pDbgc->p VM)957 DBGFR3Detach(pDbgc->p VM);958 if (pDbgc->pUVM) 959 DBGFR3Detach(pDbgc->pUVM); 958 960 959 961 /* finally, free the instance memory. */ … … 971 973 * @returns The VBox status code causing the console termination. 972 974 * 973 * @param p VM VM Handle.975 * @param pUVM The user mode VM handle. 974 976 * @param pBack Pointer to the backend structure. This must contain 975 977 * a full set of function pointers to service the console. … … 978 980 * callbacks to return fatal failures. 979 981 */ 980 DBGDECL(int) DBGCCreate(P VM pVM, PDBGCBACK pBack, unsigned fFlags)982 DBGDECL(int) DBGCCreate(PUVM pUVM, PDBGCBACK pBack, unsigned fFlags) 981 983 { 982 984 /* 983 985 * Validate input. 984 986 */ 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 } 986 994 987 995 /* … … 1002 1010 * Attach to the specified VM. 1003 1011 */ 1004 if (RT_SUCCESS(rc) && p VM)1005 { 1006 rc = DBGFR3Attach(p VM);1012 if (RT_SUCCESS(rc) && pUVM) 1013 { 1014 rc = DBGFR3Attach(pUVM); 1007 1015 if (RT_SUCCESS(rc)) 1008 1016 { 1009 1017 pDbgc->pVM = pVM; 1018 pDbgc->pUVM = pUVM; 1010 1019 pDbgc->idCpu = 0; 1011 1020 rc = pDbgc->CmdHlp.pfnPrintf(&pDbgc->CmdHlp, NULL, -
trunk/src/VBox/Debugger/DBGPlugInCommonELF.h
r33540 r44399 35 35 /* @} */ 36 36 37 int DBGDiggerCommonParseElf32Mod(P VM pVM, const char *pszModName, const char *pszFilename, uint32_t fFlags,37 int DBGDiggerCommonParseElf32Mod(PUVM pUVM, const char *pszModName, const char *pszFilename, uint32_t fFlags, 38 38 Elf32_Ehdr const *pEhdr, Elf32_Shdr const *paShdrs, 39 39 Elf32_Sym const *paSyms, size_t cMaxSyms, … … 41 41 RTGCPTR MinAddr, RTGCPTR MaxAddr, uint64_t uModTag); 42 42 43 int DBGDiggerCommonParseElf64Mod(P VM pVM, const char *pszModName, const char *pszFilename, uint32_t fFlags,43 int DBGDiggerCommonParseElf64Mod(PUVM pUVM, const char *pszModName, const char *pszFilename, uint32_t fFlags, 44 44 Elf64_Ehdr const *pEhdr, Elf64_Shdr const *paShdrs, 45 45 Elf64_Sym const *paSyms, size_t cMaxSyms, -
trunk/src/VBox/Debugger/DBGPlugInCommonELFTmpl.cpp.h
r43876 r44399 44 44 * @returns VBox status code. 45 45 * 46 * @param p VM The VM handle.46 * @param pUVM The user mode VM handle. 47 47 * @param pszModName The module name. 48 48 * @param pszFilename The filename. optional. … … 69 69 * @param uModTag Module tag. Pass 0 if tagging is of no interest. 70 70 */ 71 int DBGDiggerCommonParseElfMod(P VM pVM, const char *pszModName, const char *pszFilename, uint32_t fFlags,71 int DBGDiggerCommonParseElfMod(PUVM pUVM, const char *pszModName, const char *pszFilename, uint32_t fFlags, 72 72 Elf_Ehdr const *pEhdr, Elf_Shdr const *paShdrs, 73 73 Elf_Sym const *paSyms, size_t cMaxSyms, … … 75 75 RTGCPTR MinAddr, RTGCPTR MaxAddr, uint64_t uModTag) 76 76 { 77 AssertPtrReturn(p VM, VERR_INVALID_POINTER);77 AssertPtrReturn(pUVM, VERR_INVALID_POINTER); 78 78 AssertPtrReturn(pszModName, VERR_INVALID_POINTER); 79 79 AssertPtrReturn(pszFilename, VERR_INVALID_POINTER); … … 316 316 * Link it into the address space. 317 317 */ 318 RTDBGAS hAs = DBGFR3AsResolveAndRetain(p VM, DBGF_AS_KERNEL);318 RTDBGAS hAs = DBGFR3AsResolveAndRetain(pUVM, DBGF_AS_KERNEL); 319 319 if (hAs != NIL_RTDBGAS) 320 320 rc = dbgDiggerCommonLinkElfSegs(hAs, hMod, paSegs, cSegs); -
trunk/src/VBox/Debugger/DBGPlugInDiggers.cpp
r40726 r44399 28 28 29 29 30 DECLEXPORT(int) DBGCPlugInEntry(DBGCPLUGINOP enmOperation, P VM pVM, uintptr_t uArg)30 DECLEXPORT(int) DBGCPlugInEntry(DBGCPLUGINOP enmOperation, PUVM pUVM, uintptr_t uArg) 31 31 { 32 32 static PCDBGFOSREG s_aPlugIns[] = … … 48 48 for (unsigned i = 0; i < RT_ELEMENTS(s_aPlugIns); i++) 49 49 { 50 int rc = DBGFR3OSRegister(p VM, s_aPlugIns[i]);50 int rc = DBGFR3OSRegister(pUVM, s_aPlugIns[i]); 51 51 if (RT_FAILURE(rc)) 52 52 { 53 53 AssertRC(rc); 54 54 while (i-- > 0) 55 DBGFR3OSDeregister(p VM, s_aPlugIns[i]);55 DBGFR3OSDeregister(pUVM, s_aPlugIns[i]); 56 56 return rc; 57 57 } … … 64 64 for (unsigned i = 0; i < RT_ELEMENTS(s_aPlugIns); i++) 65 65 { 66 int rc = DBGFR3OSDeregister(p VM, s_aPlugIns[i]);66 int rc = DBGFR3OSDeregister(pUVM, s_aPlugIns[i]); 67 67 AssertRC(rc); 68 68 } -
trunk/src/VBox/Debugger/DBGPlugInLinux.cpp
r35346 r44399 74 74 * Internal Functions * 75 75 *******************************************************************************/ 76 static DECLCALLBACK(int) dbgDiggerLinuxInit(P VM pVM, void *pvData);76 static DECLCALLBACK(int) dbgDiggerLinuxInit(PUVM pUVM, void *pvData); 77 77 78 78 … … 92 92 * @copydoc DBGFOSREG::pfnQueryInterface 93 93 */ 94 static DECLCALLBACK(void *) dbgDiggerLinuxQueryInterface(P VM pVM, void *pvData, DBGFOSINTERFACE enmIf)94 static DECLCALLBACK(void *) dbgDiggerLinuxQueryInterface(PUVM pUVM, void *pvData, DBGFOSINTERFACE enmIf) 95 95 { 96 96 return NULL; … … 101 101 * @copydoc DBGFOSREG::pfnQueryVersion 102 102 */ 103 static DECLCALLBACK(int) dbgDiggerLinuxQueryVersion(P VM pVM, void *pvData, char *pszVersion, size_t cchVersion)103 static DECLCALLBACK(int) dbgDiggerLinuxQueryVersion(PUVM pUVM, void *pvData, char *pszVersion, size_t cchVersion) 104 104 { 105 105 PDBGDIGGERLINUX pThis = (PDBGDIGGERLINUX)pvData; … … 109 109 * It's all in the linux banner. 110 110 */ 111 int rc = DBGFR3MemReadString(p VM, 0, &pThis->AddrLinuxBanner, pszVersion, cchVersion);111 int rc = DBGFR3MemReadString(pUVM, 0, &pThis->AddrLinuxBanner, pszVersion, cchVersion); 112 112 if (RT_SUCCESS(rc)) 113 113 { … … 129 129 * @copydoc DBGFOSREG::pfnTerm 130 130 */ 131 static DECLCALLBACK(void) dbgDiggerLinuxTerm(P VM pVM, void *pvData)131 static DECLCALLBACK(void) dbgDiggerLinuxTerm(PUVM pUVM, void *pvData) 132 132 { 133 133 PDBGDIGGERLINUX pThis = (PDBGDIGGERLINUX)pvData; … … 141 141 * @copydoc DBGFOSREG::pfnRefresh 142 142 */ 143 static DECLCALLBACK(int) dbgDiggerLinuxRefresh(P VM pVM, void *pvData)143 static DECLCALLBACK(int) dbgDiggerLinuxRefresh(PUVM pUVM, void *pvData) 144 144 { 145 145 PDBGDIGGERLINUX pThis = (PDBGDIGGERLINUX)pvData; … … 150 150 * For now we'll flush and reload everything. 151 151 */ 152 dbgDiggerLinuxTerm(p VM, pvData);153 return dbgDiggerLinuxInit(p VM, pvData);152 dbgDiggerLinuxTerm(pUVM, pvData); 153 return dbgDiggerLinuxInit(pUVM, pvData); 154 154 } 155 155 … … 158 158 * @copydoc DBGFOSREG::pfnInit 159 159 */ 160 static DECLCALLBACK(int) dbgDiggerLinuxInit(P VM pVM, void *pvData)160 static DECLCALLBACK(int) dbgDiggerLinuxInit(PUVM pUVM, void *pvData) 161 161 { 162 162 PDBGDIGGERLINUX pThis = (PDBGDIGGERLINUX)pvData; … … 183 183 * @copydoc DBGFOSREG::pfnProbe 184 184 */ 185 static DECLCALLBACK(bool) dbgDiggerLinuxProbe(P VM pVM, void *pvData)185 static DECLCALLBACK(bool) dbgDiggerLinuxProbe(PUVM pUVM, void *pvData) 186 186 { 187 187 PDBGDIGGERLINUX pThis = (PDBGDIGGERLINUX)pvData; … … 196 196 { 197 197 DBGFADDRESS KernelAddr; 198 DBGFR3AddrFromFlat(p VM, &KernelAddr, g_au64LnxKernelAddresses[i]);198 DBGFR3AddrFromFlat(pUVM, &KernelAddr, g_au64LnxKernelAddresses[i]); 199 199 DBGFADDRESS HitAddr; 200 200 static const uint8_t s_abLinuxVersion[] = "Linux version 2."; 201 int rc = DBGFR3MemScan(p VM, 0, &KernelAddr, LNX_MAX_KERNEL_SIZE, 1,201 int rc = DBGFR3MemScan(pUVM, 0, &KernelAddr, LNX_MAX_KERNEL_SIZE, 1, 202 202 s_abLinuxVersion, sizeof(s_abLinuxVersion) - 1, &HitAddr); 203 203 if (RT_SUCCESS(rc)) … … 205 205 char szTmp[128]; 206 206 char const *pszY = &szTmp[sizeof(s_abLinuxVersion) - 1]; 207 rc = DBGFR3MemReadString(p VM, 0, &HitAddr, szTmp, sizeof(szTmp));207 rc = DBGFR3MemReadString(pUVM, 0, &HitAddr, szTmp, sizeof(szTmp)); 208 208 if ( RT_SUCCESS(rc) 209 209 && *pszY >= '0' … … 223 223 * @copydoc DBGFOSREG::pfnDestruct 224 224 */ 225 static DECLCALLBACK(void) dbgDiggerLinuxDestruct(P VM pVM, void *pvData)225 static DECLCALLBACK(void) dbgDiggerLinuxDestruct(PUVM pUVM, void *pvData) 226 226 { 227 227 … … 232 232 * @copydoc DBGFOSREG::pfnConstruct 233 233 */ 234 static DECLCALLBACK(int) dbgDiggerLinuxConstruct(P VM pVM, void *pvData)234 static DECLCALLBACK(int) dbgDiggerLinuxConstruct(PUVM pUVM, void *pvData) 235 235 { 236 236 return VINF_SUCCESS; -
trunk/src/VBox/Debugger/DBGPlugInOS2.cpp
r43876 r44399 85 85 * Internal Functions * 86 86 *******************************************************************************/ 87 static DECLCALLBACK(int) dbgDiggerOS2Init(P VM pVM, void *pvData);87 static DECLCALLBACK(int) dbgDiggerOS2Init(PUVM pUVM, void *pvData); 88 88 89 89 … … 96 96 * Process a PE image found in guest memory. 97 97 * 98 * @param pThis 99 * @param p VM The VM handle.100 * @param pszName 101 * @param pImageAddr 102 * @param cbImage 103 * @param pbBuf 104 * 105 * @param cbBuf 106 */ 107 static void dbgDiggerOS2ProcessImage(PDBGDIGGEROS2 pThis, P VM 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 */ 107 static void dbgDiggerOS2ProcessImage(PDBGDIGGEROS2 pThis, PUVM pUVM, const char *pszName, 108 108 PCDBGFADDRESS pImageAddr, uint32_t cbImage, 109 109 uint8_t *pbBuf, size_t cbBuf) … … 118 118 * @copydoc DBGFOSREG::pfnQueryInterface 119 119 */ 120 static DECLCALLBACK(void *) dbgDiggerOS2QueryInterface(P VM pVM, void *pvData, DBGFOSINTERFACE enmIf)120 static DECLCALLBACK(void *) dbgDiggerOS2QueryInterface(PUVM pUVM, void *pvData, DBGFOSINTERFACE enmIf) 121 121 { 122 122 return NULL; … … 127 127 * @copydoc DBGFOSREG::pfnQueryVersion 128 128 */ 129 static DECLCALLBACK(int) dbgDiggerOS2QueryVersion(P VM pVM, void *pvData, char *pszVersion, size_t cchVersion)129 static DECLCALLBACK(int) dbgDiggerOS2QueryVersion(PUVM pUVM, void *pvData, char *pszVersion, size_t cchVersion) 130 130 { 131 131 PDBGDIGGEROS2 pThis = (PDBGDIGGEROS2)pvData; … … 171 171 * @copydoc DBGFOSREG::pfnTerm 172 172 */ 173 static DECLCALLBACK(void) dbgDiggerOS2Term(P VM pVM, void *pvData)173 static DECLCALLBACK(void) dbgDiggerOS2Term(PUVM pUVM, void *pvData) 174 174 { 175 175 PDBGDIGGEROS2 pThis = (PDBGDIGGEROS2)pvData; … … 183 183 * @copydoc DBGFOSREG::pfnRefresh 184 184 */ 185 static DECLCALLBACK(int) dbgDiggerOS2Refresh(P VM pVM, void *pvData)185 static DECLCALLBACK(int) dbgDiggerOS2Refresh(PUVM pUVM, void *pvData) 186 186 { 187 187 PDBGDIGGEROS2 pThis = (PDBGDIGGEROS2)pvData; … … 192 192 * For now we'll flush and reload everything. 193 193 */ 194 RTDBGAS hDbgAs = DBGFR3AsResolveAndRetain(p VM, DBGF_AS_KERNEL);194 RTDBGAS hDbgAs = DBGFR3AsResolveAndRetain(pUVM, DBGF_AS_KERNEL); 195 195 if (hDbgAs != NIL_RTDBGAS) 196 196 { … … 212 212 } 213 213 214 dbgDiggerOS2Term(p VM, pvData);215 return dbgDiggerOS2Init(p VM, pvData);214 dbgDiggerOS2Term(pUVM, pvData); 215 return dbgDiggerOS2Init(pUVM, pvData); 216 216 } 217 217 … … 220 220 * @copydoc DBGFOSREG::pfnInit 221 221 */ 222 static DECLCALLBACK(int) dbgDiggerOS2Init(P VM pVM, void *pvData)222 static DECLCALLBACK(int) dbgDiggerOS2Init(PUVM pUVM, void *pvData) 223 223 { 224 224 PDBGDIGGEROS2 pThis = (PDBGDIGGEROS2)pvData; … … 240 240 do { 241 241 /* Version info is at GIS:15h (major/minor/revision). */ 242 rc = DBGFR3AddrFromSelOff(p VM, 0 /*idCpu*/, &Addr, pThis->selGIS, 0x15);242 rc = DBGFR3AddrFromSelOff(pUVM, 0 /*idCpu*/, &Addr, pThis->selGIS, 0x15); 243 243 if (RT_FAILURE(rc)) 244 244 break; 245 rc = DBGFR3MemRead(p VM, 0 /*idCpu*/, &Addr, u.au32, sizeof(uint32_t));245 rc = DBGFR3MemRead(pUVM, 0 /*idCpu*/, &Addr, u.au32, sizeof(uint32_t)); 246 246 if (RT_FAILURE(rc)) 247 247 break; … … 260 260 * @copydoc DBGFOSREG::pfnProbe 261 261 */ 262 static DECLCALLBACK(bool) dbgDiggerOS2Probe(P VM pVM, void *pvData)262 static DECLCALLBACK(bool) dbgDiggerOS2Probe(PUVM pUVM, void *pvData) 263 263 { 264 264 PDBGDIGGEROS2 pThis = (PDBGDIGGEROS2)pvData; … … 283 283 */ 284 284 do { 285 rc = DBGFR3AddrFromSelOff(p VM, 0 /*idCpu*/, &Addr, 0x70, 0x00);285 rc = DBGFR3AddrFromSelOff(pUVM, 0 /*idCpu*/, &Addr, 0x70, 0x00); 286 286 if (RT_FAILURE(rc)) 287 287 break; 288 rc = DBGFR3MemRead(p VM, 0 /*idCpu*/, &Addr, u.au32, 256);288 rc = DBGFR3MemRead(pUVM, 0 /*idCpu*/, &Addr, u.au32, 256); 289 289 if (RT_FAILURE(rc)) 290 290 break; … … 318 318 * @copydoc DBGFOSREG::pfnDestruct 319 319 */ 320 static DECLCALLBACK(void) dbgDiggerOS2Destruct(P VM pVM, void *pvData)320 static DECLCALLBACK(void) dbgDiggerOS2Destruct(PUVM pUVM, void *pvData) 321 321 { 322 322 … … 327 327 * @copydoc DBGFOSREG::pfnConstruct 328 328 */ 329 static DECLCALLBACK(int) dbgDiggerOS2Construct(P VM pVM, void *pvData)329 static DECLCALLBACK(int) dbgDiggerOS2Construct(PUVM pUVM, void *pvData) 330 330 { 331 331 PDBGDIGGEROS2 pThis = (PDBGDIGGEROS2)pvData; -
trunk/src/VBox/Debugger/DBGPlugInSolaris.cpp
r35346 r44399 350 350 * Internal Functions * 351 351 *******************************************************************************/ 352 static DECLCALLBACK(int) dbgDiggerSolarisInit(P VM pVM, void *pvData);352 static DECLCALLBACK(int) dbgDiggerSolarisInit(PUVM pUVM, void *pvData); 353 353 354 354 … … 357 357 * @copydoc DBGFOSREG::pfnQueryInterface 358 358 */ 359 static DECLCALLBACK(void *) dbgDiggerSolarisQueryInterface(P VM pVM, void *pvData, DBGFOSINTERFACE enmIf)359 static DECLCALLBACK(void *) dbgDiggerSolarisQueryInterface(PUVM pUVM, void *pvData, DBGFOSINTERFACE enmIf) 360 360 { 361 361 return NULL; … … 366 366 * @copydoc DBGFOSREG::pfnQueryVersion 367 367 */ 368 static DECLCALLBACK(int) dbgDiggerSolarisQueryVersion(P VM pVM, void *pvData, char *pszVersion, size_t cchVersion)368 static DECLCALLBACK(int) dbgDiggerSolarisQueryVersion(PUVM pUVM, void *pvData, char *pszVersion, size_t cchVersion) 369 369 { 370 370 PDBGDIGGERSOLARIS pThis = (PDBGDIGGERSOLARIS)pvData; … … 377 377 SOL_utsname_t UtsName; 378 378 RTDBGSYMBOL SymUtsName; 379 int rc = DBGFR3AsSymbolByName(p VM, DBGF_AS_KERNEL, "utsname", &SymUtsName, NULL);379 int rc = DBGFR3AsSymbolByName(pUVM, DBGF_AS_KERNEL, "utsname", &SymUtsName, NULL); 380 380 if (RT_SUCCESS(rc)) 381 rc = DBGFR3MemRead(p VM, 0, DBGFR3AddrFromFlat(pVM, &Addr, SymUtsName.Value), &UtsName, sizeof(UtsName));381 rc = DBGFR3MemRead(pUVM, 0, DBGFR3AddrFromFlat(pUVM, &Addr, SymUtsName.Value), &UtsName, sizeof(UtsName)); 382 382 if (RT_FAILURE(rc)) 383 383 { … … 387 387 memset(&UtsName, '\0', sizeof(UtsName)); 388 388 strcpy(&UtsName.sysname[0], "SunOS"); 389 rc = DBGFR3MemScan(p VM, 0, &pThis->AddrUnixData, SOL_UNIX_MAX_DATA_SEG_SIZE, 1,389 rc = DBGFR3MemScan(pUVM, 0, &pThis->AddrUnixData, SOL_UNIX_MAX_DATA_SEG_SIZE, 1, 390 390 &UtsName.sysname[0], sizeof(UtsName.sysname), &Addr); 391 391 if (RT_SUCCESS(rc)) 392 rc = DBGFR3MemRead(p VM, 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)), 393 393 &UtsName, sizeof(UtsName)); 394 394 } … … 423 423 * Processes a modctl_t. 424 424 * 425 * @param p VM The VM handle.425 * @param pUVM The user mode VM handle. 426 426 * @param pThis Our instance data. 427 427 * @param pModCtl Pointer to the modctl structure. 428 428 */ 429 static void dbgDiggerSolarisProcessModCtl32(P VM pVM, PDBGDIGGERSOLARIS pThis, SOL_modctl_t const *pModCtl)429 static void dbgDiggerSolarisProcessModCtl32(PUVM pUVM, PDBGDIGGERSOLARIS pThis, SOL_modctl_t const *pModCtl) 430 430 { 431 431 /* skip it if it's not loaded and installed */ … … 444 444 char szModName[64]; 445 445 DBGFADDRESS Addr; 446 int rc = DBGFR3MemReadString(p VM, 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)); 447 447 if (RT_FAILURE(rc)) 448 448 return; … … 452 452 AssertCompile2MemberOffsets(SOL_modctl_t, v11_32.mod_filename, v9_32.mod_filename); 453 453 char szFilename[256]; 454 rc = DBGFR3MemReadString(p VM, 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)); 455 455 if (RT_FAILURE(rc)) 456 456 strcpy(szFilename, szModName); … … 463 463 AssertCompile2MemberOffsets(SOL_modctl_t, v11_32.mod_mp, v9_32.mod_mp); 464 464 struct SOL32_module Module; 465 rc = DBGFR3MemRead(p VM, 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)); 466 466 if (RT_FAILURE(rc)) 467 467 return; … … 533 533 if (!paShdrs) 534 534 return; 535 rc = DBGFR3MemRead(p VM, 0, DBGFR3AddrFromFlat(pVM, &Addr, Module.shdrs), paShdrs, cb);535 rc = DBGFR3MemRead(pUVM, 0, DBGFR3AddrFromFlat(pUVM, &Addr, Module.shdrs), paShdrs, cb); 536 536 if (RT_SUCCESS(rc)) 537 537 { … … 539 539 if (pvSymSpace) 540 540 { 541 rc = DBGFR3MemRead(p VM, 0, DBGFR3AddrFromFlat(pVM, &Addr, Module.symspace), pvSymSpace, Module.symsize);541 rc = DBGFR3MemRead(pUVM, 0, DBGFR3AddrFromFlat(pUVM, &Addr, Module.symspace), pvSymSpace, Module.symsize); 542 542 if (RT_SUCCESS(rc)) 543 543 { … … 554 554 cMaxSyms = RT_MIN(cMaxSyms, Module.nsyms); 555 555 556 DBGDiggerCommonParseElf32Mod(p VM, szModName, szFilename, DBG_DIGGER_ELF_FUNNY_SHDRS,556 DBGDiggerCommonParseElf32Mod(pUVM, szModName, szFilename, DBG_DIGGER_ELF_FUNNY_SHDRS, 557 557 &Module.hdr, paShdrs, paSyms, cMaxSyms, pbStrings, cbMaxStrings, 558 558 SOL32_MIN_KRNL_ADDR, SOL32_MAX_KRNL_ADDR - 1, DIG_SOL_MOD_TAG); … … 570 570 * Processes a modctl_t. 571 571 * 572 * @param p VM The VM handle.572 * @param pUVM The user mode VM handle. 573 573 * @param pThis Our instance data. 574 574 * @param pModCtl Pointer to the modctl structure. 575 575 */ 576 static void dbgDiggerSolarisProcessModCtl64(P VM pVM, PDBGDIGGERSOLARIS pThis, SOL_modctl_t const *pModCtl)576 static void dbgDiggerSolarisProcessModCtl64(PUVM pUVM, PDBGDIGGERSOLARIS pThis, SOL_modctl_t const *pModCtl) 577 577 { 578 578 /* skip it if it's not loaded and installed */ … … 591 591 char szModName[64]; 592 592 DBGFADDRESS Addr; 593 int rc = DBGFR3MemReadString(p VM, 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)); 594 594 if (RT_FAILURE(rc)) 595 595 return; … … 599 599 AssertCompile2MemberOffsets(SOL_modctl_t, v11_64.mod_filename, v9_64.mod_filename); 600 600 char szFilename[256]; 601 rc = DBGFR3MemReadString(p VM, 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)); 602 602 if (RT_FAILURE(rc)) 603 603 strcpy(szFilename, szModName); … … 610 610 AssertCompile2MemberOffsets(SOL_modctl_t, v11_64.mod_mp, v9_64.mod_mp); 611 611 struct SOL64_module Module; 612 rc = DBGFR3MemRead(p VM, 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)); 613 613 if (RT_FAILURE(rc)) 614 614 return; … … 679 679 if (!paShdrs) 680 680 return; 681 rc = DBGFR3MemRead(p VM, 0, DBGFR3AddrFromFlat(pVM, &Addr, Module.shdrs), paShdrs, cb);681 rc = DBGFR3MemRead(pUVM, 0, DBGFR3AddrFromFlat(pUVM, &Addr, Module.shdrs), paShdrs, cb); 682 682 if (RT_SUCCESS(rc)) 683 683 { … … 685 685 if (pvSymSpace) 686 686 { 687 rc = DBGFR3MemRead(p VM, 0, DBGFR3AddrFromFlat(pVM, &Addr, Module.symspace), pvSymSpace, Module.symsize);687 rc = DBGFR3MemRead(pUVM, 0, DBGFR3AddrFromFlat(pUVM, &Addr, Module.symspace), pvSymSpace, Module.symsize); 688 688 if (RT_SUCCESS(rc)) 689 689 { … … 700 700 cMaxSyms = RT_MIN(cMaxSyms, Module.nsyms); 701 701 702 DBGDiggerCommonParseElf64Mod(p VM, szModName, szFilename, DBG_DIGGER_ELF_FUNNY_SHDRS,702 DBGDiggerCommonParseElf64Mod(pUVM, szModName, szFilename, DBG_DIGGER_ELF_FUNNY_SHDRS, 703 703 &Module.hdr, paShdrs, paSyms, cMaxSyms, pbStrings, cbMaxStrings, 704 704 SOL64_MIN_KRNL_ADDR, SOL64_MAX_KRNL_ADDR - 1, DIG_SOL_MOD_TAG); … … 716 716 * @copydoc DBGFOSREG::pfnTerm 717 717 */ 718 static DECLCALLBACK(void) dbgDiggerSolarisTerm(P VM pVM, void *pvData)718 static DECLCALLBACK(void) dbgDiggerSolarisTerm(PUVM pUVM, void *pvData) 719 719 { 720 720 PDBGDIGGERSOLARIS pThis = (PDBGDIGGERSOLARIS)pvData; … … 728 728 * @copydoc DBGFOSREG::pfnRefresh 729 729 */ 730 static DECLCALLBACK(int) dbgDiggerSolarisRefresh(P VM pVM, void *pvData)730 static DECLCALLBACK(int) dbgDiggerSolarisRefresh(PUVM pUVM, void *pvData) 731 731 { 732 732 PDBGDIGGERSOLARIS pThis = (PDBGDIGGERSOLARIS)pvData; … … 737 737 * For now we'll flush and reload everything. 738 738 */ 739 RTDBGAS hDbgAs = DBGFR3AsResolveAndRetain(p VM, DBGF_AS_KERNEL);739 RTDBGAS hDbgAs = DBGFR3AsResolveAndRetain(pUVM, DBGF_AS_KERNEL); 740 740 if (hDbgAs != NIL_RTDBGAS) 741 741 { … … 757 757 } 758 758 759 dbgDiggerSolarisTerm(p VM, pvData);760 return dbgDiggerSolarisInit(p VM, pvData);759 dbgDiggerSolarisTerm(pUVM, pvData); 760 return dbgDiggerSolarisInit(pUVM, pvData); 761 761 } 762 762 … … 765 765 * @copydoc DBGFOSREG::pfnInit 766 766 */ 767 static DECLCALLBACK(int) dbgDiggerSolarisInit(P VM pVM, void *pvData)767 static DECLCALLBACK(int) dbgDiggerSolarisInit(PUVM pUVM, void *pvData) 768 768 { 769 769 PDBGDIGGERSOLARIS pThis = (PDBGDIGGERSOLARIS)pvData; … … 775 775 * On Solaris the kernel and is the global address space. 776 776 */ 777 DBGFR3AsSetAlias(p VM, DBGF_AS_KERNEL, DBGF_AS_GLOBAL);777 DBGFR3AsSetAlias(pUVM, DBGF_AS_KERNEL, DBGF_AS_GLOBAL); 778 778 779 779 /** @todo Use debug_info, build 7x / S10U6. */ … … 783 783 * We know it resides in the unix data segment. 784 784 */ 785 DBGFR3AddrFromFlat(p VM, &pThis->AddrUnixModCtl, 0);785 DBGFR3AddrFromFlat(pUVM, &pThis->AddrUnixModCtl, 0); 786 786 787 787 DBGFADDRESS CurAddr = pThis->AddrUnixData; 788 788 DBGFADDRESS MaxAddr; 789 DBGFR3AddrFromFlat(p VM, &MaxAddr, CurAddr.FlatPtr + SOL_UNIX_MAX_DATA_SEG_SIZE);789 DBGFR3AddrFromFlat(pUVM, &MaxAddr, CurAddr.FlatPtr + SOL_UNIX_MAX_DATA_SEG_SIZE); 790 790 const uint8_t *pbExpr = (const uint8_t *)&pThis->AddrUnixText.FlatPtr; 791 791 const uint32_t cbExpr = pThis->f64Bit ? sizeof(uint64_t) : sizeof(uint32_t); … … 794 794 { 795 795 DBGFADDRESS HitAddr; 796 rc = DBGFR3MemScan(p VM, 0, &CurAddr, MaxAddr.FlatPtr - CurAddr.FlatPtr, 1, pbExpr, cbExpr, &HitAddr);796 rc = DBGFR3MemScan(pUVM, 0, &CurAddr, MaxAddr.FlatPtr - CurAddr.FlatPtr, 1, pbExpr, cbExpr, &HitAddr); 797 797 if (RT_FAILURE(rc)) 798 798 break; … … 806 806 if (pThis->f64Bit) 807 807 { 808 DBGFR3AddrFromFlat(p VM, &ModCtlAddr, HitAddr.FlatPtr - RT_OFFSETOF(SOL32v11_modctl_t, mod_text));808 DBGFR3AddrFromFlat(pUVM, &ModCtlAddr, HitAddr.FlatPtr - RT_OFFSETOF(SOL32v11_modctl_t, mod_text)); 809 809 SOL64v11_modctl_t ModCtlv11; 810 rc = DBGFR3MemRead(p VM, 0, &ModCtlAddr, &ModCtlv11, sizeof(ModCtlv11));810 rc = DBGFR3MemRead(pUVM, 0, &ModCtlAddr, &ModCtlv11, sizeof(ModCtlv11)); 811 811 if (RT_SUCCESS(rc)) 812 812 { … … 828 828 char szUnix[5]; 829 829 DBGFADDRESS NameAddr; 830 DBGFR3AddrFromFlat(p VM, &NameAddr, ModCtlv11.mod_modname);831 rc = DBGFR3MemRead(p VM, 0, &NameAddr, &szUnix, sizeof(szUnix));830 DBGFR3AddrFromFlat(pUVM, &NameAddr, ModCtlv11.mod_modname); 831 rc = DBGFR3MemRead(pUVM, 0, &NameAddr, &szUnix, sizeof(szUnix)); 832 832 if (RT_SUCCESS(rc)) 833 833 { … … 846 846 else 847 847 { 848 DBGFR3AddrFromFlat(p VM, &ModCtlAddr, HitAddr.FlatPtr - RT_OFFSETOF(SOL32v11_modctl_t, mod_text));848 DBGFR3AddrFromFlat(pUVM, &ModCtlAddr, HitAddr.FlatPtr - RT_OFFSETOF(SOL32v11_modctl_t, mod_text)); 849 849 SOL32v11_modctl_t ModCtlv11; 850 rc = DBGFR3MemRead(p VM, 0, &ModCtlAddr, &ModCtlv11, sizeof(ModCtlv11));850 rc = DBGFR3MemRead(pUVM, 0, &ModCtlAddr, &ModCtlv11, sizeof(ModCtlv11)); 851 851 if (RT_SUCCESS(rc)) 852 852 { … … 868 868 char szUnix[5]; 869 869 DBGFADDRESS NameAddr; 870 DBGFR3AddrFromFlat(p VM, &NameAddr, ModCtlv11.mod_modname);871 rc = DBGFR3MemRead(p VM, 0, &NameAddr, &szUnix, sizeof(szUnix));870 DBGFR3AddrFromFlat(pUVM, &NameAddr, ModCtlv11.mod_modname); 871 rc = DBGFR3MemRead(pUVM, 0, &NameAddr, &szUnix, sizeof(szUnix)); 872 872 if (RT_SUCCESS(rc)) 873 873 { … … 888 888 if (pThis->f64Bit) 889 889 { 890 DBGFR3AddrFromFlat(p VM, &ModCtlAddr, HitAddr.FlatPtr - RT_OFFSETOF(SOL64v9_modctl_t, mod_text));890 DBGFR3AddrFromFlat(pUVM, &ModCtlAddr, HitAddr.FlatPtr - RT_OFFSETOF(SOL64v9_modctl_t, mod_text)); 891 891 SOL64v9_modctl_t ModCtlv9; 892 rc = DBGFR3MemRead(p VM, 0, &ModCtlAddr, &ModCtlv9, sizeof(ModCtlv9));892 rc = DBGFR3MemRead(pUVM, 0, &ModCtlAddr, &ModCtlv9, sizeof(ModCtlv9)); 893 893 if (RT_SUCCESS(rc)) 894 894 { … … 908 908 char szUnix[5]; 909 909 DBGFADDRESS NameAddr; 910 DBGFR3AddrFromFlat(p VM, &NameAddr, ModCtlv9.mod_modname);911 rc = DBGFR3MemRead(p VM, 0, &NameAddr, &szUnix, sizeof(szUnix));910 DBGFR3AddrFromFlat(pUVM, &NameAddr, ModCtlv9.mod_modname); 911 rc = DBGFR3MemRead(pUVM, 0, &NameAddr, &szUnix, sizeof(szUnix)); 912 912 if (RT_SUCCESS(rc)) 913 913 { … … 926 926 else 927 927 { 928 DBGFR3AddrFromFlat(p VM, &ModCtlAddr, HitAddr.FlatPtr - RT_OFFSETOF(SOL32v9_modctl_t, mod_text));928 DBGFR3AddrFromFlat(pUVM, &ModCtlAddr, HitAddr.FlatPtr - RT_OFFSETOF(SOL32v9_modctl_t, mod_text)); 929 929 SOL32v9_modctl_t ModCtlv9; 930 rc = DBGFR3MemRead(p VM, 0, &ModCtlAddr, &ModCtlv9, sizeof(ModCtlv9));930 rc = DBGFR3MemRead(pUVM, 0, &ModCtlAddr, &ModCtlv9, sizeof(ModCtlv9)); 931 931 if (RT_SUCCESS(rc)) 932 932 { … … 946 946 char szUnix[5]; 947 947 DBGFADDRESS NameAddr; 948 DBGFR3AddrFromFlat(p VM, &NameAddr, ModCtlv9.mod_modname);949 rc = DBGFR3MemRead(p VM, 0, &NameAddr, &szUnix, sizeof(szUnix));948 DBGFR3AddrFromFlat(pUVM, &NameAddr, ModCtlv9.mod_modname); 949 rc = DBGFR3MemRead(pUVM, 0, &NameAddr, &szUnix, sizeof(szUnix)); 950 950 if (RT_SUCCESS(rc)) 951 951 { … … 964 964 965 965 /* next */ 966 DBGFR3AddrFromFlat(p VM, &CurAddr, HitAddr.FlatPtr + cbExpr);966 DBGFR3AddrFromFlat(pUVM, &CurAddr, HitAddr.FlatPtr + cbExpr); 967 967 } 968 968 … … 978 978 /* read it */ 979 979 SOL_modctl_t ModCtl; 980 rc = DBGFR3MemRead(p VM, 0, &CurAddr, &ModCtl, cbModCtl);980 rc = DBGFR3MemRead(pUVM, 0, &CurAddr, &ModCtl, cbModCtl); 981 981 if (RT_FAILURE(rc)) 982 982 { … … 987 987 /* process it. */ 988 988 if (pThis->f64Bit) 989 dbgDiggerSolarisProcessModCtl64(p VM, pThis, &ModCtl);989 dbgDiggerSolarisProcessModCtl64(pUVM, pThis, &ModCtl); 990 990 else 991 dbgDiggerSolarisProcessModCtl32(p VM, pThis, &ModCtl);991 dbgDiggerSolarisProcessModCtl32(pUVM, pThis, &ModCtl); 992 992 993 993 /* next */ … … 1000 1000 break; 1001 1001 } 1002 DBGFR3AddrFromFlat(p VM, &CurAddr, ModCtl.v9_64.mod_next);1002 DBGFR3AddrFromFlat(pUVM, &CurAddr, ModCtl.v9_64.mod_next); 1003 1003 } 1004 1004 else … … 1010 1010 break; 1011 1011 } 1012 DBGFR3AddrFromFlat(p VM, &CurAddr, ModCtl.v9_32.mod_next);1012 DBGFR3AddrFromFlat(pUVM, &CurAddr, ModCtl.v9_32.mod_next); 1013 1013 } 1014 1014 if (++iMod >= 1024) … … 1028 1028 * @copydoc DBGFOSREG::pfnProbe 1029 1029 */ 1030 static DECLCALLBACK(bool) dbgDiggerSolarisProbe(P VM pVM, void *pvData)1030 static DECLCALLBACK(bool) dbgDiggerSolarisProbe(PUVM pUVM, void *pvData) 1031 1031 { 1032 1032 PDBGDIGGERSOLARIS pThis = (PDBGDIGGERSOLARIS)pvData; … … 1039 1039 1040 1040 /* 32-bit search range. */ 1041 DBGFR3AddrFromFlat(p VM, &Addr, 0xfe800000);1041 DBGFR3AddrFromFlat(pUVM, &Addr, 0xfe800000); 1042 1042 RTGCUINTPTR cbRange = 0xfec00000 - 0xfe800000; 1043 1043 1044 1044 DBGFADDRESS HitAddr; 1045 1045 static const uint8_t s_abSunRelease[] = "SunOS Release "; 1046 int rc = DBGFR3MemScan(p VM, 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); 1047 1047 if (RT_FAILURE(rc)) 1048 1048 { 1049 1049 /* 64-bit.... */ 1050 DBGFR3AddrFromFlat(p VM, &Addr, UINT64_C(0xfffffffffb800000));1050 DBGFR3AddrFromFlat(pUVM, &Addr, UINT64_C(0xfffffffffb800000)); 1051 1051 cbRange = UINT64_C(0xfffffffffbc00000) - UINT64_C(0xfffffffffb800000); 1052 rc = DBGFR3MemScan(p VM, 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); 1053 1053 if (RT_FAILURE(rc)) 1054 1054 return false; … … 1061 1061 static const uint8_t s_abSMI[] = "Sun Microsystems, Inc."; 1062 1062 static const uint8_t s_abORCL[] = "Oracle and/or its affiliates."; 1063 rc = DBGFR3MemScan(p VM, 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); 1064 1064 if (RT_FAILURE(rc)) 1065 1065 { 1066 1066 /* Try the alternate copyright string. */ 1067 rc = DBGFR3MemScan(p VM, 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); 1068 1068 if (RT_FAILURE(rc)) 1069 1069 return false; … … 1085 1085 * @copydoc DBGFOSREG::pfnDestruct 1086 1086 */ 1087 static DECLCALLBACK(void) dbgDiggerSolarisDestruct(P VM pVM, void *pvData)1087 static DECLCALLBACK(void) dbgDiggerSolarisDestruct(PUVM pUVM, void *pvData) 1088 1088 { 1089 1089 … … 1094 1094 * @copydoc DBGFOSREG::pfnConstruct 1095 1095 */ 1096 static DECLCALLBACK(int) dbgDiggerSolarisConstruct(P VM pVM, void *pvData)1096 static DECLCALLBACK(int) dbgDiggerSolarisConstruct(PUVM pUVM, void *pvData) 1097 1097 { 1098 1098 return VINF_SUCCESS; -
trunk/src/VBox/Debugger/DBGPlugInWinNt.cpp
r37809 r44399 261 261 * Internal Functions * 262 262 *******************************************************************************/ 263 static DECLCALLBACK(int) dbgDiggerWinNtInit(P VM pVM, void *pvData);263 static DECLCALLBACK(int) dbgDiggerWinNtInit(PUVM pUVM, void *pvData); 264 264 265 265 … … 277 277 * Process a PE image found in guest memory. 278 278 * 279 * @param pThis 280 * @param p VM The VM handle.281 * @param pszName 282 * @param pImageAddr 283 * @param cbImage 284 * @param pbBuf 285 * 286 * @param cbBuf 287 */ 288 static void dbgDiggerWinNtProcessImage(PDBGDIGGERWINNT pThis, P VM 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 */ 288 static void dbgDiggerWinNtProcessImage(PDBGDIGGERWINNT pThis, PUVM pUVM, const char *pszName, 289 289 PCDBGFADDRESS pImageAddr, uint32_t cbImage, 290 290 uint8_t *pbBuf, size_t cbBuf) … … 409 409 DBGFADDRESS Addr = *pImageAddr; 410 410 DBGFR3AddrAdd(&Addr, uRvaDebugDir); 411 rc = DBGFR3MemRead(p VM, 0 /*idCpu*/, &Addr, pbBuf, RT_MIN(cbDebugDir, cbBuf));411 rc = DBGFR3MemRead(pUVM, 0 /*idCpu*/, &Addr, pbBuf, RT_MIN(cbDebugDir, cbBuf)); 412 412 if (RT_SUCCESS(rc)) 413 413 { … … 430 430 * Link the module. 431 431 */ 432 RTDBGAS hAs = DBGFR3AsResolveAndRetain(p VM, DBGF_AS_KERNEL);432 RTDBGAS hAs = DBGFR3AsResolveAndRetain(pUVM, DBGF_AS_KERNEL); 433 433 if (hAs != NIL_RTDBGAS) 434 434 rc = RTDbgAsModuleLink(hAs, hMod, pImageAddr->FlatPtr, RTDBGASLINK_FLAGS_REPLACE /*fFlags*/); … … 443 443 * @copydoc DBGFOSREG::pfnQueryInterface 444 444 */ 445 static DECLCALLBACK(void *) dbgDiggerWinNtQueryInterface(P VM pVM, void *pvData, DBGFOSINTERFACE enmIf)445 static DECLCALLBACK(void *) dbgDiggerWinNtQueryInterface(PUVM pUVM, void *pvData, DBGFOSINTERFACE enmIf) 446 446 { 447 447 return NULL; … … 452 452 * @copydoc DBGFOSREG::pfnQueryVersion 453 453 */ 454 static DECLCALLBACK(int) dbgDiggerWinNtQueryVersion(P VM pVM, void *pvData, char *pszVersion, size_t cchVersion)454 static DECLCALLBACK(int) dbgDiggerWinNtQueryVersion(PUVM pUVM, void *pvData, char *pszVersion, size_t cchVersion) 455 455 { 456 456 PDBGDIGGERWINNT pThis = (PDBGDIGGERWINNT)pvData; … … 472 472 * @copydoc DBGFOSREG::pfnTerm 473 473 */ 474 static DECLCALLBACK(void) dbgDiggerWinNtTerm(P VM pVM, void *pvData)474 static DECLCALLBACK(void) dbgDiggerWinNtTerm(PUVM pUVM, void *pvData) 475 475 { 476 476 PDBGDIGGERWINNT pThis = (PDBGDIGGERWINNT)pvData; … … 484 484 * @copydoc DBGFOSREG::pfnRefresh 485 485 */ 486 static DECLCALLBACK(int) dbgDiggerWinNtRefresh(P VM pVM, void *pvData)486 static DECLCALLBACK(int) dbgDiggerWinNtRefresh(PUVM pUVM, void *pvData) 487 487 { 488 488 PDBGDIGGERWINNT pThis = (PDBGDIGGERWINNT)pvData; … … 493 493 * For now we'll flush and reload everything. 494 494 */ 495 RTDBGAS hDbgAs = DBGFR3AsResolveAndRetain(p VM, DBGF_AS_KERNEL);495 RTDBGAS hDbgAs = DBGFR3AsResolveAndRetain(pUVM, DBGF_AS_KERNEL); 496 496 if (hDbgAs != NIL_RTDBGAS) 497 497 { … … 513 513 } 514 514 515 dbgDiggerWinNtTerm(p VM, pvData);516 return dbgDiggerWinNtInit(p VM, pvData);515 dbgDiggerWinNtTerm(pUVM, pvData); 516 return dbgDiggerWinNtInit(pUVM, pvData); 517 517 } 518 518 … … 521 521 * @copydoc DBGFOSREG::pfnInit 522 522 */ 523 static DECLCALLBACK(int) dbgDiggerWinNtInit(P VM pVM, void *pvData)523 static DECLCALLBACK(int) dbgDiggerWinNtInit(PUVM pUVM, void *pvData) 524 524 { 525 525 PDBGDIGGERWINNT pThis = (PDBGDIGGERWINNT)pvData; … … 538 538 * Figure the NT version. 539 539 */ 540 DBGFR3AddrFromFlat(p VM, &Addr, pThis->f32Bit ? NTKUSERSHAREDDATA_WINNT32 : NTKUSERSHAREDDATA_WINNT64);541 rc = DBGFR3MemRead(p VM, 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); 542 542 if (RT_FAILURE(rc)) 543 543 return rc; … … 557 557 /* Read the validate the MTE. */ 558 558 NTMTE Mte; 559 rc = DBGFR3MemRead(p VM, 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)); 560 560 if (RT_FAILURE(rc)) 561 561 break; … … 591 591 /* Read the full name. */ 592 592 DBGFADDRESS AddrName; 593 DBGFR3AddrFromFlat(p VM, &AddrName, WINNT_UNION(pThis, &Mte, FullDllName.Buffer));593 DBGFR3AddrFromFlat(pUVM, &AddrName, WINNT_UNION(pThis, &Mte, FullDllName.Buffer)); 594 594 uint16_t cbName = WINNT_UNION(pThis, &Mte, FullDllName.Length); 595 595 if (cbName < sizeof(u)) 596 rc = DBGFR3MemRead(p VM, 0 /*idCpu*/, &AddrName, &u, cbName);596 rc = DBGFR3MemRead(pUVM, 0 /*idCpu*/, &AddrName, &u, cbName); 597 597 else 598 598 rc = VERR_OUT_OF_RANGE; 599 599 if (RT_FAILURE(rc)) 600 600 { 601 DBGFR3AddrFromFlat(p VM, &AddrName, WINNT_UNION(pThis, &Mte, BaseDllName.Buffer));601 DBGFR3AddrFromFlat(pUVM, &AddrName, WINNT_UNION(pThis, &Mte, BaseDllName.Buffer)); 602 602 cbName = WINNT_UNION(pThis, &Mte, BaseDllName.Length); 603 603 if (cbName < sizeof(u)) 604 rc = DBGFR3MemRead(p VM, 0 /*idCpu*/, &AddrName, &u, cbName);604 rc = DBGFR3MemRead(pUVM, 0 /*idCpu*/, &AddrName, &u, cbName); 605 605 else 606 606 rc = VERR_OUT_OF_RANGE; … … 615 615 /* Read the start of the PE image and pass it along to a worker. */ 616 616 DBGFADDRESS ImageAddr; 617 DBGFR3AddrFromFlat(p VM, &ImageAddr, WINNT_UNION(pThis, &Mte, DllBase));617 DBGFR3AddrFromFlat(pUVM, &ImageAddr, WINNT_UNION(pThis, &Mte, DllBase)); 618 618 uint32_t cbImageBuf = RT_MIN(sizeof(u), WINNT_UNION(pThis, &Mte, SizeOfImage)); 619 rc = DBGFR3MemRead(p VM, 0 /*idCpu*/, &ImageAddr, &u, cbImageBuf);619 rc = DBGFR3MemRead(pUVM, 0 /*idCpu*/, &ImageAddr, &u, cbImageBuf); 620 620 if (RT_SUCCESS(rc)) 621 621 dbgDiggerWinNtProcessImage(pThis, 622 p VM,622 pUVM, 623 623 pszName, 624 624 &ImageAddr, … … 632 632 /* next */ 633 633 AddrPrev = Addr; 634 DBGFR3AddrFromFlat(p VM, &Addr, WINNT_UNION(pThis, &Mte, InLoadOrderLinks.Flink));634 DBGFR3AddrFromFlat(pUVM, &Addr, WINNT_UNION(pThis, &Mte, InLoadOrderLinks.Flink)); 635 635 } while ( Addr.FlatPtr != pThis->KernelMteAddr.FlatPtr 636 636 && Addr.FlatPtr != pThis->PsLoadedModuleListAddr.FlatPtr); … … 644 644 * @copydoc DBGFOSREG::pfnProbe 645 645 */ 646 static DECLCALLBACK(bool) dbgDiggerWinNtProbe(P VM pVM, void *pvData)646 static DECLCALLBACK(bool) dbgDiggerWinNtProbe(PUVM pUVM, void *pvData) 647 647 { 648 648 PDBGDIGGERWINNT pThis = (PDBGDIGGERWINNT)pvData; … … 663 663 * success. 664 664 */ 665 CPUMMODE enmMode = DBGFR3CpuGetMode(p VM, 0 /*idCpu*/);665 CPUMMODE enmMode = DBGFR3CpuGetMode(pUVM, 0 /*idCpu*/); 666 666 if (enmMode == CPUMMODE_LONG) 667 667 { … … 671 671 { 672 672 DBGFADDRESS KernelAddr; 673 for (DBGFR3AddrFromFlat(p VM, &KernelAddr, UINT32_C(0x80001000));673 for (DBGFR3AddrFromFlat(pUVM, &KernelAddr, UINT32_C(0x80001000)); 674 674 KernelAddr.FlatPtr < UINT32_C(0xffff0000); 675 675 KernelAddr.FlatPtr += PAGE_SIZE) 676 676 { 677 int rc = DBGFR3MemScan(p VM, 0 /*idCpu*/, &KernelAddr, UINT32_C(0xffff0000) - KernelAddr.FlatPtr,677 int rc = DBGFR3MemScan(pUVM, 0 /*idCpu*/, &KernelAddr, UINT32_C(0xffff0000) - KernelAddr.FlatPtr, 678 678 1, "MISYSPTE", sizeof("MISYSPTE") - 1, &KernelAddr); 679 679 if (RT_FAILURE(rc)) … … 682 682 683 683 /* MZ + PE header. */ 684 rc = DBGFR3MemRead(p VM, 0 /*idCpu*/, &KernelAddr, &u, sizeof(u));684 rc = DBGFR3MemRead(pUVM, 0 /*idCpu*/, &KernelAddr, &u, sizeof(u)); 685 685 if ( RT_SUCCESS(rc) 686 686 && u.MzHdr.e_magic == IMAGE_DOS_SIGNATURE … … 707 707 Mte.SizeOfImage = pHdrs->OptionalHeader.SizeOfImage; 708 708 DBGFADDRESS HitAddr; 709 rc = DBGFR3MemScan(p VM, 0 /*idCpu*/, &KernelAddr, UINT32_MAX - KernelAddr.FlatPtr,709 rc = DBGFR3MemScan(pUVM, 0 /*idCpu*/, &KernelAddr, UINT32_MAX - KernelAddr.FlatPtr, 710 710 4 /*align*/, &Mte.DllBase, 3 * sizeof(uint32_t), &HitAddr); 711 711 while (RT_SUCCESS(rc)) … … 714 714 NTMTE32 Mte2; 715 715 DBGFADDRESS MteAddr = HitAddr; 716 rc = DBGFR3MemRead(p VM, 0 /*idCpu*/, DBGFR3AddrSub(&MteAddr, RT_OFFSETOF(NTMTE32, DllBase)),716 rc = DBGFR3MemRead(pUVM, 0 /*idCpu*/, DBGFR3AddrSub(&MteAddr, RT_OFFSETOF(NTMTE32, DllBase)), 717 717 &Mte2, sizeof(Mte2)); 718 718 if ( RT_SUCCESS(rc) … … 731 731 ) 732 732 { 733 rc = DBGFR3MemRead(p VM, 0 /*idCpu*/, DBGFR3AddrFromFlat(pVM, &Addr, Mte2.BaseDllName.Buffer),733 rc = DBGFR3MemRead(pUVM, 0 /*idCpu*/, DBGFR3AddrFromFlat(pUVM, &Addr, Mte2.BaseDllName.Buffer), 734 734 u.wsz, Mte2.BaseDllName.Length); 735 735 u.wsz[Mte2.BaseDllName.Length / 2] = '\0'; … … 741 741 { 742 742 NTMTE32 Mte3; 743 rc = DBGFR3MemRead(p VM, 0 /*idCpu*/, DBGFR3AddrFromFlat(pVM, &Addr, Mte2.InLoadOrderLinks.Blink),743 rc = DBGFR3MemRead(pUVM, 0 /*idCpu*/, DBGFR3AddrFromFlat(pUVM, &Addr, Mte2.InLoadOrderLinks.Blink), 744 744 &Mte3, RT_SIZEOFMEMB(NTMTE32, InLoadOrderLinks)); 745 745 if ( RT_SUCCESS(rc) … … 761 761 DBGFR3AddrAdd(&HitAddr, 4); 762 762 if (HitAddr.FlatPtr <= UINT32_C(0xfffff000)) 763 rc = DBGFR3MemScan(p VM, 0 /*idCpu*/, &HitAddr, UINT32_MAX - HitAddr.FlatPtr,763 rc = DBGFR3MemScan(pUVM, 0 /*idCpu*/, &HitAddr, UINT32_MAX - HitAddr.FlatPtr, 764 764 4 /*align*/, &Mte.DllBase, 3 * sizeof(uint32_t), &HitAddr); 765 765 else … … 777 777 * @copydoc DBGFOSREG::pfnDestruct 778 778 */ 779 static DECLCALLBACK(void) dbgDiggerWinNtDestruct(P VM pVM, void *pvData)779 static DECLCALLBACK(void) dbgDiggerWinNtDestruct(PUVM pUVM, void *pvData) 780 780 { 781 781 … … 786 786 * @copydoc DBGFOSREG::pfnConstruct 787 787 */ 788 static DECLCALLBACK(int) dbgDiggerWinNtConstruct(P VM pVM, void *pvData)788 static DECLCALLBACK(int) dbgDiggerWinNtConstruct(PUVM pUVM, void *pvData) 789 789 { 790 790 PDBGDIGGERWINNT pThis = (PDBGDIGGERWINNT)pvData; -
trunk/src/VBox/Debugger/VBoxDbgBase.cpp
r44393 r44399 98 98 if ( pUVM 99 99 && VMR3GetStateU(pUVM) < VMSTATE_DESTROYING) 100 return DBGCCreate( VMR3GetVM(pUVM), pBack, fFlags);100 return DBGCCreate(pUVM, pBack, fFlags); 101 101 return VERR_INVALID_HANDLE; 102 102 } -
trunk/src/VBox/Debugger/testcase/tstDBGCStubs.cpp
r42165 r44399 23 23 24 24 #include <VBox/vmm/dbgf.h> 25 VMMR3DECL(PDBGFADDRESS) DBGFR3AddrFromFlat(P VM pVM, PDBGFADDRESS pAddress, RTGCUINTPTR FlatPtr)26 { 27 return NULL; 28 } 29 30 VMMR3DECL(int) DBGFR3AddrFromSelOff(P VM pVM, VMCPUID idCpu, PDBGFADDRESS pAddress, RTSEL Sel, RTUINTPTR off)25 VMMR3DECL(PDBGFADDRESS) DBGFR3AddrFromFlat(PUVM pUVM, PDBGFADDRESS pAddress, RTGCUINTPTR FlatPtr) 26 { 27 return NULL; 28 } 29 30 VMMR3DECL(int) DBGFR3AddrFromSelOff(PUVM pUVM, VMCPUID idCpu, PDBGFADDRESS pAddress, RTSEL Sel, RTUINTPTR off) 31 31 { 32 32 /* bad:bad -> provke error during parsing. */ … … 42 42 } 43 43 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, 44 VMMR3DECL(int) DBGFR3AddrToPhys(PUVM pUVM, VMCPUID idCpu, PDBGFADDRESS pAddress, PRTGCPHYS pGCPhys) 45 { 46 return VERR_INTERNAL_ERROR; 47 } 48 49 VMMR3DECL(int) DBGFR3Attach(PUVM pUVM) 50 { 51 return VERR_INTERNAL_ERROR; 52 } 53 54 VMMR3DECL(int) DBGFR3BpClear(PUVM pUVM, RTUINT iBp) 55 { 56 return VERR_INTERNAL_ERROR; 57 } 58 VMMR3DECL(int) DBGFR3BpDisable(PUVM pUVM, RTUINT iBp) 59 { 60 return VERR_INTERNAL_ERROR; 61 } 62 VMMR3DECL(int) DBGFR3BpEnable(PUVM pUVM, RTUINT iBp) 63 { 64 return VERR_INTERNAL_ERROR; 65 } 66 VMMR3DECL(int) DBGFR3BpEnum(PUVM pUVM, PFNDBGFBPENUM pfnCallback, void *pvUser) 67 { 68 return VERR_INTERNAL_ERROR; 69 } 70 VMMR3DECL(int) DBGFR3BpSet(PUVM pUVM, PCDBGFADDRESS pAddress, uint64_t iHitTrigger, uint64_t iHitDisable, PRTUINT piBp) 71 { 72 return VERR_INTERNAL_ERROR; 73 } 74 VMMR3DECL(int) DBGFR3BpSetReg(PUVM pUVM, PCDBGFADDRESS pAddress, uint64_t iHitTrigger, uint64_t iHitDisable, 85 75 uint8_t fType, uint8_t cb, PRTUINT piBp) 86 76 { 87 77 return VERR_INTERNAL_ERROR; 88 78 } 89 VMMR3DECL(int) DBGFR3BpSetREM(P VM pVM, PCDBGFADDRESS pAddress, uint64_t iHitTrigger, uint64_t iHitDisable, PRTUINT piBp)90 { 91 return VERR_INTERNAL_ERROR; 92 } 93 VMMR3DECL(bool) DBGFR3CanWait(P VM pVM)79 VMMR3DECL(int) DBGFR3BpSetREM(PUVM pUVM, PCDBGFADDRESS pAddress, uint64_t iHitTrigger, uint64_t iHitDisable, PRTUINT piBp) 80 { 81 return VERR_INTERNAL_ERROR; 82 } 83 VMMR3DECL(bool) DBGFR3CanWait(PUVM pUVM) 94 84 { 95 85 return true; 96 86 } 97 VMMR3DECL(int) DBGFR3Detach(P VM pVM)98 { 99 return VERR_INTERNAL_ERROR; 100 } 101 VMMR3DECL(int) DBGFR3DisasInstrEx(P VM pVM, VMCPUID idCpu, RTSEL Sel, RTGCPTR GCPtr, uint32_t fFlags,87 VMMR3DECL(int) DBGFR3Detach(PUVM pUVM) 88 { 89 return VERR_INTERNAL_ERROR; 90 } 91 VMMR3DECL(int) DBGFR3DisasInstrEx(PUVM pUVM, VMCPUID idCpu, RTSEL Sel, RTGCPTR GCPtr, uint32_t fFlags, 102 92 char *pszOutput, uint32_t cchOutput, uint32_t *pcbInstr) 103 93 { 104 94 return VERR_INTERNAL_ERROR; 105 95 } 106 VMMR3DECL(int) DBGFR3EventWait(P VM pVM, RTMSINTERVAL cMillies, PCDBGFEVENT *ppEvent)107 { 108 return VERR_INTERNAL_ERROR; 109 } 110 VMMR3DECL(int) DBGFR3Halt(P VM pVM)111 { 112 return VERR_INTERNAL_ERROR; 113 } 114 VMMR3DECL(int) DBGFR3Info(P VM pVM, const char *pszName, const char *pszArgs, PCDBGFINFOHLP pHlp)115 { 116 return VERR_INTERNAL_ERROR; 117 } 118 VMMR3DECL(int) DBGFR3InfoEx(P VM pVM, VMCPUID idCpu, const char *pszName, const char *pszArgs, PCDBGFINFOHLP pHlp)119 { 120 return VERR_INTERNAL_ERROR; 121 } 122 VMMR3DECL(bool) DBGFR3IsHalted(P VM pVM)96 VMMR3DECL(int) DBGFR3EventWait(PUVM pUVM, RTMSINTERVAL cMillies, PCDBGFEVENT *ppEvent) 97 { 98 return VERR_INTERNAL_ERROR; 99 } 100 VMMR3DECL(int) DBGFR3Halt(PUVM pUVM) 101 { 102 return VERR_INTERNAL_ERROR; 103 } 104 VMMR3DECL(int) DBGFR3Info(PUVM pUVM, const char *pszName, const char *pszArgs, PCDBGFINFOHLP pHlp) 105 { 106 return VERR_INTERNAL_ERROR; 107 } 108 VMMR3DECL(int) DBGFR3InfoEx(PUVM pUVM, VMCPUID idCpu, const char *pszName, const char *pszArgs, PCDBGFINFOHLP pHlp) 109 { 110 return VERR_INTERNAL_ERROR; 111 } 112 VMMR3DECL(bool) DBGFR3IsHalted(PUVM pUVM) 123 113 { 124 114 return true; 125 115 } 126 VMMR3DECL(int) DBGFR3LineByAddr(P VM pVM, RTGCUINTPTR Address, PRTGCINTPTR poffDisplacement, PDBGFLINE pLine)127 { 128 return VERR_INTERNAL_ERROR; 129 } 130 VMMR3DECL(int) DBGFR3LogModifyDestinations(P VM pVM, const char *pszDestSettings)131 { 132 return VERR_INTERNAL_ERROR; 133 } 134 VMMR3DECL(int) DBGFR3LogModifyFlags(P VM pVM, const char *pszFlagSettings)135 { 136 return VERR_INTERNAL_ERROR; 137 } 138 VMMR3DECL(int) DBGFR3LogModifyGroups(P VM pVM, const char *pszGroupSettings)139 { 140 return VERR_INTERNAL_ERROR; 141 } 142 VMMR3DECL(int) DBGFR3ModuleLoad(P VM pVM, const char *pszFilename, RTGCUINTPTR AddressDelta, const char *pszName, RTGCUINTPTR ModuleAddress, unsigned cbImage)143 { 144 return VERR_INTERNAL_ERROR; 145 } 146 VMMR3DECL(int) DBGFR3AsLoadImage(P VM 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(P VM 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(P VM pVM, RTDBGAS hAlias)116 VMMR3DECL(int) DBGFR3LineByAddr(PUVM pUVM, RTGCUINTPTR Address, PRTGCINTPTR poffDisplacement, PDBGFLINE pLine) 117 { 118 return VERR_INTERNAL_ERROR; 119 } 120 VMMR3DECL(int) DBGFR3LogModifyDestinations(PUVM pUVM, const char *pszDestSettings) 121 { 122 return VERR_INTERNAL_ERROR; 123 } 124 VMMR3DECL(int) DBGFR3LogModifyFlags(PUVM pUVM, const char *pszFlagSettings) 125 { 126 return VERR_INTERNAL_ERROR; 127 } 128 VMMR3DECL(int) DBGFR3LogModifyGroups(PUVM pUVM, const char *pszGroupSettings) 129 { 130 return VERR_INTERNAL_ERROR; 131 } 132 VMMR3DECL(int) DBGFR3ModuleLoad(PUVM pUVM, const char *pszFilename, RTGCUINTPTR AddressDelta, const char *pszName, RTGCUINTPTR ModuleAddress, unsigned cbImage) 133 { 134 return VERR_INTERNAL_ERROR; 135 } 136 VMMR3DECL(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 } 140 VMMR3DECL(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 } 144 VMMR3DECL(RTDBGAS) DBGFR3AsResolveAndRetain(PUVM pUVM, RTDBGAS hAlias) 155 145 { 156 146 return NIL_RTDBGAS; 157 147 } 158 VMMR3DECL(int) DBGFR3Resume(P VM pVM)159 { 160 return VERR_INTERNAL_ERROR; 161 } 162 VMMR3DECL(int) DBGFR3StackWalkBegin(P VM pVM, VMCPUID idCpu, DBGFCODETYPE enmCodeType, PCDBGFSTACKFRAME *ppFirstFrame)148 VMMR3DECL(int) DBGFR3Resume(PUVM pUVM) 149 { 150 return VERR_INTERNAL_ERROR; 151 } 152 VMMR3DECL(int) DBGFR3StackWalkBegin(PUVM pUVM, VMCPUID idCpu, DBGFCODETYPE enmCodeType, PCDBGFSTACKFRAME *ppFirstFrame) 163 153 { 164 154 return VERR_INTERNAL_ERROR; … … 171 161 { 172 162 } 173 VMMR3DECL(int) DBGFR3Step(P VM pVM, VMCPUID idCpu)174 { 175 return VERR_INTERNAL_ERROR; 176 } 177 VMMR3DECL(int) DBGFR3AsSymbolByAddr(P VM pVM, RTDBGAS hDbgAs, PCDBGFADDRESS pAddress, PRTGCINTPTR poffDisplacement, PRTDBGSYMBOL pSymbol, PRTDBGMOD phMod)178 { 179 return VERR_INTERNAL_ERROR; 180 } 181 VMMR3DECL(int) DBGFR3AsSymbolByName(P VM pVM, RTDBGAS hDbgAs, const char *pszSymbol, PRTDBGSYMBOL pSymbol, PRTDBGMOD phMod)182 { 183 return VERR_INTERNAL_ERROR; 184 } 185 VMMR3DECL(int) DBGFR3MemScan(P VM 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(P VM pVM, VMCPUID idCpu, PCDBGFADDRESS pAddress, void *pvBuf, size_t cbRead)190 { 191 return VERR_INTERNAL_ERROR; 192 } 193 VMMR3DECL(int) DBGFR3MemReadString(P VM pVM, VMCPUID idCpu, PCDBGFADDRESS pAddress, char *pszBuf, size_t cchBuf)194 { 195 return VERR_INTERNAL_ERROR; 196 } 197 VMMR3DECL(int) DBGFR3MemWrite(P VM pVM, VMCPUID idCpu, PCDBGFADDRESS pAddress, const void *pvBuf, size_t cbRead)198 { 199 return VERR_INTERNAL_ERROR; 200 } 201 VMMDECL(int) DBGFR3PagingDumpEx(P VM pVM, VMCPUID idCpu, uint32_t fFlags, uint64_t cr3, uint64_t u64FirstAddr,163 VMMR3DECL(int) DBGFR3Step(PUVM pUVM, VMCPUID idCpu) 164 { 165 return VERR_INTERNAL_ERROR; 166 } 167 VMMR3DECL(int) DBGFR3AsSymbolByAddr(PUVM pUVM, RTDBGAS hDbgAs, PCDBGFADDRESS pAddress, PRTGCINTPTR poffDisplacement, PRTDBGSYMBOL pSymbol, PRTDBGMOD phMod) 168 { 169 return VERR_INTERNAL_ERROR; 170 } 171 VMMR3DECL(int) DBGFR3AsSymbolByName(PUVM pUVM, RTDBGAS hDbgAs, const char *pszSymbol, PRTDBGSYMBOL pSymbol, PRTDBGMOD phMod) 172 { 173 return VERR_INTERNAL_ERROR; 174 } 175 VMMR3DECL(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 } 179 VMMR3DECL(int) DBGFR3MemRead(PUVM pUVM, VMCPUID idCpu, PCDBGFADDRESS pAddress, void *pvBuf, size_t cbRead) 180 { 181 return VERR_INTERNAL_ERROR; 182 } 183 VMMR3DECL(int) DBGFR3MemReadString(PUVM pUVM, VMCPUID idCpu, PCDBGFADDRESS pAddress, char *pszBuf, size_t cchBuf) 184 { 185 return VERR_INTERNAL_ERROR; 186 } 187 VMMR3DECL(int) DBGFR3MemWrite(PUVM pUVM, VMCPUID idCpu, PCDBGFADDRESS pAddress, const void *pvBuf, size_t cbRead) 188 { 189 return VERR_INTERNAL_ERROR; 190 } 191 VMMDECL(int) DBGFR3PagingDumpEx(PUVM pUVM, VMCPUID idCpu, uint32_t fFlags, uint64_t cr3, uint64_t u64FirstAddr, 202 192 uint64_t u64LastAddr, uint32_t cMaxDepth, PCDBGFINFOHLP pHlp) 203 193 { 204 194 return VERR_INTERNAL_ERROR; 205 195 } 206 VMMR3DECL(int) DBGFR3RegNmValidate(P VM pVM, VMCPUID idDefCpu, const char *pszReg)196 VMMR3DECL(int) DBGFR3RegNmValidate(PUVM pUVM, VMCPUID idDefCpu, const char *pszReg) 207 197 { 208 198 if ( !strcmp(pszReg, "ah") … … 213 203 return VERR_DBGF_REGISTER_NOT_FOUND; 214 204 } 215 VMMR3DECL(int) DBGFR3RegCpuQueryU8( P VM pVM, VMCPUID idCpu, DBGFREG enmReg, uint8_t *pu8)216 { 217 return VERR_INTERNAL_ERROR; 218 } 219 VMMR3DECL(int) DBGFR3RegCpuQueryU16( P VM pVM, VMCPUID idCpu, DBGFREG enmReg, uint16_t *pu16)220 { 221 return VERR_INTERNAL_ERROR; 222 } 223 VMMR3DECL(int) DBGFR3RegCpuQueryU32( P VM pVM, VMCPUID idCpu, DBGFREG enmReg, uint32_t *pu32)224 { 225 return VERR_INTERNAL_ERROR; 226 } 227 VMMR3DECL(int) DBGFR3RegCpuQueryU64( P VM pVM, VMCPUID idCpu, DBGFREG enmReg, uint64_t *pu64)228 { 229 return VERR_INTERNAL_ERROR; 230 } 231 VMMR3DECL(int) DBGFR3RegNmQuery(P VM pVM, VMCPUID idDefCpu, const char *pszReg, PDBGFREGVAL pValue, PDBGFREGVALTYPE penmType)205 VMMR3DECL(int) DBGFR3RegCpuQueryU8( PUVM pUVM, VMCPUID idCpu, DBGFREG enmReg, uint8_t *pu8) 206 { 207 return VERR_INTERNAL_ERROR; 208 } 209 VMMR3DECL(int) DBGFR3RegCpuQueryU16( PUVM pUVM, VMCPUID idCpu, DBGFREG enmReg, uint16_t *pu16) 210 { 211 return VERR_INTERNAL_ERROR; 212 } 213 VMMR3DECL(int) DBGFR3RegCpuQueryU32( PUVM pUVM, VMCPUID idCpu, DBGFREG enmReg, uint32_t *pu32) 214 { 215 return VERR_INTERNAL_ERROR; 216 } 217 VMMR3DECL(int) DBGFR3RegCpuQueryU64( PUVM pUVM, VMCPUID idCpu, DBGFREG enmReg, uint64_t *pu64) 218 { 219 return VERR_INTERNAL_ERROR; 220 } 221 VMMR3DECL(int) DBGFR3RegNmQuery(PUVM pUVM, VMCPUID idDefCpu, const char *pszReg, PDBGFREGVAL pValue, PDBGFREGVALTYPE penmType) 232 222 { 233 223 if (idDefCpu == 0 || idDefCpu == DBGFREG_HYPER_VMCPUID) … … 260 250 return VERR_DBGF_REGISTER_NOT_FOUND; 261 251 } 262 VMMR3DECL(int) DBGFR3RegPrintf(P VM pVM, VMCPUID idCpu, char *pszBuf, size_t cbBuf, const char *pszFormat, ...)252 VMMR3DECL(int) DBGFR3RegPrintf(PUVM pUVM, VMCPUID idCpu, char *pszBuf, size_t cbBuf, const char *pszFormat, ...) 263 253 { 264 254 return VERR_INTERNAL_ERROR; … … 268 258 return VERR_INTERNAL_ERROR; 269 259 } 270 VMMR3DECL(int) DBGFR3RegNmSet(P VM pVM, VMCPUID idDefCpu, const char *pszReg, PCDBGFREGVAL pValue, DBGFREGVALTYPE enmType)271 { 272 return VERR_INTERNAL_ERROR; 273 } 274 275 VMMR3DECL(PDBGFADDRESS) DBGFR3AddrFromPhys(P VM pVM, PDBGFADDRESS pAddress, RTGCPHYS PhysAddr)276 { 277 return NULL; 278 } 279 VMMR3DECL(int) DBGFR3AddrToHostPhys(P VM pVM, VMCPUID idCpu, PDBGFADDRESS pAddress, PRTHCPHYS pHCPhys)280 { 281 return VERR_INTERNAL_ERROR; 282 } 283 VMMR3DECL(int) DBGFR3AddrToVolatileR3Ptr(P VM pVM, VMCPUID idCpu, PDBGFADDRESS pAddress, bool fReadOnly, void **ppvR3Ptr)284 { 285 return VERR_INTERNAL_ERROR; 286 } 287 288 VMMR3DECL(int) DBGFR3OSRegister(P VM pVM, PCDBGFOSREG pReg)289 { 290 return VERR_INTERNAL_ERROR; 291 } 292 VMMR3DECL(int) DBGFR3OSDetect(P VM pVM, char *pszName, size_t cchName)293 { 294 return VERR_INTERNAL_ERROR; 295 } 296 VMMR3DECL(int) DBGFR3OSQueryNameAndVersion(P VM pVM, char *pszName, size_t cchName, char *pszVersion, size_t cchVersion)297 { 298 return VERR_INTERNAL_ERROR; 299 } 300 301 VMMR3DECL(int) DBGFR3SelQueryInfo(P VM pVM, VMCPUID idCpu, RTSEL Sel, uint32_t fFlags, PDBGFSELINFO pSelInfo)302 { 303 return VERR_INTERNAL_ERROR; 304 } 305 306 VMMR3DECL(CPUMMODE) DBGFR3CpuGetMode(P VM pVM, VMCPUID idCpu)260 VMMR3DECL(int) DBGFR3RegNmSet(PUVM pUVM, VMCPUID idDefCpu, const char *pszReg, PCDBGFREGVAL pValue, DBGFREGVALTYPE enmType) 261 { 262 return VERR_INTERNAL_ERROR; 263 } 264 265 VMMR3DECL(PDBGFADDRESS) DBGFR3AddrFromPhys(PUVM pUVM, PDBGFADDRESS pAddress, RTGCPHYS PhysAddr) 266 { 267 return NULL; 268 } 269 VMMR3DECL(int) DBGFR3AddrToHostPhys(PUVM pUVM, VMCPUID idCpu, PDBGFADDRESS pAddress, PRTHCPHYS pHCPhys) 270 { 271 return VERR_INTERNAL_ERROR; 272 } 273 VMMR3DECL(int) DBGFR3AddrToVolatileR3Ptr(PUVM pUVM, VMCPUID idCpu, PDBGFADDRESS pAddress, bool fReadOnly, void **ppvR3Ptr) 274 { 275 return VERR_INTERNAL_ERROR; 276 } 277 278 VMMR3DECL(int) DBGFR3OSRegister(PUVM pUVM, PCDBGFOSREG pReg) 279 { 280 return VERR_INTERNAL_ERROR; 281 } 282 VMMR3DECL(int) DBGFR3OSDetect(PUVM pUVM, char *pszName, size_t cchName) 283 { 284 return VERR_INTERNAL_ERROR; 285 } 286 VMMR3DECL(int) DBGFR3OSQueryNameAndVersion(PUVM pUVM, char *pszName, size_t cchName, char *pszVersion, size_t cchVersion) 287 { 288 return VERR_INTERNAL_ERROR; 289 } 290 291 VMMR3DECL(int) DBGFR3SelQueryInfo(PUVM pUVM, VMCPUID idCpu, RTSEL Sel, uint32_t fFlags, PDBGFSELINFO pSelInfo) 292 { 293 return VERR_INTERNAL_ERROR; 294 } 295 296 VMMR3DECL(CPUMMODE) DBGFR3CpuGetMode(PUVM pUVM, VMCPUID idCpu) 307 297 { 308 298 return CPUMMODE_INVALID; 309 299 } 310 311 VMMR3DECL(int) DBGFR3CoreWrite(PVM pVM, const char *pszFilename, bool fReplaceFile) 300 VMMR3DECL(VMCPUID) DBGFR3CpuGetCount(PUVM pUVM) 301 { 302 return 1; 303 } 304 305 VMMR3DECL(int) DBGFR3CoreWrite(PUVM pUVM, const char *pszFilename, bool fReplaceFile) 312 306 { 313 307 return VERR_INTERNAL_ERROR; … … 382 376 383 377 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 393 378 394 379 #include <VBox/vmm/pgm.h> … … 404 389 } 405 390 406 VMMR3DECL(int) PGMR3DbgR3Ptr2GCPhys(P VM pVM, RTR3PTR R3Ptr, PRTGCPHYS pGCPhys)407 { 408 return VERR_INTERNAL_ERROR; 409 } 410 411 VMMR3DECL(int) PGMR3DbgR3Ptr2HCPhys(P VM pVM, RTR3PTR R3Ptr, PRTHCPHYS pHCPhys)412 { 413 return VERR_INTERNAL_ERROR; 414 } 415 VMMR3DECL(int) PGMR3DbgHCPhys2GCPhys(P VM pVM, RTHCPHYS HCPhys, PRTGCPHYS pGCPhys)391 VMMR3DECL(int) PGMR3DbgR3Ptr2GCPhys(PUVM pUVM, RTR3PTR R3Ptr, PRTGCPHYS pGCPhys) 392 { 393 return VERR_INTERNAL_ERROR; 394 } 395 396 VMMR3DECL(int) PGMR3DbgR3Ptr2HCPhys(PUVM pUVM, RTR3PTR R3Ptr, PRTHCPHYS pHCPhys) 397 { 398 return VERR_INTERNAL_ERROR; 399 } 400 VMMR3DECL(int) PGMR3DbgHCPhys2GCPhys(PUVM pUVM, RTHCPHYS HCPhys, PRTGCPHYS pGCPhys) 416 401 { 417 402 return VERR_INTERNAL_ERROR; … … 421 406 #include <VBox/vmm/vmm.h> 422 407 423 VMMDECL(PVMCPU) VMMGetCpuById(PVM pVM, RTCPUID idCpu) 424 { 425 return NULL; 426 } 427 408 VMMR3DECL(PVMCPU) VMMR3GetCpuByIdU(PUVM pUVM, RTCPUID idCpu) 409 { 410 return NULL; 411 } 412 413 414 VMMR3DECL(PVM) VMR3GetVM(PUVM pUVM) 415 { 416 return NULL; 417 } -
trunk/src/VBox/Devices/VMMDev/VMMDev.cpp
r44130 r44399 985 985 * Write the core file. 986 986 */ 987 P VM pVM = PDMDevHlpGetVM(pDevIns);988 pRequestHeader->rc = DBGFR3CoreWrite(p VM, szCorePath, true /*fReplaceFile*/);987 PUVM pUVM = PDMDevHlpGetUVM(pDevIns); 988 pRequestHeader->rc = DBGFR3CoreWrite(pUVM, szCorePath, true /*fReplaceFile*/); 989 989 } 990 990 else -
trunk/src/VBox/Devices/VMMDev/VMMDevTesting.cpp
r43876 r44399 134 134 if (cchValueNm && pszRegNm && *pszRegNm) 135 135 { 136 PVM pVM = PDMDevHlpGetVM(pDevIns); 136 PUVM pUVM = PDMDevHlpGetUVM(pDevIns); 137 PVM pVM = PDMDevHlpGetVM(pDevIns); 137 138 VMCPUID idCpu = VMMGetCpuId(pVM); 138 139 uint64_t u64Value; 139 int rc2 = DBGFR3RegNmQueryU64(p VM, idCpu, pszRegNm, &u64Value);140 int rc2 = DBGFR3RegNmQueryU64(pUVM, idCpu, pszRegNm, &u64Value); 140 141 if (RT_SUCCESS(rc2)) 141 142 { … … 144 145 char szFormat[128], szValue[128]; 145 146 RTStrPrintf(szFormat, sizeof(szFormat), "%%VR{%s}", pszRegNm); 146 rc2 = DBGFR3RegPrintf(p VM, idCpu, szValue, sizeof(szValue), szFormat);147 rc2 = DBGFR3RegPrintf(pUVM, idCpu, szValue, sizeof(szValue), szFormat); 147 148 if (RT_SUCCESS(rc2)) 148 149 VMMDEV_TESTING_OUTPUT(("testing: VALUE '%s'%*s: %16s {reg=%s}%s\n", -
trunk/src/VBox/Main/src-client/ConsoleImpl2.cpp
r44393 r44399 4935 4935 PFNDBGFHANDLEREXT pfnHandler = (PFNDBGFHANDLEREXT)(uintptr_t)Params[0].u.pointer.addr; 4936 4936 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); 4938 4938 } 4939 4939 } -
trunk/src/VBox/Main/src-client/MachineDebuggerImpl.cpp
r44385 r44399 448 448 449 449 #ifdef LOG_ENABLED 450 int vrc = DBGFR3LogModifyFlags(ptrVM , aEnabled ? "enabled" : "disabled");450 int vrc = DBGFR3LogModifyFlags(ptrVM.rawUVM(), aEnabled ? "enabled" : "disabled"); 451 451 if (RT_FAILURE(vrc)) 452 452 { … … 676 676 */ 677 677 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); 679 679 if (RT_SUCCESS(vrc)) 680 680 { … … 713 713 */ 714 714 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)); 716 716 if (RT_SUCCESS(vrc)) 717 717 { … … 753 753 { 754 754 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); 756 756 *aEnabled = RT_BOOL(cr4 & X86_CR4_PAE); 757 757 } … … 879 879 if (SUCCEEDED(hrc)) 880 880 { 881 int vrc = DBGFR3CoreWrite(ptrVM , strFilename.c_str(), false /*fReplaceFile*/);881 int vrc = DBGFR3CoreWrite(ptrVM.rawUVM(), strFilename.c_str(), false /*fReplaceFile*/); 882 882 if (RT_SUCCESS(vrc)) 883 883 hrc = S_OK; … … 1039 1039 MACHINEDEBUGGERINOFHLP Hlp; 1040 1040 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); 1042 1042 if (RT_SUCCESS(vrc)) 1043 1043 { … … 1106 1106 if (SUCCEEDED(hrc)) 1107 1107 { 1108 int vrc = DBGFR3LogModifyFlags(ptrVM , strSettings.c_str());1108 int vrc = DBGFR3LogModifyFlags(ptrVM.rawUVM(), strSettings.c_str()); 1109 1109 if (RT_SUCCESS(vrc)) 1110 1110 hrc = S_OK; … … 1131 1131 if (SUCCEEDED(hrc)) 1132 1132 { 1133 int vrc = DBGFR3LogModifyGroups(ptrVM , strSettings.c_str());1133 int vrc = DBGFR3LogModifyGroups(ptrVM.rawUVM(), strSettings.c_str()); 1134 1134 if (RT_SUCCESS(vrc)) 1135 1135 hrc = S_OK; … … 1156 1156 if (SUCCEEDED(hrc)) 1157 1157 { 1158 int vrc = DBGFR3LogModifyDestinations(ptrVM , strSettings.c_str());1158 int vrc = DBGFR3LogModifyDestinations(ptrVM.rawUVM(), strSettings.c_str()); 1159 1159 if (RT_SUCCESS(vrc)) 1160 1160 hrc = S_OK; … … 1208 1208 /** @todo automatically load the DBGC plugins or this is a waste of time. */ 1209 1209 char szName[64]; 1210 int vrc = DBGFR3OSDetect(ptrVM.raw (), szName, sizeof(szName));1210 int vrc = DBGFR3OSDetect(ptrVM.rawUVM(), szName, sizeof(szName)); 1211 1211 if (RT_SUCCESS(vrc) && vrc != VINF_DBGF_OS_NOT_DETCTED) 1212 1212 { … … 1283 1283 DBGFREGVAL Value; 1284 1284 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); 1286 1286 if (RT_SUCCESS(vrc)) 1287 1287 { … … 1331 1331 */ 1332 1332 size_t cRegs; 1333 int vrc = DBGFR3RegNmQueryAllCount(ptrVM.raw (), &cRegs);1333 int vrc = DBGFR3RegNmQueryAllCount(ptrVM.rawUVM(), &cRegs); 1334 1334 if (RT_SUCCESS(vrc)) 1335 1335 { … … 1337 1337 if (paRegs) 1338 1338 { 1339 vrc = DBGFR3RegNmQueryAll(ptrVM.raw (), paRegs, cRegs);1339 vrc = DBGFR3RegNmQueryAll(ptrVM.rawUVM(), paRegs, cRegs); 1340 1340 if (RT_SUCCESS(vrc)) 1341 1341 { -
trunk/src/VBox/VMM/VMMAll/DBGFAll.cpp
r41965 r44399 33 33 * @param pVM Pointer to the VM. 34 34 */ 35 VMM DECL(RTGCUINTREG) DBGFBpGetDR7(PVM pVM)35 VMM_INT_DECL(RTGCUINTREG) DBGFBpGetDR7(PVM pVM) 36 36 { 37 37 RTGCUINTREG uDr7 = X86_DR7_GD | X86_DR7_GE | X86_DR7_LE | X86_DR7_MB1_MASK; … … 64 64 * @param pVM Pointer to the VM. 65 65 */ 66 VMM DECL(RTGCUINTREG) DBGFBpGetDR0(PVM pVM)66 VMM_INT_DECL(RTGCUINTREG) DBGFBpGetDR0(PVM pVM) 67 67 { 68 68 PCDBGFBP pBp = &pVM->dbgf.s.aHwBreakpoints[0]; … … 78 78 * @param pVM Pointer to the VM. 79 79 */ 80 VMM DECL(RTGCUINTREG) DBGFBpGetDR1(PVM pVM)80 VMM_INT_DECL(RTGCUINTREG) DBGFBpGetDR1(PVM pVM) 81 81 { 82 82 PCDBGFBP pBp = &pVM->dbgf.s.aHwBreakpoints[1]; … … 92 92 * @param pVM Pointer to the VM. 93 93 */ 94 VMM DECL(RTGCUINTREG) DBGFBpGetDR2(PVM pVM)94 VMM_INT_DECL(RTGCUINTREG) DBGFBpGetDR2(PVM pVM) 95 95 { 96 96 PCDBGFBP pBp = &pVM->dbgf.s.aHwBreakpoints[2]; … … 106 106 * @param pVM Pointer to the VM. 107 107 */ 108 VMM DECL(RTGCUINTREG) DBGFBpGetDR3(PVM pVM)108 VMM_INT_DECL(RTGCUINTREG) DBGFBpGetDR3(PVM pVM) 109 109 { 110 110 PCDBGFBP pBp = &pVM->dbgf.s.aHwBreakpoints[3]; … … 121 121 * @param pVCpu Pointer to the VMCPU. 122 122 */ 123 VMM DECL(bool) DBGFIsStepping(PVMCPU pVCpu)123 VMM_INT_DECL(bool) DBGFIsStepping(PVMCPU pVCpu) 124 124 { 125 125 return pVCpu->dbgf.s.fSingleSteppingRaw; -
trunk/src/VBox/VMM/VMMAll/IEMAll.cpp
r42778 r44399 2459 2459 PVMCPU pVCpu = IEMCPU_TO_VMCPU(pIemCpu); 2460 2460 char szRegs[4096]; 2461 DBGFR3RegPrintf(pVM , pVCpu->idCpu, &szRegs[0], sizeof(szRegs),2461 DBGFR3RegPrintf(pVM->pUVM, pVCpu->idCpu, &szRegs[0], sizeof(szRegs), 2462 2462 "rax=%016VR{rax} rbx=%016VR{rbx} rcx=%016VR{rcx} rdx=%016VR{rdx}\n" 2463 2463 "rsi=%016VR{rsi} rdi=%016VR{rdi} r8 =%016VR{r8} r9 =%016VR{r9}\n" … … 2487 2487 2488 2488 char szInstr[256]; 2489 DBGFR3DisasInstrEx(pVM , pVCpu->idCpu, 0, 0,2489 DBGFR3DisasInstrEx(pVM->pUVM, pVCpu->idCpu, 0, 0, 2490 2490 DBGF_DISAS_FLAGS_CURRENT_GUEST | DBGF_DISAS_FLAGS_DEFAULT_MODE, 2491 2491 szInstr, sizeof(szInstr), NULL); … … 2836 2836 PVMCPU pVCpu = IEMCPU_TO_VMCPU(pIemCpu); 2837 2837 char szRegs[4096]; 2838 DBGFR3RegPrintf(pVM , pVCpu->idCpu, &szRegs[0], sizeof(szRegs),2838 DBGFR3RegPrintf(pVM->pUVM, pVCpu->idCpu, &szRegs[0], sizeof(szRegs), 2839 2839 "rax=%016VR{rax} rbx=%016VR{rbx} rcx=%016VR{rcx} rdx=%016VR{rdx}\n" 2840 2840 "rsi=%016VR{rsi} rdi=%016VR{rdi} r8 =%016VR{r8} r9 =%016VR{r9}\n" … … 2864 2864 2865 2865 char szInstr[256]; 2866 DBGFR3DisasInstrEx(pVM , pVCpu->idCpu, 0, 0,2866 DBGFR3DisasInstrEx(pVM->pUVM, pVCpu->idCpu, 0, 0, 2867 2867 DBGF_DISAS_FLAGS_CURRENT_GUEST | DBGF_DISAS_FLAGS_DEFAULT_MODE, 2868 2868 szInstr, sizeof(szInstr), NULL); … … 7791 7791 PVMCPU pVCpu = IEMCPU_TO_VMCPU(pIemCpu); 7792 7792 char szRegs[4096]; 7793 DBGFR3RegPrintf(pVM , pVCpu->idCpu, &szRegs[0], sizeof(szRegs),7793 DBGFR3RegPrintf(pVM->pUVM, pVCpu->idCpu, &szRegs[0], sizeof(szRegs), 7794 7794 "rax=%016VR{rax} rbx=%016VR{rbx} rcx=%016VR{rcx} rdx=%016VR{rdx}\n" 7795 7795 "rsi=%016VR{rsi} rdi=%016VR{rdi} r8 =%016VR{r8} r9 =%016VR{r9}\n" … … 7819 7819 7820 7820 char szInstr1[256]; 7821 DBGFR3DisasInstrEx(pVM , pVCpu->idCpu, pIemCpu->uOldCs, pIemCpu->uOldRip,7821 DBGFR3DisasInstrEx(pVM->pUVM, pVCpu->idCpu, pIemCpu->uOldCs, pIemCpu->uOldRip, 7822 7822 DBGF_DISAS_FLAGS_DEFAULT_MODE, 7823 7823 szInstr1, sizeof(szInstr1), NULL); 7824 7824 char szInstr2[256]; 7825 DBGFR3DisasInstrEx(pVM , pVCpu->idCpu, 0, 0,7825 DBGFR3DisasInstrEx(pVM->pUVM, pVCpu->idCpu, 0, 0, 7826 7826 DBGF_DISAS_FLAGS_CURRENT_GUEST | DBGF_DISAS_FLAGS_DEFAULT_MODE, 7827 7827 szInstr2, sizeof(szInstr2), NULL); … … 8170 8170 if (cDiffs != 0) 8171 8171 { 8172 DBGFR3Info(pVM , "cpumguest", "verbose", NULL);8172 DBGFR3Info(pVM->pUVM, "cpumguest", "verbose", NULL); 8173 8173 RTAssertMsg1(NULL, __LINE__, __FILE__, __FUNCTION__); 8174 8174 iemVerifyAssertMsg2(pIemCpu); … … 8391 8391 char szInstr[256]; 8392 8392 uint32_t cbInstr = 0; 8393 DBGFR3DisasInstrEx(pVCpu->pVMR3 , pVCpu->idCpu, 0, 0,8393 DBGFR3DisasInstrEx(pVCpu->pVMR3->pUVM, pVCpu->idCpu, 0, 0, 8394 8394 DBGF_DISAS_FLAGS_CURRENT_GUEST | DBGF_DISAS_FLAGS_DEFAULT_MODE, 8395 8395 szInstr, sizeof(szInstr), &cbInstr); … … 8410 8410 8411 8411 if (LogIs3Enabled()) 8412 DBGFR3Info(pVCpu->pVMR3 , "cpumguest", "verbose", NULL);8412 DBGFR3Info(pVCpu->pVMR3->pUVM, "cpumguest", "verbose", NULL); 8413 8413 } 8414 8414 else -
trunk/src/VBox/VMM/VMMAll/PGMAllBth.h
r43387 r44399 3730 3730 pgmGstGet32bitPDPtr(pVCpu); 3731 3731 RTGCPHYS GCPhys; 3732 rc = PGMR3DbgR3Ptr2GCPhys(pVM , pPGM->pGst32BitPdR3, &GCPhys);3732 rc = PGMR3DbgR3Ptr2GCPhys(pVM->pUVM, pPGM->pGst32BitPdR3, &GCPhys); 3733 3733 AssertRCReturn(rc, 1); 3734 3734 AssertMsgReturn(PGM_A20_APPLY(pVCpu, cr3 & GST_CR3_PAGE_MASK) == GCPhys, ("GCPhys=%RGp cr3=%RGp\n", GCPhys, (RTGCPHYS)cr3), false); … … 4066 4066 # ifdef IN_RING3 4067 4067 PGMAssertHandlerAndFlagsInSync(pVM); 4068 DBGFR3PagingDumpEx(pVM , pVCpu->idCpu, DBGFPGDMP_FLAGS_CURRENT_CR3 | DBGFPGDMP_FLAGS_CURRENT_MODE4068 DBGFR3PagingDumpEx(pVM->pUVM, pVCpu->idCpu, DBGFPGDMP_FLAGS_CURRENT_CR3 | DBGFPGDMP_FLAGS_CURRENT_MODE 4069 4069 | DBGFPGDMP_FLAGS_GUEST | DBGFPGDMP_FLAGS_HEADER | DBGFPGDMP_FLAGS_PRINT_CR3, 4070 4070 0, 0, UINT64_MAX, 99, NULL); -
trunk/src/VBox/VMM/VMMAll/PGMAllHandler.cpp
r43387 r44399 130 130 { 131 131 #ifdef IN_RING3 132 DBGFR3Info(pVM , "phys", NULL, NULL);132 DBGFR3Info(pVM->pUVM, "phys", NULL, NULL); 133 133 #endif 134 134 AssertMsgFailed(("No RAM range for %RGp-%RGp\n", GCPhys, GCPhysLast)); … … 184 184 185 185 #if defined(IN_RING3) && defined(VBOX_STRICT) 186 DBGFR3Info(pVM , "handlers", "phys nostats", NULL);186 DBGFR3Info(pVM->pUVM, "handlers", "phys nostats", NULL); 187 187 #endif 188 188 AssertMsgFailed(("Conflict! GCPhys=%RGp GCPhysLast=%RGp pszDesc=%s\n", GCPhys, GCPhysLast, pszDesc)); -
trunk/src/VBox/VMM/VMMR3/CFGM.cpp
r44387 r44399 108 108 * Register DBGF into item. 109 109 */ 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); 111 112 AssertRCReturn(rc,rc); 112 113 -
trunk/src/VBox/VMM/VMMR3/CPUM.cpp
r44362 r44399 4402 4402 RTCpuSetToU64(RTMpGetOnlineSet(&OnlineSet)) )); 4403 4403 LogRel(("************************* CPUID dump ************************\n")); 4404 DBGFR3Info(pVM , "cpuid", "verbose", DBGFR3InfoLogRelHlp());4404 DBGFR3Info(pVM->pUVM, "cpuid", "verbose", DBGFR3InfoLogRelHlp()); 4405 4405 LogRel(("\n")); 4406 DBGFR3 InfoLog(pVM, "cpuid", "verbose"); /* macro */4406 DBGFR3_INFO_LOG(pVM, "cpuid", "verbose"); /* macro */ 4407 4407 RTLogRelSetBuffering(fOldBuffered); 4408 4408 LogRel(("******************** End of CPUID dump **********************\n")); -
trunk/src/VBox/VMM/VMMR3/CSAM.cpp
r44385 r44399 84 84 static bool fInCSAMCodePageInvalidate = false; 85 85 86 #ifdef VBOX_WITH_DEBUGGER 87 static FNDBGCCMD csamr3CmdOn; 88 static FNDBGCCMD csamr3CmdOff; 89 #endif 90 91 86 92 /******************************************************************************* 87 93 * Global Variables * 88 94 *******************************************************************************/ 89 95 #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 93 96 /** Command descriptors. */ 94 97 static const DBGCCMD g_aCmds[] = … … 2723 2726 2724 2727 /** 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 */ 2730 static DECLCALLBACK(int) csamr3CmdOff(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs) 2731 { 2732 DBGC_CMDHLP_REQ_UVM_RET(pCmdHlp, pCmd, pUVM); 2737 2733 NOREF(cArgs); NOREF(paArgs); 2738 2734 2739 int rc = CSAM DisableScanning(pVM);2735 int rc = CSAMR3SetScanningEnabled(pUVM, false); 2740 2736 if (RT_FAILURE(rc)) 2741 return DBGCCmdHlpFailRc(pCmdHlp, pCmd, rc, "CSAM DisableScanning");2737 return DBGCCmdHlpFailRc(pCmdHlp, pCmd, rc, "CSAMR3SetScanningEnabled"); 2742 2738 return DBGCCmdHlpPrintf(pCmdHlp, "CSAM Scanning disabled\n"); 2743 2739 } 2744 2740 2745 2741 /** 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 */ 2744 static DECLCALLBACK(int) csamr3CmdOn(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs) 2745 { 2746 DBGC_CMDHLP_REQ_UVM_RET(pCmdHlp, pCmd, pUVM); 2758 2747 NOREF(cArgs); NOREF(paArgs); 2759 2748 2760 int rc = CSAM EnableScanning(pVM);2749 int rc = CSAMR3SetScanningEnabled(pUVM, true); 2761 2750 if (RT_FAILURE(rc)) 2762 return DBGCCmdHlpFailRc(pCmdHlp, pCmd, rc, "CSAM EnableScanning");2751 return DBGCCmdHlpFailRc(pCmdHlp, pCmd, rc, "CSAMR3SetScanningEnabled"); 2763 2752 return DBGCCmdHlpPrintf(pCmdHlp, "CSAM Scanning enabled\n"); 2764 2753 } -
trunk/src/VBox/VMM/VMMR3/DBGF.cpp
r44373 r44399 135 135 * @param pVM Pointer to the VM. 136 136 */ 137 VMMR3DECL(int) DBGFR3Init(PVM pVM) 138 { 139 int rc = dbgfR3InfoInit(pVM); 137 VMMR3_INT_DECL(int) DBGFR3Init(PVM pVM) 138 { 139 PUVM pUVM = pVM->pUVM; 140 int rc = dbgfR3InfoInit(pUVM); 140 141 if (RT_SUCCESS(rc)) 141 142 rc = dbgfR3TraceInit(pVM); 142 143 if (RT_SUCCESS(rc)) 143 rc = dbgfR3RegInit(p VM);144 rc = dbgfR3RegInit(pUVM); 144 145 if (RT_SUCCESS(rc)) 145 rc = dbgfR3AsInit(p VM);146 rc = dbgfR3AsInit(pUVM); 146 147 if (RT_SUCCESS(rc)) 147 148 rc = dbgfR3SymInit(pVM); … … 158 159 * @param pVM Pointer to the VM. 159 160 */ 160 VMMR3DECL(int) DBGFR3Term(PVM pVM) 161 { 161 VMMR3_INT_DECL(int) DBGFR3Term(PVM pVM) 162 { 163 PUVM pUVM = pVM->pUVM; 162 164 int rc; 163 165 … … 213 215 * Terminate the other bits. 214 216 */ 215 dbgfR3OSTerm(p VM);216 dbgfR3AsTerm(p VM);217 dbgfR3RegTerm(p VM);217 dbgfR3OSTerm(pUVM); 218 dbgfR3AsTerm(pUVM); 219 dbgfR3RegTerm(pUVM); 218 220 dbgfR3TraceTerm(pVM); 219 dbgfR3InfoTerm(p VM);221 dbgfR3InfoTerm(pUVM); 220 222 return VINF_SUCCESS; 221 223 } … … 230 232 * @param offDelta Relocation delta relative to old location. 231 233 */ 232 VMMR3 DECL(void) DBGFR3Relocate(PVM pVM, RTGCINTPTR offDelta)234 VMMR3_INT_DECL(void) DBGFR3Relocate(PVM pVM, RTGCINTPTR offDelta) 233 235 { 234 236 dbgfR3TraceRelocate(pVM); 235 dbgfR3AsRelocate(pVM , offDelta);237 dbgfR3AsRelocate(pVM->pUVM, offDelta); 236 238 } 237 239 … … 300 302 * @param pVM Pointer to the VM. 301 303 */ 302 VMMR3 DECL(int) DBGFR3VMMForcedAction(PVM pVM)304 VMMR3_INT_DECL(int) DBGFR3VMMForcedAction(PVM pVM) 303 305 { 304 306 int rc = VINF_SUCCESS; … … 450 452 * @param pVM Pointer to the VM. 451 453 * @param enmEvent The event to send. 454 * @internal 452 455 */ 453 456 VMMR3DECL(int) DBGFR3Event(PVM pVM, DBGFEVENTTYPE enmEvent) … … 477 480 * @param pszFormat Message which accompanies the event. 478 481 * @param ... Message arguments. 482 * @internal 479 483 */ 480 484 VMMR3DECL(int) DBGFR3EventSrc(PVM pVM, DBGFEVENTTYPE enmEvent, const char *pszFile, unsigned uLine, const char *pszFunction, const char *pszFormat, ...) … … 499 503 * @param pszFormat Message which accompanies the event. 500 504 * @param args Message arguments. 505 * @internal 501 506 */ 502 507 VMMR3DECL(int) DBGFR3EventSrcV(PVM pVM, DBGFEVENTTYPE enmEvent, const char *pszFile, unsigned uLine, const char *pszFunction, const char *pszFormat, va_list args) … … 539 544 * @param pszMsg2 Second assertion message. 540 545 */ 541 VMMR3 DECL(int) DBGFR3EventAssertion(PVM pVM, DBGFEVENTTYPE enmEvent, const char *pszMsg1, const char *pszMsg2)546 VMMR3_INT_DECL(int) DBGFR3EventAssertion(PVM pVM, DBGFEVENTTYPE enmEvent, const char *pszMsg1, const char *pszMsg2) 542 547 { 543 548 int rc = dbgfR3EventPrologue(pVM, enmEvent); … … 564 569 * @param enmEvent DBGFEVENT_BREAKPOINT_HYPER or DBGFEVENT_BREAKPOINT. 565 570 */ 566 VMMR3 DECL(int) DBGFR3EventBreakpoint(PVM pVM, DBGFEVENTTYPE enmEvent)571 VMMR3_INT_DECL(int) DBGFR3EventBreakpoint(PVM pVM, DBGFEVENTTYPE enmEvent) 567 572 { 568 573 int rc = dbgfR3EventPrologue(pVM, enmEvent); … … 857 862 * 858 863 * @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 */ 866 VMMR3DECL(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); 864 871 865 872 /* … … 905 912 * 906 913 * @returns VBox status code. 907 * @param p VM Pointer to the VM.908 */ 909 VMMR3DECL(int) DBGFR3Detach(P VM pVM)914 * @param pUVM The user mode VM handle. 915 */ 916 VMMR3DECL(int) DBGFR3Detach(PUVM pUVM) 910 917 { 911 918 LogFlow(("DBGFR3Detach:\n")); … … 915 922 * Check if attached. 916 923 */ 924 UVM_ASSERT_VALID_EXT_RETURN(pUVM, false); 925 PVM pVM = pUVM->pVM; 926 VM_ASSERT_VALID_EXT_RETURN(pVM, false); 917 927 AssertReturn(pVM->dbgf.s.fAttached, VERR_DBGF_NOT_ATTACHED); 918 928 … … 951 961 * 952 962 * @returns VBox status. Will not return VBOX_INTERRUPTED. 953 * @param p VM Pointer to the VM.963 * @param pUVM The user mode VM handle. 954 964 * @param cMillies Number of millis to wait. 955 965 * @param ppEvent Where to store the event pointer. 956 966 */ 957 VMMR3DECL(int) DBGFR3EventWait(P VM pVM, RTMSINTERVAL cMillies, PCDBGFEVENT *ppEvent)967 VMMR3DECL(int) DBGFR3EventWait(PUVM pUVM, RTMSINTERVAL cMillies, PCDBGFEVENT *ppEvent) 958 968 { 959 969 /* 960 970 * Check state. 961 971 */ 972 UVM_ASSERT_VALID_EXT_RETURN(pUVM, false); 973 PVM pVM = pUVM->pVM; 974 VM_ASSERT_VALID_EXT_RETURN(pVM, false); 962 975 AssertReturn(pVM->dbgf.s.fAttached, VERR_DBGF_NOT_ATTACHED); 963 976 *ppEvent = NULL; … … 985 998 * 986 999 * @returns VBox status. 987 * @param p VM Pointer to the VM.988 */ 989 VMMR3DECL(int) DBGFR3Halt(P VM pVM)1000 * @param pUVM The user mode VM handle. 1001 */ 1002 VMMR3DECL(int) DBGFR3Halt(PUVM pUVM) 990 1003 { 991 1004 /* 992 1005 * Check state. 993 1006 */ 1007 UVM_ASSERT_VALID_EXT_RETURN(pUVM, false); 1008 PVM pVM = pUVM->pVM; 1009 VM_ASSERT_VALID_EXT_RETURN(pVM, false); 994 1010 AssertReturn(pVM->dbgf.s.fAttached, VERR_DBGF_NOT_ATTACHED); 995 1011 RTPINGPONGSPEAKER enmSpeaker = pVM->dbgf.s.PingPong.enmSpeaker; … … 1012 1028 * @returns True if halted. 1013 1029 * @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 */ 1032 VMMR3DECL(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); 1018 1037 AssertReturn(pVM->dbgf.s.fAttached, false); 1038 1019 1039 RTPINGPONGSPEAKER enmSpeaker = pVM->dbgf.s.PingPong.enmSpeaker; 1020 1040 return enmSpeaker == RTPINGPONGSPEAKER_PONG_SIGNALED … … 1030 1050 * @returns True if waitable. 1031 1051 * @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 */ 1054 VMMR3DECL(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); 1036 1059 AssertReturn(pVM->dbgf.s.fAttached, false); 1060 1037 1061 return RTSemPongShouldWait(&pVM->dbgf.s.PingPong); 1038 1062 } … … 1045 1069 * 1046 1070 * @returns VBox status. 1047 * @param p VM Pointer to the VM.1048 */ 1049 VMMR3DECL(int) DBGFR3Resume(P VM pVM)1071 * @param pUVM The user mode VM handle. 1072 */ 1073 VMMR3DECL(int) DBGFR3Resume(PUVM pUVM) 1050 1074 { 1051 1075 /* 1052 1076 * Check state. 1053 1077 */ 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); 1054 1081 AssertReturn(pVM->dbgf.s.fAttached, VERR_DBGF_NOT_ATTACHED); 1055 1082 AssertReturn(RTSemPongIsSpeaker(&pVM->dbgf.s.PingPong), VERR_SEM_OUT_OF_TURN); … … 1073 1100 * 1074 1101 * @returns VBox status. 1075 * @param p VM Pointer to the VM.1102 * @param pUVM The user mode VM handle. 1076 1103 * @param idCpu The ID of the CPU to single step on. 1077 1104 */ 1078 VMMR3DECL(int) DBGFR3Step(P VM pVM, VMCPUID idCpu)1105 VMMR3DECL(int) DBGFR3Step(PUVM pUVM, VMCPUID idCpu) 1079 1106 { 1080 1107 /* 1081 1108 * Check state. 1082 1109 */ 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); 1083 1113 AssertReturn(pVM->dbgf.s.fAttached, VERR_DBGF_NOT_ATTACHED); 1084 1114 AssertReturn(RTSemPongIsSpeaker(&pVM->dbgf.s.PingPong), VERR_SEM_OUT_OF_TURN); … … 1108 1138 * 1109 1139 * @thread VCpu EMT 1110 */ 1111 VMMR3DECL(int) DBGFR3PrgStep(PVMCPU pVCpu) 1140 * @internal 1141 */ 1142 VMMR3_INT_DECL(int) DBGFR3PrgStep(PVMCPU pVCpu) 1112 1143 { 1113 1144 VMCPU_ASSERT_EMT(pVCpu); -
trunk/src/VBox/VMM/VMMR3/DBGFAddr.cpp
r41965 r44399 27 27 #include "DBGFInternal.h" 28 28 #include <VBox/vmm/vm.h> 29 #include <VBox/vmm/uvm.h> 30 29 31 #include <VBox/param.h> 30 32 #include <VBox/err.h> … … 36 38 /** 37 39 * 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 */ 47 DECLINLINE(bool) dbgfR3IsHMA(PUVM pUVM, RTGCUINTPTR FlatPtr) 48 { 49 return MMHyperIsInsideArea(pUVM->pVM, FlatPtr); 46 50 } 47 51 … … 92 96 * 93 97 * @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 */ 104 VMMR3DECL(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); 103 109 104 110 pAddress->Sel = Sel; … … 107 113 { 108 114 DBGFSELINFO SelInfo; 109 int rc = DBGFR3SelQueryInfo(p VM, 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); 110 116 if (RT_FAILURE(rc)) 111 117 return rc; … … 120 126 } 121 127 pAddress->fFlags |= DBGFADDRESS_FLAGS_VALID; 122 if (dbgfR3IsHMA(p VM, pAddress->FlatPtr))128 if (dbgfR3IsHMA(pUVM, pAddress->FlatPtr)) 123 129 pAddress->fFlags |= DBGFADDRESS_FLAGS_HMA; 124 130 … … 132 138 * 133 139 * @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 */ 146 VMMR3DECL(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 142 151 pAddress->Sel = pSelInfo->Sel; 143 152 pAddress->off = off; … … 145 154 if (RT_FAILURE(rc)) 146 155 return rc; 156 147 157 pAddress->fFlags |= DBGFADDRESS_FLAGS_VALID; 148 if (dbgfR3IsHMA(p VM, pAddress->FlatPtr))158 if (dbgfR3IsHMA(pUVM, pAddress->FlatPtr)) 149 159 pAddress->fFlags |= DBGFADDRESS_FLAGS_HMA; 160 150 161 return VINF_SUCCESS; 151 162 } … … 156 167 * 157 168 * @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 */ 173 VMMR3DECL(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); 164 177 pAddress->Sel = DBGF_SEL_FLAT; 165 178 pAddress->off = FlatPtr; 166 179 pAddress->FlatPtr = FlatPtr; 167 180 pAddress->fFlags = DBGFADDRESS_FLAGS_FLAT | DBGFADDRESS_FLAGS_VALID; 168 if (dbgfR3IsHMA(p VM, pAddress->FlatPtr))181 if (dbgfR3IsHMA(pUVM, pAddress->FlatPtr)) 169 182 pAddress->fFlags |= DBGFADDRESS_FLAGS_HMA; 170 183 return pAddress; … … 176 189 * 177 190 * @returns pAddress. 178 * @param p VM 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(P VM 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 */ 195 VMMR3DECL(PDBGFADDRESS) DBGFR3AddrFromPhys(PUVM pUVM, PDBGFADDRESS pAddress, RTGCPHYS PhysAddr) 196 { 197 UVM_ASSERT_VALID_EXT_RETURN(pUVM, NULL); 185 198 pAddress->Sel = DBGF_SEL_FLAT; 186 199 pAddress->off = PhysAddr; … … 196 209 * @returns true if valid. 197 210 * @returns false if invalid. 198 * @param p VM Pointer to the VM.199 * @param pAddress The address to validate.200 */ 201 VMMR3DECL(bool) DBGFR3AddrIsValid(P VM pVM, PCDBGFADDRESS pAddress)202 { 203 NOREF(pVM);211 * @param pUVM The user mode VM handle. 212 * @param pAddress The address to validate. 213 */ 214 VMMR3DECL(bool) DBGFR3AddrIsValid(PUVM pUVM, PCDBGFADDRESS pAddress) 215 { 216 UVM_ASSERT_VALID_EXT_RETURN(pUVM, false); 204 217 if (!VALID_PTR(pAddress)) 205 218 return false; … … 241 254 * @retval VERR_PAGE_MAP_LEVEL4_NOT_PRESENT 242 255 * 243 * @param p VM Pointer to the VM.256 * @param pUVM The user mode VM handle. 244 257 * @param idCpu The ID of the CPU context to convert virtual 245 258 * addresses. … … 247 260 * @param pGCPhys Where to return the physical address. 248 261 */ 249 VMMR3DECL(int) DBGFR3AddrToPhys(P VM pVM, VMCPUID idCpu, PDBGFADDRESS pAddress, PRTGCPHYS pGCPhys)262 VMMR3DECL(int) DBGFR3AddrToPhys(PUVM pUVM, VMCPUID idCpu, PDBGFADDRESS pAddress, PRTGCPHYS pGCPhys) 250 263 { 251 264 /* … … 256 269 AssertPtr(pAddress); 257 270 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); 260 275 261 276 /* … … 276 291 rc = dbgfR3AddrToPhysOnVCpu(pVCpu, pAddress, pGCPhys); 277 292 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); 280 295 } 281 296 return rc; … … 299 314 * @retval VERR_PGM_INVALID_GC_PHYSICAL_ADDRESS 300 315 * 301 * @param p VM Pointer to the VM.316 * @param pUVM The user mode VM handle. 302 317 * @param idCpu The ID of the CPU context to convert virtual 303 318 * addresses. … … 305 320 * @param pHCPhys Where to return the physical address. 306 321 */ 307 VMMR3DECL(int) DBGFR3AddrToHostPhys(P VM pVM, VMCPUID idCpu, PDBGFADDRESS pAddress, PRTHCPHYS pHCPhys)322 VMMR3DECL(int) DBGFR3AddrToHostPhys(PUVM pUVM, VMCPUID idCpu, PDBGFADDRESS pAddress, PRTHCPHYS pHCPhys) 308 323 { 309 324 /* … … 314 329 AssertPtr(pAddress); 315 330 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); 318 335 319 336 /* … … 326 343 { 327 344 RTGCPHYS GCPhys; 328 rc = DBGFR3AddrToPhys(p VM, idCpu, pAddress, &GCPhys);345 rc = DBGFR3AddrToPhys(pUVM, idCpu, pAddress, &GCPhys); 329 346 if (RT_SUCCESS(rc)) 330 347 rc = PGMPhysGCPhys2HCPhys(pVM, pAddress->FlatPtr, pHCPhys); … … 339 356 * @returns VBox status code. 340 357 * 341 * @param p VM Pointer to the VM.358 * @param pUVM The user mode VM handle. 342 359 * @param idCpu The ID of the CPU context. 343 360 * @param pAddress The address. … … 345 362 * @param ppvR3Ptr Where to return the address. 346 363 */ 347 static DECLCALLBACK(int) dbgfR3AddrToVolatileR3PtrOnVCpu(PVM pVM, VMCPUID idCpu, PDBGFADDRESS pAddress, bool fReadOnly, void **ppvR3Ptr) 348 { 364 static 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); 349 369 Assert(idCpu == VMMGetCpuId(pVM)); 350 370 … … 410 430 * @retval VERR_PGM_INVALID_GC_PHYSICAL_ADDRESS 411 431 * 412 * @param p VM Pointer to the VM.432 * @param pUVM The user mode VM handle. 413 433 * @param idCpu The ID of the CPU context to convert virtual 414 434 * addresses. … … 419 439 * @param ppvR3Ptr Where to return the address. 420 440 */ 421 VMMR3DECL(int) DBGFR3AddrToVolatileR3Ptr(P VM pVM, VMCPUID idCpu, PDBGFADDRESS pAddress, bool fReadOnly, void **ppvR3Ptr)441 VMMR3DECL(int) DBGFR3AddrToVolatileR3Ptr(PUVM pUVM, VMCPUID idCpu, PDBGFADDRESS pAddress, bool fReadOnly, void **ppvR3Ptr) 422 442 { 423 443 /* … … 428 448 AssertPtr(pAddress); 429 449 AssertReturn(DBGFADDRESS_IS_VALID(pAddress), VERR_INVALID_PARAMETER); 430 VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_STATE);431 AssertReturn(idCpu < p VM->cCpus, VERR_INVALID_PARAMETER);450 UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_STATE); 451 AssertReturn(idCpu < pUVM->cCpus, VERR_INVALID_PARAMETER); 432 452 433 453 /* 434 454 * Convert it. 435 455 */ 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); 437 458 } 438 459 -
trunk/src/VBox/VMM/VMMR3/DBGFAddrSpace.cpp
r41965 r44399 5 5 6 6 /* 7 * Copyright (C) 2008 Oracle Corporation7 * Copyright (C) 2008-2013 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 42 42 #include <VBox/vmm/mm.h> 43 43 #include "DBGFInternal.h" 44 #include <VBox/vmm/uvm.h> 44 45 #include <VBox/vmm/vm.h> 45 46 #include <VBox/err.h> … … 79 80 typedef struct DBGFR3ASLOADOPENDATA 80 81 { 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; 85 86 } DBGFR3ASLOADOPENDATA; 86 87 … … 101 102 *******************************************************************************/ 102 103 /** Locks the address space database for writing. */ 103 #define DBGF_AS_DB_LOCK_WRITE(p VM) \104 #define DBGF_AS_DB_LOCK_WRITE(pUVM) \ 104 105 do { \ 105 int rcSem = RTSemRWRequestWrite((p VM)->dbgf.s.hAsDbLock, RT_INDEFINITE_WAIT); \106 int rcSem = RTSemRWRequestWrite((pUVM)->dbgf.s.hAsDbLock, RT_INDEFINITE_WAIT); \ 106 107 AssertRC(rcSem); \ 107 108 } while (0) 108 109 109 110 /** Unlocks the address space database after writing. */ 110 #define DBGF_AS_DB_UNLOCK_WRITE(p VM) \111 #define DBGF_AS_DB_UNLOCK_WRITE(pUVM) \ 111 112 do { \ 112 int rcSem = RTSemRWReleaseWrite((p VM)->dbgf.s.hAsDbLock); \113 int rcSem = RTSemRWReleaseWrite((pUVM)->dbgf.s.hAsDbLock); \ 113 114 AssertRC(rcSem); \ 114 115 } while (0) 115 116 116 117 /** Locks the address space database for reading. */ 117 #define DBGF_AS_DB_LOCK_READ(p VM) \118 #define DBGF_AS_DB_LOCK_READ(pUVM) \ 118 119 do { \ 119 int rcSem = RTSemRWRequestRead((p VM)->dbgf.s.hAsDbLock, RT_INDEFINITE_WAIT); \120 int rcSem = RTSemRWRequestRead((pUVM)->dbgf.s.hAsDbLock, RT_INDEFINITE_WAIT); \ 120 121 AssertRC(rcSem); \ 121 122 } while (0) 122 123 123 124 /** Unlocks the address space database after reading. */ 124 #define DBGF_AS_DB_UNLOCK_READ(p VM) \125 #define DBGF_AS_DB_UNLOCK_READ(pUVM) \ 125 126 do { \ 126 int rcSem = RTSemRWReleaseRead((p VM)->dbgf.s.hAsDbLock); \127 int rcSem = RTSemRWReleaseRead((pUVM)->dbgf.s.hAsDbLock); \ 127 128 AssertRC(rcSem); \ 128 129 } while (0) … … 134 135 * 135 136 * @returns VBox status code. 136 * @param p VM Pointer to the VM.137 */ 138 int dbgfR3AsInit(P VM pVM)137 * @param pUVM The user mode VM handle. 138 */ 139 int dbgfR3AsInit(PUVM pUVM) 139 140 { 140 141 /* 141 142 * Create the semaphore. 142 143 */ 143 int rc = RTSemRWCreate(&p VM->dbgf.s.hAsDbLock);144 int rc = RTSemRWCreate(&pUVM->dbgf.s.hAsDbLock); 144 145 AssertRCReturn(rc, rc); 145 146 … … 150 151 rc = RTDbgAsCreate(&hDbgAs, 0, RTGCPTR_MAX, "Global"); 151 152 AssertRCReturn(rc, rc); 152 rc = DBGFR3AsAdd(p VM, hDbgAs, NIL_RTPROCESS);153 rc = DBGFR3AsAdd(pUVM, hDbgAs, NIL_RTPROCESS); 153 154 AssertRCReturn(rc, rc); 154 155 RTDbgAsRetain(hDbgAs); 155 p VM->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; 156 157 157 158 RTDbgAsRetain(hDbgAs); 158 p VM->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; 159 160 160 161 rc = RTDbgAsCreate(&hDbgAs, 0, RTGCPHYS_MAX, "Physical"); 161 162 AssertRCReturn(rc, rc); 162 rc = DBGFR3AsAdd(p VM, hDbgAs, NIL_RTPROCESS);163 rc = DBGFR3AsAdd(pUVM, hDbgAs, NIL_RTPROCESS); 163 164 AssertRCReturn(rc, rc); 164 165 RTDbgAsRetain(hDbgAs); 165 p VM->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; 166 167 167 168 rc = RTDbgAsCreate(&hDbgAs, 0, RTRCPTR_MAX, "HyperRawMode"); 168 169 AssertRCReturn(rc, rc); 169 rc = DBGFR3AsAdd(p VM, hDbgAs, NIL_RTPROCESS);170 rc = DBGFR3AsAdd(pUVM, hDbgAs, NIL_RTPROCESS); 170 171 AssertRCReturn(rc, rc); 171 172 RTDbgAsRetain(hDbgAs); 172 p VM->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; 173 174 RTDbgAsRetain(hDbgAs); 174 p VM->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; 175 176 176 177 rc = RTDbgAsCreate(&hDbgAs, 0, RTR0PTR_MAX, "HyperRing0"); 177 178 AssertRCReturn(rc, rc); 178 rc = DBGFR3AsAdd(p VM, hDbgAs, NIL_RTPROCESS);179 rc = DBGFR3AsAdd(pUVM, hDbgAs, NIL_RTPROCESS); 179 180 AssertRCReturn(rc, rc); 180 181 RTDbgAsRetain(hDbgAs); 181 p VM->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; 182 183 183 184 return VINF_SUCCESS; … … 207 208 * Terminates the address space parts of DBGF. 208 209 * 209 * @param p VM Pointer to the VM.210 */ 211 void dbgfR3AsTerm(P VM pVM)210 * @param pUVM The user mode VM handle. 211 */ 212 void dbgfR3AsTerm(PUVM pUVM) 212 213 { 213 214 /* 214 215 * Create the semaphore. 215 216 */ 216 int rc = RTSemRWDestroy(p VM->dbgf.s.hAsDbLock);217 int rc = RTSemRWDestroy(pUVM->dbgf.s.hAsDbLock); 217 218 AssertRC(rc); 218 p VM->dbgf.s.hAsDbLock = NIL_RTSEMRW;219 pUVM->dbgf.s.hAsDbLock = NIL_RTSEMRW; 219 220 220 221 /* 221 222 * Release all the address spaces. 222 223 */ 223 RTAvlPVDestroy(&p VM->dbgf.s.AsHandleTree, dbgfR3AsTermDestroyNode, NULL);224 for (size_t i = 0; i < RT_ELEMENTS(p VM->dbgf.s.ahAsAliases); i++)225 { 226 RTDbgAsRelease(p VM->dbgf.s.ahAsAliases[i]);227 p VM->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; 228 229 } 229 230 } … … 233 234 * Relocates the RC address space. 234 235 * 235 * @param p VM Pointer to the VM.236 * @param offDelta 237 */ 238 void dbgfR3AsRelocate(P VM pVM, RTGCUINTPTR offDelta)236 * @param pUVM The user mode VM handle. 237 * @param offDelta The relocation delta. 238 */ 239 void dbgfR3AsRelocate(PUVM pUVM, RTGCUINTPTR offDelta) 239 240 { 240 241 /** @todo */ 241 NOREF(p VM); NOREF(offDelta);242 NOREF(pUVM); NOREF(offDelta); 242 243 } 243 244 … … 247 248 * 248 249 * @returns VBox status code. 249 * @param p VM Pointer to the VM.250 * @param hDbgAs The address space handle. The reference of the251 * callerwill NOT be consumed.252 * @param ProcId 253 */ 254 VMMR3DECL(int) DBGFR3AsAdd(P VM 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 */ 255 VMMR3DECL(int) DBGFR3AsAdd(PUVM pUVM, RTDBGAS hDbgAs, RTPROCESS ProcId) 255 256 { 256 257 /* 257 258 * Input validation. 258 259 */ 259 VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);260 UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE); 260 261 const char *pszName = RTDbgAsName(hDbgAs); 261 262 if (!pszName) … … 269 270 */ 270 271 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)); 272 273 if (pDbNode) 273 274 { … … 276 277 pDbNode->NameCore.pszString = pszName; 277 278 pDbNode->NameCore.cchString = strlen(pszName); 278 DBGF_AS_DB_LOCK_WRITE(p VM);279 if (RTStrSpaceInsert(&p VM->dbgf.s.AsNameSpace, &pDbNode->NameCore))279 DBGF_AS_DB_LOCK_WRITE(pUVM); 280 if (RTStrSpaceInsert(&pUVM->dbgf.s.AsNameSpace, &pDbNode->NameCore)) 280 281 { 281 if (RTAvlPVInsert(&p VM->dbgf.s.AsHandleTree, &pDbNode->HandleCore))282 if (RTAvlPVInsert(&pUVM->dbgf.s.AsHandleTree, &pDbNode->HandleCore)) 282 283 { 283 DBGF_AS_DB_UNLOCK_WRITE(p VM);284 DBGF_AS_DB_UNLOCK_WRITE(pUVM); 284 285 return VINF_SUCCESS; 285 286 } 286 287 287 288 /* bail out */ 288 RTStrSpaceRemove(&p VM->dbgf.s.AsNameSpace, pszName);289 RTStrSpaceRemove(&pUVM->dbgf.s.AsNameSpace, pszName); 289 290 } 290 DBGF_AS_DB_UNLOCK_WRITE(p VM);291 DBGF_AS_DB_UNLOCK_WRITE(pUVM); 291 292 MMR3HeapFree(pDbNode); 292 293 } … … 305 306 * @retval VERR_NOT_FOUND if not found in the address space database. 306 307 * 307 * @param p VM Pointer to the VM.308 * @param hDbgAs 309 */ 310 VMMR3DECL(int) DBGFR3AsDelete(P VM pVM, RTDBGAS hDbgAs)308 * @param pUVM The user mode VM handle. 309 * @param hDbgAs The address space handle. Aliases are not allowed. 310 */ 311 VMMR3DECL(int) DBGFR3AsDelete(PUVM pUVM, RTDBGAS hDbgAs) 311 312 { 312 313 /* … … 314 315 * the lock as well as validated. 315 316 */ 316 VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);317 UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE); 317 318 if (hDbgAs == NIL_RTDBGAS) 318 319 return VINF_SUCCESS; … … 322 323 RTDbgAsRelease(hDbgAs); 323 324 324 DBGF_AS_DB_LOCK_WRITE(p VM);325 DBGF_AS_DB_LOCK_WRITE(pUVM); 325 326 326 327 /* 327 328 * You cannot delete any of the aliases. 328 329 */ 329 for (size_t i = 0; i < RT_ELEMENTS(p VM->dbgf.s.ahAsAliases); i++)330 if (p VM->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) 331 332 { 332 DBGF_AS_DB_UNLOCK_WRITE(p VM);333 DBGF_AS_DB_UNLOCK_WRITE(pUVM); 333 334 return VERR_SHARING_VIOLATION; 334 335 } … … 337 338 * Ok, try remove it from the database. 338 339 */ 339 PDBGFASDBNODE pDbNode = (PDBGFASDBNODE)RTAvlPVRemove(&p VM->dbgf.s.AsHandleTree, hDbgAs);340 PDBGFASDBNODE pDbNode = (PDBGFASDBNODE)RTAvlPVRemove(&pUVM->dbgf.s.AsHandleTree, hDbgAs); 340 341 if (!pDbNode) 341 342 { 342 DBGF_AS_DB_UNLOCK_WRITE(p VM);343 DBGF_AS_DB_UNLOCK_WRITE(pUVM); 343 344 return VERR_NOT_FOUND; 344 345 } 345 RTStrSpaceRemove(&p VM->dbgf.s.AsNameSpace, pDbNode->NameCore.pszString);346 RTStrSpaceRemove(&pUVM->dbgf.s.AsNameSpace, pDbNode->NameCore.pszString); 346 347 if (pDbNode->PidCore.Key != NIL_RTPROCESS) 347 RTAvlU32Remove(&p VM->dbgf.s.AsPidTree, pDbNode->PidCore.Key);348 349 DBGF_AS_DB_UNLOCK_WRITE(p VM);348 RTAvlU32Remove(&pUVM->dbgf.s.AsPidTree, pDbNode->PidCore.Key); 349 350 DBGF_AS_DB_UNLOCK_WRITE(pUVM); 350 351 351 352 /* … … 366 367 * 367 368 * @returns VBox status code. 368 * @param p VM Pointer to the VM.369 * @param hAlias 370 * @param hAliasFor The address space hAlias should be an alias for.371 * This can be an alias. The caller's reference to372 * this addressspace will NOT be consumed.373 */ 374 VMMR3DECL(int) DBGFR3AsSetAlias(P VM 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 */ 375 VMMR3DECL(int) DBGFR3AsSetAlias(PUVM pUVM, RTDBGAS hAlias, RTDBGAS hAliasFor) 375 376 { 376 377 /* 377 378 * Input validation. 378 379 */ 379 VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);380 UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE); 380 381 AssertMsgReturn(DBGF_AS_IS_ALIAS(hAlias), ("%p\n", hAlias), VERR_INVALID_PARAMETER); 381 382 AssertMsgReturn(!DBGF_AS_IS_FIXED_ALIAS(hAlias), ("%p\n", hAlias), VERR_INVALID_PARAMETER); 382 RTDBGAS hRealAliasFor = DBGFR3AsResolveAndRetain(p VM, hAliasFor);383 RTDBGAS hRealAliasFor = DBGFR3AsResolveAndRetain(pUVM, hAliasFor); 383 384 if (hRealAliasFor == NIL_RTDBGAS) 384 385 return VERR_INVALID_HANDLE; … … 388 389 */ 389 390 int rc = VERR_NOT_FOUND; 390 DBGF_AS_DB_LOCK_WRITE(p VM);391 if (RTAvlPVGet(&p VM->dbgf.s.AsHandleTree, hRealAliasFor))391 DBGF_AS_DB_LOCK_WRITE(pUVM); 392 if (RTAvlPVGet(&pUVM->dbgf.s.AsHandleTree, hRealAliasFor)) 392 393 { 393 394 /* … … 395 396 */ 396 397 RTDBGAS hAsOld; 397 ASMAtomicXchgHandle(&p VM->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); 398 399 uint32_t cRefs = RTDbgAsRelease(hAsOld); 399 400 Assert(cRefs > 0); Assert(cRefs != UINT32_MAX); NOREF(cRefs); 400 401 rc = VINF_SUCCESS; 401 402 } 402 DBGF_AS_DB_UNLOCK_WRITE(p VM);403 DBGF_AS_DB_UNLOCK_WRITE(pUVM); 403 404 404 405 return rc; … … 437 438 * Lazily populates the specified address space. 438 439 * 439 * @param p VM Pointer to the VM.440 * @param hAlias 441 */ 442 static void dbgfR3AsLazyPopulate(P VM pVM, RTDBGAS hAlias)443 { 444 DBGF_AS_DB_LOCK_WRITE(p VM);440 * @param pUVM The user mode VM handle. 441 * @param hAlias The alias. 442 */ 443 static void dbgfR3AsLazyPopulate(PUVM pUVM, RTDBGAS hAlias) 444 { 445 DBGF_AS_DB_LOCK_WRITE(pUVM); 445 446 uintptr_t iAlias = DBGF_AS_ALIAS_2_INDEX(hAlias); 446 if (!p VM->dbgf.s.afAsAliasPopuplated[iAlias])447 { 448 RTDBGAS hAs = p VM->dbgf.s.ahAsAliases[iAlias];449 if (hAlias == DBGF_AS_R0 )450 PDMR3LdrEnumModules(p VM, 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); 451 452 /** @todo what do we do about DBGF_AS_RC? */ 452 453 453 p VM->dbgf.s.afAsAliasPopuplated[iAlias] = true;454 } 455 DBGF_AS_DB_UNLOCK_WRITE(p VM);454 pUVM->dbgf.s.afAsAliasPopuplated[iAlias] = true; 455 } 456 DBGF_AS_DB_UNLOCK_WRITE(pUVM); 456 457 } 457 458 … … 462 463 * @returns Real address space handle. NIL_RTDBGAS if invalid handle. 463 464 * 464 * @param p VM Pointer to the VM.465 * @param hAlias 465 * @param pUVM The user mode VM handle. 466 * @param hAlias The possibly address space alias. 466 467 * 467 468 * @remarks Doesn't take any locks. 468 469 */ 469 VMMR3DECL(RTDBGAS) DBGFR3AsResolve(P VM pVM, RTDBGAS hAlias)470 { 471 VM_ASSERT_VALID_EXT_RETURN(pVM, NULL);470 VMMR3DECL(RTDBGAS) DBGFR3AsResolve(PUVM pUVM, RTDBGAS hAlias) 471 { 472 UVM_ASSERT_VALID_EXT_RETURN(pUVM, NULL); 472 473 AssertCompileNS(NIL_RTDBGAS == (RTDBGAS)0); 473 474 474 475 uintptr_t iAlias = DBGF_AS_ALIAS_2_INDEX(hAlias); 475 476 if (iAlias < DBGF_AS_COUNT) 476 ASMAtomicReadHandle(&p VM->dbgf.s.ahAsAliases[iAlias], &hAlias);477 ASMAtomicReadHandle(&pUVM->dbgf.s.ahAsAliases[iAlias], &hAlias); 477 478 return hAlias; 478 479 } … … 485 486 * @returns Real address space handle. NIL_RTDBGAS if invalid handle. 486 487 * 487 * @param p VM Pointer to the VM.488 * @param hAlias 489 */ 490 VMMR3DECL(RTDBGAS) DBGFR3AsResolveAndRetain(P VM 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 */ 491 VMMR3DECL(RTDBGAS) DBGFR3AsResolveAndRetain(PUVM pUVM, RTDBGAS hAlias) 492 { 493 UVM_ASSERT_VALID_EXT_RETURN(pUVM, NULL); 493 494 AssertCompileNS(NIL_RTDBGAS == (RTDBGAS)0); 494 495 … … 500 501 { 501 502 /* Perform lazy address space population. */ 502 if (!p VM->dbgf.s.afAsAliasPopuplated[iAlias])503 dbgfR3AsLazyPopulate(p VM, hAlias);503 if (!pUVM->dbgf.s.afAsAliasPopuplated[iAlias]) 504 dbgfR3AsLazyPopulate(pUVM, hAlias); 504 505 505 506 /* Won't ever change, no need to grab the lock. */ 506 hAlias = p VM->dbgf.s.ahAsAliases[iAlias];507 hAlias = pUVM->dbgf.s.ahAsAliases[iAlias]; 507 508 cRefs = RTDbgAsRetain(hAlias); 508 509 } … … 510 511 { 511 512 /* May change, grab the lock so we can read it safely. */ 512 DBGF_AS_DB_LOCK_READ(p VM);513 hAlias = p VM->dbgf.s.ahAsAliases[iAlias];513 DBGF_AS_DB_LOCK_READ(pUVM); 514 hAlias = pUVM->dbgf.s.ahAsAliases[iAlias]; 514 515 cRefs = RTDbgAsRetain(hAlias); 515 DBGF_AS_DB_UNLOCK_READ(p VM);516 DBGF_AS_DB_UNLOCK_READ(pUVM); 516 517 } 517 518 } … … 529 530 * @returns Retained address space handle if found, NIL_RTDBGAS if not. 530 531 * 531 * @param p VM Pointer to the VM.532 * @param pUVM The user mode VM handle. 532 533 * @param pszName The name. 533 534 */ 534 VMMR3DECL(RTDBGAS) DBGFR3AsQueryByName(P VM pVM, const char *pszName)535 VMMR3DECL(RTDBGAS) DBGFR3AsQueryByName(PUVM pUVM, const char *pszName) 535 536 { 536 537 /* 537 538 * Validate the input. 538 539 */ 539 VM_ASSERT_VALID_EXT_RETURN(pVM, NIL_RTDBGAS);540 UVM_ASSERT_VALID_EXT_RETURN(pUVM, NIL_RTDBGAS); 540 541 AssertPtrReturn(pszName, NIL_RTDBGAS); 541 542 AssertReturn(*pszName, NIL_RTDBGAS); … … 545 546 */ 546 547 RTDBGAS hDbgAs = NIL_RTDBGAS; 547 DBGF_AS_DB_LOCK_READ(p VM);548 549 PRTSTRSPACECORE pNode = RTStrSpaceGet(&p VM->dbgf.s.AsNameSpace, pszName);548 DBGF_AS_DB_LOCK_READ(pUVM); 549 550 PRTSTRSPACECORE pNode = RTStrSpaceGet(&pUVM->dbgf.s.AsNameSpace, pszName); 550 551 if (pNode) 551 552 { … … 556 557 hDbgAs = NIL_RTDBGAS; 557 558 } 558 DBGF_AS_DB_UNLOCK_READ(pVM); 559 559 560 DBGF_AS_DB_UNLOCK_READ(pUVM); 560 561 return hDbgAs; 561 562 } … … 567 568 * @returns Retained address space handle if found, NIL_RTDBGAS if not. 568 569 * 569 * @param p VM Pointer to the VM.570 * @param pUVM The user mode VM handle. 570 571 * @param ProcId The process ID. 571 572 */ 572 VMMR3DECL(RTDBGAS) DBGFR3AsQueryByPid(P VM pVM, RTPROCESS ProcId)573 VMMR3DECL(RTDBGAS) DBGFR3AsQueryByPid(PUVM pUVM, RTPROCESS ProcId) 573 574 { 574 575 /* 575 576 * Validate the input. 576 577 */ 577 VM_ASSERT_VALID_EXT_RETURN(pVM, NIL_RTDBGAS);578 UVM_ASSERT_VALID_EXT_RETURN(pUVM, NIL_RTDBGAS); 578 579 AssertReturn(ProcId != NIL_RTPROCESS, NIL_RTDBGAS); 579 580 … … 582 583 */ 583 584 RTDBGAS hDbgAs = NIL_RTDBGAS; 584 DBGF_AS_DB_LOCK_READ(p VM);585 586 PAVLU32NODECORE pNode = RTAvlU32Get(&p VM->dbgf.s.AsPidTree, ProcId);585 DBGF_AS_DB_LOCK_READ(pUVM); 586 587 PAVLU32NODECORE pNode = RTAvlU32Get(&pUVM->dbgf.s.AsPidTree, ProcId); 587 588 if (pNode) 588 589 { … … 593 594 hDbgAs = NIL_RTDBGAS; 594 595 } 595 DBGF_AS_DB_UNLOCK_READ(p VM);596 DBGF_AS_DB_UNLOCK_READ(pUVM); 596 597 597 598 return hDbgAs; … … 717 718 * 718 719 * @returns VBox status code. 720 * @param pUVM The user mode VM handle. 719 721 * @param pszFilename The filename. 720 722 * @param pszCfgValue The name of the config variable (under /DBGF/). … … 722 724 * @param pvUser User argument for the callback. 723 725 */ 724 static int dbgfR3AsSearchCfgPath(PVM pVM, const char *pszFilename, const char *pszCfgValue, PFNDBGFR3ASSEARCHOPEN pfnOpen, void *pvUser) 726 static int dbgfR3AsSearchCfgPath(PUVM pUVM, const char *pszFilename, const char *pszCfgValue, 727 PFNDBGFR3ASSEARCHOPEN pfnOpen, void *pvUser) 725 728 { 726 729 char *pszPath; 727 int rc = CFGMR3QueryStringAllocDef(CFGMR3GetChild(CFGMR3GetRoot (pVM), "/DBGF"), pszCfgValue, &pszPath, NULL);730 int rc = CFGMR3QueryStringAllocDef(CFGMR3GetChild(CFGMR3GetRootU(pUVM), "/DBGF"), pszCfgValue, &pszPath, NULL); 728 731 if (RT_FAILURE(rc)) 729 732 return rc; … … 758 761 * @returns VBox status code. 759 762 * 760 * @param p VM Pointer to the VM.763 * @param pUVM The user mode VM handle. 761 764 * @param hDbgAs The address space. 762 765 * @param pszFilename The filename of the executable module. … … 768 771 * @param fFlags Flags reserved for future extensions, must be 0. 769 772 */ 770 VMMR3DECL(int) DBGFR3AsLoadImage(P VM pVM, RTDBGAS hDbgAs, const char *pszFilename, const char *pszModName, PCDBGFADDRESS pModAddress, RTDBGSEGIDX iModSeg, uint32_t fFlags)773 VMMR3DECL(int) DBGFR3AsLoadImage(PUVM pUVM, RTDBGAS hDbgAs, const char *pszFilename, const char *pszModName, PCDBGFADDRESS pModAddress, RTDBGSEGIDX iModSeg, uint32_t fFlags) 771 774 { 772 775 /* 773 776 * Validate input 774 777 */ 778 UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE); 775 779 AssertPtrReturn(pszFilename, VERR_INVALID_POINTER); 776 780 AssertReturn(*pszFilename, VERR_INVALID_PARAMETER); 777 AssertReturn(DBGFR3AddrIsValid(p VM, pModAddress), VERR_INVALID_PARAMETER);781 AssertReturn(DBGFR3AddrIsValid(pUVM, pModAddress), VERR_INVALID_PARAMETER); 778 782 AssertReturn(fFlags == 0, VERR_INVALID_PARAMETER); 779 RTDBGAS hRealAS = DBGFR3AsResolveAndRetain(p VM, hDbgAs);783 RTDBGAS hRealAS = DBGFR3AsResolveAndRetain(pUVM, hDbgAs); 780 784 if (hRealAS == NIL_RTDBGAS) 781 785 return VERR_INVALID_HANDLE; … … 789 793 Data.fFlags = 0; 790 794 Data.hMod = NIL_RTDBGMOD; 791 int rc = dbgfR3AsSearchCfgPath(p VM, pszFilename, "ImagePath", dbgfR3AsLoadImageOpen, &Data);795 int rc = dbgfR3AsSearchCfgPath(pUVM, pszFilename, "ImagePath", dbgfR3AsLoadImageOpen, &Data); 792 796 if (RT_FAILURE(rc)) 793 797 rc = dbgfR3AsSearchEnvPath(pszFilename, "VBOXDBG_IMAGE_PATH", dbgfR3AsLoadImageOpen, &Data); 794 798 if (RT_FAILURE(rc)) 795 rc = dbgfR3AsSearchCfgPath(p VM, pszFilename, "Path", dbgfR3AsLoadImageOpen, &Data);799 rc = dbgfR3AsSearchCfgPath(pUVM, pszFilename, "Path", dbgfR3AsLoadImageOpen, &Data); 796 800 if (RT_FAILURE(rc)) 797 801 rc = dbgfR3AsSearchEnvPath(pszFilename, "VBOXDBG_PATH", dbgfR3AsLoadImageOpen, &Data); 798 802 if (RT_SUCCESS(rc)) 799 803 { 800 rc = DBGFR3AsLinkModule(p VM, hRealAS, Data.hMod, pModAddress, iModSeg, 0);804 rc = DBGFR3AsLinkModule(pUVM, hRealAS, Data.hMod, pModAddress, iModSeg, 0); 801 805 if (RT_FAILURE(rc)) 802 806 RTDbgModRelease(Data.hMod); … … 830 834 * @returns VBox status code. 831 835 * 832 * @param p VM Pointer to the VM.836 * @param pUVM The user mode VM handle. 833 837 * @param hDbgAs The address space. 834 838 * @param pszFilename The map file. … … 843 847 * @param fFlags Flags reserved for future extensions, must be 0. 844 848 */ 845 VMMR3DECL(int) DBGFR3AsLoadMap(P VM pVM, RTDBGAS hDbgAs, const char *pszFilename, const char *pszModName,849 VMMR3DECL(int) DBGFR3AsLoadMap(PUVM pUVM, RTDBGAS hDbgAs, const char *pszFilename, const char *pszModName, 846 850 PCDBGFADDRESS pModAddress, RTDBGSEGIDX iModSeg, RTGCUINTPTR uSubtrahend, uint32_t fFlags) 847 851 { … … 849 853 * Validate input 850 854 */ 855 UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE); 851 856 AssertPtrReturn(pszFilename, VERR_INVALID_POINTER); 852 857 AssertReturn(*pszFilename, VERR_INVALID_PARAMETER); 853 AssertReturn(DBGFR3AddrIsValid(p VM, pModAddress), VERR_INVALID_PARAMETER);858 AssertReturn(DBGFR3AddrIsValid(pUVM, pModAddress), VERR_INVALID_PARAMETER); 854 859 AssertReturn(fFlags == 0, VERR_INVALID_PARAMETER); 855 RTDBGAS hRealAS = DBGFR3AsResolveAndRetain(p VM, hDbgAs);860 RTDBGAS hRealAS = DBGFR3AsResolveAndRetain(pUVM, hDbgAs); 856 861 if (hRealAS == NIL_RTDBGAS) 857 862 return VERR_INVALID_HANDLE; … … 865 870 Data.fFlags = 0; 866 871 Data.hMod = NIL_RTDBGMOD; 867 int rc = dbgfR3AsSearchCfgPath(p VM, pszFilename, "MapPath", dbgfR3AsLoadMapOpen, &Data);872 int rc = dbgfR3AsSearchCfgPath(pUVM, pszFilename, "MapPath", dbgfR3AsLoadMapOpen, &Data); 868 873 if (RT_FAILURE(rc)) 869 874 rc = dbgfR3AsSearchEnvPath(pszFilename, "VBOXDBG_MAP_PATH", dbgfR3AsLoadMapOpen, &Data); 870 875 if (RT_FAILURE(rc)) 871 rc = dbgfR3AsSearchCfgPath(p VM, pszFilename, "Path", dbgfR3AsLoadMapOpen, &Data);876 rc = dbgfR3AsSearchCfgPath(pUVM, pszFilename, "Path", dbgfR3AsLoadMapOpen, &Data); 872 877 if (RT_FAILURE(rc)) 873 878 rc = dbgfR3AsSearchEnvPath(pszFilename, "VBOXDBG_PATH", dbgfR3AsLoadMapOpen, &Data); 874 879 if (RT_SUCCESS(rc)) 875 880 { 876 rc = DBGFR3AsLinkModule(p VM, hRealAS, Data.hMod, pModAddress, iModSeg, 0);881 rc = DBGFR3AsLinkModule(pUVM, hRealAS, Data.hMod, pModAddress, iModSeg, 0); 877 882 if (RT_FAILURE(rc)) 878 883 RTDbgModRelease(Data.hMod); … … 888 893 * 889 894 * @returns VBox status code. 890 * @param p VM Pointer to the VM.895 * @param pUVM The user mode VM handle. 891 896 * @param hDbgAs The address space handle. 892 897 * @param hMod The module handle. … … 895 900 * @param fFlags Flags to pass to the link functions, see RTDBGASLINK_FLAGS_*. 896 901 */ 897 VMMR3DECL(int) DBGFR3AsLinkModule(PVM pVM, RTDBGAS hDbgAs, RTDBGMOD hMod, PCDBGFADDRESS pModAddress, RTDBGSEGIDX iModSeg, uint32_t fFlags) 902 VMMR3DECL(int) DBGFR3AsLinkModule(PUVM pUVM, RTDBGAS hDbgAs, RTDBGMOD hMod, PCDBGFADDRESS pModAddress, 903 RTDBGSEGIDX iModSeg, uint32_t fFlags) 898 904 { 899 905 /* 900 906 * Input validation. 901 907 */ 902 VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);903 AssertReturn(DBGFR3AddrIsValid(p VM, pModAddress), VERR_INVALID_PARAMETER);904 RTDBGAS hRealAS = DBGFR3AsResolveAndRetain(p VM, 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); 905 911 if (hRealAS == NIL_RTDBGAS) 906 912 return VERR_INVALID_HANDLE; … … 967 973 * @returns VBox status code. See RTDbgAsSymbolByAddr. 968 974 * 969 * @param p VM Pointer to the VM.970 * @param hDbgAs 971 * @param pAddress 972 * @param poffDisp Where to return the distance between the973 * returnedsymbol and pAddress. Optional.974 * @param pSymbol Where to return the symbol information.975 * The returned symbol name will be prefixed by976 * the module name asfar as space allows.977 * @param phMod 978 */ 979 VMMR3DECL(int) DBGFR3AsSymbolByAddr(P VM 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 */ 985 VMMR3DECL(int) DBGFR3AsSymbolByAddr(PUVM pUVM, RTDBGAS hDbgAs, PCDBGFADDRESS pAddress, 980 986 PRTGCINTPTR poffDisp, PRTDBGSYMBOL pSymbol, PRTDBGMOD phMod) 981 987 { … … 985 991 if (hDbgAs == DBGF_AS_RC_AND_GC_GLOBAL) 986 992 { 987 int rc = DBGFR3AsSymbolByAddr(p VM, DBGF_AS_RC, pAddress, poffDisp, pSymbol, phMod);993 int rc = DBGFR3AsSymbolByAddr(pUVM, DBGF_AS_RC, pAddress, poffDisp, pSymbol, phMod); 988 994 if (RT_FAILURE(rc)) 989 rc = DBGFR3AsSymbolByAddr(p VM, DBGF_AS_GLOBAL, pAddress, poffDisp, pSymbol, phMod);995 rc = DBGFR3AsSymbolByAddr(pUVM, DBGF_AS_GLOBAL, pAddress, poffDisp, pSymbol, phMod); 990 996 return rc; 991 997 } … … 994 1000 * Input validation. 995 1001 */ 996 VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);997 AssertReturn(DBGFR3AddrIsValid(p VM, pAddress), VERR_INVALID_PARAMETER);1002 UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE); 1003 AssertReturn(DBGFR3AddrIsValid(pUVM, pAddress), VERR_INVALID_PARAMETER); 998 1004 AssertPtrNullReturn(poffDisp, VERR_INVALID_POINTER); 999 1005 AssertPtrReturn(pSymbol, VERR_INVALID_POINTER); … … 1003 1009 if (phMod) 1004 1010 *phMod = NIL_RTDBGMOD; 1005 RTDBGAS hRealAS = DBGFR3AsResolveAndRetain(p VM, hDbgAs);1011 RTDBGAS hRealAS = DBGFR3AsResolveAndRetain(pUVM, hDbgAs); 1006 1012 if (hRealAS == NIL_RTDBGAS) 1007 1013 return VERR_INVALID_HANDLE; … … 1022 1028 { 1023 1029 DBGFSYMBOL DbgfSym; 1024 rc = DBGFR3SymbolByAddr(p VM, pAddress->FlatPtr, poffDisp, &DbgfSym);1030 rc = DBGFR3SymbolByAddr(pUVM->pVM, pAddress->FlatPtr, poffDisp, &DbgfSym); 1025 1031 if (RT_SUCCESS(rc)) 1026 1032 dbgfR3AsSymbolConvert(pSymbol, &DbgfSym); … … 1032 1038 RTR0PTR R0PtrNearSym; 1033 1039 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, 1035 1042 pSymbol->szName, sizeof(pSymbol->szName) / 2, &R0PtrMod, 1036 1043 &szNearSym[0], sizeof(szNearSym), &R0PtrNearSym, … … 1066 1073 * occurs. 1067 1074 * 1068 * @param p VM Pointer to the VM.1069 * @param hDbgAs 1070 * @param pAddress 1071 * @param poffDisp 1072 * @param phMod 1073 */ 1074 VMMR3DECL(PRTDBGSYMBOL) DBGFR3AsSymbolByAddrA(P VM 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 */ 1081 VMMR3DECL(PRTDBGSYMBOL) DBGFR3AsSymbolByAddrA(PUVM pUVM, RTDBGAS hDbgAs, PCDBGFADDRESS pAddress, PRTGCINTPTR poffDisp, PRTDBGMOD phMod) 1075 1082 { 1076 1083 RTDBGSYMBOL SymInfo; 1077 int rc = DBGFR3AsSymbolByAddr(p VM, hDbgAs, pAddress, poffDisp, &SymInfo, phMod);1084 int rc = DBGFR3AsSymbolByAddr(pUVM, hDbgAs, pAddress, poffDisp, &SymInfo, phMod); 1078 1085 if (RT_SUCCESS(rc)) 1079 1086 return RTDbgSymbolDup(&SymInfo); … … 1091 1098 * @returns VBox status code. See RTDbgAsSymbolByAddr. 1092 1099 * 1093 * @param p VM Pointer to the VM.1094 * @param hDbgAs 1095 * @param pszSymbol 1096 * 1097 * @param pSymbol 1098 * 1099 * 1100 * @param phMod 1101 */ 1102 VMMR3DECL(int) DBGFR3AsSymbolByName(P VM 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 */ 1109 VMMR3DECL(int) DBGFR3AsSymbolByName(PUVM pUVM, RTDBGAS hDbgAs, const char *pszSymbol, 1103 1110 PRTDBGSYMBOL pSymbol, PRTDBGMOD phMod) 1104 1111 { … … 1108 1115 if (hDbgAs == DBGF_AS_RC_AND_GC_GLOBAL) 1109 1116 { 1110 int rc = DBGFR3AsSymbolByName(p VM, DBGF_AS_RC, pszSymbol, pSymbol, phMod);1117 int rc = DBGFR3AsSymbolByName(pUVM, DBGF_AS_RC, pszSymbol, pSymbol, phMod); 1111 1118 if (RT_FAILURE(rc)) 1112 rc = DBGFR3AsSymbolByName(p VM, DBGF_AS_GLOBAL, pszSymbol, pSymbol, phMod);1119 rc = DBGFR3AsSymbolByName(pUVM, DBGF_AS_GLOBAL, pszSymbol, pSymbol, phMod); 1113 1120 return rc; 1114 1121 } … … 1117 1124 * Input validation. 1118 1125 */ 1119 VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);1126 UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE); 1120 1127 AssertPtrReturn(pSymbol, VERR_INVALID_POINTER); 1121 1128 AssertPtrNullReturn(phMod, VERR_INVALID_POINTER); 1122 1129 if (phMod) 1123 1130 *phMod = NIL_RTDBGMOD; 1124 RTDBGAS hRealAS = DBGFR3AsResolveAndRetain(p VM, hDbgAs);1131 RTDBGAS hRealAS = DBGFR3AsResolveAndRetain(pUVM, hDbgAs); 1125 1132 if (hRealAS == NIL_RTDBGAS) 1126 1133 return VERR_INVALID_HANDLE; … … 1142 1149 { 1143 1150 DBGFSYMBOL DbgfSym; 1144 rc = DBGFR3SymbolByName(p VM, pszSymbol, &DbgfSym);1151 rc = DBGFR3SymbolByName(pUVM->pVM, pszSymbol, &DbgfSym); 1145 1152 if (RT_SUCCESS(rc)) 1146 1153 dbgfR3AsSymbolConvert(pSymbol, &DbgfSym); -
trunk/src/VBox/VMM/VMMR3/DBGFBp.cpp
r42834 r44399 28 28 # include <VBox/vmm/iem.h> 29 29 #endif 30 #include <VBox/vmm/mm.h> 30 31 #include "DBGFInternal.h" 31 32 #include <VBox/vmm/vm.h> 32 #include <VBox/vmm/mm.h> 33 #include <VBox/vmm/uvm.h> 34 33 35 #include <VBox/err.h> 34 36 #include <VBox/log.h> … … 41 43 *******************************************************************************/ 42 44 RT_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);51 45 static 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); 46 static int dbgfR3BpInt3Arm(PUVM pUVM, PDBGFBP pBp); 55 47 RT_C_DECLS_END 56 48 … … 279 271 * 280 272 * @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 */ 282 static 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. 282 348 * @param pAddress The address of the breakpoint. 283 349 * @param iHitTrigger The hit count at which the breakpoint start triggering. … … 288 354 * @thread Any thread. 289 355 */ 290 VMMR3DECL(int) DBGFR3BpSet(P VM pVM, PCDBGFADDRESS pAddress, uint64_t iHitTrigger, uint64_t iHitDisable, uint32_t *piBp)356 VMMR3DECL(int) DBGFR3BpSet(PUVM pUVM, PCDBGFADDRESS pAddress, uint64_t iHitTrigger, uint64_t iHitDisable, uint32_t *piBp) 291 357 { 292 358 /* … … 294 360 */ 295 361 /** @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); 297 364 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 else367 dbgfR3BpFree(pVM, pBp);368 369 365 return rc; 370 366 } … … 376 372 * 377 373 * @returns VBox status code. 378 * @param p VM Pointer to the VM.374 * @param pUVM The user mode VM handle. 379 375 * @param pBp The breakpoint. 380 376 */ 381 static int dbgfR3BpInt3Arm(P VM pVM, PDBGFBP pBp)377 static int dbgfR3BpInt3Arm(PUVM pUVM, PDBGFBP pBp) 382 378 { 383 379 /** @todo should actually use physical address here! */ 384 380 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 */ 407 static int dbgfR3BpInt3Disarm(PUVM pUVM, PDBGFBP pBp) 408 { 385 409 /* @todo SMP support! */ 386 410 VMCPUID idCpu = 0; 387 411 388 412 /* 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 /*417 413 * Check that the current byte is the int3 instruction, and restore the original one. 418 414 * We currently ignore invalid bytes. 419 415 */ 420 416 DBGFADDRESS Addr; 421 DBGFR3AddrFromFlat(p VM, &Addr, pBp->GCPtr);417 DBGFR3AddrFromFlat(pUVM, &Addr, pBp->GCPtr); 422 418 uint8_t bCurrent; 423 int rc = DBGFR3MemRead(p VM, idCpu, &Addr, &bCurrent, 1);419 int rc = DBGFR3MemRead(pUVM, idCpu, &Addr, &bCurrent, 1); 424 420 if (bCurrent == 0xcc) 425 rc = DBGFR3MemWrite(p VM, idCpu, &Addr, &pBp->u.Int3.bOrg, 1);421 rc = DBGFR3MemWrite(pUVM, idCpu, &Addr, &pBp->u.Int3.bOrg, 1); 426 422 return rc; 427 423 } … … 432 428 * 433 429 * @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. 465 431 * @param pAddress The address of the breakpoint. 466 432 * @param piHitTrigger The hit count at which the breakpoint start triggering. … … 475 441 * @internal 476 442 */ 477 static DECLCALLBACK(int) dbgfR3BpSetReg(P VM pVM, PCDBGFADDRESS pAddress, uint64_t *piHitTrigger, uint64_t *piHitDisable,443 static DECLCALLBACK(int) dbgfR3BpSetReg(PUVM pUVM, PCDBGFADDRESS pAddress, uint64_t *piHitTrigger, uint64_t *piHitDisable, 478 444 uint8_t fType, uint8_t cb, uint32_t *piBp) 479 445 { … … 481 447 * Validate input. 482 448 */ 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)) 484 452 return VERR_INVALID_PARAMETER; 485 453 if (*piHitTrigger > *piHitDisable) … … 565 533 566 534 /** 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. 607 539 * @param pAddress The address of the breakpoint. 608 540 * @param iHitTrigger The hit count at which the breakpoint start triggering. … … 610 542 * @param iHitDisable The hit count which disables the breakpoint. 611 543 * 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. 612 547 * @param piBp Where to store the breakpoint id. (optional) 613 548 * @thread Any thread. 614 549 */ 615 VMMR3DECL(int) DBGFR3BpSetREM(PVM pVM, PCDBGFADDRESS pAddress, uint64_t iHitTrigger, uint64_t iHitDisable, uint32_t *piBp) 550 VMMR3DECL(int) DBGFR3BpSetReg(PUVM pUVM, PCDBGFADDRESS pAddress, uint64_t iHitTrigger, uint64_t iHitDisable, 551 uint8_t fType, uint8_t cb, uint32_t *piBp) 616 552 { 617 553 /* 618 554 * This must be done on EMT. 619 555 */ 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} */ 565 DECLCALLBACK(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 */ 580 static 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 */ 595 static int dbgfR3BpRegDisarm(PVM pVM, PDBGFBP pBp) 596 { 597 Assert(!pBp->fEnabled); 598 return VMMR3EmtRendezvous(pVM, VMMEMTRENDEZVOUS_FLAGS_TYPE_ALL_AT_ONCE, dbgfR3BpRegRecalcOnCpu, NULL); 623 599 } 624 600 … … 628 604 * 629 605 * @returns VBox status code. 630 * @param p VM Pointer to the VM.606 * @param pUVM The user mode VM handle. 631 607 * @param pAddress The address of the breakpoint. 632 608 * @param piHitTrigger The hit count at which the breakpoint start triggering. … … 638 614 * @internal 639 615 */ 640 static DECLCALLBACK(int) dbgfR3BpSetREM(PVM pVM, PCDBGFADDRESS pAddress, uint64_t *piHitTrigger, uint64_t *piHitDisable, uint32_t *piBp) 616 static DECLCALLBACK(int) dbgfR3BpSetREM(PUVM pUVM, PCDBGFADDRESS pAddress, uint64_t *piHitTrigger, 617 uint64_t *piHitDisable, uint32_t *piBp) 641 618 { 642 619 /* 643 620 * Validate input. 644 621 */ 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)) 646 625 return VERR_INVALID_PARAMETER; 647 626 if (*piHitTrigger > *piHitDisable) … … 706 685 707 686 /** 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) 713 697 * @thread Any thread. 714 698 */ 715 VMMR3DECL(int) DBGFR3Bp Clear(PVM pVM, uint32_tiBp)699 VMMR3DECL(int) DBGFR3BpSetREM(PUVM pUVM, PCDBGFADDRESS pAddress, uint64_t iHitTrigger, uint64_t iHitDisable, uint32_t *piBp) 716 700 { 717 701 /* 718 702 * This must be done on EMT. 719 703 */ 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)); 722 707 return rc; 723 708 } … … 728 713 * 729 714 * @returns VBox status code. 730 * @param p VM Pointer to the VM.715 * @param pUVM The user mode VM handle. 731 716 * @param iBp The id of the breakpoint which should be removed (cleared). 732 717 * @thread EMT 733 718 * @internal 734 719 */ 735 static DECLCALLBACK(int) dbgfR3BpClear(P VM pVM, uint32_t iBp)720 static DECLCALLBACK(int) dbgfR3BpClear(PUVM pUVM, uint32_t iBp) 736 721 { 737 722 /* 738 723 * Validate input. 739 724 */ 725 PVM pVM = pUVM->pVM; 726 VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE); 740 727 PDBGFBP pBp = dbgfR3BpGet(pVM, iBp); 741 728 if (!pBp) … … 756 743 757 744 case DBGFBPTYPE_INT3: 758 rc = dbgfR3BpInt3Disarm(p VM, pBp);745 rc = dbgfR3BpInt3Disarm(pUVM, pBp); 759 746 break; 760 747 … … 782 769 783 770 /** 784 * Enables a breakpoint.785 * 786 * @returns VBox status code. 787 * @param p VM 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). 789 776 * @thread Any thread. 790 777 */ 791 VMMR3DECL(int) DBGFR3Bp Enable(PVM pVM, uint32_t iBp)778 VMMR3DECL(int) DBGFR3BpClear(PUVM pUVM, uint32_t iBp) 792 779 { 793 780 /* 794 781 * This must be done on EMT. 795 782 */ 796 int rc = VMR3ReqPriorityCallWait (pVM, VMCPUID_ANY, (PFNRT)dbgfR3BpEnable, 2, pVM, iBp);797 LogFlow(("DBGFR3Bp Enable: returns %Rrc\n", rc));783 int rc = VMR3ReqPriorityCallWaitU(pUVM, VMCPUID_ANY, (PFNRT)dbgfR3BpClear, 2, pUVM, iBp); 784 LogFlow(("DBGFR3BpClear: returns %Rrc\n", rc)); 798 785 return rc; 799 786 } … … 804 791 * 805 792 * @returns VBox status code. 806 * @param p VM Pointer to the VM.793 * @param pUVM The user mode VM handle. 807 794 * @param iBp The id of the breakpoint which should be enabled. 808 795 * @thread EMT 809 796 * @internal 810 797 */ 811 static DECLCALLBACK(int) dbgfR3BpEnable(P VM pVM, uint32_t iBp)798 static DECLCALLBACK(int) dbgfR3BpEnable(PUVM pUVM, uint32_t iBp) 812 799 { 813 800 /* 814 801 * Validate input. 815 802 */ 803 PVM pVM = pUVM->pVM; 804 VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE); 816 805 PDBGFBP pBp = dbgfR3BpGet(pVM, iBp); 817 806 if (!pBp) … … 836 825 837 826 case DBGFBPTYPE_INT3: 838 rc = dbgfR3BpInt3Arm(p VM, pBp);827 rc = dbgfR3BpInt3Arm(pUVM, pBp); 839 828 break; 840 829 … … 858 847 859 848 /** 860 * Disables a breakpoint.861 * 862 * @returns VBox status code. 863 * @param p VM 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. 865 854 * @thread Any thread. 866 855 */ 867 VMMR3DECL(int) DBGFR3Bp Disable(PVM pVM, uint32_t iBp)856 VMMR3DECL(int) DBGFR3BpEnable(PUVM pUVM, uint32_t iBp) 868 857 { 869 858 /* 870 859 * This must be done on EMT. 871 860 */ 872 int rc = VMR3ReqPriorityCallWait (pVM, VMCPUID_ANY, (PFNRT)dbgfR3BpDisable, 2, pVM, iBp);873 LogFlow(("DBGFR3Bp Disable: returns %Rrc\n", rc));861 int rc = VMR3ReqPriorityCallWaitU(pUVM, VMCPUID_ANY, (PFNRT)dbgfR3BpEnable, 2, pUVM, iBp); 862 LogFlow(("DBGFR3BpEnable: returns %Rrc\n", rc)); 874 863 return rc; 875 864 } … … 880 869 * 881 870 * @returns VBox status code. 882 * @param p VM Pointer to the VM.871 * @param pUVM The user mode VM handle. 883 872 * @param iBp The id of the breakpoint which should be disabled. 884 873 * @thread EMT 885 874 * @internal 886 875 */ 887 static DECLCALLBACK(int) dbgfR3BpDisable(P VM pVM, uint32_t iBp)876 static DECLCALLBACK(int) dbgfR3BpDisable(PUVM pUVM, uint32_t iBp) 888 877 { 889 878 /* 890 879 * Validate input. 891 880 */ 881 PVM pVM = pUVM->pVM; 882 VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE); 892 883 PDBGFBP pBp = dbgfR3BpGet(pVM, iBp); 893 884 if (!pBp) … … 912 903 913 904 case DBGFBPTYPE_INT3: 914 rc = dbgfR3BpInt3Disarm(p VM, pBp);905 rc = dbgfR3BpInt3Disarm(pUVM, pBp); 915 906 break; 916 907 … … 932 923 933 924 /** 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 */ 932 VMMR3DECL(int) DBGFR3BpDisable(PUVM pUVM, uint32_t iBp) 943 933 { 944 934 /* 945 935 * This must be done on EMT. 946 936 */ 947 int rc = VMR3ReqPriorityCallWait (pVM, VMCPUID_ANY, (PFNRT)dbgfR3BpEnum, 3, pVM, pfnCallback, pvUser);948 LogFlow(("DBGFR3Bp Clear: returns %Rrc\n", rc));937 int rc = VMR3ReqPriorityCallWaitU(pUVM, VMCPUID_ANY, (PFNRT)dbgfR3BpDisable, 2, pUVM, iBp); 938 LogFlow(("DBGFR3BpDisable: returns %Rrc\n", rc)); 949 939 return rc; 950 940 } … … 955 945 * 956 946 * @returns VBox status code. 957 * @param p VM Pointer to the VM.947 * @param pUVM The user mode VM handle. 958 948 * @param pfnCallback The callback function. 959 949 * @param pvUser The user argument to pass to the callback. … … 961 951 * @internal 962 952 */ 963 static DECLCALLBACK(int) dbgfR3BpEnum(P VM pVM, PFNDBGFBPENUM pfnCallback, void *pvUser)953 static DECLCALLBACK(int) dbgfR3BpEnum(PUVM pUVM, PFNDBGFBPENUM pfnCallback, void *pvUser) 964 954 { 965 955 /* 966 956 * Validate input. 967 957 */ 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); 969 961 970 962 /* … … 975 967 if (pVM->dbgf.s.aHwBreakpoints[i].enmType != DBGFBPTYPE_FREE) 976 968 { 977 int rc = pfnCallback(p VM, pvUser, &pVM->dbgf.s.aHwBreakpoints[i]);969 int rc = pfnCallback(pUVM, pvUser, &pVM->dbgf.s.aHwBreakpoints[i]); 978 970 if (RT_FAILURE(rc)) 979 971 return rc; … … 986 978 if (pVM->dbgf.s.aBreakpoints[i].enmType != DBGFBPTYPE_FREE) 987 979 { 988 int rc = pfnCallback(p VM, pvUser, &pVM->dbgf.s.aBreakpoints[i]);980 int rc = pfnCallback(pUVM, pvUser, &pVM->dbgf.s.aBreakpoints[i]); 989 981 if (RT_FAILURE(rc)) 990 982 return rc; … … 994 986 } 995 987 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 */ 998 VMMR3DECL(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 5 5 6 6 /* 7 * Copyright (C) 2010 Oracle Corporation7 * Copyright (C) 2010-2013 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 55 55 56 56 #include <VBox/vmm/cpum.h> 57 #include "CPUMInternal.h"57 #include <VBox/vmm/pgm.h> 58 58 #include <VBox/vmm/dbgf.h> 59 59 #include <VBox/vmm/dbgfcorefmt.h> 60 #include <VBox/vmm/mm.h> 60 61 #include <VBox/vmm/vm.h> 61 #include <VBox/vmm/pgm.h> 62 #include <VBox/vmm/uvm.h> 63 62 64 #include <VBox/err.h> 63 65 #include <VBox/log.h> 64 #include <VBox/vmm/mm.h>65 66 #include <VBox/version.h> 66 67 … … 430 431 for (uint32_t iCpu = 0; iCpu < pVM->cCpus; iCpu++) 431 432 { 432 PCPUMCTX pCpuCtx = &pVM->aCpus[iCpu].cpum.s.Guest;433 PCPUMCTX pCpuCtx = CPUMQueryGuestCtxPtr(&pVM->aCpus[iCpu]); 433 434 rc = Elf64WriteNoteHdr(hFile, NT_VBOXCPU, s_pcszCoreVBoxCpu, pCpuCtx, sizeof(CPUMCTX)); 434 435 if (RT_FAILURE(rc)) … … 534 535 * 535 536 * @returns VBox status code. 536 * @param p VM Pointer to the VM.537 * @param pUVM The user mode VM handle. 537 538 * @param pszFilename The name of the file to which the guest core 538 539 * dump should be written. … … 542 543 * interfer with the state. 543 544 */ 544 VMMR3DECL(int) DBGFR3CoreWrite(PVM pVM, const char *pszFilename, bool fReplaceFile) 545 { 545 VMMR3DECL(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; 546 549 VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE); 547 550 AssertReturn(pszFilename, VERR_INVALID_HANDLE); -
trunk/src/VBox/VMM/VMMR3/DBGFCpu.cpp
r41783 r44399 25 25 #include "DBGFInternal.h" 26 26 #include <VBox/vmm/vm.h> 27 #include <VBox/vmm/uvm.h> 27 28 #include <VBox/err.h> 28 29 #include <VBox/log.h> … … 35 36 * 36 37 * @returns VINF_SUCCESS. 37 * @param pVM 38 * @param idCpu 39 * @param penmMode 38 * @param pVM Pointer to the VM. 39 * @param idCpu The current CPU ID. 40 * @param penmMode Where to return the mode. 40 41 */ 41 42 static DECLCALLBACK(int) dbgfR3CpuGetMode(PVM pVM, VMCPUID idCpu, CPUMMODE *penmMode) … … 52 53 * 53 54 * @returns The CPU mode on success, CPUMMODE_INVALID on failure. 54 * @param p VM Pointer to the VM.55 * @param idCpu 55 * @param pUVM The user mode VM handle. 56 * @param idCpu The target CPU ID. 56 57 */ 57 VMMR3DECL(CPUMMODE) DBGFR3CpuGetMode(P VM pVM, VMCPUID idCpu)58 VMMR3DECL(CPUMMODE) DBGFR3CpuGetMode(PUVM pUVM, VMCPUID idCpu) 58 59 { 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); 61 63 62 64 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); 64 66 if (RT_FAILURE(rc)) 65 67 return CPUMMODE_INVALID; … … 67 69 } 68 70 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 */ 78 VMMR3DECL(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 30 30 #include <VBox/param.h> 31 31 #include <VBox/vmm/vm.h> 32 #include <VBox/vmm/uvm.h> 32 33 #include "internal/pgm.h" 33 34 … … 296 297 : pSelInfo->Sel == DIS_FMT_SEL_GET_VALUE(u32Sel)) 297 298 { 298 rc = DBGFR3AddrFromSelInfoOff(pState->pVM , &Addr, pSelInfo, uAddress);299 rc = DBGFR3AddrFromSelInfoOff(pState->pVM->pUVM, &Addr, pSelInfo, uAddress); 299 300 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*/); 301 302 } 302 303 else … … 576 577 * 577 578 * @returns VBox status code. 578 * @param p VM Pointer to the VM.579 * @param pUVM The user mode VM handle. 579 580 * @param idCpu The ID of virtual CPU. 580 581 * @param Sel The code selector. This used to determine the 32/16 bit ness and … … 591 592 * address conversion. 592 593 */ 593 VMMR3DECL(int) DBGFR3DisasInstrEx(P VM pVM, VMCPUID idCpu, RTSEL Sel, RTGCPTR GCPtr, uint32_t fFlags,594 VMMR3DECL(int) DBGFR3DisasInstrEx(PUVM pUVM, VMCPUID idCpu, RTSEL Sel, RTGCPTR GCPtr, uint32_t fFlags, 594 595 char *pszOutput, uint32_t cbOutput, uint32_t *pcbInstr) 595 596 { 596 597 AssertReturn(cbOutput > 0, VERR_INVALID_PARAMETER); 597 598 *pszOutput = '\0'; 599 UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE); 600 PVM pVM = pUVM->pVM; 598 601 VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE); 599 AssertReturn(idCpu < p VM->cCpus, VERR_INVALID_CPU_ID);602 AssertReturn(idCpu < pUVM->cCpus, VERR_INVALID_CPU_ID); 600 603 AssertReturn(!(fFlags & ~DBGF_DISAS_FLAGS_VALID_MASK), VERR_INVALID_PARAMETER); 601 604 AssertReturn((fFlags & DBGF_DISAS_FLAGS_MODE_MASK) <= DBGF_DISAS_FLAGS_64BIT_MODE, VERR_INVALID_PARAMETER); … … 626 629 * terminated if @a cbOutput is greater than zero. 627 630 * @param cbOutput Size of the output buffer. 628 */ 629 VMMR3DECL(int) DBGFR3DisasInstrCurrent(PVMCPU pVCpu, char *pszOutput, uint32_t cbOutput) 631 * @thread EMT(pVCpu) 632 */ 633 VMMR3_INT_DECL(int) DBGFR3DisasInstrCurrent(PVMCPU pVCpu, char *pszOutput, uint32_t cbOutput) 630 634 { 631 635 AssertReturn(cbOutput > 0, VERR_INVALID_PARAMETER); 632 636 *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); 637 643 } 638 644 … … 645 651 * @param pVCpu Pointer to the VMCPU. 646 652 * @param pszPrefix Short prefix string to the disassembly string. (optional) 653 * @thread EMT(pVCpu) 647 654 */ 648 655 VMMR3DECL(int) DBGFR3DisasInstrCurrentLogInternal(PVMCPU pVCpu, const char *pszPrefix) … … 667 674 * 668 675 * @returns VBox status code. 669 * @param pVM Pointer to the VM.670 676 * @param pVCpu Pointer to the VMCPU, defaults to CPU 0 if NULL. 671 677 * @param Sel The code selector. This used to determine the 32/16 bit-ness and … … 673 679 * @param GCPtr The code address relative to the base of Sel. 674 680 * @param pszPrefix Short prefix string to the disassembly string. (optional) 681 * @thread EMT(pVCpu) 675 682 */ 676 683 VMMR3DECL(int) DBGFR3DisasInstrLogInternal(PVMCPU pVCpu, RTSEL Sel, RTGCPTR GCPtr, const char *pszPrefix) 677 684 { 685 Assert(VMCPU_IS_EMT(pVCpu)); 686 678 687 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); 681 691 if (RT_FAILURE(rc)) 682 692 RTStrPrintf(szBuf, sizeof(szBuf), "DBGFR3DisasInstrLog(, %RTsel, %RGv) failed with rc=%Rrc\n", Sel, GCPtr, rc); -
trunk/src/VBox/VMM/VMMR3/DBGFInfo.cpp
r41965 r44399 5 5 6 6 /* 7 * Copyright (C) 2006-20 07Oracle Corporation7 * Copyright (C) 2006-2013 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 26 26 #include "DBGFInternal.h" 27 27 #include <VBox/vmm/vm.h> 28 #include <VBox/vmm/uvm.h> 28 29 #include <VBox/err.h> 29 30 #include <VBox/log.h> … … 31 32 #include <iprt/assert.h> 32 33 #include <iprt/ctype.h> 34 #include <iprt/param.h> 33 35 #include <iprt/semaphore.h> 34 36 #include <iprt/stream.h> … … 78 80 * 79 81 * @returns VBox status code. 80 * @param p VM Pointer to the VM.81 */ 82 int dbgfR3InfoInit(P VM pVM)82 * @param pUVM The user mode VM handle. 83 */ 84 int dbgfR3InfoInit(PUVM pUVM) 83 85 { 84 86 /* 85 87 * Make sure we already didn't initialized in the lazy manner. 86 88 */ 87 if (RTCritSectIsInitialized(&p VM->dbgf.s.InfoCritSect))89 if (RTCritSectIsInitialized(&pUVM->dbgf.s.InfoCritSect)) 88 90 return VINF_SUCCESS; 89 91 … … 91 93 * Initialize the crit sect. 92 94 */ 93 int rc = RTCritSectInit(&p VM->dbgf.s.InfoCritSect);95 int rc = RTCritSectInit(&pUVM->dbgf.s.InfoCritSect); 94 96 AssertRCReturn(rc, rc); 95 97 … … 97 99 * Register the 'info help' item. 98 100 */ 99 rc = DBGFR3InfoRegisterInternal(p VM, "help", "List of info items.", dbgfR3InfoHelp);101 rc = DBGFR3InfoRegisterInternal(pUVM->pVM, "help", "List of info items.", dbgfR3InfoHelp); 100 102 AssertRCReturn(rc, rc); 101 103 … … 108 110 * 109 111 * @returns VBox status code. 110 * @param p VM Pointer to the VM.111 */ 112 int dbgfR3InfoTerm(P VM pVM)112 * @param pUVM The user mode VM handle. 113 */ 114 int dbgfR3InfoTerm(PUVM pUVM) 113 115 { 114 116 /* 115 117 * Delete the crit sect. 116 118 */ 117 int rc = RTCritSectDelete(&p VM->dbgf.s.InfoCritSect);119 int rc = RTCritSectDelete(&pUVM->dbgf.s.InfoCritSect); 118 120 AssertRC(rc); 119 121 return rc; … … 211 213 * 212 214 * @returns VBox status code. 213 * @param p VM Pointer to the VM.215 * @param pUVM The user mode VM handle. 214 216 * @param pszName The identifier of the info. 215 217 * @param pszDesc The description of the info and any arguments the handler may take. … … 217 219 * @param ppInfo Where to store the created 218 220 */ 219 static int dbgfR3InfoRegister(P VM pVM, const char *pszName, const char *pszDesc, uint32_t fFlags, PDBGFINFO *ppInfo)221 static int dbgfR3InfoRegister(PUVM pUVM, const char *pszName, const char *pszDesc, uint32_t fFlags, PDBGFINFO *ppInfo) 220 222 { 221 223 /* … … 232 234 int rc; 233 235 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])); 235 237 if (pInfo) 236 238 { … … 243 245 /* lazy init */ 244 246 rc = VINF_SUCCESS; 245 if (!RTCritSectIsInitialized(&p VM->dbgf.s.InfoCritSect))246 rc = dbgfR3InfoInit(p VM);247 if (!RTCritSectIsInitialized(&pUVM->dbgf.s.InfoCritSect)) 248 rc = dbgfR3InfoInit(pUVM); 247 249 if (RT_SUCCESS(rc)) 248 250 { … … 250 252 * Insert in alphabetical order. 251 253 */ 252 rc = RTCritSectEnter(&p VM->dbgf.s.InfoCritSect);254 rc = RTCritSectEnter(&pUVM->dbgf.s.InfoCritSect); 253 255 AssertRC(rc); 254 256 PDBGFINFO pPrev = NULL; 255 257 PDBGFINFO pCur; 256 for (pCur = p VM->dbgf.s.pInfoFirst; pCur; pPrev = pCur, pCur = pCur->pNext)258 for (pCur = pUVM->dbgf.s.pInfoFirst; pCur; pPrev = pCur, pCur = pCur->pNext) 257 259 if (strcmp(pszName, pCur->szName) < 0) 258 260 break; … … 261 263 pPrev->pNext = pInfo; 262 264 else 263 p VM->dbgf.s.pInfoFirst = pInfo;265 pUVM->dbgf.s.pInfoFirst = pInfo; 264 266 265 267 *ppInfo = pInfo; … … 284 286 * @param pDevIns The device instance owning the info. 285 287 */ 286 VMMR3DECL(int) DBGFR3InfoRegisterDevice(PVM pVM, const char *pszName, const char *pszDesc, PFNDBGFHANDLERDEV pfnHandler, PPDMDEVINS pDevIns) 288 VMMR3_INT_DECL(int) DBGFR3InfoRegisterDevice(PVM pVM, const char *pszName, const char *pszDesc, 289 PFNDBGFHANDLERDEV pfnHandler, PPDMDEVINS pDevIns) 287 290 { 288 291 LogFlow(("DBGFR3InfoRegisterDevice: pszName=%p:{%s} pszDesc=%p:{%s} pfnHandler=%p pDevIns=%p\n", … … 292 295 * Validate the specific stuff. 293 296 */ 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); 304 299 305 300 /* … … 307 302 */ 308 303 PDBGFINFO pInfo; 309 int rc = dbgfR3InfoRegister(pVM , pszName, pszDesc, 0, &pInfo);304 int rc = dbgfR3InfoRegister(pVM->pUVM, pszName, pszDesc, 0, &pInfo); 310 305 if (RT_SUCCESS(rc)) 311 306 { … … 313 308 pInfo->u.Dev.pfnHandler = pfnHandler; 314 309 pInfo->u.Dev.pDevIns = pDevIns; 315 RTCritSectLeave(&pVM-> dbgf.s.InfoCritSect);310 RTCritSectLeave(&pVM->pUVM->dbgf.s.InfoCritSect); 316 311 } 317 312 … … 330 325 * @param pDrvIns The driver instance owning the info. 331 326 */ 332 VMMR3 DECL(int) DBGFR3InfoRegisterDriver(PVM pVM, const char *pszName, const char *pszDesc, PFNDBGFHANDLERDRV pfnHandler, PPDMDRVINS pDrvIns)327 VMMR3_INT_DECL(int) DBGFR3InfoRegisterDriver(PVM pVM, const char *pszName, const char *pszDesc, PFNDBGFHANDLERDRV pfnHandler, PPDMDRVINS pDrvIns) 333 328 { 334 329 LogFlow(("DBGFR3InfoRegisterDriver: pszName=%p:{%s} pszDesc=%p:{%s} pfnHandler=%p pDrvIns=%p\n", … … 338 333 * Validate the specific stuff. 339 334 */ 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); 350 337 351 338 /* … … 353 340 */ 354 341 PDBGFINFO pInfo; 355 int rc = dbgfR3InfoRegister(pVM , pszName, pszDesc, 0, &pInfo);342 int rc = dbgfR3InfoRegister(pVM->pUVM, pszName, pszDesc, 0, &pInfo); 356 343 if (RT_SUCCESS(rc)) 357 344 { … … 359 346 pInfo->u.Drv.pfnHandler = pfnHandler; 360 347 pInfo->u.Drv.pDrvIns = pDrvIns; 361 RTCritSectLeave(&pVM-> dbgf.s.InfoCritSect);348 RTCritSectLeave(&pVM->pUVM->dbgf.s.InfoCritSect); 362 349 } 363 350 … … 375 362 * @param pfnHandler The handler function to be called to display the info. 376 363 */ 377 VMMR3 DECL(int) DBGFR3InfoRegisterInternal(PVM pVM, const char *pszName, const char *pszDesc, PFNDBGFHANDLERINT pfnHandler)364 VMMR3_INT_DECL(int) DBGFR3InfoRegisterInternal(PVM pVM, const char *pszName, const char *pszDesc, PFNDBGFHANDLERINT pfnHandler) 378 365 { 379 366 return DBGFR3InfoRegisterInternalEx(pVM, pszName, pszDesc, pfnHandler, 0); … … 391 378 * @param fFlags Flags, see the DBGFINFO_FLAGS_*. 392 379 */ 393 VMMR3DECL(int) DBGFR3InfoRegisterInternalEx(PVM pVM, const char *pszName, const char *pszDesc, PFNDBGFHANDLERINT pfnHandler, uint32_t fFlags) 380 VMMR3_INT_DECL(int) DBGFR3InfoRegisterInternalEx(PVM pVM, const char *pszName, const char *pszDesc, 381 PFNDBGFHANDLERINT pfnHandler, uint32_t fFlags) 394 382 { 395 383 LogFlow(("DBGFR3InfoRegisterInternal: pszName=%p:{%s} pszDesc=%p:{%s} pfnHandler=%p fFlags=%x\n", … … 399 387 * Validate the specific stuff. 400 388 */ 401 if (!pfnHandler) 402 { 403 AssertMsgFailed(("No handler\n")); 404 return VERR_INVALID_PARAMETER; 405 } 389 AssertPtrReturn(pfnHandler, VERR_INVALID_POINTER); 406 390 407 391 /* … … 409 393 */ 410 394 PDBGFINFO pInfo; 411 int rc = dbgfR3InfoRegister(pVM , pszName, pszDesc, fFlags, &pInfo);395 int rc = dbgfR3InfoRegister(pVM->pUVM, pszName, pszDesc, fFlags, &pInfo); 412 396 if (RT_SUCCESS(rc)) 413 397 { 414 398 pInfo->enmType = DBGFINFOTYPE_INT; 415 399 pInfo->u.Int.pfnHandler = pfnHandler; 416 RTCritSectLeave(&pVM-> dbgf.s.InfoCritSect);400 RTCritSectLeave(&pVM->pUVM->dbgf.s.InfoCritSect); 417 401 } 418 402 … … 425 409 * 426 410 * @returns VBox status code. 427 * @param p VM Pointer to the VM.411 * @param pUVM The user mode VM handle. 428 412 * @param pszName The identifier of the info. 429 413 * @param pszDesc The description of the info and any arguments the handler may take. … … 431 415 * @param pvUser User argument to be passed to the handler. 432 416 */ 433 VMMR3DECL(int) DBGFR3InfoRegisterExternal(PVM pVM, const char *pszName, const char *pszDesc, PFNDBGFHANDLEREXT pfnHandler, void *pvUser) 417 VMMR3DECL(int) DBGFR3InfoRegisterExternal(PUVM pUVM, const char *pszName, const char *pszDesc, 418 PFNDBGFHANDLEREXT pfnHandler, void *pvUser) 434 419 { 435 420 LogFlow(("DBGFR3InfoRegisterExternal: pszName=%p:{%s} pszDesc=%p:{%s} pfnHandler=%p pvUser=%p\n", … … 439 424 * Validate the specific stuff. 440 425 */ 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); 446 428 447 429 /* … … 449 431 */ 450 432 PDBGFINFO pInfo; 451 int rc = dbgfR3InfoRegister(p VM, pszName, pszDesc, 0, &pInfo);433 int rc = dbgfR3InfoRegister(pUVM, pszName, pszDesc, 0, &pInfo); 452 434 if (RT_SUCCESS(rc)) 453 435 { … … 455 437 pInfo->u.Ext.pfnHandler = pfnHandler; 456 438 pInfo->u.Ext.pvUser = pvUser; 457 RTCritSectLeave(&p VM->dbgf.s.InfoCritSect);439 RTCritSectLeave(&pUVM->dbgf.s.InfoCritSect); 458 440 } 459 441 … … 470 452 * @param pszName The identifier of the info. If NULL all owned by the device. 471 453 */ 472 VMMR3 DECL(int) DBGFR3InfoDeregisterDevice(PVM pVM, PPDMDEVINS pDevIns, const char *pszName)454 VMMR3_INT_DECL(int) DBGFR3InfoDeregisterDevice(PVM pVM, PPDMDEVINS pDevIns, const char *pszName) 473 455 { 474 456 LogFlow(("DBGFR3InfoDeregisterDevice: pDevIns=%p pszName=%p:{%s}\n", pDevIns, pszName, pszName)); … … 477 459 * Validate input. 478 460 */ 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); 484 463 size_t cchName = pszName ? strlen(pszName) : 0; 464 PUVM pUVM = pVM->pUVM; 485 465 486 466 /* 487 467 * Enumerate the info handlers and free the requested entries. 488 468 */ 489 int rc = RTCritSectEnter(&pVM->dbgf.s.InfoCritSect); 490 AssertRC(rc); 469 int rc = RTCritSectEnter(&pUVM->dbgf.s.InfoCritSect); AssertRC(rc); 491 470 rc = VERR_FILE_NOT_FOUND; 492 471 PDBGFINFO pPrev = NULL; 493 PDBGFINFO pInfo = p VM->dbgf.s.pInfoFirst;472 PDBGFINFO pInfo = pUVM->dbgf.s.pInfoFirst; 494 473 if (pszName) 495 474 { … … 506 485 pPrev->pNext = pInfo->pNext; 507 486 else 508 p VM->dbgf.s.pInfoFirst = pInfo->pNext;487 pUVM->dbgf.s.pInfoFirst = pInfo->pNext; 509 488 MMR3HeapFree(pInfo); 510 489 rc = VINF_SUCCESS; … … 515 494 { 516 495 /* 517 * Free all owned by the d river.496 * Free all owned by the device. 518 497 */ 519 498 for (; pInfo; pPrev = pInfo, pInfo = pInfo->pNext) … … 524 503 pPrev->pNext = pInfo->pNext; 525 504 else 526 p VM->dbgf.s.pInfoFirst = pInfo->pNext;505 pUVM->dbgf.s.pInfoFirst = pInfo->pNext; 527 506 MMR3HeapFree(pInfo); 528 507 pInfo = pPrev; … … 530 509 rc = VINF_SUCCESS; 531 510 } 532 int rc2 = RTCritSectLeave(&p VM->dbgf.s.InfoCritSect);511 int rc2 = RTCritSectLeave(&pUVM->dbgf.s.InfoCritSect); 533 512 AssertRC(rc2); 534 513 AssertRC(rc); … … 545 524 * @param pszName The identifier of the info. If NULL all owned by the driver. 546 525 */ 547 VMMR3 DECL(int) DBGFR3InfoDeregisterDriver(PVM pVM, PPDMDRVINS pDrvIns, const char *pszName)526 VMMR3_INT_DECL(int) DBGFR3InfoDeregisterDriver(PVM pVM, PPDMDRVINS pDrvIns, const char *pszName) 548 527 { 549 528 LogFlow(("DBGFR3InfoDeregisterDriver: pDrvIns=%p pszName=%p:{%s}\n", pDrvIns, pszName, pszName)); … … 552 531 * Validate input. 553 532 */ 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); 559 535 size_t cchName = pszName ? strlen(pszName) : 0; 536 PUVM pUVM = pVM->pUVM; 560 537 561 538 /* 562 539 * Enumerate the info handlers and free the requested entries. 563 540 */ 564 int rc = RTCritSectEnter(&pVM->dbgf.s.InfoCritSect); 565 AssertRC(rc); 541 int rc = RTCritSectEnter(&pUVM->dbgf.s.InfoCritSect); AssertRC(rc); 566 542 rc = VERR_FILE_NOT_FOUND; 567 543 PDBGFINFO pPrev = NULL; 568 PDBGFINFO pInfo = p VM->dbgf.s.pInfoFirst;544 PDBGFINFO pInfo = pUVM->dbgf.s.pInfoFirst; 569 545 if (pszName) 570 546 { … … 581 557 pPrev->pNext = pInfo->pNext; 582 558 else 583 p VM->dbgf.s.pInfoFirst = pInfo->pNext;559 pUVM->dbgf.s.pInfoFirst = pInfo->pNext; 584 560 MMR3HeapFree(pInfo); 585 561 rc = VINF_SUCCESS; … … 599 575 pPrev->pNext = pInfo->pNext; 600 576 else 601 p VM->dbgf.s.pInfoFirst = pInfo->pNext;577 pUVM->dbgf.s.pInfoFirst = pInfo->pNext; 602 578 MMR3HeapFree(pInfo); 603 579 pInfo = pPrev; … … 605 581 rc = VINF_SUCCESS; 606 582 } 607 int rc2 = RTCritSectLeave(&p VM->dbgf.s.InfoCritSect);583 int rc2 = RTCritSectLeave(&pUVM->dbgf.s.InfoCritSect); 608 584 AssertRC(rc2); 609 585 AssertRC(rc); … … 617 593 * 618 594 * @returns VBox status code. 619 * @param p VMPointer to the VM.595 * @param pUVM Pointer to the VM. 620 596 * @param pszName The identifier of the info. 621 597 * @param enmType The info owner type. 622 598 */ 623 static int dbgfR3InfoDeregister(P VM pVM, const char *pszName, DBGFINFOTYPE enmType)599 static int dbgfR3InfoDeregister(PUVM pUVM, const char *pszName, DBGFINFOTYPE enmType) 624 600 { 625 601 /* 626 602 * Validate input. 627 603 */ 628 if (!pszName) 629 { 630 AssertMsgFailed(("!pszName\n")); 631 return VERR_INVALID_PARAMETER; 632 } 604 AssertPtrReturn(pszName, VERR_INVALID_POINTER); 633 605 634 606 /* … … 636 608 */ 637 609 size_t cchName = strlen(pszName); 638 int rc = RTCritSectEnter(&p VM->dbgf.s.InfoCritSect);610 int rc = RTCritSectEnter(&pUVM->dbgf.s.InfoCritSect); 639 611 AssertRC(rc); 640 612 rc = VERR_FILE_NOT_FOUND; 641 613 PDBGFINFO pPrev = NULL; 642 PDBGFINFO pInfo = p VM->dbgf.s.pInfoFirst;614 PDBGFINFO pInfo = pUVM->dbgf.s.pInfoFirst; 643 615 for (; pInfo; pPrev = pInfo, pInfo = pInfo->pNext) 644 616 if ( pInfo->cchName == cchName … … 649 621 pPrev->pNext = pInfo->pNext; 650 622 else 651 p VM->dbgf.s.pInfoFirst = pInfo->pNext;623 pUVM->dbgf.s.pInfoFirst = pInfo->pNext; 652 624 MMR3HeapFree(pInfo); 653 625 rc = VINF_SUCCESS; 654 626 break; 655 627 } 656 int rc2 = RTCritSectLeave(&p VM->dbgf.s.InfoCritSect);628 int rc2 = RTCritSectLeave(&pUVM->dbgf.s.InfoCritSect); 657 629 AssertRC(rc2); 658 630 AssertRC(rc); … … 669 641 * @param pszName The identifier of the info. If NULL all owned by the device. 670 642 */ 671 VMMR3 DECL(int) DBGFR3InfoDeregisterInternal(PVM pVM, const char *pszName)643 VMMR3_INT_DECL(int) DBGFR3InfoDeregisterInternal(PVM pVM, const char *pszName) 672 644 { 673 645 LogFlow(("DBGFR3InfoDeregisterInternal: pszName=%p:{%s}\n", pszName, pszName)); 674 return dbgfR3InfoDeregister(pVM , pszName, DBGFINFOTYPE_INT);646 return dbgfR3InfoDeregister(pVM->pUVM, pszName, DBGFINFOTYPE_INT); 675 647 } 676 648 … … 680 652 * 681 653 * @returns VBox status code. 682 * @param p VM Pointer to the VM.654 * @param pUVM The user mode VM handle. 683 655 * @param pszName The identifier of the info. If NULL all owned by the device. 684 656 */ 685 VMMR3DECL(int) DBGFR3InfoDeregisterExternal(P VM pVM, const char *pszName)657 VMMR3DECL(int) DBGFR3InfoDeregisterExternal(PUVM pUVM, const char *pszName) 686 658 { 687 659 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); 689 662 } 690 663 … … 694 667 * 695 668 * @returns VBox status code. 696 * @param p VM Pointer to the VM.697 * @param idCpu Which CPU to run EMT bound handlers on.698 * VMCPUID_ANY ora valid CPU ID.699 * @param pszName 700 * @param pszArgs 701 * @param pHlp 702 */ 703 static DECLCALLBACK(int) dbgfR3Info(P VM 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 */ 676 static DECLCALLBACK(int) dbgfR3Info(PUVM pUVM, VMCPUID idCpu, const char *pszName, const char *pszArgs, PCDBGFINFOHLP pHlp) 704 677 { 705 678 /* … … 707 680 */ 708 681 AssertPtrReturn(pszName, VERR_INVALID_POINTER); 682 AssertPtrNullReturn(pszArgs, VERR_INVALID_POINTER); 709 683 if (pHlp) 710 684 { 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); 717 688 } 718 689 else … … 723 694 */ 724 695 size_t cchName = strlen(pszName); 725 int rc = RTCritSectEnter(&p VM->dbgf.s.InfoCritSect);696 int rc = RTCritSectEnter(&pUVM->dbgf.s.InfoCritSect); 726 697 AssertRC(rc); 727 PDBGFINFO pInfo = p VM->dbgf.s.pInfoFirst;698 PDBGFINFO pInfo = pUVM->dbgf.s.pInfoFirst; 728 699 for (; pInfo; pInfo = pInfo->pNext) 729 700 if ( pInfo->cchName == cchName … … 738 709 */ 739 710 DBGFINFO Info = *pInfo; 740 rc = RTCritSectLeave(&p VM->dbgf.s.InfoCritSect);711 rc = RTCritSectLeave(&pUVM->dbgf.s.InfoCritSect); 741 712 AssertRC(rc); 742 713 rc = VINF_SUCCESS; … … 745 716 case DBGFINFOTYPE_DEV: 746 717 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); 748 719 else 749 720 Info.u.Dev.pfnHandler(Info.u.Dev.pDevIns, pHlp, pszArgs); … … 752 723 case DBGFINFOTYPE_DRV: 753 724 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); 755 726 else 756 727 Info.u.Drv.pfnHandler(Info.u.Drv.pDrvIns, pHlp, pszArgs); … … 758 729 759 730 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 } 762 738 else 763 Info.u.Int.pfnHandler(pVM, pHlp, pszArgs);739 rc = VERR_INVALID_VM_HANDLE; 764 740 break; 765 741 766 742 case DBGFINFOTYPE_EXT: 767 743 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); 769 745 else 770 746 Info.u.Ext.pfnHandler(Info.u.Ext.pvUser, pHlp, pszArgs); … … 777 753 else 778 754 { 779 rc = RTCritSectLeave(&p VM->dbgf.s.InfoCritSect);755 rc = RTCritSectLeave(&pUVM->dbgf.s.InfoCritSect); 780 756 AssertRC(rc); 781 757 rc = VERR_FILE_NOT_FOUND; … … 788 764 * 789 765 * @returns VBox status code. 790 * @param p VM Pointer to the VM.766 * @param pUVM The user mode VM handle. 791 767 * @param pszName The identifier of the info to display. 792 768 * @param pszArgs Arguments to the info handler. 793 769 * @param pHlp The output helper functions. If NULL the logger will be used. 794 770 */ 795 VMMR3DECL(int) DBGFR3Info(PVM pVM, const char *pszName, const char *pszArgs, PCDBGFINFOHLP pHlp) 796 { 797 return dbgfR3Info(pVM, VMCPUID_ANY, pszName, pszArgs, pHlp); 771 VMMR3DECL(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); 798 775 } 799 776 … … 803 780 * 804 781 * @returns VBox status code. 805 * @param p VM Pointer to the VM.782 * @param pUVM The user mode VM handle. 806 783 * @param idCpu The CPU to exectue the request on. Pass NIL_VMCPUID 807 784 * to not involve any EMT. … … 810 787 * @param pHlp The output helper functions. If NULL the logger will be used. 811 788 */ 812 VMMR3DECL(int) DBGFR3InfoEx(PVM pVM, VMCPUID idCpu, const char *pszName, const char *pszArgs, PCDBGFINFOHLP pHlp) 813 { 789 VMMR3DECL(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); 814 792 if (idCpu == NIL_VMCPUID) 815 return dbgfR3Info(p VM, 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); 818 796 } 819 797 … … 823 801 * 824 802 * @returns See DBGFR3Info. 825 * @param p VM Pointer to the VM.826 * @param pszName 827 * @param pszArgs 828 */ 829 VMMR3DECL(int) DBGFR3InfoLogRel(P VM pVM, const char *pszName, const char *pszArgs)830 { 831 return DBGFR3Info(p VM, pszName, pszArgs, &g_dbgfR3InfoLogRelHlp);803 * @param pUVM The user mode VM handle. 804 * @param pszName See DBGFR3Info. 805 * @param pszArgs See DBGFR3Info. 806 */ 807 VMMR3DECL(int) DBGFR3InfoLogRel(PUVM pUVM, const char *pszName, const char *pszArgs) 808 { 809 return DBGFR3Info(pUVM, pszName, pszArgs, &g_dbgfR3InfoLogRelHlp); 832 810 } 833 811 … … 837 815 * 838 816 * @returns See DBGFR3Info. 839 * @param p VM Pointer to the VM.840 * @param pszName 841 * @param pszArgs 842 */ 843 VMMR3DECL(int) DBGFR3InfoStdErr(P VM pVM, const char *pszName, const char *pszArgs)844 { 845 return DBGFR3Info(p VM, pszName, pszArgs, &g_dbgfR3InfoStdErrHlp);817 * @param pUVM The user mode VM handle. 818 * @param pszName See DBGFR3Info. 819 * @param pszArgs See DBGFR3Info. 820 */ 821 VMMR3DECL(int) DBGFR3InfoStdErr(PUVM pUVM, const char *pszName, const char *pszArgs) 822 { 823 return DBGFR3Info(pUVM, pszName, pszArgs, &g_dbgfR3InfoStdErrHlp); 846 824 } 847 825 … … 863 841 * @threads EMT 864 842 */ 865 VMMR3 DECL(int) DBGFR3InfoMulti(PVM pVM, const char *pszIncludePat, const char *pszExcludePat, const char *pszSepFmt,866 PCDBGFINFOHLP pHlp)843 VMMR3_INT_DECL(int) DBGFR3InfoMulti(PVM pVM, const char *pszIncludePat, const char *pszExcludePat, const char *pszSepFmt, 844 PCDBGFINFOHLP pHlp) 867 845 { 868 846 /* 869 847 * Validate input. 870 848 */ 849 PUVM pUVM = pVM->pUVM; 871 850 VM_ASSERT_EMT_RETURN(pVM, VERR_VM_THREAD_NOT_EMT); 872 851 AssertPtrReturn(pszIncludePat, VERR_INVALID_POINTER); … … 888 867 * Note! We won't leave the critical section here... 889 868 */ 890 int rc = RTCritSectEnter(&p VM->dbgf.s.InfoCritSect);869 int rc = RTCritSectEnter(&pUVM->dbgf.s.InfoCritSect); 891 870 AssertRC(rc); 892 871 rc = VWRN_NOT_FOUND; 893 for (PDBGFINFO pInfo = p VM->dbgf.s.pInfoFirst; pInfo; pInfo = pInfo->pNext)872 for (PDBGFINFO pInfo = pUVM->dbgf.s.pInfoFirst; pInfo; pInfo = pInfo->pNext) 894 873 { 895 874 if ( RTStrSimplePatternMultiMatch(pszIncludePat, cchIncludePat, pInfo->szName, pInfo->cchName, NULL) … … 902 881 case DBGFINFOTYPE_DEV: 903 882 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); 905 885 else 906 886 pInfo->u.Dev.pfnHandler(pInfo->u.Dev.pDevIns, pHlp, pszArgs); … … 909 889 case DBGFINFOTYPE_DRV: 910 890 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); 912 893 else 913 894 pInfo->u.Drv.pfnHandler(pInfo->u.Drv.pDrvIns, pHlp, pszArgs); … … 916 897 case DBGFINFOTYPE_INT: 917 898 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); 919 900 else 920 901 pInfo->u.Int.pfnHandler(pVM, pHlp, pszArgs); … … 923 904 case DBGFINFOTYPE_EXT: 924 905 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); 926 908 else 927 909 pInfo->u.Ext.pfnHandler(pInfo->u.Ext.pvUser, pHlp, pszArgs); … … 933 915 } 934 916 } 935 int rc2 = RTCritSectLeave(&p VM->dbgf.s.InfoCritSect);917 int rc2 = RTCritSectLeave(&pUVM->dbgf.s.InfoCritSect); 936 918 AssertRC(rc2); 937 919 … … 944 926 * 945 927 * @returns VBox status code. 946 * @param p VM Pointer to the VM.928 * @param pUVM The user mode VM handle. 947 929 * @param pfnCallback Pointer to callback function. 948 930 * @param pvUser User argument to pass to the callback. 949 931 */ 950 VMMR3DECL(int) DBGFR3InfoEnum(P VM pVM, PFNDBGFINFOENUM pfnCallback, void *pvUser)932 VMMR3DECL(int) DBGFR3InfoEnum(PUVM pUVM, PFNDBGFINFOENUM pfnCallback, void *pvUser) 951 933 { 952 934 LogFlow(("DBGFR3InfoLog: pfnCallback=%p pvUser=%p\n", pfnCallback, pvUser)); … … 960 942 return VERR_INVALID_PARAMETER; 961 943 } 944 UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE); 962 945 963 946 /* 964 947 * Enter and enumerate. 965 948 */ 966 int rc = RTCritSectEnter(&p VM->dbgf.s.InfoCritSect);949 int rc = RTCritSectEnter(&pUVM->dbgf.s.InfoCritSect); 967 950 AssertRC(rc); 968 951 969 952 rc = VINF_SUCCESS; 970 for (PDBGFINFO pInfo = p VM->dbgf.s.pInfoFirst; RT_SUCCESS(rc) && pInfo; pInfo = pInfo->pNext)971 rc = pfnCallback(p VM, 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); 972 955 973 956 /* 974 957 * Leave and exit. 975 958 */ 976 int rc2 = RTCritSectLeave(&p VM->dbgf.s.InfoCritSect);959 int rc2 = RTCritSectLeave(&pUVM->dbgf.s.InfoCritSect); 977 960 AssertRC(rc2); 978 961 … … 996 979 * Enter and enumerate. 997 980 */ 998 int rc = RTCritSectEnter(&pVM->dbgf.s.InfoCritSect); 981 PUVM pUVM = pVM->pUVM; 982 int rc = RTCritSectEnter(&pUVM->dbgf.s.InfoCritSect); 999 983 AssertRC(rc); 1000 984 1001 985 if (pszArgs && *pszArgs) 1002 986 { 1003 for (PDBGFINFO pInfo = p VM->dbgf.s.pInfoFirst; pInfo; pInfo = pInfo->pNext)987 for (PDBGFINFO pInfo = pUVM->dbgf.s.pInfoFirst; pInfo; pInfo = pInfo->pNext) 1004 988 { 1005 989 const char *psz = strstr(pszArgs, pInfo->szName); … … 1015 999 else 1016 1000 { 1017 for (PDBGFINFO pInfo = p VM->dbgf.s.pInfoFirst; pInfo; pInfo = pInfo->pNext)1001 for (PDBGFINFO pInfo = pUVM->dbgf.s.pInfoFirst; pInfo; pInfo = pInfo->pNext) 1018 1002 pHlp->pfnPrintf(pHlp, "%-16s %s\n", 1019 1003 pInfo->szName, pInfo->pszDesc); … … 1023 1007 * Leave and exit. 1024 1008 */ 1025 rc = RTCritSectLeave(&p VM->dbgf.s.InfoCritSect);1009 rc = RTCritSectLeave(&pUVM->dbgf.s.InfoCritSect); 1026 1010 AssertRC(rc); 1027 1011 } -
trunk/src/VBox/VMM/VMMR3/DBGFLog.cpp
r41965 r44399 23 23 #include <VBox/vmm/vmm.h> 24 24 #include <VBox/vmm/dbgf.h> 25 #include <VBox/vmm/uvm.h> 26 #include <VBox/vmm/vm.h> 25 27 #include <VBox/log.h> 26 28 #include <VBox/err.h> 27 29 #include <iprt/assert.h> 30 #include <iprt/param.h> 28 31 #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);37 32 38 33 … … 63 58 64 59 /** 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 */ 66 static 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 /** 65 83 * Changes the logger group settings. 66 84 * 67 85 * @returns VBox status code. 68 * @param p VM Pointer to the VM.86 * @param pUVM The user mode VM handle. 69 87 * @param pszGroupSettings The group settings string. (VBOX_LOG) 70 88 * By prefixing the string with \"release:\" the … … 73 91 * is also recognized. 74 92 */ 75 VMMR3DECL(int) DBGFR3LogModifyGroups(P VM pVM, const char *pszGroupSettings)93 VMMR3DECL(int) DBGFR3LogModifyGroups(PUVM pUVM, const char *pszGroupSettings) 76 94 { 77 AssertPtrReturn(pVM, VERR_INVALID_POINTER);95 UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE); 78 96 AssertPtrReturn(pszGroupSettings, VERR_INVALID_POINTER); 79 97 80 return VMR3ReqPriorityCallWait (pVM, VMCPUID_ANY, (PFNRT)dbgfR3LogModifyGroups, 2, pVM, pszGroupSettings);98 return VMR3ReqPriorityCallWaitU(pUVM, VMCPUID_ANY, (PFNRT)dbgfR3LogModifyGroups, 2, pUVM, pszGroupSettings); 81 99 } 82 100 83 101 84 102 /** 85 * EMT worker for DBGFR3LogModify Groups.103 * EMT worker for DBGFR3LogModifyFlags. 86 104 * 87 105 * @returns VBox status code. 88 * @param p VM Pointer to the VM.89 * @param psz GroupSettings The group settings string. (VBOX_LOG)106 * @param pUVM The user mode VM handle. 107 * @param pszFlagSettings The group settings string. (VBOX_LOG_FLAGS) 90 108 */ 91 static DECLCALLBACK(int) dbgfR3LogModify Groups(PVM pVM, const char *pszGroupSettings)109 static DECLCALLBACK(int) dbgfR3LogModifyFlags(PUVM pUVM, const char *pszFlagSettings) 92 110 { 93 PRTLOGGER pLogger = dbgfR3LogResolvedLogger(&psz GroupSettings);111 PRTLOGGER pLogger = dbgfR3LogResolvedLogger(&pszFlagSettings); 94 112 if (!pLogger) 95 113 return VINF_SUCCESS; 96 114 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 } 100 121 return rc; 101 122 } … … 106 127 * 107 128 * @returns VBox status code. 108 * @param p VM Pointer to the VM.129 * @param pUVM The user mode VM handle. 109 130 * @param pszFlagSettings The group settings string. (VBOX_LOG_FLAGS) 110 131 * By prefixing the string with \"release:\" the … … 113 134 * is also recognized. 114 135 */ 115 VMMR3DECL(int) DBGFR3LogModifyFlags(P VM pVM, const char *pszFlagSettings)136 VMMR3DECL(int) DBGFR3LogModifyFlags(PUVM pUVM, const char *pszFlagSettings) 116 137 { 117 AssertPtrReturn(pVM, VERR_INVALID_POINTER);138 UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE); 118 139 AssertPtrReturn(pszFlagSettings, VERR_INVALID_POINTER); 119 140 120 return VMR3ReqPriorityCallWait (pVM, VMCPUID_ANY, (PFNRT)dbgfR3LogModifyFlags, 2, pVM, pszFlagSettings);141 return VMR3ReqPriorityCallWaitU(pUVM, VMCPUID_ANY, (PFNRT)dbgfR3LogModifyFlags, 2, pUVM, pszFlagSettings); 121 142 } 122 143 … … 126 147 * 127 148 * @returns VBox status code. 128 * @param p VM Pointer to the VM.129 * @param psz FlagSettings 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) 130 151 */ 131 static DECLCALLBACK(int) dbgfR3LogModify Flags(PVM pVM, const char *pszFlagSettings)152 static DECLCALLBACK(int) dbgfR3LogModifyDestinations(PUVM pUVM, const char *pszDestSettings) 132 153 { 133 PRTLOGGER pLogger = dbgfR3LogResolvedLogger(&psz FlagSettings);154 PRTLOGGER pLogger = dbgfR3LogResolvedLogger(&pszDestSettings); 134 155 if (!pLogger) 135 156 return VINF_SUCCESS; 136 157 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 } 140 164 return rc; 141 165 } … … 146 170 * 147 171 * @returns VBox status code. 148 * @param p VM Pointer to the VM.172 * @param pUVM The user mode VM handle. 149 173 * @param pszDestSettings The destination settings string. (VBOX_LOG_DEST) 150 174 * By prefixing the string with \"release:\" the … … 153 177 * is also recognized. 154 178 */ 155 VMMR3DECL(int) DBGFR3LogModifyDestinations(P VM pVM, const char *pszDestSettings)179 VMMR3DECL(int) DBGFR3LogModifyDestinations(PUVM pUVM, const char *pszDestSettings) 156 180 { 157 AssertReturn(VALID_PTR(pVM), VERR_INVALID_POINTER);158 Assert Return(VALID_PTR(pszDestSettings), VERR_INVALID_POINTER);181 UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE); 182 AssertPtrReturn(pszDestSettings, VERR_INVALID_POINTER); 159 183 160 return VMR3ReqPriorityCallWait (pVM, VMCPUID_ANY, (PFNRT)dbgfR3LogModifyDestinations, 2, pVM, pszDestSettings);184 return VMR3ReqPriorityCallWaitU(pUVM, VMCPUID_ANY, (PFNRT)dbgfR3LogModifyDestinations, 2, pUVM, pszDestSettings); 161 185 } 162 186 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 27 27 #include "DBGFInternal.h" 28 28 #include <VBox/vmm/vm.h> 29 #include <VBox/vmm/uvm.h> 29 30 #include <VBox/err.h> 30 31 #include <VBox/log.h> … … 37 38 * 38 39 * @returns VBox status code. 39 * @param p VM Pointer to the VM.40 * @param pUVM The user mode VM handle. 40 41 * @param idCpu The ID of the CPU context to search in. 41 42 * @param pAddress Where to store the mixed address. … … 47 48 * @param pHitAddress Where to put the address of the first hit. 48 49 */ 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 { 50 static 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); 52 55 Assert(idCpu == VMMGetCpuId(pVM)); 53 56 … … 56 59 */ 57 60 RTGCUINTPTR cbRange = *pcbRange; 58 if (!DBGFR3AddrIsValid(p VM, pAddress))61 if (!DBGFR3AddrIsValid(pUVM, pAddress)) 59 62 return VERR_INVALID_POINTER; 60 63 if (!VALID_PTR(pHitAddress)) … … 80 83 rc = PGMR3DbgScanPhysical(pVM, pAddress->FlatPtr, cbRange, GCPhysAlign, pabNeedle, cbNeedle, &PhysHit); 81 84 if (RT_SUCCESS(rc)) 82 DBGFR3AddrFromPhys(p VM, pHitAddress, PhysHit);85 DBGFR3AddrFromPhys(pUVM, pHitAddress, PhysHit); 83 86 } 84 87 else … … 94 97 rc = PGMR3DbgScanVirtual(pVM, pVCpu, pAddress->FlatPtr, cbRange, *puAlign, pabNeedle, cbNeedle, &GCPtrHit); 95 98 if (RT_SUCCESS(rc)) 96 DBGFR3AddrFromFlat(p VM, pHitAddress, GCPtrHit);99 DBGFR3AddrFromFlat(pUVM, pHitAddress, GCPtrHit); 97 100 } 98 101 … … 110 113 * @retval VERR_INVALID_ARGUMENT if any other arguments are invalid. 111 114 * 112 * @param p VM Pointer to the VM.115 * @param pUVM The user mode VM handle. 113 116 * @param idCpu The ID of the CPU context to search in. 114 117 * @param pAddress Where to store the mixed address. … … 122 125 * @thread Any thread. 123 126 */ 124 VMMR3DECL(int) DBGFR3MemScan(P VM pVM, VMCPUID idCpu, PCDBGFADDRESS pAddress, RTGCUINTPTR cbRange, RTGCUINTPTR uAlign,127 VMMR3DECL(int) DBGFR3MemScan(PUVM pUVM, VMCPUID idCpu, PCDBGFADDRESS pAddress, RTGCUINTPTR cbRange, RTGCUINTPTR uAlign, 125 128 const void *pvNeedle, size_t cbNeedle, PDBGFADDRESS pHitAddress) 126 129 { 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 */ 147 static DECLCALLBACK(int) dbgfR3MemRead(PUVM pUVM, VMCPUID idCpu, PCDBGFADDRESS pAddress, void *pvBuf, size_t cbRead) 148 { 149 PVM pVM = pUVM->pVM; 127 150 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 {146 151 Assert(idCpu == VMMGetCpuId(pVM)); 147 152 … … 149 154 * Validate the input we use, PGM does the rest. 150 155 */ 151 if (!DBGFR3AddrIsValid(p VM, pAddress))156 if (!DBGFR3AddrIsValid(pUVM, pAddress)) 152 157 return VERR_INVALID_POINTER; 153 158 if (!VALID_PTR(pvBuf)) … … 197 202 * @returns VBox status code. 198 203 * 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 */ 210 VMMR3DECL(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 209 215 if ((pAddress->fFlags & DBGFADDRESS_FLAGS_TYPE_MASK) == DBGFADDRESS_FLAGS_RING0) 210 216 { 211 217 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); 215 222 } 216 223 … … 221 228 * @returns VBox status code. 222 229 * 223 * @param p VM Pointer to the VM.224 * @param idCpu 225 * @param pAddress 226 * @param pszBuf 227 * @param cchBuf 228 */ 229 static DECLCALLBACK(int) dbgfR3MemReadString(P VM 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 */ 236 static DECLCALLBACK(int) dbgfR3MemReadString(PUVM pUVM, VMCPUID idCpu, PCDBGFADDRESS pAddress, char *pszBuf, size_t cchBuf) 230 237 { 231 238 /* 232 239 * Validate the input we use, PGM does the rest. 233 240 */ 234 if (!DBGFR3AddrIsValid(p VM, pAddress))241 if (!DBGFR3AddrIsValid(pUVM, pAddress)) 235 242 return VERR_INVALID_POINTER; 236 243 if (!VALID_PTR(pszBuf)) … … 240 247 * Let dbgfR3MemRead do the job. 241 248 */ 242 int rc = dbgfR3MemRead(p VM, idCpu, pAddress, pszBuf, cchBuf);249 int rc = dbgfR3MemRead(pUVM, idCpu, pAddress, pszBuf, cchBuf); 243 250 244 251 /* … … 269 276 * @returns VBox status code. 270 277 * 271 * @param p VM Pointer to the VM.272 * @param idCpu 273 * @param pAddress 274 * @param pszBuf 275 * @param cchBuf 276 */ 277 VMMR3DECL(int) DBGFR3MemReadString(P VM 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 */ 284 VMMR3DECL(int) DBGFR3MemReadString(PUVM pUVM, VMCPUID idCpu, PCDBGFADDRESS pAddress, char *pszBuf, size_t cchBuf) 278 285 { 279 286 /* … … 285 292 return VERR_INVALID_PARAMETER; 286 293 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 */ 315 static 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; 287 325 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;317 326 318 327 /* … … 357 366 * @returns VBox status code. 358 367 * 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 */ 374 VMMR3DECL(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 */ 385 static DECLCALLBACK(int) dbgfR3SelQueryInfo(PUVM pUVM, VMCPUID idCpu, RTSEL Sel, uint32_t fFlags, PDBGFSELINFO pSelInfo) 386 { 387 PVM pVM = pUVM->pVM; 367 388 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 378 390 /* 379 391 * Make the query. … … 446 458 * pagetable or page backing the selector table wasn't present. 447 459 * 448 * @param p VM Pointer to the VM.460 * @param pUVM The user mode VM handle. 449 461 * @param idCpu The ID of the virtual CPU context. 450 462 * @param Sel The selector to get info about. … … 456 468 * SELMR3GetShadowSelectorInfo. 457 469 */ 458 VMMR3DECL(int) DBGFR3SelQueryInfo(P VM 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 < p VM->cCpus, VERR_INVALID_CPU_ID);470 VMMR3DECL(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); 462 474 AssertReturn(!(fFlags & ~(DBGFSELQI_FLAGS_DT_GUEST | DBGFSELQI_FLAGS_DT_SHADOW | DBGFSELQI_FLAGS_DT_ADJ_64BIT_MODE)), VERR_INVALID_PARAMETER); 463 475 AssertReturn( (fFlags & (DBGFSELQI_FLAGS_DT_SHADOW | DBGFSELQI_FLAGS_DT_ADJ_64BIT_MODE)) … … 470 482 * Dispatch the request to a worker running on the target CPU. 471 483 */ 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); 473 485 } 474 486 … … 545 557 * 546 558 * @returns VBox status code. 547 * @param p VM Pointer to the VM.559 * @param pUVM The shared VM handle. 548 560 * @param idCpu The current CPU ID. 549 561 * @param fFlags The flags, DBGFPGDMP_FLAGS_XXX. Valid. … … 555 567 * @param pHlp The output callbacks. 556 568 */ 557 static DECLCALLBACK(int) dbgfR3PagingDumpEx(P VM pVM, VMCPUID idCpu, uint32_t fFlags, uint64_t *pcr3,569 static DECLCALLBACK(int) dbgfR3PagingDumpEx(PUVM pUVM, VMCPUID idCpu, uint32_t fFlags, uint64_t *pcr3, 558 570 uint64_t *pu64FirstAddr, uint64_t *pu64LastAddr, 559 571 uint32_t cMaxDepth, PCDBGFINFOHLP pHlp) … … 564 576 if ((fFlags & (DBGFPGDMP_FLAGS_GUEST | DBGFPGDMP_FLAGS_SHADOW)) == (DBGFPGDMP_FLAGS_GUEST | DBGFPGDMP_FLAGS_SHADOW)) 565 577 { 566 int rc1 = dbgfR3PagingDumpEx(p VM, idCpu, fFlags & ~DBGFPGDMP_FLAGS_GUEST,578 int rc1 = dbgfR3PagingDumpEx(pUVM, idCpu, fFlags & ~DBGFPGDMP_FLAGS_GUEST, 567 579 pcr3, pu64FirstAddr, pu64LastAddr, cMaxDepth, pHlp); 568 int rc2 = dbgfR3PagingDumpEx(p VM, idCpu, fFlags & ~DBGFPGDMP_FLAGS_SHADOW,580 int rc2 = dbgfR3PagingDumpEx(pUVM, idCpu, fFlags & ~DBGFPGDMP_FLAGS_SHADOW, 569 581 pcr3, pu64FirstAddr, pu64LastAddr, cMaxDepth, pHlp); 570 582 return RT_FAILURE(rc1) ? rc1 : rc2; 571 583 } 584 585 PVM pVM = pUVM->pVM; 586 VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE); 572 587 573 588 /* … … 626 641 * 627 642 * @returns VBox status code. 628 * @param p VM Pointer to the VM.643 * @param pUVM The user mode VM handle. 629 644 * @param idCpu The current CPU ID. 630 645 * @param fFlags The flags, DBGFPGDMP_FLAGS_XXX. … … 637 652 * NULL. 638 653 */ 639 VMMDECL(int) DBGFR3PagingDumpEx(P VM pVM, VMCPUID idCpu, uint32_t fFlags, uint64_t cr3, uint64_t u64FirstAddr,654 VMMDECL(int) DBGFR3PagingDumpEx(PUVM pUVM, VMCPUID idCpu, uint32_t fFlags, uint64_t cr3, uint64_t u64FirstAddr, 640 655 uint64_t u64LastAddr, uint32_t cMaxDepth, PCDBGFINFOHLP pHlp) 641 656 { … … 643 658 * Input validation. 644 659 */ 645 VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);646 AssertReturn(idCpu < p VM->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); 647 662 AssertReturn(!(fFlags & ~DBGFPGDMP_FLAGS_VALID_MASK), VERR_INVALID_PARAMETER); 648 663 AssertReturn(fFlags & (DBGFPGDMP_FLAGS_SHADOW | DBGFPGDMP_FLAGS_GUEST), VERR_INVALID_PARAMETER); … … 657 672 * Forward the request to the target CPU. 658 673 */ 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 5 5 6 6 /* 7 * Copyright (C) 2008 Oracle Corporation7 * Copyright (C) 2008-2013 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 24 24 #include <VBox/vmm/mm.h> 25 25 #include "DBGFInternal.h" 26 #include <VBox/vmm/ vm.h>26 #include <VBox/vmm/uvm.h> 27 27 #include <VBox/err.h> 28 28 #include <VBox/log.h> … … 36 36 * Defined Constants And Macros * 37 37 *******************************************************************************/ 38 #define DBGF_OS_READ_LOCK(p VM) do { } while (0)39 #define DBGF_OS_READ_UNLOCK(p VM) do { } while (0)40 41 #define DBGF_OS_WRITE_LOCK(p VM) do { } while (0)42 #define DBGF_OS_WRITE_UNLOCK(p VM) 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) 43 43 44 44 … … 46 46 * Internal cleanup routine called by DBGFR3Term(). 47 47 * 48 * @param p VM Pointer to the VM.49 */ 50 void dbgfR3OSTerm(P VM pVM)48 * @param pUVM The user mode VM handle. 49 */ 50 void dbgfR3OSTerm(PUVM pUVM) 51 51 { 52 52 /* 53 53 * Terminate the current one. 54 54 */ 55 if (p VM->dbgf.s.pCurOS)56 { 57 p VM->dbgf.s.pCurOS->pReg->pfnTerm(pVM, pVM->dbgf.s.pCurOS->abData);58 p VM->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; 59 59 } 60 60 … … 62 62 * Destroy all the instances. 63 63 */ 64 while (p VM->dbgf.s.pOSHead)65 { 66 PDBGFOS pOS = p VM->dbgf.s.pOSHead;67 p VM->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; 68 68 if (pOS->pReg->pfnDestruct) 69 pOS->pReg->pfnDestruct(p VM, pOS->abData);69 pOS->pReg->pfnDestruct(pUVM, pOS->abData); 70 70 MMR3HeapFree(pOS); 71 71 } … … 77 77 * 78 78 * @returns VBox status code. 79 * @param p VM Pointer to the VM.79 * @param pUVM The user mode VM handle. 80 80 * @param pReg The registration structure. 81 81 */ 82 static DECLCALLBACK(int) dbgfR3OSRegister(P VM pVM, PDBGFOSREG pReg)82 static DECLCALLBACK(int) dbgfR3OSRegister(PUVM pUVM, PDBGFOSREG pReg) 83 83 { 84 84 /* more validations. */ 85 DBGF_OS_READ_LOCK(p VM);85 DBGF_OS_READ_LOCK(pUVM); 86 86 PDBGFOS pOS; 87 for (pOS = p VM->dbgf.s.pOSHead; pOS; pOS = pOS->pNext)87 for (pOS = pUVM->dbgf.s.pOSHead; pOS; pOS = pOS->pNext) 88 88 if (!strcmp(pOS->pReg->szName, pReg->szName)) 89 89 { 90 DBGF_OS_READ_UNLOCK(p VM);90 DBGF_OS_READ_UNLOCK(pUVM); 91 91 Log(("dbgfR3OSRegister: %s -> VERR_ALREADY_LOADED\n", pReg->szName)); 92 92 return VERR_ALREADY_LOADED; … … 96 96 * Allocate a new structure, call the constructor and link it into the list. 97 97 */ 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])); 99 99 AssertReturn(pOS, VERR_NO_MEMORY); 100 100 pOS->pReg = pReg; 101 101 102 int rc = pOS->pReg->pfnConstruct(p VM, pOS->abData);102 int rc = pOS->pReg->pfnConstruct(pUVM, pOS->abData); 103 103 if (RT_SUCCESS(rc)) 104 104 { 105 DBGF_OS_WRITE_LOCK(p VM);106 pOS->pNext = p VM->dbgf.s.pOSHead;107 p VM->dbgf.s.pOSHead = pOS;108 DBGF_OS_WRITE_UNLOCK(p VM);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); 109 109 } 110 110 else 111 111 { 112 112 if (pOS->pReg->pfnDestruct) 113 pOS->pReg->pfnDestruct(p VM, pOS->abData);113 pOS->pReg->pfnDestruct(pUVM, pOS->abData); 114 114 MMR3HeapFree(pOS); 115 115 } … … 126 126 * 127 127 * @returns VBox status code. 128 * @param p VM Pointer to the VM.128 * @param pUVM The user mode VM handle. 129 129 * @param pReg The registration structure. 130 130 * @thread Any. 131 131 */ 132 VMMR3DECL(int) DBGFR3OSRegister(P VM pVM, PCDBGFOSREG pReg)132 VMMR3DECL(int) DBGFR3OSRegister(PUVM pUVM, PCDBGFOSREG pReg) 133 133 { 134 134 /* 135 135 * Validate intput. 136 136 */ 137 VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);137 UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE); 138 138 139 139 AssertPtrReturn(pReg, VERR_INVALID_POINTER); … … 156 156 * Pass it on to EMT(0). 157 157 */ 158 return VMR3ReqPriorityCallWait (pVM, 0 /*idDstCpu*/, (PFNRT)dbgfR3OSRegister, 2, pVM, pReg);158 return VMR3ReqPriorityCallWaitU(pUVM, 0 /*idDstCpu*/, (PFNRT)dbgfR3OSRegister, 2, pUVM, pReg); 159 159 } 160 160 … … 164 164 * 165 165 * @returns VBox status code. 166 * @param p VM Pointer to the VM.166 * @param pUVM The user mode VM handle. 167 167 * @param pReg The registration structure. 168 168 */ 169 static DECLCALLBACK(int) dbgfR3OSDeregister(P VM pVM, PDBGFOSREG pReg)169 static DECLCALLBACK(int) dbgfR3OSDeregister(PUVM pUVM, PDBGFOSREG pReg) 170 170 { 171 171 /* … … 175 175 PDBGFOS pOSPrev = NULL; 176 176 PDBGFOS pOS; 177 DBGF_OS_WRITE_LOCK(p VM);178 for (pOS = p VM->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) 179 179 if (pOS->pReg == pReg) 180 180 { … … 182 182 pOSPrev->pNext = pOS->pNext; 183 183 else 184 p VM->dbgf.s.pOSHead = pOS->pNext;185 if (p VM->dbgf.s.pCurOS == pOS)184 pUVM->dbgf.s.pOSHead = pOS->pNext; 185 if (pUVM->dbgf.s.pCurOS == pOS) 186 186 { 187 p VM->dbgf.s.pCurOS = NULL;187 pUVM->dbgf.s.pCurOS = NULL; 188 188 fWasCurOS = true; 189 189 } 190 190 break; 191 191 } 192 DBGF_OS_WRITE_UNLOCK(p VM);192 DBGF_OS_WRITE_UNLOCK(pUVM); 193 193 if (!pOS) 194 194 { … … 202 202 */ 203 203 if (fWasCurOS) 204 pOS->pReg->pfnTerm(p VM, pOS->abData);204 pOS->pReg->pfnTerm(pUVM, pOS->abData); 205 205 if (pOS->pReg->pfnDestruct) 206 pOS->pReg->pfnDestruct(p VM, pOS->abData);206 pOS->pReg->pfnDestruct(pUVM, pOS->abData); 207 207 MMR3HeapFree(pOS); 208 208 … … 216 216 * @returns VBox status code. 217 217 * 218 * @param p VM Pointer to the VM.218 * @param pUVM The user mode VM handle. 219 219 * @param pReg The registration structure. 220 220 * @thread Any. 221 221 */ 222 VMMR3DECL(int) DBGFR3OSDeregister(P VM pVM, PCDBGFOSREG pReg)222 VMMR3DECL(int) DBGFR3OSDeregister(PUVM pUVM, PCDBGFOSREG pReg) 223 223 { 224 224 /* 225 225 * Validate input. 226 226 */ 227 VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);227 UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE); 228 228 AssertPtrReturn(pReg, VERR_INVALID_POINTER); 229 229 AssertReturn(pReg->u32Magic == DBGFOSREG_MAGIC, VERR_INVALID_MAGIC); … … 231 231 AssertReturn(RTStrEnd(&pReg->szName[0], sizeof(pReg->szName)), VERR_INVALID_NAME); 232 232 233 DBGF_OS_READ_LOCK(p VM);233 DBGF_OS_READ_LOCK(pUVM); 234 234 PDBGFOS pOS; 235 for (pOS = p VM->dbgf.s.pOSHead; pOS; pOS = pOS->pNext)235 for (pOS = pUVM->dbgf.s.pOSHead; pOS; pOS = pOS->pNext) 236 236 if (pOS->pReg == pReg) 237 237 break; 238 DBGF_OS_READ_LOCK(p VM);238 DBGF_OS_READ_LOCK(pUVM); 239 239 240 240 if (!pOS) … … 247 247 * Pass it on to EMT(0). 248 248 */ 249 return VMR3ReqPriorityCallWait (pVM, 0 /*idDstCpu*/, (PFNRT)dbgfR3OSDeregister, 2, pVM, pReg);249 return VMR3ReqPriorityCallWaitU(pUVM, 0 /*idDstCpu*/, (PFNRT)dbgfR3OSDeregister, 2, pUVM, pReg); 250 250 } 251 251 … … 258 258 * @retval VINF_DBGF_OS_NOT_DETCTED if we cannot figure it out. 259 259 * 260 * @param p VM Pointer to the VM.260 * @param pUVM The user mode VM handle. 261 261 * @param pszName Where to store the OS name. Empty string if not detected. 262 262 * @param cchName Size of the buffer. 263 263 */ 264 static DECLCALLBACK(int) dbgfR3OSDetect(P VM pVM, char *pszName, size_t cchName)264 static DECLCALLBACK(int) dbgfR3OSDetect(PUVM pUVM, char *pszName, size_t cchName) 265 265 { 266 266 /* 267 267 * Cycle thru the detection routines. 268 268 */ 269 PDBGFOS const pOldOS = p VM->dbgf.s.pCurOS;270 p VM->dbgf.s.pCurOS = NULL;271 272 for (PDBGFOS pNewOS = p VM->dbgf.s.pOSHead; pNewOS; pNewOS = pNewOS->pNext)273 if (pNewOS->pReg->pfnProbe(p VM, 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)) 274 274 { 275 275 int rc; 276 p VM->dbgf.s.pCurOS = pNewOS;276 pUVM->dbgf.s.pCurOS = pNewOS; 277 277 if (pOldOS == pNewOS) 278 rc = pNewOS->pReg->pfnRefresh(p VM, pNewOS->abData);278 rc = pNewOS->pReg->pfnRefresh(pUVM, pNewOS->abData); 279 279 else 280 280 { 281 281 if (pOldOS) 282 pOldOS->pReg->pfnTerm(p VM, pNewOS->abData);283 rc = pNewOS->pReg->pfnInit(p VM, pNewOS->abData);282 pOldOS->pReg->pfnTerm(pUVM, pNewOS->abData); 283 rc = pNewOS->pReg->pfnInit(pUVM, pNewOS->abData); 284 284 } 285 285 if (pszName && cchName) … … 290 290 /* not found */ 291 291 if (pOldOS) 292 pOldOS->pReg->pfnTerm(p VM, pOldOS->abData);292 pOldOS->pReg->pfnTerm(pUVM, pOldOS->abData); 293 293 return VINF_DBGF_OS_NOT_DETCTED; 294 294 } … … 305 305 * @retval VINF_DBGF_OS_NOT_DETCTED if we cannot figure it out. 306 306 * 307 * @param p VM Pointer to the VM.307 * @param pUVM The user mode VM handle. 308 308 * @param pszName Where to store the OS name. Empty string if not detected. 309 309 * @param cchName Size of the buffer. 310 310 * @thread Any. 311 311 */ 312 VMMR3DECL(int) DBGFR3OSDetect(P VM pVM, char *pszName, size_t cchName)312 VMMR3DECL(int) DBGFR3OSDetect(PUVM pUVM, char *pszName, size_t cchName) 313 313 { 314 314 AssertPtrNullReturn(pszName, VERR_INVALID_POINTER); 315 315 if (pszName && cchName) 316 316 *pszName = '\0'; 317 UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE); 317 318 318 319 /* 319 320 * Pass it on to EMT(0). 320 321 */ 321 return VMR3ReqPriorityCallWait (pVM, 0 /*idDstCpu*/, (PFNRT)dbgfR3OSDetect, 3, pVM, pszName, cchName);322 return VMR3ReqPriorityCallWaitU(pUVM, 0 /*idDstCpu*/, (PFNRT)dbgfR3OSDetect, 3, pUVM, pszName, cchName); 322 323 } 323 324 … … 327 328 * 328 329 * @returns VBox status code. 329 * @param p VM Pointer to the VM.330 * @param pUVM The user mode VM handle. 330 331 * @param pszName Where to store the OS name. Optional. 331 332 * @param cchName The size of the name buffer. … … 333 334 * @param cchVersion The size of the version buffer. 334 335 */ 335 static DECLCALLBACK(int) dbgfR3OSQueryNameAndVersion(P VM pVM, char *pszName, size_t cchName, char *pszVersion, size_t cchVersion)336 static DECLCALLBACK(int) dbgfR3OSQueryNameAndVersion(PUVM pUVM, char *pszName, size_t cchName, char *pszVersion, size_t cchVersion) 336 337 { 337 338 /* 338 339 * Any known OS? 339 340 */ 340 if (p VM->dbgf.s.pCurOS)341 if (pUVM->dbgf.s.pCurOS) 341 342 { 342 343 int rc = VINF_SUCCESS; 343 344 if (pszName && cchName) 344 345 { 345 size_t cch = strlen(p VM->dbgf.s.pCurOS->pReg->szName);346 size_t cch = strlen(pUVM->dbgf.s.pCurOS->pReg->szName); 346 347 if (cchName > cch) 347 memcpy(pszName, p VM->dbgf.s.pCurOS->pReg->szName, cch + 1);348 memcpy(pszName, pUVM->dbgf.s.pCurOS->pReg->szName, cch + 1); 348 349 else 349 350 { 350 memcpy(pszName, p VM->dbgf.s.pCurOS->pReg->szName, cchName - 1);351 memcpy(pszName, pUVM->dbgf.s.pCurOS->pReg->szName, cchName - 1); 351 352 pszName[cchName - 1] = '\0'; 352 353 rc = VINF_BUFFER_OVERFLOW; … … 356 357 if (pszVersion && cchVersion) 357 358 { 358 int rc2 = p VM->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); 359 360 if (RT_FAILURE(rc2) || rc == VINF_SUCCESS) 360 361 rc = rc2; … … 374 375 * 375 376 * @returns VBox status code. 376 * @param p VM Pointer to the VM.377 * @param pUVM The user mode VM handle. 377 378 * @param pszName Where to store the OS name. Optional. 378 379 * @param cchName The size of the name buffer. … … 381 382 * @thread Any. 382 383 */ 383 VMMR3DECL(int) DBGFR3OSQueryNameAndVersion(PVM pVM, char *pszName, size_t cchName, char *pszVersion, size_t cchVersion) 384 { 384 VMMR3DECL(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); 385 387 AssertPtrNullReturn(pszName, VERR_INVALID_POINTER); 386 388 AssertPtrNullReturn(pszVersion, VERR_INVALID_POINTER); … … 397 399 * Pass it on to EMT(0). 398 400 */ 399 return VMR3ReqPriorityCallWait (pVM, 0 /*idDstCpu*/,400 (PFNRT)dbgfR3OSQueryNameAndVersion, 5, p VM, pszName, cchName, pszVersion, cchVersion);401 return VMR3ReqPriorityCallWaitU(pUVM, 0 /*idDstCpu*/, 402 (PFNRT)dbgfR3OSQueryNameAndVersion, 5, pUVM, pszName, cchName, pszVersion, cchVersion); 401 403 } 402 404 … … 405 407 * EMT worker for DBGFR3OSQueryInterface. 406 408 * 407 * @param p VM 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(P VM pVM, DBGFOSINTERFACE enmIf, void **ppvIf)412 { 413 if (p VM->dbgf.s.pCurOS)414 { 415 *ppvIf = p VM->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 */ 413 static 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); 416 418 if (*ppvIf) 417 419 { … … 430 432 * @returns Pointer to the digger interface on success, NULL if the interfaces isn't 431 433 * available or no active guest OS digger. 432 * @param p VM Pointer to the VM.433 * @param enmIf The interface identifier.434 * @param pUVM The user mode VM handle. 435 * @param enmIf The interface identifier. 434 436 * @thread Any. 435 437 */ 436 VMMR3DECL(void *) DBGFR3OSQueryInterface(P VM pVM, DBGFOSINTERFACE enmIf)438 VMMR3DECL(void *) DBGFR3OSQueryInterface(PUVM pUVM, DBGFOSINTERFACE enmIf) 437 439 { 438 440 AssertMsgReturn(enmIf > DBGFOSINTERFACE_INVALID && enmIf < DBGFOSINTERFACE_END, ("%d\n", enmIf), NULL); … … 442 444 */ 443 445 void *pvIf = NULL; 444 VMR3ReqPriorityCallVoidWaitU(p VM->pUVM, VMCPUID_ANY, (PFNRT)dbgfR3OSQueryInterface, 3, pVM, enmIf, &pvIf);446 VMR3ReqPriorityCallVoidWaitU(pUVM, VMCPUID_ANY, (PFNRT)dbgfR3OSQueryInterface, 3, pUVM, enmIf, &pvIf); 445 447 return pvIf; 446 448 } -
trunk/src/VBox/VMM/VMMR3/DBGFReg.cpp
r41803 r44399 25 25 #include <VBox/vmm/mm.h> 26 26 #include <VBox/vmm/vm.h> 27 #include <VBox/vmm/uvm.h> 27 28 #include <VBox/param.h> 28 29 #include <VBox/err.h> … … 37 38 *******************************************************************************/ 38 39 /** Locks the register database for writing. */ 39 #define DBGF_REG_DB_LOCK_WRITE(p VM) \40 #define DBGF_REG_DB_LOCK_WRITE(pUVM) \ 40 41 do { \ 41 int rcSem = RTSemRWRequestWrite((p VM)->dbgf.s.hRegDbLock, RT_INDEFINITE_WAIT); \42 int rcSem = RTSemRWRequestWrite((pUVM)->dbgf.s.hRegDbLock, RT_INDEFINITE_WAIT); \ 42 43 AssertRC(rcSem); \ 43 44 } while (0) 44 45 45 46 /** Unlocks the register database after writing. */ 46 #define DBGF_REG_DB_UNLOCK_WRITE(p VM) \47 #define DBGF_REG_DB_UNLOCK_WRITE(pUVM) \ 47 48 do { \ 48 int rcSem = RTSemRWReleaseWrite((p VM)->dbgf.s.hRegDbLock); \49 int rcSem = RTSemRWReleaseWrite((pUVM)->dbgf.s.hRegDbLock); \ 49 50 AssertRC(rcSem); \ 50 51 } while (0) 51 52 52 53 /** Locks the register database for reading. */ 53 #define DBGF_REG_DB_LOCK_READ(p VM) \54 #define DBGF_REG_DB_LOCK_READ(pUVM) \ 54 55 do { \ 55 int rcSem = RTSemRWRequestRead((p VM)->dbgf.s.hRegDbLock, RT_INDEFINITE_WAIT); \56 int rcSem = RTSemRWRequestRead((pUVM)->dbgf.s.hRegDbLock, RT_INDEFINITE_WAIT); \ 56 57 AssertRC(rcSem); \ 57 58 } while (0) 58 59 59 60 /** Unlocks the register database after reading. */ 60 #define DBGF_REG_DB_UNLOCK_READ(p VM) \61 #define DBGF_REG_DB_UNLOCK_READ(pUVM) \ 61 62 do { \ 62 int rcSem = RTSemRWReleaseRead((p VM)->dbgf.s.hRegDbLock); \63 int rcSem = RTSemRWReleaseRead((pUVM)->dbgf.s.hRegDbLock); \ 63 64 AssertRC(rcSem); \ 64 65 } while (0) … … 161 162 /** The number of entries in the output array. */ 162 163 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). */ 164 166 size_t iReg; 165 167 } DBGFR3REGNMQUERYALLARGS; … … 174 176 typedef struct DBGFR3REGPRINTFARGS 175 177 { 176 /** Pointer to the VM. */177 P VM pVM;178 /** The user mode VM handle. */ 179 PUVM pUVM; 178 180 /** The target CPU. */ 179 181 VMCPUID idCpu; … … 204 206 * 205 207 * @returns VBox status code. 206 * @param p VM Pointer to the VM.207 */ 208 int dbgfR3RegInit(P VM pVM)209 { 210 int rc= VINF_SUCCESS;211 if (!p VM->dbgf.s.fRegDbInitialized)212 { 213 rc = RTSemRWCreate(&p VM->dbgf.s.hRegDbLock);214 p VM->dbgf.s.fRegDbInitialized = RT_SUCCESS(rc);208 * @param pUVM The user mode VM handle. 209 */ 210 int 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); 215 217 } 216 218 return rc; … … 221 223 * Terminates the register database. 222 224 * 223 * @param p VM Pointer to the VM.224 */ 225 void dbgfR3RegTerm(P VM pVM)226 { 227 RTSemRWDestroy(p VM->dbgf.s.hRegDbLock);228 p VM->dbgf.s.hRegDbLock = NIL_RTSEMRW;229 p VM->dbgf.s.fRegDbInitialized = false;225 * @param pUVM The user mode VM handle. 226 */ 227 void dbgfR3RegTerm(PUVM pUVM) 228 { 229 RTSemRWDestroy(pUVM->dbgf.s.hRegDbLock); 230 pUVM->dbgf.s.hRegDbLock = NIL_RTSEMRW; 231 pUVM->dbgf.s.fRegDbInitialized = false; 230 232 } 231 233 … … 262 264 * 263 265 * @returns VBox status code. 264 * @param p VM Pointer to the VM.266 * @param pUVM The user mode VM handle. 265 267 * @param paRegisters The register descriptors. 266 268 * @param enmType The set type. … … 270 272 * pszPrefix when creating the set name. 271 273 */ 272 static int dbgfR3RegRegisterCommon(P VM pVM, PCDBGFREGDESC paRegisters, DBGFREGSETTYPE enmType, void *pvUserArg,274 static int dbgfR3RegRegisterCommon(PUVM pUVM, PCDBGFREGDESC paRegisters, DBGFREGSETTYPE enmType, void *pvUserArg, 273 275 const char *pszPrefix, uint32_t iInstance) 274 276 { … … 338 340 339 341 /* Check the instance number of the CPUs. */ 340 AssertReturn(enmType != DBGFREGSETTYPE_CPU || iInstance < p VM->cCpus, VERR_INVALID_CPU_ID);342 AssertReturn(enmType != DBGFREGSETTYPE_CPU || iInstance < pUVM->cCpus, VERR_INVALID_CPU_ID); 341 343 342 344 /* … … 348 350 cbRegSet += cLookupRecs * sizeof(DBGFREGLOOKUP); 349 351 350 PDBGFREGSET pRegSet = (PDBGFREGSET)MMR3HeapAllocZ (pVM, MM_TAG_DBGF_REG, cbRegSet);352 PDBGFREGSET pRegSet = (PDBGFREGSET)MMR3HeapAllocZU(pUVM, MM_TAG_DBGF_REG, cbRegSet); 351 353 if (!pRegSet) 352 354 return VERR_NO_MEMORY; … … 382 384 { 383 385 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); 385 387 if (!pLookupRec->Core.pszString) 386 388 rc = VERR_NO_STR_MEMORY; … … 411 413 { 412 414 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); 414 416 if (!pLookupRec->Core.pszString) 415 417 rc = VERR_NO_STR_MEMORY; … … 432 434 /* The alias record. */ 433 435 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); 435 437 if (!pLookupRec->Core.pszString) 436 438 rc = VERR_NO_STR_MEMORY; … … 450 452 * the CPU register set cache. 451 453 */ 452 DBGF_REG_DB_LOCK_WRITE(p VM);453 454 bool fInserted = RTStrSpaceInsert(&p VM->dbgf.s.RegSetSpace, &pRegSet->Core);454 DBGF_REG_DB_LOCK_WRITE(pUVM); 455 456 bool fInserted = RTStrSpaceInsert(&pUVM->dbgf.s.RegSetSpace, &pRegSet->Core); 455 457 if (fInserted) 456 458 { 457 p VM->dbgf.s.cRegs += pRegSet->cDescs;459 pUVM->dbgf.s.cRegs += pRegSet->cDescs; 458 460 if (enmType == DBGFREGSETTYPE_CPU) 459 461 { 460 462 if (pRegSet->cDescs > DBGFREG_ALL_COUNT) 461 p VM->dbgf.s.cRegs -= pRegSet->cDescs - DBGFREG_ALL_COUNT;463 pUVM->dbgf.s.cRegs -= pRegSet->cDescs - DBGFREG_ALL_COUNT; 462 464 if (!strcmp(pszPrefix, "cpu")) 463 p VM->aCpus[iInstance].dbgf.s.pGuestRegSet = pRegSet;465 pUVM->aCpus[iInstance].dbgf.s.pGuestRegSet = pRegSet; 464 466 else 465 p VM->aCpus[iInstance].dbgf.s.pHyperRegSet = pRegSet;467 pUVM->aCpus[iInstance].dbgf.s.pHyperRegSet = pRegSet; 466 468 } 467 469 … … 470 472 while (iLookupRec-- > 0) 471 473 { 472 bool fInserted2 = RTStrSpaceInsert(&p VM->dbgf.s.RegSpace, &paLookupRecs[iLookupRec].Core);474 bool fInserted2 = RTStrSpaceInsert(&pUVM->dbgf.s.RegSpace, &paLookupRecs[iLookupRec].Core); 473 475 AssertMsg(fInserted2, ("'%s'", paLookupRecs[iLookupRec].Core.pszString)); NOREF(fInserted2); 474 476 } 475 477 476 DBGF_REG_DB_UNLOCK_WRITE(p VM);478 DBGF_REG_DB_UNLOCK_WRITE(pUVM); 477 479 return VINF_SUCCESS; 478 480 } 479 481 480 DBGF_REG_DB_UNLOCK_WRITE(p VM);482 DBGF_REG_DB_UNLOCK_WRITE(pUVM); 481 483 rc = VERR_DUPLICATE; 482 484 } … … 505 507 VMMR3_INT_DECL(int) DBGFR3RegRegisterCpu(PVM pVM, PVMCPU pVCpu, PCDBGFREGDESC paRegisters, bool fGuestRegs) 506 508 { 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); 510 513 if (RT_FAILURE(rc)) 511 514 return rc; 512 515 } 513 516 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); 515 519 } 516 520 … … 525 529 * the standard name. 526 530 */ 527 VMMR3 DECL(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); 531 VMMR3_INT_DECL(int) DBGFR3RegRegisterDevice(PVM pVM, PCDBGFREGDESC paRegisters, PPDMDEVINS pDevIns, const char *pszPrefix, 532 uint32_t iInstance) 533 { 530 534 AssertPtrReturn(paRegisters, VERR_INVALID_POINTER); 531 535 AssertPtrReturn(pDevIns, VERR_INVALID_POINTER); 532 536 AssertPtrReturn(pszPrefix, VERR_INVALID_POINTER); 533 537 534 return dbgfR3RegRegisterCommon(pVM , paRegisters, DBGFREGSETTYPE_DEVICE, pDevIns, pszPrefix, iInstance);538 return dbgfR3RegRegisterCommon(pVM->pUVM, paRegisters, DBGFREGSETTYPE_DEVICE, pDevIns, pszPrefix, iInstance); 535 539 } 536 540 … … 782 786 * @retval VINF_DBGF_ZERO_EXTENDED_REGISTER 783 787 * 784 * @param p VM Pointer to the VM.788 * @param pUVM The user mode VM handle. 785 789 * @param idCpu The virtual CPU ID. 786 790 * @param enmReg The register to query. … … 790 794 * @param pValue Where to return the register value. 791 795 */ 792 static DECLCALLBACK(int) dbgfR3RegCpuQueryWorkerOnCpu(P VM pVM, VMCPUID idCpu, DBGFREG enmReg, DBGFREGVALTYPE enmType,796 static DECLCALLBACK(int) dbgfR3RegCpuQueryWorkerOnCpu(PUVM pUVM, VMCPUID idCpu, DBGFREG enmReg, DBGFREGVALTYPE enmType, 793 797 bool fGuestRegs, PDBGFREGVAL pValue) 794 798 { 795 799 int rc = VINF_SUCCESS; 796 DBGF_REG_DB_LOCK_READ(p VM);800 DBGF_REG_DB_LOCK_READ(pUVM); 797 801 798 802 /* … … 800 804 */ 801 805 PDBGFREGSET pSet = fGuestRegs 802 ? p VM->aCpus[idCpu].dbgf.s.pGuestRegSet803 : p VM->aCpus[idCpu].dbgf.s.pHyperRegSet;806 ? pUVM->aCpus[idCpu].dbgf.s.pGuestRegSet 807 : pUVM->aCpus[idCpu].dbgf.s.pHyperRegSet; 804 808 if (RT_LIKELY(pSet)) 805 809 { … … 831 835 rc = VERR_INVALID_CPU_ID; 832 836 833 DBGF_REG_DB_UNLOCK_READ(p VM);837 DBGF_REG_DB_UNLOCK_READ(pUVM); 834 838 return rc; 835 839 } … … 848 852 * @retval VINF_DBGF_ZERO_EXTENDED_REGISTER 849 853 * 850 * @param p VM Pointer to the VM.854 * @param pUVM The user mode VM handle. 851 855 * @param idCpu The virtual CPU ID. Can be OR'ed with 852 856 * DBGFREG_HYPER_VMCPUID. … … 855 859 * @param pValue Where to return the register value. 856 860 */ 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); 861 static 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); 860 865 AssertMsgReturn(enmReg >= DBGFREG_AL && enmReg <= DBGFREG_END, ("%d\n", enmReg), VERR_INVALID_PARAMETER); 861 866 862 867 bool const fGuestRegs = !(idCpu & DBGFREG_HYPER_VMCPUID); 863 868 idCpu &= ~DBGFREG_HYPER_VMCPUID; 864 AssertReturn(idCpu < p VM->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); 868 873 } 869 874 … … 879 884 * @retval VINF_DBGF_TRUNCATED_REGISTER 880 885 * 881 * @param p VM Pointer to the VM.886 * @param pUVM The user mode VM handle. 882 887 * @param idCpu The target CPU ID. Can be OR'ed with 883 888 * DBGFREG_HYPER_VMCPUID. … … 885 890 * @param pu8 Where to store the register value. 886 891 */ 887 VMMR3DECL(int) DBGFR3RegCpuQueryU8(P VM pVM, VMCPUID idCpu, DBGFREG enmReg, uint8_t *pu8)892 VMMR3DECL(int) DBGFR3RegCpuQueryU8(PUVM pUVM, VMCPUID idCpu, DBGFREG enmReg, uint8_t *pu8) 888 893 { 889 894 DBGFREGVAL Value; 890 int rc = dbgfR3RegCpuQueryWorker(p VM, idCpu, enmReg, DBGFREGVALTYPE_U8, &Value);895 int rc = dbgfR3RegCpuQueryWorker(pUVM, idCpu, enmReg, DBGFREGVALTYPE_U8, &Value); 891 896 if (RT_SUCCESS(rc)) 892 897 *pu8 = Value.u8; … … 908 913 * @retval VINF_DBGF_ZERO_EXTENDED_REGISTER 909 914 * 910 * @param p VM Pointer to the VM.915 * @param pUVM The user mode VM handle. 911 916 * @param idCpu The target CPU ID. Can be OR'ed with 912 917 * DBGFREG_HYPER_VMCPUID. … … 914 919 * @param pu16 Where to store the register value. 915 920 */ 916 VMMR3DECL(int) DBGFR3RegCpuQueryU16(P VM pVM, VMCPUID idCpu, DBGFREG enmReg, uint16_t *pu16)921 VMMR3DECL(int) DBGFR3RegCpuQueryU16(PUVM pUVM, VMCPUID idCpu, DBGFREG enmReg, uint16_t *pu16) 917 922 { 918 923 DBGFREGVAL Value; 919 int rc = dbgfR3RegCpuQueryWorker(p VM, idCpu, enmReg, DBGFREGVALTYPE_U16, &Value);924 int rc = dbgfR3RegCpuQueryWorker(pUVM, idCpu, enmReg, DBGFREGVALTYPE_U16, &Value); 920 925 if (RT_SUCCESS(rc)) 921 926 *pu16 = Value.u16; … … 937 942 * @retval VINF_DBGF_ZERO_EXTENDED_REGISTER 938 943 * 939 * @param p VM Pointer to the VM.944 * @param pUVM The user mode VM handle. 940 945 * @param idCpu The target CPU ID. Can be OR'ed with 941 946 * DBGFREG_HYPER_VMCPUID. … … 943 948 * @param pu32 Where to store the register value. 944 949 */ 945 VMMR3DECL(int) DBGFR3RegCpuQueryU32(P VM pVM, VMCPUID idCpu, DBGFREG enmReg, uint32_t *pu32)950 VMMR3DECL(int) DBGFR3RegCpuQueryU32(PUVM pUVM, VMCPUID idCpu, DBGFREG enmReg, uint32_t *pu32) 946 951 { 947 952 DBGFREGVAL Value; 948 int rc = dbgfR3RegCpuQueryWorker(p VM, idCpu, enmReg, DBGFREGVALTYPE_U32, &Value);953 int rc = dbgfR3RegCpuQueryWorker(pUVM, idCpu, enmReg, DBGFREGVALTYPE_U32, &Value); 949 954 if (RT_SUCCESS(rc)) 950 955 *pu32 = Value.u32; … … 966 971 * @retval VINF_DBGF_ZERO_EXTENDED_REGISTER 967 972 * 968 * @param p VM Pointer to the VM.973 * @param pUVM The user mode VM handle. 969 974 * @param idCpu The target CPU ID. Can be OR'ed with 970 975 * DBGFREG_HYPER_VMCPUID. … … 972 977 * @param pu64 Where to store the register value. 973 978 */ 974 VMMR3DECL(int) DBGFR3RegCpuQueryU64(P VM pVM, VMCPUID idCpu, DBGFREG enmReg, uint64_t *pu64)979 VMMR3DECL(int) DBGFR3RegCpuQueryU64(PUVM pUVM, VMCPUID idCpu, DBGFREG enmReg, uint64_t *pu64) 975 980 { 976 981 DBGFREGVAL Value; 977 int rc = dbgfR3RegCpuQueryWorker(p VM, idCpu, enmReg, DBGFREGVALTYPE_U64, &Value);982 int rc = dbgfR3RegCpuQueryWorker(pUVM, idCpu, enmReg, DBGFREGVALTYPE_U64, &Value); 978 983 if (RT_SUCCESS(rc)) 979 984 *pu64 = Value.u64; … … 1008 1013 1009 1014 1010 static DECLCALLBACK(int) dbgfR3RegCpuQueryBatchWorker(P VM pVM, VMCPUID idCpu, PDBGFREGENTRY paRegs, size_t cRegs)1015 static DECLCALLBACK(int) dbgfR3RegCpuQueryBatchWorker(PUVM pUVM, VMCPUID idCpu, PDBGFREGENTRY paRegs, size_t cRegs) 1011 1016 { 1012 1017 #if 0 1013 PVMCPU pVCpu = &p VM->aCpus[idCpu];1018 PVMCPU pVCpu = &pUVM->pVM->aCpus[idCpu]; 1014 1019 PCCPUMCTX pCtx = CPUMQueryGuestCtxPtr(pVCpu); 1015 1020 … … 1071 1076 * @retval VERR_DBGF_REGISTER_NOT_FOUND 1072 1077 * 1073 * @param p VM Pointer to the VM.1078 * @param pUVM The user mode VM handle. 1074 1079 * @param idCpu The target CPU ID. Can be OR'ed with 1075 1080 * DBGFREG_HYPER_VMCPUID. … … 1081 1086 * @param cRegs The number of entries in @a paRegs. 1082 1087 */ 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); 1088 VMMR3DECL(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); 1087 1093 if (!cRegs) 1088 1094 return VINF_SUCCESS; … … 1096 1102 } 1097 1103 1098 return VMR3ReqCallWait (pVM, idCpu, (PFNRT)dbgfR3RegCpuQueryBatchWorker, 4, pVM, idCpu, paRegs, cRegs);1104 return VMR3ReqCallWaitU(pUVM, idCpu, (PFNRT)dbgfR3RegCpuQueryBatchWorker, 4, pUVM, idCpu, paRegs, cRegs); 1099 1105 } 1100 1106 … … 1107 1113 * @retval VERR_INVALID_CPU_ID 1108 1114 * 1109 * @param p VM Pointer to the VM.1115 * @param pUVM The user mode VM handle. 1110 1116 * @param idCpu The target CPU ID. Can be OR'ed with 1111 1117 * DBGFREG_HYPER_VMCPUID. … … 1118 1124 * recommended value is DBGFREG_ALL_COUNT. 1119 1125 */ 1120 VMMR3DECL(int) DBGFR3RegCpuQueryAll(P VM pVM, VMCPUID idCpu, PDBGFREGENTRY paRegs, size_t cRegs)1126 VMMR3DECL(int) DBGFR3RegCpuQueryAll(PUVM pUVM, VMCPUID idCpu, PDBGFREGENTRY paRegs, size_t cRegs) 1121 1127 { 1122 1128 /* 1123 1129 * Validate input. 1124 1130 */ 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); 1127 1134 if (!cRegs) 1128 1135 return VINF_SUCCESS; … … 1142 1149 paRegs[iReg++].enmReg = DBGFREG_END; 1143 1150 1144 return VMR3ReqCallWait (pVM, idCpu, (PFNRT)dbgfR3RegCpuQueryBatchWorker, 4, pVM, idCpu, paRegs, cRegs);1151 return VMR3ReqCallWaitU(pUVM, idCpu, (PFNRT)dbgfR3RegCpuQueryBatchWorker, 4, pUVM, idCpu, paRegs, cRegs); 1145 1152 } 1146 1153 … … 1153 1160 * parameters are invalid. 1154 1161 * 1155 * @param p VM Pointer to the VM.1162 * @param pUVM The user mode VM handle. 1156 1163 * @param enmReg The register identifier. 1157 1164 * @param enmType The register type. This is for sort out … … 1159 1166 * the standard name. 1160 1167 */ 1161 VMMR3DECL(const char *) DBGFR3RegCpuName(P VM pVM, DBGFREG enmReg, DBGFREGVALTYPE enmType)1168 VMMR3DECL(const char *) DBGFR3RegCpuName(PUVM pUVM, DBGFREG enmReg, DBGFREGVALTYPE enmType) 1162 1169 { 1163 1170 AssertReturn(enmReg >= DBGFREG_AL && enmReg < DBGFREG_END, NULL); 1164 1171 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; 1168 1176 if (RT_UNLIKELY(!pSet)) 1169 1177 return NULL; … … 1221 1229 * 1222 1230 * @returns Lookup record. 1223 * @param p VM Pointer to the VM.1231 * @param pUVM The user mode VM handle. 1224 1232 * @param idDefCpu The default CPU ID set. 1225 1233 * @param pszReg The register name. … … 1227 1235 * hypervisor CPU registers if clear. 1228 1236 */ 1229 static PCDBGFREGLOOKUP dbgfR3RegResolve(P VM pVM, VMCPUID idDefCpu, const char *pszReg, bool fGuestRegs)1230 { 1231 DBGF_REG_DB_LOCK_READ(p VM);1237 static PCDBGFREGLOOKUP dbgfR3RegResolve(PUVM pUVM, VMCPUID idDefCpu, const char *pszReg, bool fGuestRegs) 1238 { 1239 DBGF_REG_DB_LOCK_READ(pUVM); 1232 1240 1233 1241 /* 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); 1235 1244 if (!pLookupRec) 1236 1245 { … … 1240 1249 ssize_t cchFolded = dbgfR3RegCopyToLower(pszReg, RTSTR_MAX, szName, sizeof(szName) - DBGF_REG_MAX_NAME); 1241 1250 if (cchFolded > 0) 1242 pLookupRec = (PCDBGFREGLOOKUP)RTStrSpaceGet( &pVM->dbgf.s.RegSpace, szName);1251 pLookupRec = (PCDBGFREGLOOKUP)RTStrSpaceGet(pRegSpace, szName); 1243 1252 if ( !pLookupRec 1244 1253 && cchFolded >= 0 … … 1248 1257 size_t cchCpuSet = RTStrPrintf(szName, sizeof(szName), fGuestRegs ? "cpu%u." : "hypercpu%u.", idDefCpu); 1249 1258 dbgfR3RegCopyToLower(pszReg, RTSTR_MAX, &szName[cchCpuSet], sizeof(szName) - cchCpuSet); 1250 pLookupRec = (PCDBGFREGLOOKUP)RTStrSpaceGet( &pVM->dbgf.s.RegSpace, szName);1259 pLookupRec = (PCDBGFREGLOOKUP)RTStrSpaceGet(pRegSpace, szName); 1251 1260 } 1252 1261 } 1253 1262 1254 DBGF_REG_DB_UNLOCK_READ(p VM);1263 DBGF_REG_DB_UNLOCK_READ(pUVM); 1255 1264 return pLookupRec; 1256 1265 } … … 1264 1273 * @retval VERR_DBGF_REGISTER_NOT_FOUND if not found. 1265 1274 * 1266 * @param p VM Pointer to the VM.1275 * @param pUVM The user mode VM handle. 1267 1276 * @param idDefCpu The default CPU. 1268 1277 * @param pszReg The registe name. 1269 1278 */ 1270 VMMR3DECL(int) DBGFR3RegNmValidate(P VM pVM, VMCPUID idDefCpu, const char *pszReg)1279 VMMR3DECL(int) DBGFR3RegNmValidate(PUVM pUVM, VMCPUID idDefCpu, const char *pszReg) 1271 1280 { 1272 1281 /* 1273 1282 * Validate input. 1274 1283 */ 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); 1277 1287 AssertPtrReturn(pszReg, VERR_INVALID_POINTER); 1278 1288 … … 1281 1291 */ 1282 1292 bool const fGuestRegs = !(idDefCpu & DBGFREG_HYPER_VMCPUID) && idDefCpu != VMCPUID_ANY; 1283 PCDBGFREGLOOKUP pLookupRec = dbgfR3RegResolve(p VM, idDefCpu, pszReg, fGuestRegs);1293 PCDBGFREGLOOKUP pLookupRec = dbgfR3RegResolve(pUVM, idDefCpu, pszReg, fGuestRegs); 1284 1294 if (!pLookupRec) 1285 1295 return VERR_DBGF_REGISTER_NOT_FOUND; … … 1294 1304 * @returns VBox status code. 1295 1305 * 1296 * @param p VM Pointer to the VM.1306 * @param pUVM The user mode VM handle. 1297 1307 * @param pLookupRec The register lookup record. 1298 1308 * @param enmType The desired return type. … … 1301 1311 * Optional. 1302 1312 */ 1303 static DECLCALLBACK(int) dbgfR3RegNmQueryWorkerOnCpu(P VM pVM, PCDBGFREGLOOKUP pLookupRec, DBGFREGVALTYPE enmType,1313 static DECLCALLBACK(int) dbgfR3RegNmQueryWorkerOnCpu(PUVM pUVM, PCDBGFREGLOOKUP pLookupRec, DBGFREGVALTYPE enmType, 1304 1314 PDBGFREGVAL pValue, PDBGFREGVALTYPE penmType) 1305 1315 { … … 1310 1320 int rc; 1311 1321 1312 NOREF(p VM);1322 NOREF(pUVM); 1313 1323 1314 1324 /* … … 1409 1419 * @retval VINF_DBGF_ZERO_EXTENDED_REGISTER 1410 1420 * 1411 * @param p VM Pointer to the VM.1421 * @param pUVM The user mode VM handle. 1412 1422 * @param idDefCpu The virtual CPU ID for the default CPU register 1413 1423 * set. Can be OR'ed with DBGFREG_HYPER_VMCPUID. … … 1418 1428 * Optional. 1419 1429 */ 1420 static int dbgfR3RegNmQueryWorker(P VM pVM, VMCPUID idDefCpu, const char *pszReg, DBGFREGVALTYPE enmType,1430 static int dbgfR3RegNmQueryWorker(PUVM pUVM, VMCPUID idDefCpu, const char *pszReg, DBGFREGVALTYPE enmType, 1421 1431 PDBGFREGVAL pValue, PDBGFREGVALTYPE penmType) 1422 1432 { … … 1424 1434 * Validate input. 1425 1435 */ 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); 1428 1439 AssertPtrReturn(pszReg, VERR_INVALID_POINTER); 1429 1440 … … 1435 1446 */ 1436 1447 bool const fGuestRegs = !(idDefCpu & DBGFREG_HYPER_VMCPUID) && idDefCpu != VMCPUID_ANY; 1437 PCDBGFREGLOOKUP pLookupRec = dbgfR3RegResolve(p VM, idDefCpu, pszReg, fGuestRegs);1448 PCDBGFREGLOOKUP pLookupRec = dbgfR3RegResolve(pUVM, idDefCpu, pszReg, fGuestRegs); 1438 1449 if (pLookupRec) 1439 1450 { … … 1442 1453 else if (idDefCpu != VMCPUID_ANY) 1443 1454 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); 1445 1457 } 1446 1458 return VERR_DBGF_REGISTER_NOT_FOUND; … … 1456 1468 * @retval VERR_DBGF_REGISTER_NOT_FOUND 1457 1469 * 1458 * @param p VM Pointer to the VM.1470 * @param pUVM The user mode VM handle. 1459 1471 * @param idDefCpu The default target CPU ID, VMCPUID_ANY if not 1460 1472 * applicable. Can be OR'ed with … … 1466 1478 * @param penmType Where to store the register value type. 1467 1479 */ 1468 VMMR3DECL(int) DBGFR3RegNmQuery(P VM pVM, VMCPUID idDefCpu, const char *pszReg, PDBGFREGVAL pValue, PDBGFREGVALTYPE penmType)1469 { 1470 return dbgfR3RegNmQueryWorker(p VM, idDefCpu, pszReg, DBGFREGVALTYPE_END, pValue, penmType);1480 VMMR3DECL(int) DBGFR3RegNmQuery(PUVM pUVM, VMCPUID idDefCpu, const char *pszReg, PDBGFREGVAL pValue, PDBGFREGVALTYPE penmType) 1481 { 1482 return dbgfR3RegNmQueryWorker(pUVM, idDefCpu, pszReg, DBGFREGVALTYPE_END, pValue, penmType); 1471 1483 } 1472 1484 … … 1482 1494 * @retval VINF_DBGF_TRUNCATED_REGISTER 1483 1495 * 1484 * @param p VM Pointer to the VM.1496 * @param pUVM The user mode VM handle. 1485 1497 * @param idDefCpu The default target CPU ID, VMCPUID_ANY if not 1486 1498 * applicable. Can be OR'ed with … … 1491 1503 * @param pu8 Where to store the register value. 1492 1504 */ 1493 VMMR3DECL(int) DBGFR3RegNmQueryU8(P VM pVM, VMCPUID idDefCpu, const char *pszReg, uint8_t *pu8)1505 VMMR3DECL(int) DBGFR3RegNmQueryU8(PUVM pUVM, VMCPUID idDefCpu, const char *pszReg, uint8_t *pu8) 1494 1506 { 1495 1507 DBGFREGVAL Value; 1496 int rc = dbgfR3RegNmQueryWorker(p VM, idDefCpu, pszReg, DBGFREGVALTYPE_U8, &Value, NULL);1508 int rc = dbgfR3RegNmQueryWorker(pUVM, idDefCpu, pszReg, DBGFREGVALTYPE_U8, &Value, NULL); 1497 1509 if (RT_SUCCESS(rc)) 1498 1510 *pu8 = Value.u8; … … 1514 1526 * @retval VINF_DBGF_ZERO_EXTENDED_REGISTER 1515 1527 * 1516 * @param p VM Pointer to the VM.1528 * @param pUVM The user mode VM handle. 1517 1529 * @param idDefCpu The default target CPU ID, VMCPUID_ANY if not 1518 1530 * applicable. Can be OR'ed with … … 1523 1535 * @param pu16 Where to store the register value. 1524 1536 */ 1525 VMMR3DECL(int) DBGFR3RegNmQueryU16(P VM pVM, VMCPUID idDefCpu, const char *pszReg, uint16_t *pu16)1537 VMMR3DECL(int) DBGFR3RegNmQueryU16(PUVM pUVM, VMCPUID idDefCpu, const char *pszReg, uint16_t *pu16) 1526 1538 { 1527 1539 DBGFREGVAL Value; 1528 int rc = dbgfR3RegNmQueryWorker(p VM, idDefCpu, pszReg, DBGFREGVALTYPE_U16, &Value, NULL);1540 int rc = dbgfR3RegNmQueryWorker(pUVM, idDefCpu, pszReg, DBGFREGVALTYPE_U16, &Value, NULL); 1529 1541 if (RT_SUCCESS(rc)) 1530 1542 *pu16 = Value.u16; … … 1546 1558 * @retval VINF_DBGF_ZERO_EXTENDED_REGISTER 1547 1559 * 1548 * @param p VM Pointer to the VM.1560 * @param pUVM The user mode VM handle. 1549 1561 * @param idDefCpu The default target CPU ID, VMCPUID_ANY if not 1550 1562 * applicable. Can be OR'ed with … … 1555 1567 * @param pu32 Where to store the register value. 1556 1568 */ 1557 VMMR3DECL(int) DBGFR3RegNmQueryU32(P VM pVM, VMCPUID idDefCpu, const char *pszReg, uint32_t *pu32)1569 VMMR3DECL(int) DBGFR3RegNmQueryU32(PUVM pUVM, VMCPUID idDefCpu, const char *pszReg, uint32_t *pu32) 1558 1570 { 1559 1571 DBGFREGVAL Value; 1560 int rc = dbgfR3RegNmQueryWorker(p VM, idDefCpu, pszReg, DBGFREGVALTYPE_U32, &Value, NULL);1572 int rc = dbgfR3RegNmQueryWorker(pUVM, idDefCpu, pszReg, DBGFREGVALTYPE_U32, &Value, NULL); 1561 1573 if (RT_SUCCESS(rc)) 1562 1574 *pu32 = Value.u32; … … 1578 1590 * @retval VINF_DBGF_ZERO_EXTENDED_REGISTER 1579 1591 * 1580 * @param p VM Pointer to the VM.1592 * @param pUVM The user mode VM handle. 1581 1593 * @param idDefCpu The default target CPU ID, VMCPUID_ANY if not 1582 1594 * applicable. Can be OR'ed with … … 1587 1599 * @param pu64 Where to store the register value. 1588 1600 */ 1589 VMMR3DECL(int) DBGFR3RegNmQueryU64(P VM pVM, VMCPUID idDefCpu, const char *pszReg, uint64_t *pu64)1601 VMMR3DECL(int) DBGFR3RegNmQueryU64(PUVM pUVM, VMCPUID idDefCpu, const char *pszReg, uint64_t *pu64) 1590 1602 { 1591 1603 DBGFREGVAL Value; 1592 int rc = dbgfR3RegNmQueryWorker(p VM, idDefCpu, pszReg, DBGFREGVALTYPE_U64, &Value, NULL);1604 int rc = dbgfR3RegNmQueryWorker(pUVM, idDefCpu, pszReg, DBGFREGVALTYPE_U64, &Value, NULL); 1593 1605 if (RT_SUCCESS(rc)) 1594 1606 *pu64 = Value.u64; … … 1610 1622 * @retval VINF_DBGF_ZERO_EXTENDED_REGISTER 1611 1623 * 1612 * @param p VM Pointer to the VM.1624 * @param pUVM The user mode VM handle. 1613 1625 * @param idDefCpu The default target CPU ID, VMCPUID_ANY if not 1614 1626 * applicable. Can be OR'ed with … … 1619 1631 * @param pu128 Where to store the register value. 1620 1632 */ 1621 VMMR3DECL(int) DBGFR3RegNmQueryU128(P VM pVM, VMCPUID idDefCpu, const char *pszReg, PRTUINT128U pu128)1633 VMMR3DECL(int) DBGFR3RegNmQueryU128(PUVM pUVM, VMCPUID idDefCpu, const char *pszReg, PRTUINT128U pu128) 1622 1634 { 1623 1635 DBGFREGVAL Value; 1624 int rc = dbgfR3RegNmQueryWorker(p VM, idDefCpu, pszReg, DBGFREGVALTYPE_U128, &Value, NULL);1636 int rc = dbgfR3RegNmQueryWorker(pUVM, idDefCpu, pszReg, DBGFREGVALTYPE_U128, &Value, NULL); 1625 1637 if (RT_SUCCESS(rc)) 1626 1638 *pu128 = Value.u128; … … 1643 1655 * @retval VINF_DBGF_ZERO_EXTENDED_REGISTER 1644 1656 * 1645 * @param p VM Pointer to the VM.1657 * @param pUVM The user mode VM handle. 1646 1658 * @param idDefCpu The default target CPU ID, VMCPUID_ANY if not 1647 1659 * applicable. Can be OR'ed with … … 1652 1664 * @param plrd Where to store the register value. 1653 1665 */ 1654 VMMR3DECL(int) DBGFR3RegNmQueryLrd(P VM pVM, VMCPUID idDefCpu, const char *pszReg, long double *plrd)1666 VMMR3DECL(int) DBGFR3RegNmQueryLrd(PUVM pUVM, VMCPUID idDefCpu, const char *pszReg, long double *plrd) 1655 1667 { 1656 1668 DBGFREGVAL Value; 1657 int rc = dbgfR3RegNmQueryWorker(p VM, idDefCpu, pszReg, DBGFREGVALTYPE_R80, &Value, NULL);1669 int rc = dbgfR3RegNmQueryWorker(pUVM, idDefCpu, pszReg, DBGFREGVALTYPE_R80, &Value, NULL); 1658 1670 if (RT_SUCCESS(rc)) 1659 1671 *plrd = Value.lrd; … … 1676 1688 * @retval VINF_DBGF_ZERO_EXTENDED_REGISTER 1677 1689 * 1678 * @param p VM Pointer to the VM.1690 * @param pUVM The user mode VM handle. 1679 1691 * @param idDefCpu The default target CPU ID, VMCPUID_ANY if not 1680 1692 * applicable. Can be OR'ed with … … 1686 1698 * @param pu32Limit Where to store the register limit value. 1687 1699 */ 1688 VMMR3DECL(int) DBGFR3RegNmQueryXdtr(P VM pVM, VMCPUID idDefCpu, const char *pszReg, uint64_t *pu64Base, uint32_t *pu32Limit)1700 VMMR3DECL(int) DBGFR3RegNmQueryXdtr(PUVM pUVM, VMCPUID idDefCpu, const char *pszReg, uint64_t *pu64Base, uint32_t *pu32Limit) 1689 1701 { 1690 1702 DBGFREGVAL Value; 1691 int rc = dbgfR3RegNmQueryWorker(p VM, idDefCpu, pszReg, DBGFREGVALTYPE_DTR, &Value, NULL);1703 int rc = dbgfR3RegNmQueryWorker(pUVM, idDefCpu, pszReg, DBGFREGVALTYPE_DTR, &Value, NULL); 1692 1704 if (RT_SUCCESS(rc)) 1693 1705 { … … 1704 1716 1705 1717 1706 /// @todo VMMR3DECL(int) DBGFR3RegNmQueryBatch(P VM pVM,VMCPUID idDefCpu, DBGFREGENTRYNM paRegs, size_t cRegs);1718 /// @todo VMMR3DECL(int) DBGFR3RegNmQueryBatch(PUVM pUVM,VMCPUID idDefCpu, DBGFREGENTRYNM paRegs, size_t cRegs); 1707 1719 1708 1720 … … 1711 1723 * 1712 1724 * @returns VBox status code. 1713 * @param p VM Pointer to the VM.1725 * @param pUVM The user mode VM handle. 1714 1726 * @param pcRegs Where to return the register count. 1715 1727 */ 1716 VMMR3DECL(int) DBGFR3RegNmQueryAllCount(P VM pVM, size_t *pcRegs)1717 { 1718 VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);1719 *pcRegs = p VM->dbgf.s.cRegs;1728 VMMR3DECL(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; 1720 1732 return VINF_SUCCESS; 1721 1733 } … … 1803 1815 PDBGFREGENTRYNM paRegs = pArgs->paRegs; 1804 1816 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); 1807 1821 1808 1822 /* … … 1810 1824 */ 1811 1825 size_t iCpuReg = pVCpu->idCpu * DBGFREG_ALL_COUNT; 1812 if (p VCpu->dbgf.s.pGuestRegSet)1826 if (pUVCpu->dbgf.s.pGuestRegSet) 1813 1827 { 1814 1828 if (iCpuReg < cRegs) 1815 dbgfR3RegNmQueryAllInSet(p VCpu->dbgf.s.pGuestRegSet, DBGFREG_ALL_COUNT, &paRegs[iCpuReg], cRegs - iCpuReg);1829 dbgfR3RegNmQueryAllInSet(pUVCpu->dbgf.s.pGuestRegSet, DBGFREG_ALL_COUNT, &paRegs[iCpuReg], cRegs - iCpuReg); 1816 1830 } 1817 1831 else … … 1821 1835 * My hypervisor CPU registers. 1822 1836 */ 1823 iCpuReg = p VM->cCpus * DBGFREG_ALL_COUNT + pVCpu->idCpu * DBGFREG_ALL_COUNT;1824 if (p VCpu->dbgf.s.pHyperRegSet)1837 iCpuReg = pUVM->cCpus * DBGFREG_ALL_COUNT + pUVCpu->idCpu * DBGFREG_ALL_COUNT; 1838 if (pUVCpu->dbgf.s.pHyperRegSet) 1825 1839 { 1826 1840 if (iCpuReg < cRegs) 1827 dbgfR3RegNmQueryAllInSet(p VCpu->dbgf.s.pHyperRegSet, DBGFREG_ALL_COUNT, &paRegs[iCpuReg], cRegs - iCpuReg);1841 dbgfR3RegNmQueryAllInSet(pUVCpu->dbgf.s.pHyperRegSet, DBGFREG_ALL_COUNT, &paRegs[iCpuReg], cRegs - iCpuReg); 1828 1842 } 1829 1843 else … … 1833 1847 * The primary CPU does all the other registers. 1834 1848 */ 1835 if (p VCpu->idCpu == 0)1836 { 1837 pArgs->iReg = p VM->cCpus * DBGFREG_ALL_COUNT * 2;1838 RTStrSpaceEnumerate(&p VM->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); 1839 1853 dbgfR3RegNmQueryAllPadEntries(paRegs, cRegs, pArgs->iReg, cRegs); 1840 1854 } 1841 1855 1842 DBGF_REG_DB_UNLOCK_READ(p VM);1856 DBGF_REG_DB_UNLOCK_READ(pUVM); 1843 1857 return VINF_SUCCESS; /* Ignore errors. */ 1844 1858 } … … 1849 1863 * 1850 1864 * @returns VBox status code. 1851 * @param p VM Pointer to the VM.1865 * @param pUVM The user mode VM handle. 1852 1866 * @param paRegs The output register value array. The register 1853 1867 * name string is read only and shall not be freed … … 1857 1871 * DBGFR3RegNmQueryAllCount. 1858 1872 */ 1859 VMMR3DECL(int) DBGFR3RegNmQueryAll(PVM pVM, PDBGFREGENTRYNM paRegs, size_t cRegs) 1860 { 1873 VMMR3DECL(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; 1861 1877 VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE); 1862 1878 AssertPtrReturn(paRegs, VERR_INVALID_POINTER); … … 1871 1887 1872 1888 1873 VMMR3DECL(int) DBGFR3RegNmSet(P VM pVM, VMCPUID idDefCpu, const char *pszReg, PCDBGFREGVAL pValue, DBGFREGVALTYPE enmType)1874 { 1875 NOREF(p VM); NOREF(idDefCpu); NOREF(pszReg); NOREF(pValue); NOREF(enmType);1889 VMMR3DECL(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); 1876 1892 return VERR_NOT_IMPLEMENTED; 1877 1893 } … … 1923 1939 1924 1940 1925 1926 1941 /** 1927 1942 * Format a register value, extended version. … … 1939 1954 * @param fFlags String formatting flags, RTSTR_F_XXX. 1940 1955 */ 1941 VMM DECL(ssize_t) DBGFR3RegFormatValueEx(char *pszBuf, size_t cbBuf, PCDBGFREGVAL pValue, DBGFREGVALTYPE enmType,1942 unsigned uBase, signed int cchWidth, signed int cchPrecision, uint32_t fFlags)1956 VMMR3DECL(ssize_t) DBGFR3RegFormatValueEx(char *pszBuf, size_t cbBuf, PCDBGFREGVAL pValue, DBGFREGVALTYPE enmType, 1957 unsigned uBase, signed int cchWidth, signed int cchPrecision, uint32_t fFlags) 1943 1958 { 1944 1959 /* … … 1976 1991 * @param fSpecial Same as RTSTR_F_SPECIAL. 1977 1992 */ 1978 VMM DECL(ssize_t) DBGFR3RegFormatValue(char *pszBuf, size_t cbBuf, PCDBGFREGVAL pValue, DBGFREGVALTYPE enmType, bool fSpecial)1993 VMMR3DECL(ssize_t) DBGFR3RegFormatValue(char *pszBuf, size_t cbBuf, PCDBGFREGVAL pValue, DBGFREGVALTYPE enmType, bool fSpecial) 1979 1994 { 1980 1995 int cchWidth = 0; … … 2021 2036 DBGFREGVAL Value; 2022 2037 DBGFREGVALTYPE enmType; 2023 int rc = dbgfR3RegNmQueryWorkerOnCpu(pThis->p VM, pLookupRec, DBGFREGVALTYPE_END, &Value, &enmType);2038 int rc = dbgfR3RegNmQueryWorkerOnCpu(pThis->pUVM, pLookupRec, DBGFREGVALTYPE_END, &Value, &enmType); 2024 2039 if (RT_FAILURE(rc)) 2025 2040 { … … 2114 2129 DBGFREGVAL Value; 2115 2130 DBGFREGVALTYPE enmType; 2116 int rc = dbgfR3RegNmQueryWorkerOnCpu(pThis->p VM, pLookupRec, DBGFREGVALTYPE_END, &Value, &enmType);2131 int rc = dbgfR3RegNmQueryWorkerOnCpu(pThis->pUVM, pLookupRec, DBGFREGVALTYPE_END, &Value, &enmType); 2117 2132 if (RT_FAILURE(rc)) 2118 2133 { … … 2177 2192 * input string termination. 2178 2193 */ 2194 PRTSTRSPACE pRegSpace = &pThis->pUVM->dbgf.s.RegSpace; 2179 2195 /* 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); 2181 2197 if (!pLookupRec) 2182 2198 { … … 2185 2201 ssize_t cchFolded = dbgfR3RegCopyToLower(pachReg, cchReg, szName, sizeof(szName) - DBGF_REG_MAX_NAME); 2186 2202 if (cchFolded > 0) 2187 pLookupRec = (PCDBGFREGLOOKUP)RTStrSpaceGet( &pThis->pVM->dbgf.s.RegSpace, szName);2203 pLookupRec = (PCDBGFREGLOOKUP)RTStrSpaceGet(pRegSpace, szName); 2188 2204 if ( !pLookupRec 2189 2205 && cchFolded >= 0 … … 2193 2209 size_t cchCpuSet = RTStrPrintf(szName, sizeof(szName), pThis->fGuestRegs ? "cpu%u." : "hypercpu%u.", pThis->idCpu); 2194 2210 dbgfR3RegCopyToLower(pachReg, cchReg, &szName[cchCpuSet], sizeof(szName) - cchCpuSet); 2195 pLookupRec = (PCDBGFREGLOOKUP)RTStrSpaceGet( &pThis->pVM->dbgf.s.RegSpace, szName);2211 pLookupRec = (PCDBGFREGLOOKUP)RTStrSpaceGet(pRegSpace, szName); 2196 2212 } 2197 2213 } … … 2270 2286 static DECLCALLBACK(int) dbgfR3RegPrintfWorkerOnCpu(PDBGFR3REGPRINTFARGS pArgs) 2271 2287 { 2272 DBGF_REG_DB_LOCK_READ(pArgs->p VM);2288 DBGF_REG_DB_LOCK_READ(pArgs->pUVM); 2273 2289 RTStrFormatV(dbgfR3RegPrintfCbOutput, pArgs, dbgfR3RegPrintfCbFormat, pArgs, pArgs->pszFormat, pArgs->va); 2274 DBGF_REG_DB_UNLOCK_READ(pArgs->p VM);2290 DBGF_REG_DB_UNLOCK_READ(pArgs->pUVM); 2275 2291 return pArgs->rc; 2276 2292 } … … 2283 2299 * 2284 2300 * @returns VBox status code. 2285 * @param p VM Pointer to the VM.2301 * @param pUVM The user mode VM handle. 2286 2302 * @param idCpu The CPU ID of any CPU registers that may be 2287 2303 * printed, pass VMCPUID_ANY if not applicable. … … 2292 2308 * @param va Other format arguments. 2293 2309 */ 2294 VMMR3DECL(int) DBGFR3RegPrintfV(P VM pVM, VMCPUID idCpu, char *pszBuf, size_t cbBuf, const char *pszFormat, va_list va)2310 VMMR3DECL(int) DBGFR3RegPrintfV(PUVM pUVM, VMCPUID idCpu, char *pszBuf, size_t cbBuf, const char *pszFormat, va_list va) 2295 2311 { 2296 2312 AssertPtrReturn(pszBuf, VERR_INVALID_POINTER); … … 2298 2314 *pszBuf = '\0'; 2299 2315 2300 VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);2301 AssertReturn((idCpu & ~DBGFREG_HYPER_VMCPUID) < p VM->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); 2302 2318 AssertPtrReturn(pszFormat, VERR_INVALID_POINTER); 2303 2319 … … 2307 2323 */ 2308 2324 DBGFR3REGPRINTFARGS Args; 2309 Args.p VM = pVM;2325 Args.pUVM = pUVM; 2310 2326 Args.idCpu = idCpu != VMCPUID_ANY ? idCpu & ~DBGFREG_HYPER_VMCPUID : idCpu; 2311 2327 Args.fGuestRegs = idCpu != VMCPUID_ANY && !(idCpu & DBGFREG_HYPER_VMCPUID); … … 2316 2332 Args.cchLeftBuf = cbBuf - 1; 2317 2333 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); 2319 2335 va_end(Args.va); 2320 2336 return rc; … … 2328 2344 * 2329 2345 * @returns VBox status code. 2330 * @param p VM Pointer to the VM.2346 * @param pUVM The user mode VM handle. 2331 2347 * @param idCpu The CPU ID of any CPU registers that may be 2332 2348 * printed, pass VMCPUID_ANY if not applicable. … … 2340 2356 * @param ... Other format arguments. 2341 2357 */ 2342 VMMR3DECL(int) DBGFR3RegPrintf(P VM pVM, VMCPUID idCpu, char *pszBuf, size_t cbBuf, const char *pszFormat, ...)2358 VMMR3DECL(int) DBGFR3RegPrintf(PUVM pUVM, VMCPUID idCpu, char *pszBuf, size_t cbBuf, const char *pszFormat, ...) 2343 2359 { 2344 2360 va_list va; 2345 2361 va_start(va, pszFormat); 2346 int rc = DBGFR3RegPrintfV(p VM, idCpu, pszBuf, cbBuf, pszFormat, va);2362 int rc = DBGFR3RegPrintfV(pUVM, idCpu, pszBuf, cbBuf, pszFormat, va); 2347 2363 va_end(va); 2348 2364 return rc; -
trunk/src/VBox/VMM/VMMR3/DBGFStack.cpp
r42449 r44399 26 26 #include "DBGFInternal.h" 27 27 #include <VBox/vmm/vm.h> 28 #include <VBox/vmm/uvm.h> 28 29 #include <VBox/err.h> 29 30 #include <VBox/log.h> … … 38 39 * Read stack memory. 39 40 */ 40 DECLINLINE(int) dbgfR3Read(P VM pVM, VMCPUID idCpu, void *pvBuf, PCDBGFADDRESS pSrcAddr, size_t cb, size_t *pcbRead)41 { 42 int rc = DBGFR3MemRead(p VM, idCpu, pSrcAddr, pvBuf, cb);41 DECLINLINE(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); 43 44 if (RT_FAILURE(rc)) 44 45 { … … 48 49 { 49 50 DBGFADDRESS Addr = *pSrcAddr; 50 rc = DBGFR3MemRead(p VM, idCpu, DBGFR3AddrAdd(&Addr, cbRead), (uint8_t *)pvBuf + cbRead, 1);51 rc = DBGFR3MemRead(pUVM, idCpu, DBGFR3AddrAdd(&Addr, cbRead), (uint8_t *)pvBuf + cbRead, 1); 51 52 if (RT_FAILURE(rc)) 52 53 break; … … 77 78 * unwind tables). 78 79 */ 79 static int dbgfR3StackWalk(P VM pVM, VMCPUID idCpu, RTDBGAS hAs, PDBGFSTACKFRAME pFrame)80 static int dbgfR3StackWalk(PUVM pUVM, VMCPUID idCpu, RTDBGAS hAs, PDBGFSTACKFRAME pFrame) 80 81 { 81 82 /* … … 136 137 137 138 Assert(DBGFADDRESS_IS_VALID(&pFrame->AddrFrame)); 138 int rc = dbgfR3Read(p VM, idCpu, u.pv,139 int rc = dbgfR3Read(pUVM, idCpu, u.pv, 139 140 pFrame->fFlags & DBGFSTACKFRAME_FLAGS_ALL_VALID 140 141 ? &pFrame->AddrReturnFrame … … 156 157 if (DBGFADDRESS_IS_VALID(&pFrame->AddrPC)) 157 158 { 158 pFrame->pSymPC = DBGFR3AsSymbolByAddrA(p VM, hAs, &pFrame->AddrPC, NULL /*offDisp*/, NULL /*phMod*/);159 pFrame->pLinePC = DBGFR3LineByAddrAlloc(p VM, 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); 160 161 } 161 162 } … … 203 204 } 204 205 else 205 DBGFR3AddrFromFlat(p VM, &pFrame->AddrReturnPC, *uRet.pu16);206 DBGFR3AddrFromFlat(pUVM, &pFrame->AddrReturnPC, *uRet.pu16); 206 207 break; 207 208 case DBGFRETURNTYPE_NEAR32: … … 212 213 } 213 214 else 214 DBGFR3AddrFromFlat(p VM, &pFrame->AddrReturnPC, *uRet.pu32);215 DBGFR3AddrFromFlat(pUVM, &pFrame->AddrReturnPC, *uRet.pu32); 215 216 break; 216 217 case DBGFRETURNTYPE_NEAR64: … … 221 222 } 222 223 else 223 DBGFR3AddrFromFlat(p VM, &pFrame->AddrReturnPC, *uRet.pu64);224 DBGFR3AddrFromFlat(pUVM, &pFrame->AddrReturnPC, *uRet.pu64); 224 225 break; 225 226 case DBGFRETURNTYPE_FAR16: 226 DBGFR3AddrFromSelOff(p VM, idCpu, &pFrame->AddrReturnPC, uRet.pu16[1], uRet.pu16[0]);227 DBGFR3AddrFromSelOff(pUVM, idCpu, &pFrame->AddrReturnPC, uRet.pu16[1], uRet.pu16[0]); 227 228 break; 228 229 case DBGFRETURNTYPE_FAR32: 229 DBGFR3AddrFromSelOff(p VM, idCpu, &pFrame->AddrReturnPC, uRet.pu16[2], uRet.pu32[0]);230 DBGFR3AddrFromSelOff(pUVM, idCpu, &pFrame->AddrReturnPC, uRet.pu16[2], uRet.pu32[0]); 230 231 break; 231 232 case DBGFRETURNTYPE_FAR64: 232 DBGFR3AddrFromSelOff(p VM, idCpu, &pFrame->AddrReturnPC, uRet.pu16[4], uRet.pu64[0]);233 DBGFR3AddrFromSelOff(pUVM, idCpu, &pFrame->AddrReturnPC, uRet.pu16[4], uRet.pu64[0]); 233 234 break; 234 235 case DBGFRETURNTYPE_IRET16: 235 DBGFR3AddrFromSelOff(p VM, idCpu, &pFrame->AddrReturnPC, uRet.pu16[1], uRet.pu16[0]);236 DBGFR3AddrFromSelOff(pUVM, idCpu, &pFrame->AddrReturnPC, uRet.pu16[1], uRet.pu16[0]); 236 237 break; 237 238 case DBGFRETURNTYPE_IRET32: 238 DBGFR3AddrFromSelOff(p VM, idCpu, &pFrame->AddrReturnPC, uRet.pu16[2], uRet.pu32[0]);239 DBGFR3AddrFromSelOff(pUVM, idCpu, &pFrame->AddrReturnPC, uRet.pu16[2], uRet.pu32[0]); 239 240 break; 240 241 case DBGFRETURNTYPE_IRET32_PRIV: 241 DBGFR3AddrFromSelOff(p VM, idCpu, &pFrame->AddrReturnPC, uRet.pu16[2], uRet.pu32[0]);242 DBGFR3AddrFromSelOff(pUVM, idCpu, &pFrame->AddrReturnPC, uRet.pu16[2], uRet.pu32[0]); 242 243 break; 243 244 case DBGFRETURNTYPE_IRET32_V86: 244 DBGFR3AddrFromSelOff(p VM, idCpu, &pFrame->AddrReturnPC, uRet.pu16[2], uRet.pu32[0]);245 DBGFR3AddrFromSelOff(pUVM, idCpu, &pFrame->AddrReturnPC, uRet.pu16[2], uRet.pu32[0]); 245 246 break; 246 247 case DBGFRETURNTYPE_IRET64: 247 DBGFR3AddrFromSelOff(p VM, idCpu, &pFrame->AddrReturnPC, uRet.pu16[4], uRet.pu64[0]);248 DBGFR3AddrFromSelOff(pUVM, idCpu, &pFrame->AddrReturnPC, uRet.pu16[4], uRet.pu64[0]); 248 249 break; 249 250 default: … … 252 253 } 253 254 254 pFrame->pSymReturnPC = DBGFR3AsSymbolByAddrA(p VM, hAs, &pFrame->AddrReturnPC, NULL /*offDisp*/, NULL /*phMod*/);255 pFrame->pLineReturnPC = DBGFR3LineByAddrAlloc(p VM, 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); 256 257 257 258 /* … … 278 279 * Walks the entire stack allocating memory as we walk. 279 280 */ 280 static DECLCALLBACK(int) dbgfR3StackWalkCtxFull(P VM pVM, VMCPUID idCpu, PCCPUMCTXCORE pCtxCore, RTDBGAS hAs,281 static DECLCALLBACK(int) dbgfR3StackWalkCtxFull(PUVM pUVM, VMCPUID idCpu, PCCPUMCTXCORE pCtxCore, RTDBGAS hAs, 281 282 DBGFCODETYPE enmCodeType, 282 283 PCDBGFADDRESS pAddrFrame, … … 287 288 { 288 289 /* 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)); 290 291 if (!pCur) 291 292 return VERR_NO_MEMORY; … … 301 302 pCur->AddrPC = *pAddrPC; 302 303 else if (enmCodeType != DBGFCODETYPE_GUEST) 303 DBGFR3AddrFromFlat(p VM, &pCur->AddrPC, pCtxCore->rip);304 DBGFR3AddrFromFlat(pUVM, &pCur->AddrPC, pCtxCore->rip); 304 305 else 305 rc = DBGFR3AddrFromSelOff(p VM, idCpu, &pCur->AddrPC, pCtxCore->cs.Sel, pCtxCore->rip);306 rc = DBGFR3AddrFromSelOff(pUVM, idCpu, &pCur->AddrPC, pCtxCore->cs.Sel, pCtxCore->rip); 306 307 if (RT_SUCCESS(rc)) 307 308 { … … 329 330 else 330 331 { 331 PVMCPU pVCpu = VMMGetCpuById(p VM, idCpu);332 PVMCPU pVCpu = VMMGetCpuById(pUVM->pVM, idCpu); 332 333 CPUMMODE CpuMode = CPUMGetGuestMode(pVCpu); 333 334 if (CpuMode == CPUMMODE_REAL) … … 343 344 pCur->AddrStack = *pAddrStack; 344 345 else if (enmCodeType != DBGFCODETYPE_GUEST) 345 DBGFR3AddrFromFlat(p VM, &pCur->AddrStack, pCtxCore->rsp & fAddrMask);346 DBGFR3AddrFromFlat(pUVM, &pCur->AddrStack, pCtxCore->rsp & fAddrMask); 346 347 else 347 rc = DBGFR3AddrFromSelOff(p VM, idCpu, &pCur->AddrStack, pCtxCore->ss.Sel, pCtxCore->rsp & fAddrMask);348 rc = DBGFR3AddrFromSelOff(pUVM, idCpu, &pCur->AddrStack, pCtxCore->ss.Sel, pCtxCore->rsp & fAddrMask); 348 349 349 350 if (pAddrFrame) 350 351 pCur->AddrFrame = *pAddrFrame; 351 352 else if (enmCodeType != DBGFCODETYPE_GUEST) 352 DBGFR3AddrFromFlat(p VM, &pCur->AddrFrame, pCtxCore->rbp & fAddrMask);353 DBGFR3AddrFromFlat(pUVM, &pCur->AddrFrame, pCtxCore->rbp & fAddrMask); 353 354 else if (RT_SUCCESS(rc)) 354 rc = DBGFR3AddrFromSelOff(p VM, idCpu, &pCur->AddrFrame, pCtxCore->ss.Sel, pCtxCore->rbp & fAddrMask);355 rc = DBGFR3AddrFromSelOff(pUVM, idCpu, &pCur->AddrFrame, pCtxCore->ss.Sel, pCtxCore->rbp & fAddrMask); 355 356 } 356 357 else … … 361 362 */ 362 363 if (RT_SUCCESS(rc)) 363 rc = dbgfR3StackWalk(p VM, idCpu, hAs, pCur);364 rc = dbgfR3StackWalk(pUVM, idCpu, hAs, pCur); 364 365 if (RT_FAILURE(rc)) 365 366 { … … 375 376 { 376 377 /* try walk. */ 377 rc = dbgfR3StackWalk(p VM, idCpu, hAs, &Next);378 rc = dbgfR3StackWalk(pUVM, idCpu, hAs, &Next); 378 379 if (RT_FAILURE(rc)) 379 380 break; 380 381 381 382 /* 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)); 383 384 if (!pNext) 384 385 { … … 415 416 * DBGFR3StackWalkBeginGuest and DBGFR3StackWalkBeginHyper. 416 417 */ 417 static int dbgfR3StackWalkBeginCommon(P VM pVM,418 static int dbgfR3StackWalkBeginCommon(PUVM pUVM, 418 419 VMCPUID idCpu, 419 420 DBGFCODETYPE enmCodeType, … … 428 429 */ 429 430 *ppFirstFrame = NULL; 431 UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE); 432 PVM pVM = pUVM->pVM; 430 433 VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE); 431 434 AssertReturn(idCpu < pVM->cCpus, VERR_INVALID_CPU_ID); 432 435 if (pAddrFrame) 433 AssertReturn(DBGFR3AddrIsValid(p VM, pAddrFrame), VERR_INVALID_PARAMETER);436 AssertReturn(DBGFR3AddrIsValid(pUVM, pAddrFrame), VERR_INVALID_PARAMETER); 434 437 if (pAddrStack) 435 AssertReturn(DBGFR3AddrIsValid(p VM, pAddrStack), VERR_INVALID_PARAMETER);438 AssertReturn(DBGFR3AddrIsValid(pUVM, pAddrStack), VERR_INVALID_PARAMETER); 436 439 if (pAddrPC) 437 AssertReturn(DBGFR3AddrIsValid(p VM, pAddrPC), VERR_INVALID_PARAMETER);440 AssertReturn(DBGFR3AddrIsValid(pUVM, pAddrPC), VERR_INVALID_PARAMETER); 438 441 AssertReturn(enmReturnType >= DBGFRETURNTYPE_INVALID && enmReturnType < DBGFRETURNTYPE_END, VERR_INVALID_PARAMETER); 439 442 … … 460 463 AssertFailedReturn(VERR_INVALID_PARAMETER); 461 464 } 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); 465 468 } 466 469 … … 476 479 * @returns VERR_NO_MEMORY if we're out of memory. 477 480 * 478 * @param p VM Pointer to the VM.481 * @param pUVM The user mode VM handle. 479 482 * @param idCpu The ID of the virtual CPU which stack we want to walk. 480 483 * @param enmCodeType Code type … … 485 488 * @param ppFirstFrame Where to return the pointer to the first info frame. 486 489 */ 487 VMMR3DECL(int) DBGFR3StackWalkBeginEx(P VM pVM,490 VMMR3DECL(int) DBGFR3StackWalkBeginEx(PUVM pUVM, 488 491 VMCPUID idCpu, 489 492 DBGFCODETYPE enmCodeType, … … 494 497 PCDBGFSTACKFRAME *ppFirstFrame) 495 498 { 496 return dbgfR3StackWalkBeginCommon(p VM, idCpu, enmCodeType, pAddrFrame, pAddrStack, pAddrPC, enmReturnType, ppFirstFrame);499 return dbgfR3StackWalkBeginCommon(pUVM, idCpu, enmCodeType, pAddrFrame, pAddrStack, pAddrPC, enmReturnType, ppFirstFrame); 497 500 } 498 501 … … 508 511 * @returns VERR_NO_MEMORY if we're out of memory. 509 512 * 510 * @param p VM Pointer to the VM.513 * @param pUVM The user mode VM handle. 511 514 * @param idCpu The ID of the virtual CPU which stack we want to walk. 512 515 * @param enmCodeType Code type 513 516 * @param ppFirstFrame Where to return the pointer to the first info frame. 514 517 */ 515 VMMR3DECL(int) DBGFR3StackWalkBegin(P VM pVM, VMCPUID idCpu, DBGFCODETYPE enmCodeType, PCDBGFSTACKFRAME *ppFirstFrame)516 { 517 return dbgfR3StackWalkBeginCommon(p VM, idCpu, enmCodeType, NULL, NULL, NULL, DBGFRETURNTYPE_INVALID, ppFirstFrame);518 VMMR3DECL(int) DBGFR3StackWalkBegin(PUVM pUVM, VMCPUID idCpu, DBGFCODETYPE enmCodeType, PCDBGFSTACKFRAME *ppFirstFrame) 519 { 520 return dbgfR3StackWalkBeginCommon(pUVM, idCpu, enmCodeType, NULL, NULL, NULL, DBGFRETURNTYPE_INVALID, ppFirstFrame); 518 521 } 519 522 -
trunk/src/VBox/VMM/VMMR3/DBGFSym.cpp
r41965 r44399 33 33 #include "DBGFInternal.h" 34 34 #include <VBox/vmm/vm.h> 35 #include <VBox/vmm/uvm.h> 35 36 #include <VBox/err.h> 36 37 #include <VBox/log.h> … … 321 322 * Execute the command. 322 323 */ 323 rc = DBGFR3ModuleLoad(pVM , pszFilename, offDelta, pszModule, ModuleAddress, cbModule);324 rc = DBGFR3ModuleLoad(pVM->pUVM, pszFilename, offDelta, pszModule, ModuleAddress, cbModule); 324 325 AssertMsgRCReturn(rc, ("pszFilename=%s offDelta=%RGv pszModule=%s ModuleAddress=%RGv cbModule=%RGv\n", 325 326 pszFilename, offDelta, pszModule, ModuleAddress, cbModule), rc); … … 356 357 AssertMsgRCReturn(rc, ("rc=%Rrc querying the 'Address' attribute of '/DBGF/loadsyms/%s'!\n", rc, szCmdName), rc); 357 358 DBGFADDRESS ModAddr; 358 DBGFR3AddrFromFlat(pVM , &ModAddr, GCPtrAddr);359 DBGFR3AddrFromFlat(pVM->pUVM, &ModAddr, GCPtrAddr); 359 360 360 361 /* Name (optional) */ … … 376 377 * Execute the command. 377 378 */ 378 rc = DBGFR3AsLoadMap(pVM , DBGF_AS_GLOBAL, pszFilename, pszModName, &ModAddr,379 rc = DBGFR3AsLoadMap(pVM->pUVM, DBGF_AS_GLOBAL, pszFilename, pszModName, &ModAddr, 379 380 iSeg == UINT32_MAX ? NIL_RTDBGSEGIDX : iSeg, offSubtrahend, 0 /*fFlags*/); 380 381 AssertMsgRCReturn(rc, ("pszFilename=%s pszModName=%s ModAddr=%RGv offSubtrahend=%#x iSeg=%#x\n", … … 690 691 * 691 692 * @returns VBox status. 692 * @param p VM Pointer to the VM.693 * @param pUVM The user mode VM handle. 693 694 * @param pszFilename Path to the file containing the symbol information. 694 695 * This can be the executable image, a flat symbol file of some kind or stripped debug info. … … 700 701 * Ignored when pszName is NULL. 701 702 */ 702 VMMR3DECL(int) DBGFR3ModuleLoad(P VM pVM, const char *pszFilename, RTGCUINTPTR AddressDelta, const char *pszName,703 VMMR3DECL(int) DBGFR3ModuleLoad(PUVM pUVM, const char *pszFilename, RTGCUINTPTR AddressDelta, const char *pszName, 703 704 RTGCUINTPTR ModuleAddress, unsigned cbImage) 704 705 { … … 708 709 * Lazy init. 709 710 */ 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); 710 714 if (!pVM->dbgf.s.fSymInited) 711 715 { … … 807 811 * @param pszName The module name. 808 812 */ 809 VMMR3 DECL(void) DBGFR3ModuleRelocate(PVM pVM, RTGCUINTPTR OldImageBase, RTGCUINTPTR NewImageBase, RTGCUINTPTR cbImage,810 const char *pszFilename, const char *pszName)813 VMMR3_INT_DECL(void) DBGFR3ModuleRelocate(PVM pVM, RTGCUINTPTR OldImageBase, RTGCUINTPTR NewImageBase, RTGCUINTPTR cbImage, 814 const char *pszFilename, const char *pszName) 811 815 { 812 816 #ifdef HAVE_DBGHELP … … 839 843 * @param pszSymbol Symbol name. 840 844 */ 841 VMMR3 DECL(int) DBGFR3SymbolAdd(PVM pVM, RTGCUINTPTR ModuleAddress, RTGCUINTPTR SymbolAddress, RTUINT cbSymbol,842 const char *pszSymbol)845 VMMR3_INT_DECL(int) DBGFR3SymbolAdd(PVM pVM, RTGCUINTPTR ModuleAddress, RTGCUINTPTR SymbolAddress, RTUINT cbSymbol, 846 const char *pszSymbol) 843 847 { 844 848 /* … … 881 885 * @param pSymbol Where to store the symbol info. 882 886 */ 883 VMMR3 DECL(int) DBGFR3SymbolByAddr(PVM pVM, RTGCUINTPTR Address, PRTGCINTPTR poffDisplacement, PDBGFSYMBOL pSymbol)887 VMMR3_INT_DECL(int) DBGFR3SymbolByAddr(PVM pVM, RTGCUINTPTR Address, PRTGCINTPTR poffDisplacement, PDBGFSYMBOL pSymbol) 884 888 { 885 889 /* … … 969 973 * @param pSymbol Where to store the symbol info. 970 974 */ 971 VMMR3 DECL(int) DBGFR3SymbolByName(PVM pVM, const char *pszSymbol, PDBGFSYMBOL pSymbol)975 VMMR3_INT_DECL(int) DBGFR3SymbolByName(PVM pVM, const char *pszSymbol, PDBGFSYMBOL pSymbol) 972 976 { 973 977 /* … … 1021 1025 * 1022 1026 * @returns VBox status. 1023 * @param p VM Pointer to the VM.1027 * @param pUVM The user mode VM handle. 1024 1028 * @param Address Address. 1025 1029 * @param poffDisplacement Where to store the line displacement from Address. 1026 1030 * @param pLine Where to store the line info. 1027 1031 */ 1028 VMMR3DECL(int) DBGFR3LineByAddr(P VM pVM, RTGCUINTPTR Address, PRTGCINTPTR poffDisplacement, PDBGFLINE pLine)1032 VMMR3DECL(int) DBGFR3LineByAddr(PUVM pUVM, RTGCUINTPTR Address, PRTGCINTPTR poffDisplacement, PDBGFLINE pLine) 1029 1033 { 1030 1034 /* 1031 1035 * Lazy init. 1032 1036 */ 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); 1033 1040 if (!pVM->dbgf.s.fSymInited) 1034 1041 { … … 1067 1074 * 1068 1075 * @returns VBox status code. 1069 * @param p VM Pointer to the VM.1076 * @param pUVM The user mode VM handle. 1070 1077 * @param pLine The line to duplicate. 1071 1078 */ 1072 static PDBGFLINE dbgfR3LineDup(P VM pVM, PCDBGFLINE pLine)1079 static PDBGFLINE dbgfR3LineDup(PUVM pUVM, PCDBGFLINE pLine) 1073 1080 { 1074 1081 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); 1076 1083 if (pDup) 1077 1084 memcpy(pDup, pLine, cb); … … 1085 1092 * @returns Pointer to the line. Must be freed using DBGFR3LineFree(). 1086 1093 * @returns NULL if the line was not found or if we're out of memory. 1087 * @param p VM Pointer to the VM.1094 * @param pUVM The user mode VM handle. 1088 1095 * @param Address Address. 1089 1096 * @param poffDisplacement Where to store the line displacement from Address. 1090 1097 */ 1091 VMMR3DECL(PDBGFLINE) DBGFR3LineByAddrAlloc(P VM pVM, RTGCUINTPTR Address, PRTGCINTPTR poffDisplacement)1098 VMMR3DECL(PDBGFLINE) DBGFR3LineByAddrAlloc(PUVM pUVM, RTGCUINTPTR Address, PRTGCINTPTR poffDisplacement) 1092 1099 { 1093 1100 DBGFLINE Line; 1094 int rc = DBGFR3LineByAddr(p VM, Address, poffDisplacement, &Line);1101 int rc = DBGFR3LineByAddr(pUVM, Address, poffDisplacement, &Line); 1095 1102 if (RT_FAILURE(rc)) 1096 1103 return NULL; 1097 return dbgfR3LineDup(p VM, &Line);1104 return dbgfR3LineDup(pUVM, &Line); 1098 1105 } 1099 1106 … … 1104 1111 * @param pLine Pointer to the line. 1105 1112 */ 1106 VMMR3 DECL(void) DBGFR3LineFree(PDBGFLINE pLine)1113 VMMR3_INT_DECL(void) DBGFR3LineFree(PDBGFLINE pLine) 1107 1114 { 1108 1115 if (pLine) -
trunk/src/VBox/VMM/VMMR3/EM.cpp
r44375 r44399 1182 1182 { 1183 1183 DBGFR3PrgStep(pVCpu); 1184 DBGFR3 DisasInstrCurrentLog(pVCpu, "RSS: ");1184 DBGFR3_DISAS_INSTR_CUR_LOG(pVCpu, "RSS: "); 1185 1185 emR3RemStep(pVM, pVCpu); 1186 1186 if (emR3Reschedule(pVM, pVCpu, pVCpu->em.s.pCtx) != EMSTATE_REM) -
trunk/src/VBox/VMM/VMMR3/EMHM.cpp
r44340 r44399 137 137 { 138 138 DBGFR3PrgStep(pVCpu); 139 DBGFR3 DisasInstrCurrentLog(pVCpu, "RSS: ");139 DBGFR3_DISAS_INSTR_CUR_LOG(pVCpu, "RSS: "); 140 140 rc = emR3HmStep(pVM, pVCpu); 141 141 if ( rc != VINF_SUCCESS … … 189 189 if (pszPrefix) 190 190 { 191 DBGFR3 InfoLog(pVM, "cpumguest", pszPrefix);192 DBGFR3 DisasInstrCurrentLog(pVCpu, pszPrefix);191 DBGFR3_INFO_LOG(pVM, "cpumguest", pszPrefix); 192 DBGFR3_DISAS_INSTR_CUR_LOG(pVCpu, pszPrefix); 193 193 } 194 194 #endif /* LOG_ENABLED */ -
trunk/src/VBox/VMM/VMMR3/EMRaw.cpp
r44375 r44399 237 237 { 238 238 DBGFR3PrgStep(pVCpu); 239 DBGFR3 DisasInstrCurrentLog(pVCpu, "RSS: ");239 DBGFR3_DISAS_INSTR_CUR_LOG(pVCpu, "RSS: "); 240 240 rc = emR3RawStep(pVM, pVCpu); 241 241 if (rc != VINF_SUCCESS) … … 285 285 if (pszPrefix) 286 286 { 287 DBGFR3 InfoLog(pVM, "cpumguest", pszPrefix);288 DBGFR3 DisasInstrCurrentLog(pVCpu, pszPrefix);287 DBGFR3_INFO_LOG(pVM, "cpumguest", pszPrefix); 288 DBGFR3_DISAS_INSTR_CUR_LOG(pVCpu, pszPrefix); 289 289 } 290 290 #endif /* LOG_ENABLED */ … … 634 634 635 635 #ifdef LOG_ENABLED 636 DBGFR3 InfoLog(pVM, "cpumguest", "Guest trap");637 DBGFR3 DisasInstrCurrentLog(pVCpu, "Guest trap");636 DBGFR3_INFO_LOG(pVM, "cpumguest", "Guest trap"); 637 DBGFR3_DISAS_INSTR_CUR_LOG(pVCpu, "Guest trap"); 638 638 639 639 /* Get guest page information. */ … … 687 687 if (RT_SUCCESS(rc)) 688 688 { 689 DBGFR3 DisasInstrCurrentLog(pVCpu, "Patched sysenter instruction");689 DBGFR3_DISAS_INSTR_CUR_LOG(pVCpu, "Patched sysenter instruction"); 690 690 return VINF_EM_RESCHEDULE_RAW; 691 691 } … … 770 770 { 771 771 #ifdef LOG_ENABLED 772 DBGFR3 InfoLog(pVM, "cpumguest", "Trap in patch code");773 DBGFR3 DisasInstrCurrentLog(pVCpu, "Patch code");772 DBGFR3_INFO_LOG(pVM, "cpumguest", "Trap in patch code"); 773 DBGFR3_DISAS_INSTR_CUR_LOG(pVCpu, "Patch code"); 774 774 775 775 DISCPUSTATE Cpu; … … 924 924 { 925 925 #ifdef LOG_ENABLED 926 DBGFR3 InfoLog(pVM, "cpumguest", "PRIV");926 DBGFR3_INFO_LOG(pVM, "cpumguest", "PRIV"); 927 927 #endif 928 928 AssertMsgFailed(("FATAL ERROR: executing random instruction inside generated patch jump %08x\n", pCtx->eip)); … … 938 938 { 939 939 #ifdef LOG_ENABLED 940 DBGFR3 InfoLog(pVM, "cpumguest", "PRIV");940 DBGFR3_INFO_LOG(pVM, "cpumguest", "PRIV"); 941 941 #endif 942 DBGFR3 DisasInstrCurrentLog(pVCpu, "Patched privileged instruction");942 DBGFR3_DISAS_INSTR_CUR_LOG(pVCpu, "Patched privileged instruction"); 943 943 return VINF_SUCCESS; 944 944 } … … 949 949 if (!PATMIsPatchGCAddr(pVM, pCtx->eip)) 950 950 { 951 DBGFR3 InfoLog(pVM, "cpumguest", "PRIV");952 DBGFR3 DisasInstrCurrentLog(pVCpu, "Privileged instr: ");951 DBGFR3_INFO_LOG(pVM, "cpumguest", "PRIV"); 952 DBGFR3_DISAS_INSTR_CUR_LOG(pVCpu, "Privileged instr: "); 953 953 } 954 954 #endif … … 1089 1089 if (PATMIsPatchGCAddr(pVM, pCtx->eip)) 1090 1090 { 1091 DBGFR3 InfoLog(pVM, "cpumguest", "PRIV");1092 DBGFR3 DisasInstrCurrentLog(pVCpu, "Privileged instr: ");1091 DBGFR3_INFO_LOG(pVM, "cpumguest", "PRIV"); 1092 DBGFR3_DISAS_INSTR_CUR_LOG(pVCpu, "Privileged instr: "); 1093 1093 } 1094 1094 #endif -
trunk/src/VBox/VMM/VMMR3/HM.cpp
r44373 r44399 1765 1765 char szOutput[256]; 1766 1766 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, 1768 1768 szOutput, sizeof(szOutput), NULL); 1769 1769 if (RT_SUCCESS(rc)) … … 1789 1789 1790 1790 #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, 1792 1792 szOutput, sizeof(szOutput), NULL); 1793 1793 if (RT_SUCCESS(rc)) … … 1920 1920 * Disassembler the instruction and get cracking. 1921 1921 */ 1922 DBGFR3 DisasInstrCurrentLog(pVCpu, "hmR3ReplaceTprInstr");1922 DBGFR3_DISAS_INSTR_CUR_LOG(pVCpu, "hmR3ReplaceTprInstr"); 1923 1923 PDISCPUSTATE pDis = &pVCpu->hm.s.DisState; 1924 1924 uint32_t cbOp; … … 1976 1976 pCtx->rip += cbOp; 1977 1977 rc = EMInterpretDisasCurrent(pVM, pVCpu, pDis, &cbOp); 1978 DBGFR3 DisasInstrCurrentLog(pVCpu, "Following read");1978 DBGFR3_DISAS_INSTR_CUR_LOG(pVCpu, "Following read"); 1979 1979 pCtx->rip = uSavedRip; 1980 1980 … … 2089 2089 2090 2090 Log(("hmR3PatchTprInstr: rip=%RGv idxPatch=%u\n", pCtx->rip, idx)); 2091 DBGFR3 DisasInstrCurrentLog(pVCpu, "hmR3PatchTprInstr");2091 DBGFR3_DISAS_INSTR_CUR_LOG(pVCpu, "hmR3PatchTprInstr"); 2092 2092 2093 2093 /* … … 2231 2231 { 2232 2232 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, 2234 2234 szOutput, sizeof(szOutput), &cbCurInstr); 2235 2235 if (RT_SUCCESS(rc)) … … 2247 2247 AssertRC(rc); 2248 2248 2249 DBGFR3 DisasInstrCurrentLog(pVCpu, "Jump");2249 DBGFR3_DISAS_INSTR_CUR_LOG(pVCpu, "Jump"); 2250 2250 2251 2251 pVM->hm.s.pFreeGuestPatchMem += off; -
trunk/src/VBox/VMM/VMMR3/IOM.cpp
r43387 r44399 577 577 578 578 /* conflict. */ 579 DBGFR3Info(pVM , "ioport", NULL, NULL);579 DBGFR3Info(pVM->pUVM, "ioport", NULL, NULL); 580 580 AssertMsgFailed(("Port range %#x-%#x (%s) conflicts with existing range(s)!\n", PortStart, (unsigned)PortStart + cPorts - 1, pszDesc)); 581 581 MMHyperFree(pVM, pRange); … … 1487 1487 /* bail out */ 1488 1488 IOM_UNLOCK(pVM); 1489 DBGFR3Info(pVM , "mmio", NULL, NULL);1489 DBGFR3Info(pVM->pUVM, "mmio", NULL, NULL); 1490 1490 AssertMsgFailed(("This cannot happen!\n")); 1491 1491 rc = VERR_IOM_IOPORT_IPE_3; -
trunk/src/VBox/VMM/VMMR3/PATM.cpp
r44362 r44399 114 114 #ifdef VBOX_WITH_DEBUGGER 115 115 static 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);116 static FNDBGCCMD patmr3CmdOn; 117 static FNDBGCCMD patmr3CmdOff; 118 118 119 119 /** Command descriptors. */ … … 6142 6142 #ifdef DEBUG 6143 6143 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, 6145 6145 szBuf, sizeof(szBuf), NULL); 6146 6146 Log(("DIRTY: %s\n", szBuf)); … … 6205 6205 #ifdef DEBUG 6206 6206 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, 6208 6208 szBuf, sizeof(szBuf), NULL); 6209 6209 Log(("NEW: %s\n", szBuf)); … … 6221 6221 #ifdef DEBUG 6222 6222 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, 6224 6224 szBuf, sizeof(szBuf), NULL); 6225 6225 Log(("NEW: %s (FAILED)\n", szBuf)); … … 6258 6258 #ifdef DEBUG 6259 6259 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); 6262 6262 Log(("FILL: %s\n", szBuf)); 6263 6263 #endif … … 6270 6270 #ifdef DEBUG 6271 6271 char szBuf[256]; 6272 DBGFR3DisasInstrEx(pVM , pVCpu->idCpu, pCtx->cs.Sel, pCurPatchInstrGC + i,6272 DBGFR3DisasInstrEx(pVM->pUVM, pVCpu->idCpu, pCtx->cs.Sel, pCurPatchInstrGC + i, 6273 6273 DBGF_DISAS_FLAGS_DEFAULT_MODE, szBuf, sizeof(szBuf), NULL); 6274 6274 Log(("FILL: %s\n", szBuf)); … … 6462 6462 6463 6463 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); 6465 6465 6466 6466 /* Very bad. We crashed in emitted code. Probably stack? */ … … 6579 6579 6580 6580 Log2(("pPatchBlockGC %RRv - pEip %RRv corresponding GC address %RRv\n", PATCHCODE_PTR_GC(&pPatch->patch), pEip, pNewEip)); 6581 DBGFR3 DisasInstrLog(pVCpu, pCtx->cs.Sel, pNewEip, "PATCHRET: ");6581 DBGFR3_DISAS_INSTR_LOG(pVCpu, pCtx->cs.Sel, pNewEip, "PATCHRET: "); 6582 6582 if (pNewEip >= pPatch->patch.pPrivInstrGC && pNewEip < pPatch->patch.pPrivInstrGC + pPatch->patch.cbPatchJump) 6583 6583 { … … 6765 6765 6766 6766 #endif /* VBOX_WITH_STATISTICS */ 6767 6768 6767 #ifdef VBOX_WITH_DEBUGGER 6768 6769 6769 /** 6770 6770 * The '.patmoff' command. … … 6777 6777 * @param cArgs Number of arguments in the array. 6778 6778 */ 6779 static DECLCALLBACK(int) patmr3CmdOff(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, P VM pVM, PCDBGCVAR paArgs, unsigned cArgs)6779 static DECLCALLBACK(int) patmr3CmdOff(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs) 6780 6780 { 6781 6781 /* 6782 6782 * Validate input. 6783 6783 */ 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); 6787 6788 6788 6789 RTAvloU32DoWithAll(&pVM->patm.s.PatchLookupTreeHC->PatchTree, true, DisableAllPatches, pVM); … … 6801 6802 * @param cArgs Number of arguments in the array. 6802 6803 */ 6803 static DECLCALLBACK(int) patmr3CmdOn(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, P VM pVM, PCDBGCVAR paArgs, unsigned cArgs)6804 static DECLCALLBACK(int) patmr3CmdOn(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs) 6804 6805 { 6805 6806 /* 6806 6807 * Validate input. 6807 6808 */ 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); 6811 6813 6812 6814 PATMR3AllowPatching(pVM->pUVM, true); … … 6814 6816 return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "Patching enabled\n"); 6815 6817 } 6816 #endif 6818 6819 #endif /* VBOX_WITH_DEBUGGER */ -
trunk/src/VBox/VMM/VMMR3/PDM.cpp
r44358 r44399 659 659 660 660 TMR3TimerDestroyDevice(pVM, pDevIns); 661 //SSMR3DeregisterDriver(pVM, pDevIns, NULL, 0);661 SSMR3DeregisterDevice(pVM, pDevIns, NULL, 0); 662 662 pdmR3CritSectDeleteDevice(pVM, pDevIns); 663 //pdmR3ThreadDestroyDevice(pVM, pDevIns);664 //PDMR3QueueDestroyDevice(pVM, pDevIns);663 pdmR3ThreadDestroyDevice(pVM, pDevIns); 664 PDMR3QueueDestroyDevice(pVM, pDevIns); 665 665 PGMR3PhysMMIO2Deregister(pVM, pDevIns, UINT32_MAX); 666 666 #ifdef VBOX_WITH_PDM_ASYNC_COMPLETION 667 667 pdmR3AsyncCompletionTemplateDestroyDevice(pVM, pDevIns); 668 668 #endif 669 DBGFR3InfoDeregisterDevice(pVM, pDevIns, NULL); 669 670 } 670 671 -
trunk/src/VBox/VMM/VMMR3/PDMAsyncCompletionFile.cpp
r43625 r44399 49 49 *******************************************************************************/ 50 50 #ifdef VBOX_WITH_DEBUGGER 51 static DECLCALLBACK(int) pdmacEpFileErrorInject(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR pArgs, unsigned cArgs);51 static FNDBGCCMD pdmacEpFileErrorInject; 52 52 # ifdef PDM_ASYNC_COMPLETION_FILE_WITH_DELAY 53 static DECLCALLBACK(int) pdmacEpFileDelayInject(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR pArgs, unsigned cArgs);53 static FNDBGCCMD pdmacEpFileDelayInject; 54 54 # endif 55 55 #endif … … 611 611 612 612 /** 613 * Error inject callback.613 * @callback_method_impl{FNDBGCCMD, The '.injecterror' command.} 614 614 */ 615 static DECLCALLBACK(int) pdmacEpFileErrorInject(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, P VM pVM, PCDBGCVAR pArgs, unsigned cArgs)615 static DECLCALLBACK(int) pdmacEpFileErrorInject(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR pArgs, unsigned cArgs) 616 616 { 617 617 /* 618 618 * Validate input. 619 619 */ 620 DBGC_CMDHLP_REQ_ VM_RET(pCmdHlp, pCmd, pVM);620 DBGC_CMDHLP_REQ_UVM_RET(pCmdHlp, pCmd, pUVM); 621 621 DBGC_CMDHLP_ASSERT_PARSER_RET(pCmdHlp, pCmd, -1, cArgs == 3); 622 622 DBGC_CMDHLP_ASSERT_PARSER_RET(pCmdHlp, pCmd, 0, pArgs[0].enmType == DBGCVAR_TYPE_STRING); … … 625 625 626 626 PPDMASYNCCOMPLETIONEPCLASSFILE pEpClassFile; 627 pEpClassFile = (PPDMASYNCCOMPLETIONEPCLASSFILE)p VM->pUVM->pdm.s.apAsyncCompletionEndpointClass[PDMASYNCCOMPLETIONEPCLASSTYPE_FILE];627 pEpClassFile = (PPDMASYNCCOMPLETIONEPCLASSFILE)pUVM->pdm.s.apAsyncCompletionEndpointClass[PDMASYNCCOMPLETIONEPCLASSTYPE_FILE]; 628 628 629 629 /* Syntax is "read|write <filename> <status code>" */ … … 640 640 return DBGCCmdHlpFail(pCmdHlp, pCmd, "The status code '%lld' is out of range", pArgs[0].u.u64Number); 641 641 642 643 642 /* 644 643 * Search for the matching endpoint. … … 677 676 # ifdef PDM_ASYNC_COMPLETION_FILE_WITH_DELAY 678 677 /** 679 * Delay inject callback.678 * @callback_method_impl{FNDBGCCMD, The '.injectdelay' command.} 680 679 */ 681 static DECLCALLBACK(int) pdmacEpFileDelayInject(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, P VM pVM, PCDBGCVAR pArgs, unsigned cArgs)680 static DECLCALLBACK(int) pdmacEpFileDelayInject(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR pArgs, unsigned cArgs) 682 681 { 683 682 /* 684 683 * Validate input. 685 684 */ 686 DBGC_CMDHLP_REQ_ VM_RET(pCmdHlp, pCmd, pVM);685 DBGC_CMDHLP_REQ_UVM_RET(pCmdHlp, pCmd, pUVM); 687 686 DBGC_CMDHLP_ASSERT_PARSER_RET(pCmdHlp, pCmd, -1, cArgs >= 3); 688 687 DBGC_CMDHLP_ASSERT_PARSER_RET(pCmdHlp, pCmd, 0, pArgs[0].enmType == DBGCVAR_TYPE_STRING); … … 691 690 692 691 PPDMASYNCCOMPLETIONEPCLASSFILE pEpClassFile; 693 pEpClassFile = (PPDMASYNCCOMPLETIONEPCLASSFILE)p VM->pUVM->pdm.s.apAsyncCompletionEndpointClass[PDMASYNCCOMPLETIONEPCLASSTYPE_FILE];692 pEpClassFile = (PPDMASYNCCOMPLETIONEPCLASSFILE)pUVM->pdm.s.apAsyncCompletionEndpointClass[PDMASYNCCOMPLETIONEPCLASSTYPE_FILE]; 694 693 695 694 /* Syntax is "read|write|flush|any <filename> <delay> [reqs]" */ -
trunk/src/VBox/VMM/VMMR3/PGM.cpp
r44393 r44399 661 661 662 662 #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); 663 static FNDBGCCMD pgmR3CmdError; 664 static FNDBGCCMD pgmR3CmdSync; 665 static FNDBGCCMD pgmR3CmdSyncAlways; 668 666 # ifdef VBOX_STRICT 669 static DECLCALLBACK(int) pgmR3CmdAssertCR3(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);667 static FNDBGCCMD pgmR3CmdAssertCR3; 670 668 # endif 671 static DECLCALLBACK(int) pgmR3CmdPhysToFile(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);669 static FNDBGCCMD pgmR3CmdPhysToFile; 672 670 #endif 673 671 … … 704 702 { 705 703 /* pszCmd, cArgsMin, cArgsMax, paArgDesc, cArgDescs, fFlags, pfnHandler pszSyntax, ....pszDescription */ 706 { "pgmram", 0, 0, NULL, 0, 0, pgmR3CmdRam, "", "Display the ram ranges." },707 704 { "pgmsync", 0, 0, NULL, 0, 0, pgmR3CmdSync, "", "Sync the CR3 page." }, 708 705 { "pgmerror", 0, 1, &g_aPgmErrorArgs[0], 1, 0, pgmR3CmdError, "", "Enables inject runtime of errors into parts of PGM." }, … … 2535 2532 2536 2533 #ifdef DEBUG 2537 DBGFR3 InfoLog(pVM, "mappings", NULL);2538 DBGFR3 InfoLog(pVM, "handlers", "all nostat");2534 DBGFR3_INFO_LOG(pVM, "mappings", NULL); 2535 DBGFR3_INFO_LOG(pVM, "handlers", "all nostat"); 2539 2536 #endif 2540 2537 … … 2720 2717 pCur->pszDesc); 2721 2718 } 2719 2722 2720 2723 2721 /** … … 3697 3695 3698 3696 /** 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 */ 3699 static DECLCALLBACK(int) pgmR3CmdError(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs) 3709 3700 { 3710 3701 /* 3711 3702 * Validate input. 3712 3703 */ 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)); 3756 3707 3757 3708 if (!cArgs) … … 3760 3711 * Print the list of error injection locations with status. 3761 3712 */ 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); 3764 3715 } 3765 3716 else 3766 3717 { 3767 3768 3718 /* 3769 3719 * String switch on where to inject the error. … … 3774 3724 ASMAtomicWriteBool(&pVM->pgm.s.fErrInjHandyPages, fNewState); 3775 3725 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"); 3778 3728 } 3779 3729 return VINF_SUCCESS; … … 3782 3732 3783 3733 /** 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 */ 3736 static DECLCALLBACK(int) pgmR3CmdSync(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs) 3737 { 3797 3738 /* 3798 3739 * Validate input. 3799 3740 */ 3800 3741 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"); 3805 3746 3806 3747 /* … … 3809 3750 VMCPU_FF_SET(pVCpu, VMCPU_FF_PGM_SYNC_CR3); 3810 3751 3811 int rc = pCmdHlp->pfnPrintf(pCmdHlp, NULL, "Forcing page directory sync.\n");3752 int rc = DBGCCmdHlpPrintf(pCmdHlp, "Forcing page directory sync.\n"); 3812 3753 if (RT_FAILURE(rc)) 3813 3754 return rc; … … 3816 3757 } 3817 3758 3818 3819 3759 #ifdef VBOX_STRICT 3760 3820 3761 /** 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 */ 3768 static 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 */ 3783 static DECLCALLBACK(int) pgmR3CmdAssertCR3(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs) 3784 { 3834 3785 /* 3835 3786 * Validate input. 3836 3787 */ 3837 3788 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"); 3844 3792 if (RT_FAILURE(rc)) 3845 3793 return rc; 3846 3794 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"); 3850 3802 } 3803 3851 3804 #endif /* VBOX_STRICT */ 3852 3805 3853 3854 3806 /** 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 */ 3809 static DECLCALLBACK(int) pgmR3CmdSyncAlways(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs) 3810 { 3869 3811 /* 3870 3812 * Validate input. 3871 3813 */ 3872 3814 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"); 3875 3819 3876 3820 /* 3877 3821 * Force page directory sync. 3878 3822 */ 3823 int rc; 3879 3824 if (pVCpu->pgm.s.fSyncFlags & PGM_SYNC_ALWAYS) 3880 3825 { 3881 3826 ASMAtomicAndU32(&pVCpu->pgm.s.fSyncFlags, ~PGM_SYNC_ALWAYS); 3882 r eturn pCmdHlp->pfnPrintf(pCmdHlp, NULL, "Disabled permanent forced page directory syncing.\n");3827 rc = DBGCCmdHlpPrintf(pCmdHlp, "Disabled permanent forced page directory syncing.\n"); 3883 3828 } 3884 3829 else … … 3886 3831 ASMAtomicOrU32(&pVCpu->pgm.s.fSyncFlags, PGM_SYNC_ALWAYS); 3887 3832 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; 3890 3836 } 3891 3837 3892 3838 3893 3839 /** 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 */ 3842 static DECLCALLBACK(int) pgmR3CmdPhysToFile(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs) 3904 3843 { 3905 3844 /* … … 3907 3846 */ 3908 3847 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 } 3920 3858 bool fIncZeroPgs = cArgs < 2; 3921 3859 … … 3926 3864 int rc = RTFileOpen(&hFile, paArgs[0].u.pszString, RTFILE_O_WRITE | RTFILE_O_CREATE_REPLACE | RTFILE_O_DENY_WRITE); 3927 3865 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); 3929 3867 3930 3868 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); 3932 3870 uint64_t cbRam = 0; 3933 CFGMR3QueryU64Def(CFGMR3GetRoot (pVM), "RamSize", &cbRam, 0);3871 CFGMR3QueryU64Def(CFGMR3GetRootU(pUVM), "RamSize", &cbRam, 0); 3934 3872 RTGCPHYS GCPhysEnd = cbRam + cbRamHole; 3935 3873 … … 3966 3904 rc = RTFileWrite(hFile, abZeroPg, PAGE_SIZE, NULL); 3967 3905 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); 3969 3907 } 3970 3908 } … … 3986 3924 PGMPhysReleasePageMappingLock(pVM, &Lock); 3987 3925 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); 3989 3927 } 3990 3928 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); 3992 3930 break; 3993 3931 } … … 4001 3939 rc = RTFileWrite(hFile, abZeroPg, PAGE_SIZE, NULL); 4002 3940 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); 4004 3942 } 4005 3943 break; … … 4017 3955 RTFileClose(hFile); 4018 3956 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); 4020 3958 return VINF_SUCCESS; 4021 3959 } -
trunk/src/VBox/VMM/VMMR3/PGMDbg.cpp
r41965 r44399 5 5 6 6 /* 7 * Copyright (C) 2006-201 0Oracle Corporation7 * Copyright (C) 2006-2013 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 24 24 #include "PGMInternal.h" 25 25 #include <VBox/vmm/vm.h> 26 #include <VBox/vmm/uvm.h> 26 27 #include "PGMInline.h" 27 28 #include <iprt/assert.h> … … 103 104 * @retval VERR_INVALID_POINTER if the pointer is not within the GC physical memory. 104 105 * 105 * @param p VM Pointer to the VM.106 * @param pUVM The user mode VM handle. 106 107 * @param R3Ptr The R3 pointer to convert. 107 108 * @param pGCPhys Where to store the GC physical address on success. 108 109 */ 109 VMMR3DECL(int) PGMR3DbgR3Ptr2GCPhys(P VM pVM, RTR3PTR R3Ptr, PRTGCPHYS pGCPhys)110 { 111 NOREF(p VM); NOREF(R3Ptr);110 VMMR3DECL(int) PGMR3DbgR3Ptr2GCPhys(PUVM pUVM, RTR3PTR R3Ptr, PRTGCPHYS pGCPhys) 111 { 112 NOREF(pUVM); NOREF(R3Ptr); 112 113 *pGCPhys = NIL_RTGCPHYS; 113 114 return VERR_NOT_IMPLEMENTED; … … 125 126 * @retval VERR_INVALID_POINTER if the pointer is not within the GC physical memory. 126 127 * 127 * @param p VM Pointer to the VM.128 * @param pUVM The user mode VM handle. 128 129 * @param R3Ptr The R3 pointer to convert. 129 130 * @param pHCPhys Where to store the HC physical address on success. 130 131 */ 131 VMMR3DECL(int) PGMR3DbgR3Ptr2HCPhys(P VM pVM, RTR3PTR R3Ptr, PRTHCPHYS pHCPhys)132 { 133 NOREF(p VM); NOREF(R3Ptr);132 VMMR3DECL(int) PGMR3DbgR3Ptr2HCPhys(PUVM pUVM, RTR3PTR R3Ptr, PRTHCPHYS pHCPhys) 133 { 134 NOREF(pUVM); NOREF(R3Ptr); 134 135 *pHCPhys = NIL_RTHCPHYS; 135 136 return VERR_NOT_IMPLEMENTED; … … 146 147 * @retval VERR_INVALID_POINTER if the HC physical address is not within the GC physical memory. 147 148 * 148 * @param p VM Pointer to the VM.149 * @param pUVM The user mode VM handle. 149 150 * @param HCPhys The HC physical address to convert. 150 151 * @param pGCPhys Where to store the GC physical address on success. 151 152 */ 152 VMMR3DECL(int) PGMR3DbgHCPhys2GCPhys(PVM pVM, RTHCPHYS HCPhys, PRTGCPHYS pGCPhys) 153 { 153 VMMR3DECL(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 154 158 /* 155 159 * Validate and adjust the input a bit. … … 162 166 return VERR_INVALID_POINTER; 163 167 164 for (PPGMRAMRANGE pRam = p VM->pgm.s.CTX_SUFF(pRamRangesX);168 for (PPGMRAMRANGE pRam = pUVM->pVM->pgm.s.CTX_SUFF(pRamRangesX); 165 169 pRam; 166 170 pRam = pRam->CTX_SUFF(pNext)) … … 193 197 * @todo Unused? 194 198 */ 195 VMMR3 DECL(int) PGMR3DbgReadGCPhys(PVM pVM, void *pvDst, RTGCPHYS GCPhysSrc, size_t cb, uint32_t fFlags, size_t *pcbRead)199 VMMR3_INT_DECL(int) PGMR3DbgReadGCPhys(PVM pVM, void *pvDst, RTGCPHYS GCPhysSrc, size_t cb, uint32_t fFlags, size_t *pcbRead) 196 200 { 197 201 /* validate */ … … 244 248 * @todo Unused? 245 249 */ 246 VMMR3 DECL(int) PGMR3DbgWriteGCPhys(PVM pVM, RTGCPHYS GCPhysDst, const void *pvSrc, size_t cb, uint32_t fFlags, size_t *pcbWritten)250 VMMR3_INT_DECL(int) PGMR3DbgWriteGCPhys(PVM pVM, RTGCPHYS GCPhysDst, const void *pvSrc, size_t cb, uint32_t fFlags, size_t *pcbWritten) 247 251 { 248 252 /* validate */ … … 295 299 * @todo Unused? 296 300 */ 297 VMMR3 DECL(int) PGMR3DbgReadGCPtr(PVM pVM, void *pvDst, RTGCPTR GCPtrSrc, size_t cb, uint32_t fFlags, size_t *pcbRead)301 VMMR3_INT_DECL(int) PGMR3DbgReadGCPtr(PVM pVM, void *pvDst, RTGCPTR GCPtrSrc, size_t cb, uint32_t fFlags, size_t *pcbRead) 298 302 { 299 303 /* validate */ … … 351 355 * @todo Unused? 352 356 */ 353 VMMR3 DECL(int) PGMR3DbgWriteGCPtr(PVM pVM, RTGCPTR GCPtrDst, void const *pvSrc, size_t cb, uint32_t fFlags, size_t *pcbWritten)357 VMMR3_INT_DECL(int) PGMR3DbgWriteGCPtr(PVM pVM, RTGCPTR GCPtrDst, void const *pvSrc, size_t cb, uint32_t fFlags, size_t *pcbWritten) 354 358 { 355 359 /* validate */ … … 570 574 * @param pGCPhysHit Where to store the address of the first occurrence on success. 571 575 */ 572 VMMR3 DECL(int) PGMR3DbgScanPhysical(PVM pVM, RTGCPHYS GCPhys, RTGCPHYS cbRange, RTGCPHYS GCPhysAlign,573 const uint8_t *pabNeedle, size_t cbNeedle, PRTGCPHYS pGCPhysHit)576 VMMR3_INT_DECL(int) PGMR3DbgScanPhysical(PVM pVM, RTGCPHYS GCPhys, RTGCPHYS cbRange, RTGCPHYS GCPhysAlign, 577 const uint8_t *pabNeedle, size_t cbNeedle, PRTGCPHYS pGCPhysHit) 574 578 { 575 579 /* … … 730 734 * @param pGCPtrHit Where to store the address of the first occurrence on success. 731 735 */ 732 VMMR3 DECL(int) PGMR3DbgScanVirtual(PVM pVM, PVMCPU pVCpu, RTGCPTR GCPtr, RTGCPTR cbRange, RTGCPTR GCPtrAlign,733 const uint8_t *pabNeedle, size_t cbNeedle, PRTGCUINTPTR pGCPtrHit)736 VMMR3_INT_DECL(int) PGMR3DbgScanVirtual(PVM pVM, PVMCPU pVCpu, RTGCPTR GCPtr, RTGCPTR cbRange, RTGCPTR GCPtrAlign, 737 const uint8_t *pabNeedle, size_t cbNeedle, PRTGCUINTPTR pGCPtrHit) 734 738 { 735 739 VMCPU_ASSERT_EMT(pVCpu); … … 1038 1042 char szPage[80]; 1039 1043 RTGCPHYS GCPhys; 1040 int rc = PGMR3DbgHCPhys2GCPhys(pState->pVM , HCPhys, &GCPhys);1044 int rc = PGMR3DbgHCPhys2GCPhys(pState->pVM->pUVM, HCPhys, &GCPhys); 1041 1045 if (RT_SUCCESS(rc)) 1042 1046 { … … 1681 1685 fFlags |= DBGFPGDMP_FLAGS_LME; 1682 1686 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); 1684 1688 } 1685 1689 -
trunk/src/VBox/VMM/VMMR3/PGMPool.cpp
r43387 r44399 5 5 6 6 /* 7 * Copyright (C) 2006-20 07Oracle Corporation7 * Copyright (C) 2006-2013 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 101 101 #include "PGMInternal.h" 102 102 #include <VBox/vmm/vm.h> 103 #include <VBox/vmm/uvm.h> 103 104 #include "PGMInline.h" 104 105 … … 115 116 static DECLCALLBACK(int) pgmR3PoolAccessHandler(PVM pVM, RTGCPHYS GCPhys, void *pvPhys, void *pvBuf, size_t cbBuf, PGMACCESSTYPE enmAccessType, void *pvUser); 116 117 #ifdef VBOX_WITH_DEBUGGER 117 static DECLCALLBACK(int) pgmR3PoolCmdCheck(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);118 static FNDBGCCMD pgmR3PoolCmdCheck; 118 119 #endif 119 120 … … 978 979 #ifdef VBOX_WITH_DEBUGGER 979 980 /** 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 */ 983 static DECLCALLBACK(int) pgmR3PoolCmdCheck(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs) 990 984 { 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); 992 988 DBGC_CMDHLP_ASSERT_PARSER_RET(pCmdHlp, pCmd, -1, cArgs == 0); 993 989 uint32_t cErrors = 0; -
trunk/src/VBox/VMM/VMMR3/SELM.cpp
r43872 r44399 2641 2641 VMMR3DECL(void) SELMR3DumpHyperGDT(PVM pVM) 2642 2642 { 2643 DBGFR3Info(pVM , "gdt", NULL, NULL);2643 DBGFR3Info(pVM->pUVM, "gdt", NULL, NULL); 2644 2644 } 2645 2645 … … 2652 2652 VMMR3DECL(void) SELMR3DumpHyperLDT(PVM pVM) 2653 2653 { 2654 DBGFR3Info(pVM , "ldt", NULL, NULL);2654 DBGFR3Info(pVM->pUVM, "ldt", NULL, NULL); 2655 2655 } 2656 2656 … … 2663 2663 VMMR3DECL(void) SELMR3DumpGuestGDT(PVM pVM) 2664 2664 { 2665 DBGFR3Info(pVM , "gdtguest", NULL, NULL);2665 DBGFR3Info(pVM->pUVM, "gdtguest", NULL, NULL); 2666 2666 } 2667 2667 … … 2674 2674 VMMR3DECL(void) SELMR3DumpGuestLDT(PVM pVM) 2675 2675 { 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 5 5 6 6 /* 7 * Copyright (C) 2006-20 07Oracle Corporation7 * Copyright (C) 2006-2013 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 72 72 typedef struct STAMR3PRINTONEARGS 73 73 { 74 P VM pVM;75 void *pvArg;74 PUVM pUVM; 75 void *pvArg; 76 76 DECLCALLBACKMEMBER(void, pfnPrintf)(struct STAMR3PRINTONEARGS *pvArg, const char *pszFormat, ...); 77 77 } STAMR3PRINTONEARGS, *PSTAMR3PRINTONEARGS; … … 151 151 152 152 #ifdef VBOX_WITH_DEBUGGER 153 static DECLCALLBACK(int) stamR3CmdStats(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);153 static FNDBGCCMD stamR3CmdStats; 154 154 static DECLCALLBACK(void) stamR3EnumDbgfPrintf(PSTAMR3PRINTONEARGS pArgs, const char *pszFormat, ...); 155 static DECLCALLBACK(int) stamR3CmdStatsReset(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);155 static FNDBGCCMD stamR3CmdStatsReset; 156 156 #endif 157 157 … … 1281 1281 1282 1282 STAMR3PRINTONEARGS Args; 1283 Args.p VM = pUVM->pVM;1283 Args.pUVM = pUVM; 1284 1284 Args.pvArg = NULL; 1285 1285 Args.pfnPrintf = stamR3EnumLogPrintf; … … 1321 1321 1322 1322 STAMR3PRINTONEARGS Args; 1323 Args.p VM = pUVM->pVM;1323 Args.pUVM = pUVM; 1324 1324 Args.pvArg = NULL; 1325 1325 Args.pfnPrintf = stamR3EnumRelLogPrintf; … … 1360 1360 1361 1361 STAMR3PRINTONEARGS Args; 1362 Args.p VM = pUVM->pVM;1362 Args.pUVM = pUVM; 1363 1363 Args.pvArg = NULL; 1364 1364 Args.pfnPrintf = stamR3EnumPrintf; … … 1431 1431 { 1432 1432 char szBuf[512]; 1433 pDesc->u.Callback.pfnPrint(pArgs->p VM, pDesc->u.Callback.pvSample, szBuf, sizeof(szBuf));1433 pDesc->u.Callback.pfnPrint(pArgs->pUVM->pVM, pDesc->u.Callback.pvSample, szBuf, sizeof(szBuf)); 1434 1434 pArgs->pfnPrintf(pArgs, "%-32s %s %s\n", pDesc->pszName, szBuf, STAMR3GetUnit(pDesc->enmUnit)); 1435 1435 break; … … 1914 1914 1915 1915 /** 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 */ 1918 static DECLCALLBACK(int) stamR3CmdStats(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs) 1926 1919 { 1927 1920 /* 1928 1921 * Validate input. 1929 1922 */ 1930 DBGC_CMDHLP_REQ_VM_RET(pCmdHlp, pCmd, pVM); 1931 PUVM pUVM = pVM->pUVM; 1923 DBGC_CMDHLP_REQ_UVM_RET(pCmdHlp, pCmd, pUVM); 1932 1924 if (!pUVM->stam.s.pHead) 1933 1925 return DBGCCmdHlpFail(pCmdHlp, pCmd, "No statistics present"); … … 1937 1929 */ 1938 1930 STAMR3PRINTONEARGS Args; 1939 Args.p VM = pVM;1931 Args.pUVM = pUVM; 1940 1932 Args.pvArg = pCmdHlp; 1941 1933 Args.pfnPrintf = stamR3EnumDbgfPrintf; … … 1965 1957 1966 1958 /** 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 */ 1961 static DECLCALLBACK(int) stamR3CmdStatsReset(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs) 1977 1962 { 1978 1963 /* 1979 1964 * Validate input. 1980 1965 */ 1981 DBGC_CMDHLP_REQ_VM_RET(pCmdHlp, pCmd, pVM); 1982 PUVM pUVM = pVM->pUVM; 1966 DBGC_CMDHLP_REQ_UVM_RET(pCmdHlp, pCmd, pUVM); 1983 1967 if (!pUVM->stam.s.pHead) 1984 1968 return DBGCCmdHlpFail(pCmdHlp, pCmd, "No statistics present"); -
trunk/src/VBox/VMM/VMMR3/TRPM.cpp
r44118 r44399 1510 1510 1511 1511 # ifdef LOG_ENABLED 1512 DBGFR3 InfoLog(pVM, "cpumguest", "TRPMInject");1513 DBGFR3 DisasInstrCurrentLog(pVCpu, "TRPMInject");1512 DBGFR3_INFO_LOG(pVM, "cpumguest", "TRPMInject"); 1513 DBGFR3_DISAS_INSTR_CUR_LOG(pVCpu, "TRPMInject"); 1514 1514 # endif 1515 1515 -
trunk/src/VBox/VMM/VMMR3/VM.cpp
r44393 r44399 730 730 */ 731 731 void *pvUser = NULL; 732 rc = DBGCTcpCreate(p VM, &pvUser);732 rc = DBGCTcpCreate(pUVM, &pvUser); 733 733 if ( RT_SUCCESS(rc) 734 734 || rc == VERR_NET_ADDRESS_IN_USE) … … 760 760 } 761 761 #ifdef VBOX_WITH_DEBUGGER 762 DBGCTcpTerminate(p VM, pUVM->vm.s.pvDBGC);762 DBGCTcpTerminate(pUVM, pUVM->vm.s.pvDBGC); 763 763 pUVM->vm.s.pvDBGC = NULL; 764 764 } … … 2201 2201 bool fOldBuffered = RTLogRelSetBuffering(true /*fBuffered*/); 2202 2202 RTLogRelPrintf("****************** Guest state at power off ******************\n"); 2203 DBGFR3Info(pVM , "cpumguest", "verbose", DBGFR3InfoLogRelHlp());2203 DBGFR3Info(pVM->pUVM, "cpumguest", "verbose", DBGFR3InfoLogRelHlp()); 2204 2204 RTLogRelPrintf("***\n"); 2205 DBGFR3Info(pVM , "mode", NULL, DBGFR3InfoLogRelHlp());2205 DBGFR3Info(pVM->pUVM, "mode", NULL, DBGFR3InfoLogRelHlp()); 2206 2206 RTLogRelPrintf("***\n"); 2207 DBGFR3Info(pVM , "activetimers", NULL, DBGFR3InfoLogRelHlp());2207 DBGFR3Info(pVM->pUVM, "activetimers", NULL, DBGFR3InfoLogRelHlp()); 2208 2208 RTLogRelPrintf("***\n"); 2209 DBGFR3Info(pVM , "gdt", NULL, DBGFR3InfoLogRelHlp());2209 DBGFR3Info(pVM->pUVM, "gdt", NULL, DBGFR3InfoLogRelHlp()); 2210 2210 /** @todo dump guest call stack. */ 2211 2211 #if 1 // "temporary" while debugging #1589 … … 2397 2397 AssertRC(rc); 2398 2398 #ifdef VBOX_WITH_DEBUGGER 2399 rc = DBGCTcpTerminate(p VM, pUVM->vm.s.pvDBGC);2399 rc = DBGCTcpTerminate(pUVM, pUVM->vm.s.pvDBGC); 2400 2400 pUVM->vm.s.pvDBGC = NULL; 2401 2401 #endif … … 2716 2716 */ 2717 2717 RTLogPrintf("\n\nThe VM was reset:\n"); 2718 DBGFR3Info(pVM , "cpum", "verbose", NULL);2718 DBGFR3Info(pVM->pUVM, "cpum", "verbose", NULL); 2719 2719 #endif 2720 2720 … … 3784 3784 3785 3785 /** 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 */ 3799 VMMR3DECL(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 */ 3823 VMMR3DECL(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 /** 3786 3833 * Registers a VM runtime error callback. 3787 3834 * -
trunk/src/VBox/VMM/VMMR3/VMMGuruMeditation.cpp
r43387 r44399 415 415 416 416 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, 418 418 DBGFRETURNTYPE_INVALID, &pFirstFrame); 419 419 if (RT_SUCCESS(rc2)) … … 527 527 /* Disassemble the instruction. */ 528 528 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, 530 531 &szInstr[0], sizeof(szInstr), NULL); 531 532 if (RT_SUCCESS(rc2)) … … 538 539 "!!\n" 539 540 "!!\n"); 540 rc2 = DBGFR3Info(pVM , "cpumhyper", "verbose", pHlp);541 rc2 = DBGFR3Info(pVM->pUVM, "cpumhyper", "verbose", pHlp); 541 542 fDoneHyper = true; 542 543 543 544 /* Callstack. */ 544 545 PCDBGFSTACKFRAME pFirstFrame; 545 rc2 = DBGFR3StackWalkBegin(pVM , pVCpu->idCpu, DBGFCODETYPE_HYPER, &pFirstFrame);546 rc2 = DBGFR3StackWalkBegin(pVM->pUVM, pVCpu->idCpu, DBGFCODETYPE_HYPER, &pFirstFrame); 546 547 if (RT_SUCCESS(rc2)) 547 548 { … … 599 600 case VERR_IEM_ASPECT_NOT_IMPLEMENTED: 600 601 { 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); 603 604 break; 604 605 } … … 643 644 "!!\n", 644 645 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); 646 647 } 647 648 -
trunk/src/VBox/VMM/VMMR3/VMMTests.cpp
r43864 r44399 189 189 #ifdef VBOX_WITH_RAW_MODE 190 190 PVMCPU pVCpu = &pVM->aCpus[0]; 191 PUVM pUVM = pVM->pUVM; 191 192 192 193 # ifdef NO_SUPCALLR0VMM … … 251 252 RTPrintf("VMM: testing hardware bp at 0x10000 (not hit)\n"); 252 253 DBGFADDRESS Addr; 253 DBGFR3AddrFromFlat(p VM, &Addr, 0x10000);254 DBGFR3AddrFromFlat(pUVM, &Addr, 0x10000); 254 255 RTUINT iBp0; 255 rc = DBGFR3BpSetReg(p VM, &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); 256 257 AssertReleaseRC(rc); 257 258 rc = vmmR3DoGCTest(pVM, VMMGC_DO_TESTCASE_NOP, 0); … … 264 265 /* a bad one at VMMGCEntry */ 265 266 RTPrintf("VMM: testing hardware bp at VMMGCEntry (hit)\n"); 266 DBGFR3AddrFromFlat(p VM, &Addr, RCPtrEP);267 DBGFR3AddrFromFlat(pUVM, &Addr, RCPtrEP); 267 268 RTUINT iBp1; 268 rc = DBGFR3BpSetReg(p VM, &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); 269 270 AssertReleaseRC(rc); 270 271 rc = vmmR3DoGCTest(pVM, VMMGC_DO_TESTCASE_NOP, 0); … … 318 319 319 320 /* done, clear it */ 320 if ( RT_FAILURE(DBGFR3BpClear(p VM, iBp0))321 || RT_FAILURE(DBGFR3BpClear(p VM, iBp1)))321 if ( RT_FAILURE(DBGFR3BpClear(pUVM, iBp0)) 322 || RT_FAILURE(DBGFR3BpClear(pUVM, iBp1))) 322 323 { 323 324 RTPrintf("VMM: Failed to clear breakpoints!\n"); -
trunk/src/VBox/VMM/VMMRZ/DBGFRZ.cpp
r41965 r44399 43 43 * @param uDr6 The DR6 register value. 44 44 */ 45 VMMRZ DECL(int) DBGFRZTrap01Handler(PVM pVM, PVMCPU pVCpu, PCPUMCTXCORE pRegFrame, RTGCUINTREG uDr6)45 VMMRZ_INT_DECL(int) DBGFRZTrap01Handler(PVM pVM, PVMCPU pVCpu, PCPUMCTXCORE pRegFrame, RTGCUINTREG uDr6) 46 46 { 47 47 #ifdef IN_RC … … 110 110 * @param pRegFrame Pointer to the register frame for the trap. 111 111 */ 112 VMMRZ DECL(int) DBGFRZTrap03Handler(PVM pVM, PVMCPU pVCpu, PCPUMCTXCORE pRegFrame)112 VMMRZ_INT_DECL(int) DBGFRZTrap03Handler(PVM pVM, PVMCPU pVCpu, PCPUMCTXCORE pRegFrame) 113 113 { 114 114 #ifdef IN_RC -
trunk/src/VBox/VMM/include/DBGFInternal.h
r39154 r44399 233 233 DBGFCMDDATA VMMCmdData; 234 234 235 /** List of registered info handlers. */236 R3PTRTYPE(PDBGFINFO) pInfoFirst;237 /** Critical section protecting the above list. */238 RTCRITSECT InfoCritSect;239 240 235 /** Range tree containing the loaded symbols of the a VM. 241 236 * This tree will never have blind spots. */ … … 259 254 * @remark This is currently a fixed size array for reasons of simplicity. */ 260 255 DBGFBP aBreakpoints[32]; 261 256 } DBGF; 257 /** Pointer to DBGF Data. */ 258 typedef 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 */ 267 typedef 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. */ 287 typedef DBGFCPU *PDBGFCPU; 288 289 290 /** 291 * The DBGF data kept in the UVM. 292 */ 293 typedef struct DBGFUSERPERVM 294 { 262 295 /** The address space database lock. */ 263 296 RTSEMRW hAsDbLock; … … 293 326 /** The head of the Guest OS digger instances. */ 294 327 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 */ 339 typedef struct DBGFUSERPERVMCPU 340 { 325 341 /** The guest register set for this CPU. Can be NULL. */ 326 342 R3PTRTYPE(struct DBGFREGSET *) pGuestRegSet; 327 343 /** The hypervisor register set for this CPU. Can be NULL. */ 328 344 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 348 int dbgfR3AsInit(PUVM pUVM); 349 void dbgfR3AsTerm(PUVM pUVM); 350 void dbgfR3AsRelocate(PUVM pUVM, RTGCUINTPTR offDelta); 337 351 int dbgfR3BpInit(PVM pVM); 338 int dbgfR3InfoInit(P VM pVM);339 int dbgfR3InfoTerm(P VM pVM);340 void dbgfR3OSTerm(P VM pVM);341 int dbgfR3RegInit(P VM pVM);342 void dbgfR3RegTerm(P VM pVM);352 int dbgfR3InfoInit(PUVM pUVM); 353 int dbgfR3InfoTerm(PUVM pUVM); 354 void dbgfR3OSTerm(PUVM pUVM); 355 int dbgfR3RegInit(PUVM pUVM); 356 void dbgfR3RegTerm(PUVM pUVM); 343 357 int dbgfR3SymInit(PVM pVM); 344 358 int dbgfR3SymTerm(PVM pVM); -
trunk/src/VBox/VMM/testcase/tstAnimate.cpp
r44387 r44399 881 881 rc = EMR3SetExecutionPolicy(pUVM, EMEXECPOLICY_RECOMPILE_RING0, true); AssertReleaseRC(rc); 882 882 rc = EMR3SetExecutionPolicy(pUVM, EMEXECPOLICY_RECOMPILE_RING3, true); AssertReleaseRC(rc); 883 DBGFR3Info(p VM, "cpumguest", "verbose", NULL);883 DBGFR3Info(pUVM, "cpumguest", "verbose", NULL); 884 884 if (fPowerOn) 885 885 rc = VMR3PowerOn(pUVM); … … 903 903 */ 904 904 RTPrintf("info: entering debugger...\n"); 905 DBGFR3Info(p VM, "cpumguest", "verbose", NULL);905 DBGFR3Info(pUVM, "cpumguest", "verbose", NULL); 906 906 signal(SIGINT, SigInterrupt); 907 907 while (!g_fSignaled) -
trunk/src/VBox/VMM/testcase/tstMicro.cpp
r44347 r44399 255 255 return rc; 256 256 } 257 DBGFR3PagingDumpEx(pVM , 0 /*idCpu*/, DBGFPGDMP_FLAGS_CURRENT_CR3 | DBGFPGDMP_FLAGS_CURRENT_MODE257 DBGFR3PagingDumpEx(pVM->pUVM, 0 /*idCpu*/, DBGFPGDMP_FLAGS_CURRENT_CR3 | DBGFPGDMP_FLAGS_CURRENT_MODE 258 258 | DBGFPGDMP_FLAGS_SHADOW | DBGFPGDMP_FLAGS_HEADER | DBGFPGDMP_FLAGS_PRINT_CR3, 259 259 0 /*cr3*/, 0 /*u64FirstAddr*/, UINT64_MAX /*u64LastAddr*/, 99 /*cMaxDepth*/, NULL); -
trunk/src/VBox/VMM/testcase/tstVMStruct.h
r43658 r44399 219 219 GEN_CHECK_OFF(DBGF, enmVMMCmd); 220 220 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); 223 223 GEN_CHECK_OFF(DBGF, SymbolTree); 224 224 GEN_CHECK_OFF(DBGF, pSymbolSpace); … … 228 228 GEN_CHECK_OFF(DBGF, aHwBreakpoints); 229 229 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); 234 234 GEN_CHECK_SIZE(DBGFEVENT); 235 235 … … 237 237 GEN_CHECK_OFF(DBGFCPU, iActiveBp); 238 238 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); 241 241 242 242 GEN_CHECK_SIZE(EM); -
trunk/src/recompiler/VBoxREMWrapper.cpp
r44362 r44399 615 615 static const REMPARMDESC g_aArgsDBGFR3DisasInstrEx[] = 616 616 { 617 { REMPARMDESC_FLAGS_INT, sizeof(P VM),NULL },617 { REMPARMDESC_FLAGS_INT, sizeof(PUVM), NULL }, 618 618 { REMPARMDESC_FLAGS_INT, sizeof(VMCPUID), NULL }, 619 619 { REMPARMDESC_FLAGS_INT, sizeof(RTSEL), NULL }, … … 631 631 static const REMPARMDESC g_aArgsDBGFR3Info[] = 632 632 { 633 { REMPARMDESC_FLAGS_INT, sizeof(P VM),NULL },633 { REMPARMDESC_FLAGS_INT, sizeof(PUVM), NULL }, 634 634 { REMPARMDESC_FLAGS_INT, sizeof(const char *), NULL }, 635 635 { REMPARMDESC_FLAGS_INT, sizeof(const char *), NULL }, … … 638 638 static const REMPARMDESC g_aArgsDBGFR3AsSymbolByAddr[] = 639 639 { 640 { REMPARMDESC_FLAGS_INT, sizeof(P VM),NULL },640 { REMPARMDESC_FLAGS_INT, sizeof(PUVM), NULL }, 641 641 { REMPARMDESC_FLAGS_INT, sizeof(RTDBGAS), NULL }, 642 642 { REMPARMDESC_FLAGS_INT, sizeof(PCDBGFADDRESS), NULL }, … … 647 647 static const REMPARMDESC g_aArgsDBGFR3AddrFromFlat[] = 648 648 { 649 { REMPARMDESC_FLAGS_INT, sizeof(P VM),NULL },649 { REMPARMDESC_FLAGS_INT, sizeof(PUVM), NULL }, 650 650 { REMPARMDESC_FLAGS_INT, sizeof(PDBGFADDRESS), NULL }, 651 651 { REMPARMDESC_FLAGS_INT, sizeof(RTGCUINTPTR), NULL } -
trunk/src/recompiler/VBoxRecompiler.c
r44330 r44399 45 45 #include "REMInternal.h" 46 46 #include <VBox/vmm/vm.h> 47 #include <VBox/vmm/uvm.h> 47 48 #include <VBox/param.h> 48 49 #include <VBox/err.h> … … 193 194 * Debugger commands. 194 195 */ 195 static DECLCALLBACK(int) remR3CmdDisasEnableStepping(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs);196 static FNDBGCCMD remR3CmdDisasEnableStepping;; 196 197 197 198 /** '.remstep' arguments. */ … … 1121 1122 */ 1122 1123 remR3StateUpdate(pVM, pVCpu); 1123 DBGFR3Info(pVM , "cpumguest", NULL, NULL);1124 DBGFR3Info(pVM->pUVM, "cpumguest", NULL, NULL); 1124 1125 szBuf[0] = '\0'; 1125 rc = DBGFR3DisasInstrEx(pVM ,1126 rc = DBGFR3DisasInstrEx(pVM->pUVM, 1126 1127 pVCpu->idCpu, 1127 1128 0, /* Sel */ … … 3490 3491 "*** handlers\n", 3491 3492 (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()); 3493 3494 LogRel(("*** mmio\n")); 3494 DBGFR3Info(pVM , "mmio", NULL, DBGFR3InfoLogRelHlp());3495 DBGFR3Info(pVM->pUVM, "mmio", NULL, DBGFR3InfoLogRelHlp()); 3495 3496 LogRel(("*** phys\n")); 3496 DBGFR3Info(pVM , "phys", NULL, DBGFR3InfoLogRelHlp());3497 DBGFR3Info(pVM->pUVM, "phys", NULL, DBGFR3InfoLogRelHlp()); 3497 3498 cpu_abort(env, "Trying to execute code with memory type addr_code=%RGv addend=%RGp at %RGv. (iHandlerMemType=%#x iMMIOMemType=%#x)\n", 3498 3499 (RTGCPTR)pTLBEntry->addr_code, (RTGCPHYS)pTLBEntry->addend, (RTGCPTR)addr, pVM->rem.s.iHandlerMemType, pVM->rem.s.iMMIOMemType); … … 3923 3924 * External Debugger Command: .remstep [on|off|1|0] 3924 3925 */ 3925 static DECLCALLBACK(int) remR3CmdDisasEnableStepping(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, P VM pVM, PCDBGCVAR paArgs, unsigned cArgs)3926 static DECLCALLBACK(int) remR3CmdDisasEnableStepping(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs) 3926 3927 { 3927 3928 int rc; 3929 PVM pVM = pUVM->pVM; 3928 3930 3929 3931 if (cArgs == 0) … … 3988 3990 */ 3989 3991 if (fLog2) 3990 DBGFR3 InfoLog(pVM, "cpumguest", pszPrefix);3992 DBGFR3_INFO_LOG(pVM, "cpumguest", pszPrefix); 3991 3993 3992 3994 /* … … 3998 4000 char szBuf[256]; 3999 4001 szBuf[0] = '\0'; 4000 int rc = DBGFR3DisasInstrEx(pVCpu->pVMR3 ,4002 int rc = DBGFR3DisasInstrEx(pVCpu->pVMR3->pUVM, 4001 4003 pVCpu->idCpu, 4002 4004 0, /* Sel */ … … 4092 4094 char szBuf[256]; 4093 4095 uint32_t cbInstr; 4094 int rc = DBGFR3DisasInstrEx(pVM ,4096 int rc = DBGFR3DisasInstrEx(pVM->pUVM, 4095 4097 pVCpu->idCpu, 4096 4098 cs, … … 4131 4133 DBGFADDRESS Addr; 4132 4134 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*/); 4134 4137 if (RT_SUCCESS(rc)) 4135 4138 {
Note:
See TracChangeset
for help on using the changeset viewer.