Changeset 44399 in vbox for trunk/src/VBox/Debugger
- Timestamp:
- Jan 27, 2013 9:12:53 PM (12 years ago)
- svn:sync-xref-src-repo-rev:
- 83373
- Location:
- trunk/src/VBox/Debugger
- Files:
-
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
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 }
Note:
See TracChangeset
for help on using the changeset viewer.