Changeset 83088 in vbox for trunk/src/VBox/Debugger
- Timestamp:
- Feb 16, 2020 8:12:37 PM (5 years ago)
- svn:sync-xref-src-repo-rev:
- 136144
- Location:
- trunk/src/VBox/Debugger
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Debugger/DBGCCommands.cpp
r82968 r83088 65 65 static FNDBGCCMD dbgcCmdLoadMap; 66 66 static FNDBGCCMD dbgcCmdLoadSeg; 67 static FNDBGCCMD dbgcCmdMultiStep; 67 68 static FNDBGCCMD dbgcCmdUnload; 68 69 static FNDBGCCMD dbgcCmdSet; … … 207 208 /* cTimesMin, cTimesMax, enmCategory, fFlags, pszName, pszDescription */ 208 209 { 0, 1, DBGCVAR_CAT_STRING, 0, "flags", "Flag modifier string (quote it!)." } 210 }; 211 212 /** multistep arguments. */ 213 static const DBGCVARDESC g_aArgMultiStep[] = 214 { 215 /* cTimesMin, cTimesMax, enmCategory, fFlags, pszName, pszDescription */ 216 { 0, 1, DBGCVAR_CAT_NUMBER_NO_RANGE, 0, "count", "Number of steps to take, defaults to 64." }, 217 { 0, 1, DBGCVAR_CAT_NUMBER_NO_RANGE, DBGCVD_FLAGS_DEP_PREV, "stride", "The length of each step, defaults to 1." }, 209 218 }; 210 219 … … 283 292 { "logflags", 0, 1, &g_aArgLogFlags[0], RT_ELEMENTS(g_aArgLogFlags), 0, dbgcCmdLogFlags, "[flags string]", "Displays or modifies the logging flags (VBOX_LOG_FLAGS)." }, 284 293 { "logflush", 0, 0, NULL, 0, 0, dbgcCmdLogFlush, "", "Flushes the log buffers." }, 294 { "multistep", 0, 2, &g_aArgMultiStep[0], RT_ELEMENTS(g_aArgMultiStep), 0, dbgcCmdMultiStep, "[count [stride]", "Performs the specified number of step-into operations. Stops early if non-step event occurs." }, 285 295 { "quit", 0, 0, NULL, 0, 0, dbgcCmdQuit, "", "Exits the debugger." }, 286 296 { "runscript", 1, 1, &g_aArgFilename[0], RT_ELEMENTS(g_aArgFilename), 0, dbgcCmdRunScript, "<filename>", "Runs the command listed in the script. Lines starting with '#' " … … 859 869 NOREF(pCmd); 860 870 NOREF(pUVM); 871 return rc; 872 } 873 874 875 /** 876 * @callback_method_impl{FNDBGCCMD, The 'multistep' command.} 877 */ 878 static DECLCALLBACK(int) dbgcCmdMultiStep(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PUVM pUVM, PCDBGCVAR paArgs, unsigned cArgs) 879 { 880 PDBGC pDbgc = DBGC_CMDHLP2DBGC(pCmdHlp); 881 882 /* 883 * Parse arguments. 884 */ 885 uint32_t cSteps = 64; 886 if (cArgs > 0) 887 { 888 if (paArgs[0].u.u64Number == 0 || paArgs[0].u.u64Number > _2G) 889 return DBGCCmdHlpFailRc(pCmdHlp, pCmd, VERR_OUT_OF_RANGE, 890 "The 'count' argument is out of range: %#llx - 1..2GiB\n", paArgs[0].u.u64Number); 891 cSteps = (uint32_t)paArgs[0].u.u64Number; 892 } 893 uint32_t uStrideLength = 1; 894 if (cArgs > 1) 895 { 896 if (paArgs[1].u.u64Number == 0 || paArgs[1].u.u64Number > _2G) 897 return DBGCCmdHlpFailRc(pCmdHlp, pCmd, VERR_OUT_OF_RANGE, 898 "The 'stride' argument is out of range: %#llx - 1..2GiB\n", paArgs[0].u.u64Number); 899 uStrideLength = (uint32_t)paArgs[0].u.u64Number; 900 } 901 902 /* 903 * Take the first step. 904 */ 905 int rc = DBGFR3StepEx(pUVM, pDbgc->idCpu, DBGF_STEP_F_INTO, NULL, NULL, 0, uStrideLength); 906 if (RT_SUCCESS(rc)) 907 { 908 pDbgc->cMultiStepsLeft = cSteps; 909 pDbgc->uMultiStepStrideLength = uStrideLength; 910 pDbgc->pMultiStepCmd = pCmd; 911 pDbgc->fReady = false; 912 } 913 else 914 return DBGCCmdHlpFailRc(pCmdHlp, pCmd, rc, "DBGFR3StepEx(,,DBGF_STEP_F_INTO,) failed"); 915 916 NOREF(pCmd); 861 917 return rc; 862 918 } -
trunk/src/VBox/Debugger/DBGCInternal.h
r82968 r83088 138 138 bool fLog; 139 139 140 /** Counter use to suppress the printing of the headers. */ 141 uint8_t cPagingHierarchyDumps; 140 142 /** Indicates whether the register are terse or sparse. */ 141 143 bool fRegTerse; 144 145 /** @name Stepping 146 * @{ */ 142 147 /** Whether to display registers when tracing. */ 143 148 bool fStepTraceRegs; 144 /** Counter use to suppress the printing of the headers. */ 145 uint8_t cPagingHierarchyDumps; 149 /** Number of multi-steps left, zero if not multi-stepping. */ 150 uint32_t cMultiStepsLeft; 151 /** The multi-step stride length. */ 152 uint32_t uMultiStepStrideLength; 153 /** The active multi-step command. */ 154 PCDBGCCMD pMultiStepCmd; 155 /** @} */ 146 156 147 157 /** Current disassembler position. */ -
trunk/src/VBox/Debugger/DBGConsole.cpp
r82968 r83088 716 716 case DBGFEVENT_STEPPED_HYPER: 717 717 { 718 rc = pDbgc->CmdHlp.pfnPrintf(&pDbgc->CmdHlp, NULL, "\ndbgf event: Single step! (%s)\n", dbgcGetEventCtx(pEvent->enmCtx)); 718 if (!pDbgc->cMultiStepsLeft) 719 rc = pDbgc->CmdHlp.pfnPrintf(&pDbgc->CmdHlp, NULL, "\ndbgf event: Single step! (%s)\n", dbgcGetEventCtx(pEvent->enmCtx)); 720 else 721 pDbgc->cMultiStepsLeft -= 1; 719 722 if (RT_SUCCESS(rc)) 720 723 { … … 733 736 rc = pDbgc->CmdHlp.pfnExec(&pDbgc->CmdHlp, "%s", szCmd); 734 737 } 738 } 739 740 /* If multi-stepping, take the next step: */ 741 if (pDbgc->cMultiStepsLeft > 0) 742 { 743 int rc2 = DBGFR3StepEx(pDbgc->pUVM, pDbgc->idCpu, DBGF_STEP_F_INTO, NULL, NULL, 0, pDbgc->uMultiStepStrideLength); 744 if (RT_SUCCESS(rc2)) 745 fPrintPrompt = false; 746 else 747 DBGCCmdHlpFailRc(&pDbgc->CmdHlp, pDbgc->pMultiStepCmd, rc2, "DBGFR3StepEx(,,DBGF_STEP_F_INTO,) failed"); 735 748 } 736 749 break; … … 860 873 if (RT_SUCCESS(rc)) 861 874 pDbgc->pBack->pfnSetReady(pDbgc->pBack, true); 875 pDbgc->cMultiStepsLeft = 0; 862 876 } 863 877
Note:
See TracChangeset
for help on using the changeset viewer.