Пример #1
0
 public StepCompleteEventArgs(AppDomain appDomain, Thread thread,
                              Stepper stepper, CorDebugStepReason stepReason)
     : base(appDomain, thread)
 {
     m_stepper    = stepper;
     m_stepReason = stepReason;
 }
Пример #2
0
 public StepCompleteEventArgs(DebuggedAppDomain ad, DebuggedThread thread,
                              Stepper step, CorDebugStepReason reason)
     : base(ad, thread)
 {
     m_step   = step;
     m_reason = reason;
 }
		public void StepComplete(ICorDebugAppDomain pAppDomain, ICorDebugThread pThread, ICorDebugStepper pStepper, CorDebugStepReason reason)
		{
			ManagedCallback managedCallback = GetProcessCallbackInterface(pAppDomain);
			if (managedCallback != null) {
				managedCallback.StepComplete(pAppDomain, pThread, pStepper, reason);
			}
		}
Пример #4
0
 public StepCompleteDebugCallbackEventArgs(ICorDebugAppDomain?pAppDomain, ICorDebugThread?pThread, ICorDebugStepper?pStepper, CorDebugStepReason reason)
     : base(pAppDomain)
 {
     AppDomain = pAppDomain;
     Thread    = pThread;
     Stepper   = pStepper;
     Reason    = reason;
 }
Пример #5
0
 public StepCompleteEventArgs(AppDomain appDomain, Thread thread,
                              Stepper stepper, CorDebugStepReason stepReason,
                              ManagedCallbackType callbackType)
     : base(appDomain, thread, callbackType)
 {
     m_stepper    = stepper;
     m_stepReason = stepReason;
 }
Пример #6
0
 public StepCompleteDebugCallbackEventArgs(ICorDebugAppDomain pAppDomain, ICorDebugThread pThread, ICorDebugStepper pStepper, CorDebugStepReason reason)
     : base(pAppDomain)
 {
     this.AppDomain = pAppDomain;
     this.Thread    = pThread;
     this.Stepper   = pStepper;
     this.Reason    = reason;
 }
Пример #7
0
 protected internal virtual void OnStepComplete(CorDebugStepReason reason)
 {
     this.corStepper = null;
     if (StepComplete != null)
     {
         StepComplete(this, new StepperEventArgs(this, reason));
     }
 }
 protected override unsafe int OnStepComplete(
     CorDebugAppDomain pAppDomain,
     CorDebugThread pThread,
     CorDebugStepper pStepper,
     CorDebugStepReason reason)
 {
     StepComplete?.Invoke(this, pAppDomain, pThread, pStepper, reason);
     return(Continue());
 }
Пример #9
0
 public void StepComplete(IntPtr pAppDomain, IntPtr pThread, IntPtr pStepper, CorDebugStepReason reason)
 {
     Call(delegate
     {
         _managedCallback.StepComplete(
             _connector.MarshalAs <ICorDebugAppDomain>(pAppDomain),
             _connector.MarshalAs <ICorDebugThread>(pThread),
             _connector.MarshalAs <ICorDebugStepper>(pStepper),
             reason);
     });
 }
 public void StepComplete(IntPtr pAppDomain, IntPtr pThread, IntPtr pStepper, CorDebugStepReason reason)
 {
     Call(delegate
     {
         _managedCallback.StepComplete(
             _connector.MarshalAs<ICorDebugAppDomain>(pAppDomain),
             _connector.MarshalAs<ICorDebugThread>(pThread),
             _connector.MarshalAs<ICorDebugStepper>(pStepper),
             reason);
     });
 }
		public void StepComplete(System.IntPtr pAppDomain, System.IntPtr pThread, System.IntPtr pStepper, CorDebugStepReason reason)
		{
			Call(delegate {
			     	callbackSwitch.StepComplete(
			     		MTA2STA.MarshalIntPtrTo<ICorDebugAppDomain>(pAppDomain),
			     		MTA2STA.MarshalIntPtrTo<ICorDebugThread>(pThread),
			     		MTA2STA.MarshalIntPtrTo<ICorDebugStepper>(pStepper),
			     		reason
			     	);
			     });
		}
Пример #12
0
 void ICorDebugManagedCallback.StepComplete(
     ICorDebugAppDomain appDomain,
     ICorDebugThread thread,
     ICorDebugStepper stepper,
     CorDebugStepReason stepReason)
 {
     if (DebugOutput)
     {
         Console.WriteLine("info: StepComplete");
     }
     appDomain.Continue(0);
 }
Пример #13
0
 public void StepComplete(
     ICorDebugAppDomain appDomain,
     ICorDebugThread thread,
     ICorDebugStepper step,
     CorDebugStepReason reason)
 {
     m_delegate.OnStepComplete(
         new StepCompleteEventArgs(
             new DebuggedAppDomain(appDomain),
             new DebuggedThread(thread),
             new Stepper(step),
             reason));
 }
Пример #14
0
            public void StepComplete(ICorDebugAppDomain pAppDomain, ICorDebugThread pThread, ICorDebugStepper pStepper, CorDebugStepReason reason)
            {
                try
                {
                    _EnterCallback();

                    _UpdateActiveThread(pThread);

                    bool _isspecial;
                    lock (dbgproc)
                    {
                        _isspecial = _IsSourceAtSpecialPosition_unlocked();
                    }
                    if (_isspecial)
                    {
                        dbgproc._StepDirect(false, false);
                        return; // Don't fire this callback event; fire the next one.
                    }

                    lock (dbgproc)
                    {
#if DEBUG
                        if (!dbgproc.IsStepping)
                        {
                            dbgproc.dout.WriteLine("DEBUG:  StepComplete: (!dbgproc.IsStepping)");
                        }
#endif
                        dbgproc.IsStepping = false;

                        {
                            //dbgproc.dout.WriteLine("0: -");
                            dbgproc.ShowCurrentLine_unlocked();
                        }

                    }

                    _CallbackEvent("StepComplete");
                }
                catch (Exception e)
                {
                    _CallbackException(e);
                }
            }
 public virtual void StepComplete(
     ICorDebugAppDomain appDomain, 
     ICorDebugThread thread, 
     ICorDebugStepper stepper, 
     CorDebugStepReason reason)
 {
     this.DefaultHandler(appDomain);
 }
Пример #16
0
 public StepStopState(CorDebugStepReason stepReason)
     : base(DebuggerStopReason.Step)
 {
     this.stepReason = stepReason;
 }
Пример #17
0
 public void StepComplete(System.IntPtr pAppDomain, System.IntPtr pThread, System.IntPtr pStepper, CorDebugStepReason reason)
 {
     this.WrappedObject.StepComplete(pAppDomain, pThread, pStepper, reason);
 }
Пример #18
0
 public virtual void OnStepComplete(AppDomain appDomainRef, Thread threadRef, Stepper stepperRef, CorDebugStepReason reason)
 {
     _handleEvent(ManagedCallbackType.OnStepComplete, new StepCompleteEventArgs(appDomainRef, threadRef, stepperRef, reason, ManagedCallbackType.OnStepComplete));
 }
        public void StepComplete(ICorDebugAppDomain pAppDomain, ICorDebugThread pThread, ICorDebugStepper pStepper, CorDebugStepReason reason)
        {
            ManagedCallback managedCallback = GetProcessCallbackInterface(pAppDomain);

            if (managedCallback != null)
            {
                managedCallback.StepComplete(pAppDomain, pThread, pStepper, reason);
            }
        }
Пример #20
0
 public void StepComplete(System.IntPtr pAppDomain, System.IntPtr pThread, System.IntPtr pStepper, CorDebugStepReason reason)
 {
     Call(delegate {
         callbackSwitch.StepComplete(
             MTA2STA.MarshalIntPtrTo <ICorDebugAppDomain>(pAppDomain),
             MTA2STA.MarshalIntPtrTo <ICorDebugThread>(pThread),
             MTA2STA.MarshalIntPtrTo <ICorDebugStepper>(pStepper),
             reason
             );
     });
 }
Пример #21
0
		public StepperEventArgs(Stepper stepper, CorDebugStepReason reason)
		{
			this.stepper = stepper;
			this.reason = reason;
		}
Пример #22
0
 public StepperEventArgs(Stepper stepper, CorDebugStepReason reason)
     : base(stepper.Process)
 {
     this.stepper = stepper;
     this.reason = reason;
 }
Пример #23
0
        public void StepComplete(ICorDebugAppDomain pAppDomain, ICorDebugThread pThread, ICorDebugStepper pStepper, CorDebugStepReason reason)
        {
            Log("Step completed. ({0})", reason);

            var domain  = GetProcessWrapper(pAppDomain).GetAppDomain(pAppDomain);
            var thread  = domain.GetThread(pThread);
            var stepper = domain.GetStepper(pStepper);

            var eventArgs = new StepperEventArgs(domain, thread, stepper);

            if (thread.CurrentFrame.IsUserCode)
            {
                domain.DispatchStepCompletedEvent(eventArgs);
            }
            else
            {
                Log("Non-user code detected. Stepping out.");
                thread.CurrentFrame.CreateStepper().StepOut();
                eventArgs.Continue = true;
            }

            FinalizeEvent(eventArgs);
        }
Пример #24
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();
			}
		}
Пример #25
0
 public virtual void StepComplete(ICorDebugAppDomain pAppDomain, ICorDebugThread pThread, ICorDebugStepper pStepper, CorDebugStepReason reason)
 {
     pAppDomain.Continue(0);
 }
Пример #26
0
 public StepperEventArgs(Stepper stepper, CorDebugStepReason reason)
 {
     this.stepper = stepper;
     this.reason  = reason;
 }
Пример #27
0
 public void StepComplete(ICorDebugAppDomain pAppDomain, ICorDebugThread pThread, ICorDebugStepper pStepper, CorDebugStepReason reason)
 {
     throw new NotImplementedException();
 }
Пример #28
0
 protected abstract int OnStepComplete(
     CorDebugAppDomain pAppDomain,
     CorDebugThread pThread,
     CorDebugStepper pStepper,
     CorDebugStepReason reason);
Пример #29
0
            void ICorDebugManagedCallback.StepComplete(ICorDebugAppDomain pAppDomain, ICorDebugThread pThread, ICorDebugStepper pStepper, CorDebugStepReason reason)
            {
                var ev = new CorEventArgs(new CorAppDomain(pAppDomain, p_options));

                GetOwner(ev.Controller).DispatchEvent(ev);

                FinishEvent(ev);
            }
Пример #30
0
		protected internal virtual void OnStepComplete(CorDebugStepReason reason) {
			this.corStepper = null;
			if (StepComplete != null) {
				StepComplete(this, new StepperEventArgs(this, reason));
			}
		}
		int ICorDebugManagedCallback.StepComplete (CorDebugAppDomain pAppDomain, CorDebugThread pThread, CorDebugStepper pStepper, CorDebugStepReason reason)
		{
			TargetEventArgs args = new TargetEventArgs (TargetEventType.TargetStopped);
			args.Process = GetProcess (pAppDomain.Process);
			args.Thread = pAppDomain.Process.GetThread (pThread);
			args.Backtrace = new Backtrace (new CorDebugBacktrace (pThread, this));
			OnTargetEvent (args);
			SetActiveThread (pThread);
			return 0;
		}
Пример #32
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();
            }
        }
Пример #33
0
		public StepPauseState(CorDebugStepReason stepReason)
			: base(DebuggerPauseReason.Step) {
			this.stepReason = stepReason;
		}
Пример #34
0
			public ManagedCallbackStepComplete (CorDebugThread thread, CorDebugStepper stepper, CorDebugStepReason reason) : base (thread)
			{
				m_stepper = stepper;
				m_reason = reason;
			}
Пример #35
0
		public StepCompleteDebugCallbackEventArgs(ICorDebugAppDomain pAppDomain, ICorDebugThread pThread, ICorDebugStepper pStepper, CorDebugStepReason reason)
			: base(pAppDomain) {
			this.AppDomain = pAppDomain;
			this.Thread = pThread;
			this.Stepper = pStepper;
			this.Reason = reason;
		}
Пример #36
0
 public StepperEventArgs(Stepper stepper, CorDebugStepReason reason) : base(stepper.Process)
 {
     this.stepper = stepper;
     this.reason  = reason;
 }
Пример #37
0
 public void StepComplete(ICorDebugAppDomain pAppDomain, ICorDebugThread pThread, ICorDebugStepper pStepper, CorDebugStepReason reason)
 {
     pAppDomain.Continue(0);
 }
Пример #38
0
 void ICorDebugManagedCallback.StepComplete(IntPtr pAppDomain, IntPtr pThread, IntPtr pStepper, CorDebugStepReason reason)
 {
     dbg.OnManagedCallbackFromAnyThread(() => new StepCompleteDebugCallbackEventArgs(I <ICorDebugAppDomain>(pAppDomain), I <ICorDebugThread>(pThread), I <ICorDebugStepper>(pStepper), reason));
 }
        public void StepComplete(ICorDebugAppDomain pAppDomain, ICorDebugThread pThread, ICorDebugStepper pStepper, CorDebugStepReason reason)
        {
            Log("Step completed. ({0})", reason);

            var domain = GetProcessWrapper(pAppDomain).GetAppDomain(pAppDomain);
            var thread = domain.GetThread(pThread);
            var stepper = domain.GetStepper(pStepper);
            
            var eventArgs = new StepperEventArgs(domain, thread, stepper);

            if (thread.CurrentFrame.IsUserCode)
            {
                domain.DispatchStepCompletedEvent(eventArgs);
            }
            else
            {
                Log("Non-user code detected. Stepping out.");
                thread.CurrentFrame.CreateStepper().StepOut();
                eventArgs.Continue = true;
            }

            FinalizeEvent(eventArgs);
        }
Пример #40
0
 public CorStepCompleteEventArgs(CorAppDomain appDomain, CorThread thread,
                                  CorStepper stepper, CorDebugStepReason stepReason)
     : base(appDomain, thread)
 {
     m_stepper = stepper;
     m_stepReason = stepReason;
 }
Пример #41
0
		public void StepComplete(ICorDebugAppDomain appDomain,
								ICorDebugThread thd,
								ICorDebugStepper stepper,
								CorDebugStepReason reason)
		{
		}
 public static void StepComplete(this ICorDebugManagedCallback instance, IntPtr pAppDomain, IntPtr pThread, IntPtr pStepper, CorDebugStepReason reason)
 {
     instance.StepComplete(pAppDomain, pThread, pStepper, reason);
 }
Пример #43
0
 public StepCompleteStopReason(CorStepper stepper, CorDebugStepReason stepReason)
 {
     Debug.Assert(stepper != null);
     m_stepReason = stepReason;
     m_stepper = stepper;
 }
Пример #44
0
 public StepStopState(CorDebugStepReason stepReason)
     : base(DebuggerStopReason.Step)
 {
     this.stepReason = stepReason;
 }
 public ManagedCallbackStepComplete(CorDebugThread thread, CorDebugStepper stepper, CorDebugStepReason reason) : base(thread)
 {
     m_stepper = stepper;
     m_reason  = reason;
 }
Пример #46
0
        int ICorDebugManagedCallback.StepComplete(CorDebugAppDomain pAppDomain, CorDebugThread pThread, CorDebugStepper pStepper, CorDebugStepReason reason)
        {
            TargetEventArgs args = new TargetEventArgs(TargetEventType.TargetStopped);

            args.Process   = GetProcess(pAppDomain.Process);
            args.Thread    = pAppDomain.Process.GetThread(pThread);
            args.Backtrace = new Backtrace(new CorDebugBacktrace(pThread, this));
            OnTargetEvent(args);
            SetActiveThread(pThread);
            return(0);
        }
Пример #47
0
        public override bool ShouldBreak(BreakpointDef breakpointDef)
        {
            bool fStop = true;
            CorDebugStepReason reason;

            //optimize, optimize, optimize No reason to get list of threads, and get thread stack for each step!!!
            ushort flags    = breakpointDef.m_flags;
            int    depthOld = (int)m_frame.DepthnanoCLR;
            int    depthNew = (int)breakpointDef.m_depth;
            int    dDepth   = depthNew - depthOld;

            if ((flags & BreakpointDef.c_STEP) != 0)
            {
                if ((flags & BreakpointDef.c_STEP_IN) != 0)
                {
                    if (this.Process.Engine.Capabilities.ExceptionFilters && breakpointDef.m_depthExceptionHandler == BreakpointDef.c_DEPTH_STEP_INTERCEPT)
                    {
                        reason = CorDebugStepReason.STEP_INTERCEPT;
                    }
                    else
                    {
                        reason = CorDebugStepReason.STEP_CALL;
                    }
                }
                else if ((flags & BreakpointDef.c_STEP_OVER) != 0)
                {
                    reason = CorDebugStepReason.STEP_NORMAL;
                }
                else
                {
                    if (this.Process.Engine.Capabilities.ExceptionFilters & breakpointDef.m_depthExceptionHandler == BreakpointDef.c_DEPTH_STEP_EXCEPTION_HANDLER)
                    {
                        reason = CorDebugStepReason.STEP_EXCEPTION_HANDLER;
                    }
                    else
                    {
                        reason = CorDebugStepReason.STEP_RETURN;
                    }
                }
            }
            else if ((flags & BreakpointDef.c_EXCEPTION_CAUGHT) != 0)
            {
                reason = CorDebugStepReason.STEP_EXCEPTION_HANDLER;
                if (dDepth > 0)
                {
                    fStop = false;
                }
                else if (dDepth == 0)
                {
                    fStop = (this.Debugging_Execution_BreakpointDef.m_flags & BreakpointDef.c_STEP_OVER) != 0;
                }
                else
                {
                    fStop = true;
                }
            }
            else if ((flags & BreakpointDef.c_THREAD_TERMINATED) != 0)
            {
                reason = CorDebugStepReason.STEP_EXIT;

                this.Active = false;
                fStop       = false;
            }
            else
            {
                Debug.Assert(false);
                throw new ApplicationException("Invalid stepper hit received");
            }

            if (m_ranges != null && reason == CorDebugStepReason.STEP_NORMAL && breakpointDef.m_depth == this.Debugging_Execution_BreakpointDef.m_depth)
            {
                foreach (COR_DEBUG_STEP_RANGE range in m_ranges)
                {
                    if (Utility.InRange(breakpointDef.m_IP, range.startOffset, range.endOffset - 1))
                    {
                        fStop = false;
                        break;
                    }
                }

                Debug.Assert(Utility.FImplies(m_ranges != null && m_ranges.Length == 1, fStop));
            }

            if (fStop && reason != CorDebugStepReason.STEP_EXIT)
            {
                uint          depth = breakpointDef.m_depth;
                CorDebugFrame frame = this.m_thread.Chain.GetFrameFromDepthnanoCLR(depth);

                m_ranges = null;
                Initialize(frame);

                //Will callback with wrong reason if stepping through internal calls?????
                //If we don't stop at an internal call, we need to reset/remember the range somehow?
                //This might be broken if a StepRange is called that causes us to enter an internal function
                fStop = !m_frame.Function.IsInternal;
            }

            m_reasonStopped = reason;
            return(fStop);
        }
Пример #48
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();
        }
Пример #49
0
		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();
		}
Пример #50
0
 public StepCompleteStopReason(CorStepper stepper, CorDebugStepReason stepReason)
 {
     Debug.Assert(stepper != null);
     m_stepReason = stepReason;
     m_stepper    = stepper;
 }
Пример #51
0
 void ICorDebugManagedCallback.StepComplete(ICorDebugAppDomain appDomain,
                            ICorDebugThread thread,
                            ICorDebugStepper stepper,
                            CorDebugStepReason stepReason)
 {
     HandleEvent(ManagedCallbackType.OnStepComplete,
                        new CorStepCompleteEventArgs(appDomain == null ? null : new CorAppDomain(appDomain),
                                                     thread == null ? null : new CorThread(thread),
                                                     stepper == null ? null : new CorStepper(stepper),
                                                     stepReason,
                                                     ManagedCallbackType.OnStepComplete));
 }
Пример #52
0
 public StepPauseState(CorDebugStepReason stepReason)
     : base(DebuggerPauseReason.Step)
 {
     this.stepReason = stepReason;
 }
Пример #53
0
 public CorStepCompleteEventArgs(CorAppDomain appDomain, CorThread thread,
                                  CorStepper stepper, CorDebugStepReason stepReason,
                                  ManagedCallbackType callbackType)
     : base(appDomain, thread, callbackType)
 {
     m_stepper = stepper;
     m_stepReason = stepReason;
 }
Пример #54
0
		public override bool ShouldBreak (BreakpointDef breakpointDef)
		{
			bool fStop = true;
			CorDebugStepReason reason;

			//optimize, optimize, optimize No reason to get list of threads, and get thread stack for each step!!!            
			ushort flags = breakpointDef.m_flags;
			int depthOld = (int)m_frame.DepthTinyCLR;
			int depthNew = (int)breakpointDef.m_depth;
			int dDepth = depthNew - depthOld;

			if ((flags & BreakpointDef.c_STEP) != 0) {
				if ((flags & BreakpointDef.c_STEP_IN) != 0) {
					if (this.Process.Engine.Capabilities.ExceptionFilters && breakpointDef.m_depthExceptionHandler == BreakpointDef.c_DEPTH_STEP_INTERCEPT) {
						reason = CorDebugStepReason.STEP_INTERCEPT;
					} else {
						reason = CorDebugStepReason.STEP_CALL;
					}
				} else if ((flags & BreakpointDef.c_STEP_OVER) != 0) {
					reason = CorDebugStepReason.STEP_NORMAL;
				} else {
					if (this.Process.Engine.Capabilities.ExceptionFilters & breakpointDef.m_depthExceptionHandler == BreakpointDef.c_DEPTH_STEP_EXCEPTION_HANDLER) {
						reason = CorDebugStepReason.STEP_EXCEPTION_HANDLER;
					} else {
						reason = CorDebugStepReason.STEP_RETURN;
					}
				}
			} else if ((flags & BreakpointDef.c_EXCEPTION_CAUGHT) != 0) {
				reason = CorDebugStepReason.STEP_EXCEPTION_HANDLER;
				if (dDepth > 0)
					fStop = false;
				else if (dDepth == 0)
					fStop = (this.Debugging_Execution_BreakpointDef.m_flags & BreakpointDef.c_STEP_OVER) != 0;
				else
					fStop = true;
			} else if ((flags & BreakpointDef.c_THREAD_TERMINATED) != 0) {
				reason = CorDebugStepReason.STEP_EXIT;

				this.Active = false;
				fStop = false;
			} else {
				Debug.Assert (false);
				throw new ApplicationException ("Invalid stepper hit received");
			}

			if (m_ranges != null && reason == CorDebugStepReason.STEP_NORMAL && breakpointDef.m_depth == this.Debugging_Execution_BreakpointDef.m_depth) {
				foreach (COR_DEBUG_STEP_RANGE range in m_ranges) {
					if (Utility.InRange (breakpointDef.m_IP, range.startOffset, range.endOffset - 1)) {
						fStop = false;
						break;
					}
				}

				Debug.Assert (Utility.FImplies (m_ranges != null && m_ranges.Length == 1, fStop));
			}

			if (fStop && reason != CorDebugStepReason.STEP_EXIT) {
				uint depth = breakpointDef.m_depth;
				CorDebugFrame frame = this.m_thread.Chain.GetFrameFromDepthTinyCLR (depth);

				m_ranges = null;
				Initialize (frame);

				//Will callback with wrong reason if stepping through internal calls?????                
				//If we don't stop at an internal call, we need to reset/remember the range somehow?
				//This might be broken if a StepRange is called that causes us to enter an internal function                
				fStop = !m_frame.Function.IsInternal;
			}

			m_reasonStopped = reason;
			return fStop;
		}