public void StepComplete(ICorDebugAppDomain pAppDomain, ICorDebugThread pThread, ICorDebugStepper pStepper, CorDebugStepReason reason)
		{
			ManagedCallback managedCallback = GetProcessCallbackInterface(pAppDomain);
			if (managedCallback != null) {
				managedCallback.StepComplete(pAppDomain, pThread, pStepper, reason);
			}
		}
Example #2
0
        public ICorDebugStepper CreateStepper()
        {
            ICorDebugStepper ppStepper;

            Debugger.Interop.CorDebug.ICorDebugStepper out_ppStepper;
            this.WrappedObject.CreateStepper(out out_ppStepper);
            ppStepper = ICorDebugStepper.Wrap(out_ppStepper);
            return(ppStepper);
        }
Example #3
0
		public Stepper(Function function)
		{
			this.function = function;
			
			corStepper = function.CorILFrame.CreateStepper();
			
			JustMyCode = true;
			
			function.Thread.Steppers.Add(this);
		}
Example #4
0
		private Stepper(StackFrame stackFrame, StepperOperation operation, int[] stepRanges, string name, bool justMyCode)
		{
			this.stackFrame = stackFrame;
			this.operation = operation;
			this.stepRanges = stepRanges;
			this.name = name;
			
			this.corStepper = stackFrame.CorILFrame.CreateStepper();
			this.ignore = false;
			this.StackFrame.Thread.Steppers.Add(this);
			
			if (justMyCode) {
				corStepper.SetUnmappedStopMask(CorDebugUnmappedStop.STOP_NONE);
				corStepper.CastTo<ICorDebugStepper2>().SetJMC(1);
			}
		}
Example #5
0
		internal Stepper GetStepper(ICorDebugStepper corStepper)
		{
			foreach(Stepper stepper in steppers) {
				if (stepper.IsCorStepper(corStepper)) {
					return stepper;
				}
			}
			throw new DebuggerException("Stepper is not in collection");
		}
        public override bool Equals(object o)
        {
            ICorDebugStepper casted = o as ICorDebugStepper;

            return((casted != null) && (casted.WrappedObject == wrappedObject));
        }
Example #7
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();
			}
		}
Example #8
0
		internal bool IsCorStepper(ICorDebugStepper corStepper)
		{
			return this.corStepper == corStepper;
		}
Example #9
0
		protected internal virtual void OnStepComplete(CorDebugStepReason reason) {
			this.corStepper = null;
			if (StepComplete != null) {
				StepComplete(this, new StepperEventArgs(this, reason));
			}
		}
		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);
			
			StackFrame currentStackFrame = process.SelectedThread.MostRecentStackFrame;
			process.TraceMessage(" - stopped at {0} because of {1}", currentStackFrame.MethodInfo.FullName, stepper.ToString());
			
			thread.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.CorInstructionPtr)) {
				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();
		}