Exemplo n.º 1
0
        public void StepComplete(ICorDebugAppDomain pAppDomain, ICorDebugThread pThread, ICorDebugStepper pStepper, CorDebugStepReason reason)
        {
            EnterCallback(PausedReason.StepComplete, "StepComplete (" + reason.ToString() + ")", pThread);

            Thread  thread  = process.GetThread(pThread);
            Stepper stepper = thread.GetStepper(pStepper);

            process.TraceMessage(" - stepper info: " + stepper.ToString());

            thread.Steppers.Remove(stepper);
            stepper.OnStepComplete();

            if (stepper.PauseWhenComplete)
            {
                if (process.SelectedThread.LastFunction.HasSymbols)
                {
                    ExitCallback_Paused();
                }
                else
                {
                    // This can only happen when JMC is disabled (ie NET1.1 or StepOut)
                    if (stepper.Operation == Stepper.StepperOperation.StepOut)
                    {
                        // Create new stepper and keep going
                        process.TraceMessage(" - stepping out of code without symbols at " + process.SelectedThread.LastFunction.ToString());
                        new Stepper(process.SelectedThread.LastFunction, "Stepper out of code without symbols").StepOut();
                        ExitCallback_Continue();
                    }
                    else
                    {
                        // NET1.1: There is extra step over stepper, just keep going
                        process.TraceMessage(" - leaving code without symbols");
                        ExitCallback_Continue();
                    }
                }
            }
            else
            {
                ExitCallback_Continue();
            }
        }
Exemplo n.º 2
0
        public void StepComplete(ICorDebugAppDomain pAppDomain, ICorDebugThread pThread, ICorDebugStepper pStepper, CorDebugStepReason reason)
        {
            EnterCallback(PausedReason.StepComplete, "StepComplete (" + reason.ToString() + ")", pThread);

            Thread  thread  = process.Threads[pThread];
            Stepper stepper = process.GetStepper(pStepper);

            StackFrame currentStackFrame = process.SelectedThread.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.MethodInfo.StepOver)
            {
                if (process.Options.EnableJustMyCode)
                {
                    currentStackFrame.MethodInfo.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
                pauseOnNextExit = true;
                process.TraceMessage(" - pausing in user code");
            }

            ExitCallback();
        }