Changeset 35694 in vbox for trunk/src/VBox/VMM/VMMR3
- Timestamp:
- Jan 24, 2011 5:35:59 PM (14 years ago)
- Location:
- trunk/src/VBox/VMM/VMMR3
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR3/CSAM.cpp
r35348 r35694 2663 2663 2664 2664 #ifdef VBOX_WITH_DEBUGGER 2665 2665 2666 /** 2666 2667 * The '.csamoff' command. … … 2675 2676 static DECLCALLBACK(int) csamr3CmdOff(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs, PDBGCVAR pResult) 2676 2677 { 2677 /* 2678 * Validate input. 2679 */ 2680 if (!pVM) 2681 return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "error: The command requires VM to be selected.\n"); 2682 2683 CSAMDisableScanning(pVM); 2684 return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "CSAM Scanning disabled\n"); 2678 DBGC_CMDHLP_REQ_VM_RET(pCmdHlp, pCmd, pVM); 2679 2680 int rc = CSAMDisableScanning(pVM); 2681 if (RT_FAILURE(rc)) 2682 return DBGCCmdHlpFailRc(pCmdHlp, pCmd, rc, "CSAMDisableScanning"); 2683 return DBGCCmdHlpPrintf(pCmdHlp, "CSAM Scanning disabled\n"); 2685 2684 } 2686 2685 … … 2697 2696 static DECLCALLBACK(int) csamr3CmdOn(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs, PDBGCVAR pResult) 2698 2697 { 2699 /* 2700 * Validate input. 2701 */ 2702 if (!pVM) 2703 return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "error: The command requires VM to be selected.\n"); 2704 2705 CSAMEnableScanning(pVM); 2706 return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "CSAM Scanning enabled\n"); 2707 } 2708 #endif 2698 DBGC_CMDHLP_REQ_VM_RET(pCmdHlp, pCmd, pVM); 2699 2700 int rc = CSAMEnableScanning(pVM); 2701 if (RT_FAILURE(rc)) 2702 return DBGCCmdHlpFailRc(pCmdHlp, pCmd, rc, "CSAMEnableScanning"); 2703 return DBGCCmdHlpPrintf(pCmdHlp, "CSAM Scanning enabled\n"); 2704 } 2705 2706 #endif /* VBOX_WITH_DEBUGGER */ -
trunk/src/VBox/VMM/VMMR3/DBGFBp.cpp
r35346 r35694 38 38 RT_C_DECLS_BEGIN 39 39 static DECLCALLBACK(int) dbgfR3BpSetReg(PVM pVM, PCDBGFADDRESS pAddress, uint64_t *piHitTrigger, uint64_t *piHitDisable, 40 uint8_t u8Type, uint8_t cb, PRTUINTpiBp);41 static DECLCALLBACK(int) dbgfR3BpSetInt3(PVM pVM, PCDBGFADDRESS pAddress, uint64_t *piHitTrigger, uint64_t *piHitDisable, PRTUINTpiBp);42 static DECLCALLBACK(int) dbgfR3BpSetREM(PVM pVM, PCDBGFADDRESS pAddress, uint64_t *piHitTrigger, uint64_t *piHitDisable, PRTUINTpiBp);43 static DECLCALLBACK(int) dbgfR3BpClear(PVM pVM, RTUINTiBp);44 static DECLCALLBACK(int) dbgfR3BpEnable(PVM pVM, RTUINTiBp);45 static DECLCALLBACK(int) dbgfR3BpDisable(PVM pVM, RTUINTiBp);40 uint8_t u8Type, uint8_t cb, uint32_t *piBp); 41 static DECLCALLBACK(int) dbgfR3BpSetInt3(PVM pVM, PCDBGFADDRESS pAddress, uint64_t *piHitTrigger, uint64_t *piHitDisable, uint32_t *piBp); 42 static DECLCALLBACK(int) dbgfR3BpSetREM(PVM pVM, PCDBGFADDRESS pAddress, uint64_t *piHitTrigger, uint64_t *piHitDisable, uint32_t *piBp); 43 static DECLCALLBACK(int) dbgfR3BpClear(PVM pVM, uint32_t iBp); 44 static DECLCALLBACK(int) dbgfR3BpEnable(PVM pVM, uint32_t iBp); 45 static DECLCALLBACK(int) dbgfR3BpDisable(PVM pVM, uint32_t iBp); 46 46 static DECLCALLBACK(int) dbgfR3BpEnum(PVM pVM, PFNDBGFBPENUM pfnCallback, void *pvUser); 47 47 static int dbgfR3BpRegArm(PVM pVM, PDBGFBP pBp); … … 101 101 * Determine which array to search. 102 102 */ 103 unsigned cBps;104 PRTUINTpcBpsCur;105 PDBGFBP paBps;103 unsigned cBps; 104 uint32_t *pcBpsCur; 105 PDBGFBP paBps; 106 106 switch (enmType) 107 107 { … … 149 149 * @param iBp The breakpoint id. 150 150 */ 151 static PDBGFBP dbgfR3BpGet(PVM pVM, RTUINTiBp)151 static PDBGFBP dbgfR3BpGet(PVM pVM, uint32_t iBp) 152 152 { 153 153 /* Find it. */ … … 278 278 * @thread Any thread. 279 279 */ 280 VMMR3DECL(int) DBGFR3BpSet(PVM pVM, PCDBGFADDRESS pAddress, uint64_t iHitTrigger, uint64_t iHitDisable, PRTUINTpiBp)280 VMMR3DECL(int) DBGFR3BpSet(PVM pVM, PCDBGFADDRESS pAddress, uint64_t iHitTrigger, uint64_t iHitDisable, uint32_t *piBp) 281 281 { 282 282 /* … … 303 303 * @thread Any thread. 304 304 */ 305 static DECLCALLBACK(int) dbgfR3BpSetInt3(PVM pVM, PCDBGFADDRESS pAddress, uint64_t *piHitTrigger, uint64_t *piHitDisable, PRTUINTpiBp)305 static DECLCALLBACK(int) dbgfR3BpSetInt3(PVM pVM, PCDBGFADDRESS pAddress, uint64_t *piHitTrigger, uint64_t *piHitDisable, uint32_t *piBp) 306 306 { 307 307 /* … … 435 435 */ 436 436 VMMR3DECL(int) DBGFR3BpSetReg(PVM pVM, PCDBGFADDRESS pAddress, uint64_t iHitTrigger, uint64_t iHitDisable, 437 uint8_t fType, uint8_t cb, PRTUINTpiBp)437 uint8_t fType, uint8_t cb, uint32_t *piBp) 438 438 { 439 439 /** @todo SMP - broadcast, VT-x/AMD-V. */ … … 466 466 */ 467 467 static DECLCALLBACK(int) dbgfR3BpSetReg(PVM pVM, PCDBGFADDRESS pAddress, uint64_t *piHitTrigger, uint64_t *piHitDisable, 468 uint8_t fType, uint8_t cb, PRTUINTpiBp)468 uint8_t fType, uint8_t cb, uint32_t *piBp) 469 469 { 470 470 /* … … 603 603 * @thread Any thread. 604 604 */ 605 VMMR3DECL(int) DBGFR3BpSetREM(PVM pVM, PCDBGFADDRESS pAddress, uint64_t iHitTrigger, uint64_t iHitDisable, PRTUINTpiBp)605 VMMR3DECL(int) DBGFR3BpSetREM(PVM pVM, PCDBGFADDRESS pAddress, uint64_t iHitTrigger, uint64_t iHitDisable, uint32_t *piBp) 606 606 { 607 607 /* … … 628 628 * @internal 629 629 */ 630 static DECLCALLBACK(int) dbgfR3BpSetREM(PVM pVM, PCDBGFADDRESS pAddress, uint64_t *piHitTrigger, uint64_t *piHitDisable, PRTUINTpiBp)630 static DECLCALLBACK(int) dbgfR3BpSetREM(PVM pVM, PCDBGFADDRESS pAddress, uint64_t *piHitTrigger, uint64_t *piHitDisable, uint32_t *piBp) 631 631 { 632 632 /* … … 695 695 * @thread Any thread. 696 696 */ 697 VMMR3DECL(int) DBGFR3BpClear(PVM pVM, RTUINTiBp)697 VMMR3DECL(int) DBGFR3BpClear(PVM pVM, uint32_t iBp) 698 698 { 699 699 /* … … 715 715 * @internal 716 716 */ 717 static DECLCALLBACK(int) dbgfR3BpClear(PVM pVM, RTUINTiBp)717 static DECLCALLBACK(int) dbgfR3BpClear(PVM pVM, uint32_t iBp) 718 718 { 719 719 /* … … 768 768 * @thread Any thread. 769 769 */ 770 VMMR3DECL(int) DBGFR3BpEnable(PVM pVM, RTUINTiBp)770 VMMR3DECL(int) DBGFR3BpEnable(PVM pVM, uint32_t iBp) 771 771 { 772 772 /* … … 788 788 * @internal 789 789 */ 790 static DECLCALLBACK(int) dbgfR3BpEnable(PVM pVM, RTUINTiBp)790 static DECLCALLBACK(int) dbgfR3BpEnable(PVM pVM, uint32_t iBp) 791 791 { 792 792 /* … … 841 841 * @thread Any thread. 842 842 */ 843 VMMR3DECL(int) DBGFR3BpDisable(PVM pVM, RTUINTiBp)843 VMMR3DECL(int) DBGFR3BpDisable(PVM pVM, uint32_t iBp) 844 844 { 845 845 /* … … 861 861 * @internal 862 862 */ 863 static DECLCALLBACK(int) dbgfR3BpDisable(PVM pVM, RTUINTiBp)863 static DECLCALLBACK(int) dbgfR3BpDisable(PVM pVM, uint32_t iBp) 864 864 { 865 865 /* -
trunk/src/VBox/VMM/VMMR3/PDMAsyncCompletionFile.cpp
r35346 r35694 86 86 { 1, 1, DBGCVAR_CAT_STRING, 0, "direction", "write/read." }, 87 87 { 1, 1, DBGCVAR_CAT_STRING, 0, "filename", "Filename." }, 88 { 1, 1, DBGCVAR_CAT_ STRING, 0, "errcode", "IPRT errorcode." },88 { 1, 1, DBGCVAR_CAT_NUMBER, 0, "errcode", "VBox status code." }, 89 89 }; 90 90 … … 699 699 static DECLCALLBACK(int) pdmacEpFileErrorInject(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR pArgs, unsigned cArgs, PDBGCVAR pResult) 700 700 { 701 bool fWrite;702 PPDMASYNCCOMPLETIONEPCLASSFILE pEpClassFile;703 704 701 /* 705 702 * Validate input. 706 703 */ 707 if (!pVM) 708 return DBGCCmdHlpPrintf(pCmdHlp, "error: The command requires a VM to be selected.\n"); 709 if ( cArgs != 3 710 || pArgs[0].enmType != DBGCVAR_TYPE_STRING 711 || pArgs[1].enmType != DBGCVAR_TYPE_STRING 712 || pArgs[2].enmType != DBGCVAR_TYPE_STRING) 713 return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "error: parser error, invalid arguments.\n"); 714 704 DBGC_CMDHLP_REQ_VM_RET(pCmdHlp, pCmd, pVM); 705 DBGC_CMDHLP_ASSERT_PARSER_RET(pCmdHlp, pCmd, -1, cArgs == 3); 706 DBGC_CMDHLP_ASSERT_PARSER_RET(pCmdHlp, pCmd, 0, pArgs[0].enmType == DBGCVAR_TYPE_STRING); 707 DBGC_CMDHLP_ASSERT_PARSER_RET(pCmdHlp, pCmd, 1, pArgs[1].enmType == DBGCVAR_TYPE_STRING); 708 DBGC_CMDHLP_ASSERT_PARSER_RET(pCmdHlp, pCmd, 2, pArgs[2].enmType == DBGCVAR_TYPE_NUMBER); 709 710 PPDMASYNCCOMPLETIONEPCLASSFILE pEpClassFile; 715 711 pEpClassFile = (PPDMASYNCCOMPLETIONEPCLASSFILE)pVM->pUVM->pdm.s.apAsyncCompletionEndpointClass[PDMASYNCCOMPLETIONEPCLASSTYPE_FILE]; 716 712 717 713 /* Syntax is "read|write <filename> <status code>" */ 714 bool fWrite; 718 715 if (!RTStrCmp(pArgs[0].u.pszString, "read")) 719 716 fWrite = false; … … 721 718 fWrite = true; 722 719 else 723 { 724 DBGCCmdHlpPrintf(pCmdHlp, "error: invalid transefr direction '%s'.\n", pArgs[0].u.pszString); 725 return VINF_SUCCESS; 726 } 727 728 /* Search for the matching endpoint. */ 720 return DBGCCmdHlpFail(pCmdHlp, pCmd, "invalid transfer direction '%s'", pArgs[0].u.pszString); 721 722 int32_t rcToInject = (int32_t)pArgs[2].u.u64Number; 723 if ((uint64_t)rcToInject != pArgs[2].u.u64Number) 724 return DBGCCmdHlpFail(pCmdHlp, pCmd, "The status code '%lld' is out of range", pArgs[0].u.u64Number); 725 726 727 /* 728 * Search for the matching endpoint. 729 */ 729 730 RTCritSectEnter(&pEpClassFile->Core.CritSect); 731 730 732 PPDMASYNCCOMPLETIONENDPOINTFILE pEpFile = (PPDMASYNCCOMPLETIONENDPOINTFILE)pEpClassFile->Core.pEndpointsHead; 731 732 733 while (pEpFile) 733 734 { … … 736 737 pEpFile = (PPDMASYNCCOMPLETIONENDPOINTFILE)pEpFile->Core.pNext; 737 738 } 738 739 739 if (pEpFile) 740 740 { 741 int rcToInject = RTStrToInt32(pArgs[2].u.pszString); 742 741 /* 742 * Do the job. 743 */ 743 744 if (fWrite) 744 745 ASMAtomicXchgS32(&pEpFile->rcReqWrite, rcToInject); 745 746 else 746 ASMAtomicXchgS32(&pEpFile->rcReqRead, rcToInject); 747 748 DBGCCmdHlpPrintf(pCmdHlp, "Injected %Rrc into '%s' for %s\n", 749 rcToInject, pArgs[1].u.pszString, pArgs[0].u.pszString); 750 } 751 else 752 DBGCCmdHlpPrintf(pCmdHlp, "No file with name '%s' found\n", NULL, pArgs[1].u.pszString); 747 ASMAtomicXchgS32(&pEpFile->rcReqRead, rcToInject); 748 749 DBGCCmdHlpPrintf(pCmdHlp, "Injected %Rrc into '%s' for %s\n", 750 (int)rcToInject, pArgs[1].u.pszString, pArgs[0].u.pszString); 751 } 753 752 754 753 RTCritSectLeave(&pEpClassFile->Core.CritSect); 754 755 if (!pEpFile) 756 return DBGCCmdHlpFail(pCmdHlp, pCmd, "No file with name '%s' found", pArgs[1].u.pszString); 755 757 return VINF_SUCCESS; 756 758 } 757 #endif 759 #endif /* VBOX_WITH_DEBUGGER */ 758 760 759 761 static int pdmacFileInitialize(PPDMASYNCCOMPLETIONEPCLASS pClassGlobals, PCFGMNODE pCfgNode) … … 830 832 if (RT_SUCCESS(rc)) 831 833 { 832 rc = DBGCRegisterCommands(&g_aCmds[0], 1);834 rc = DBGCRegisterCommands(&g_aCmds[0], RT_ELEMENTS(g_aCmds)); 833 835 AssertRC(rc); 834 836 } -
trunk/src/VBox/VMM/VMMR3/STAM.cpp
r35346 r35694 172 172 { 173 173 /* pszCmd, cArgsMin, cArgsMax, paArgDesc, cArgDescs, pResultDesc, fFlags, pfnHandler pszSyntax, ....pszDescription */ 174 { "stats", 0, 1, &g_aArgPat[0], RT_ELEMENTS(g_aArgPat), 175 { "statsreset", 0, 1, &g_aArgPat[0], RT_ELEMENTS(g_aArgPat), 174 { "stats", 0, 1, &g_aArgPat[0], RT_ELEMENTS(g_aArgPat), NULL, 0, stamR3CmdStats, "[pattern]", "Display statistics." }, 175 { "statsreset", 0, 1, &g_aArgPat[0], RT_ELEMENTS(g_aArgPat), NULL, 0, stamR3CmdStatsReset,"[pattern]", "Resets statistics." } 176 176 }; 177 177 #endif … … 1922 1922 * Validate input. 1923 1923 */ 1924 if (!pVM) 1925 return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "error: The command requires VM to be selected.\n"); 1924 DBGC_CMDHLP_REQ_VM_RET(pCmdHlp, pCmd, pVM); 1926 1925 PUVM pUVM = pVM->pUVM; 1927 1926 if (!pUVM->stam.s.pHead) 1928 return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "Sorry, no statistics present.\n");1927 return DBGCCmdHlpFail(pCmdHlp, pCmd, "No statistics present"); 1929 1928 1930 1929 /* … … 1932 1931 */ 1933 1932 STAMR3PRINTONEARGS Args; 1934 Args.pVM = pVM;1935 Args.pvArg = pCmdHlp;1936 Args.pfnPrintf = stamR3EnumDbgfPrintf;1933 Args.pVM = pVM; 1934 Args.pvArg = pCmdHlp; 1935 Args.pfnPrintf = stamR3EnumDbgfPrintf; 1937 1936 1938 1937 return stamR3EnumU(pUVM, cArgs ? paArgs[0].u.pszString : NULL, true /* fUpdateRing0 */, stamR3PrintOne, &Args); … … 1974 1973 * Validate input. 1975 1974 */ 1976 if (!pVM) 1977 return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "error: The command requires VM to be selected.\n"); 1975 DBGC_CMDHLP_REQ_VM_RET(pCmdHlp, pCmd, pVM); 1978 1976 PUVM pUVM = pVM->pUVM; 1979 1977 if (!pUVM->stam.s.pHead) 1980 return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "Sorry, no statistics present.\n");1978 return DBGCCmdHlpFail(pCmdHlp, pCmd, "No statistics present"); 1981 1979 1982 1980 /* … … 1985 1983 int rc = STAMR3ResetU(pUVM, cArgs ? paArgs[0].u.pszString : NULL); 1986 1984 if (RT_SUCCESS(rc)) 1987 return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "info: Statistics reset.\n"); 1988 1989 return pCmdHlp->pfnVBoxError(pCmdHlp, rc, "Resetting statistics.\n"); 1985 return DBGCCmdHlpFailRc(pCmdHlp, pCmd, rc, "STAMR3ResetU"); 1986 return DBGCCmdHlpPrintf(pCmdHlp, "Statistics have been reset.\n"); 1990 1987 } 1991 1988
Note:
See TracChangeset
for help on using the changeset viewer.