예제 #1
0
		void EnterCallback(PausedReason pausedReason, string name, ICorDebugProcess pProcess)
		{
			process.TraceMessage("Callback: " + name);
			System.Diagnostics.Debug.Assert(process.CorProcess == pProcess);
			// Check state
			if (process.IsRunning ||
				// After break is pressed we may receive some messages that were already queued
				process.PauseSession.PausedReason == PausedReason.ForcedBreak ||
				// ExitProcess may be called at any time when debuggee is killed
				name == "ExitProcess") {
				
				if (process.IsPaused && process.PauseSession.PausedReason == PausedReason.ForcedBreak && name != "ExitProcess") {
					process.TraceMessage("Processing post-break callback");
					// Continue the break, process is still breaked because of the callback
					process.Continue();
					pauseProcessInsteadOfContinue = true;
				} else {
					pauseProcessInsteadOfContinue = false;
				}
				
				// Remove expired threads and functions
				foreach(Thread thread in process.Threads) {
					thread.CheckExpiration();
				}
				
				process.NotifyPaused(new PauseSession(pausedReason));
			} else {
				throw new DebuggerException("Invalid state at the start of callback");
			}
		}
예제 #2
0
		void EnterCallback(PausedReason pausedReason, string name, ICorDebugProcess pProcess)
		{
			isInCallback = true;
			
			process.TraceMessage("Callback: " + name);
			System.Diagnostics.Debug.Assert(process.CorProcess == pProcess);
			
			// After break is pressed we may receive some messages that were already queued
			if (process.IsPaused && process.PauseSession.PausedReason == PausedReason.ForcedBreak) {
				// TODO: This does not work well if exception if being processed and the user continues it
				process.TraceMessage("Processing post-break callback");
				// This compensates for the break call and we are in normal callback handling mode
				process.AsyncContinue(DebuggeeStateAction.Keep, new Thread[] {}, null);
				// Start of call back - create new pause session (as usual)
				process.NotifyPaused(pausedReason);
				// Make sure we stay pause after the callback is handled
				pauseOnNextExit = true;
				return;
			}
			
			if (process.IsRunning) {
				process.NotifyPaused(pausedReason);
				return;
			}
			
			throw new DebuggerException("Invalid state at the start of callback");
		}
 // HACK: should not be public
 public virtual void OnDebuggeeStateChanged()
 {
     TraceMessage("Debugger event: OnDebuggeeStateChanged (" + PausedReason.ToString() + ")");
     if (DebuggeeStateChanged != null)
     {
         DebuggeeStateChanged(this, new ProcessEventArgs(this));
     }
 }
 protected virtual void OnDebuggingPaused()
 {
     TraceMessage("Debugger event: OnDebuggingPaused (" + PausedReason.ToString() + ")");
     if (DebuggingPaused != null)
     {
         DebuggingPaused(this, new ProcessEventArgs(this));
     }
 }
		/// <summary> Puts the process into a paused state </summary>
		internal void NotifyPaused(PausedReason pauseReason)
		{
			AssertRunning();
			pauseSession = new PauseSession(this, pauseReason);
			if (debuggeeState == null) {
				debuggeeState = new DebuggeeState(this);
			}
		}
예제 #6
0
        void EnterCallback(PausedReason pausedReason, string name, ICorDebugProcess pProcess)
        {
            process.TraceMessage("Callback: " + name);
            System.Diagnostics.Debug.Assert(process.CorProcess == pProcess);
            // Check state
            if (process.IsRunning ||
                // After break is pressed we may receive some messages that were already queued
                process.PauseSession.PausedReason == PausedReason.ForcedBreak ||
                // ExitProcess may be called at any time when debuggee is killed
                name == "ExitProcess")
            {
                if (process.IsPaused && process.PauseSession.PausedReason == PausedReason.ForcedBreak && name != "ExitProcess")
                {
                    process.TraceMessage("Processing post-break callback");
                    // Continue the break, process is still breaked because of the callback
                    process.Continue();
                    pauseProcessInsteadOfContinue = true;
                }
                else
                {
                    pauseProcessInsteadOfContinue = false;
                }

                // Remove expired threads and functions
                foreach (Thread thread in process.Threads)
                {
                    thread.CheckExpiration();
                }

                process.NotifyPaused(new PauseSession(pausedReason));
            }
            else
            {
                throw new DebuggerException("Invalid state at the start of callback");
            }
        }
예제 #7
0
		void EnterCallback(PausedReason pausedReason, string name, ICorDebugThread pThread)
		{
			EnterCallback(pausedReason, name, pThread.GetProcess());
			process.SelectedThread = process.Threads[pThread];
		}
예제 #8
0
		void EnterCallback(PausedReason pausedReason, string name, ICorDebugAppDomain pAppDomain)
		{
			EnterCallback(pausedReason, name, pAppDomain.GetProcess());
		}
예제 #9
0
 void EnterCallback(PausedReason pausedReason, string name, ICorDebugThread pThread)
 {
     EnterCallback(pausedReason, name, pThread.Process);
     process.SelectedThread = process.GetThread(pThread);
 }
예제 #10
0
		public PauseSession(PausedReason pausedReason)
		{
			this.pausedReason = pausedReason;
		}
예제 #11
0
		public PauseSession(Process process, PausedReason pausedReason)
		{
			this.process = process;
			this.pausedReason = pausedReason;
		}
예제 #12
0
		void EnterCallback(PausedReason pausedReason, string name, ICorDebugThread pThread)
		{
			EnterCallback(pausedReason, name, pThread.Process);
			process.SelectedThread = process.GetThread(pThread);
		}
예제 #13
0
 public PauseSession(PausedReason pausedReason)
 {
     this.pausedReason = pausedReason;
 }