public void StepComplete(ICorDebugAppDomain pAppDomain, ICorDebugThread pThread, ICorDebugStepper pStepper, CorDebugStepReason reason) { EnterCallback("StepComplete (" + reason.ToString() + ")", pThread); Thread thread = process.GetThread(pThread); Stepper stepper = process.GetStepper(pStepper); StackFrame currentStackFrame = thread.MostRecentStackFrame; process.TraceMessage(" - stopped at {0} because of {1}", currentStackFrame.MethodInfo.FullName, stepper.ToString()); process.Steppers.Remove(stepper); stepper.OnStepComplete(reason); if (stepper.Ignore) { // The stepper is ignored process.TraceMessage(" - ignored"); } else if (thread.CurrentStepIn != null && thread.CurrentStepIn.StackFrame.Equals(currentStackFrame) && thread.CurrentStepIn.IsInStepRanges((int)currentStackFrame.IP)) { Stepper.StepIn(currentStackFrame, thread.CurrentStepIn.StepRanges, "finishing step in"); process.TraceMessage(" - finishing step in"); } else if (currentStackFrame.IsNonUserCode) { if (process.Options.EnableJustMyCode) { currentStackFrame.MarkAsNonUserCode(); process.TraceMessage(" - method {0} marked as non user code", currentStackFrame.MethodInfo.FullName); Stepper.StepIn(currentStackFrame, new int[] { 0, int.MaxValue }, "seeking user code"); process.TraceMessage(" - seeking user code"); } else { Stepper.StepOut(currentStackFrame, "stepping out of non-user code"); process.TraceMessage(" - stepping out of non-user code"); } } else { // User-code method RequestPause(thread).Break = true; process.TraceMessage(" - pausing in user code"); } ExitCallback(); }
void EnterCallback(PausedReason pausedReason, string name, ICorDebugThread pThread) { EnterCallback(pausedReason, name, pThread.Process); process.SelectedThread = process.GetThread(pThread); }
void EnterCallback(string name, ICorDebugThread pThread) { EnterCallback(name, pThread.GetProcess()); threadToReport = process.GetThread(pThread); }