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"); } }
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); } }
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"); } }
void EnterCallback(PausedReason pausedReason, string name, ICorDebugThread pThread) { EnterCallback(pausedReason, name, pThread.GetProcess()); process.SelectedThread = process.Threads[pThread]; }
void EnterCallback(PausedReason pausedReason, string name, ICorDebugAppDomain pAppDomain) { EnterCallback(pausedReason, name, pAppDomain.GetProcess()); }
void EnterCallback(PausedReason pausedReason, string name, ICorDebugThread pThread) { EnterCallback(pausedReason, name, pThread.Process); process.SelectedThread = process.GetThread(pThread); }
public PauseSession(PausedReason pausedReason) { this.pausedReason = pausedReason; }
public PauseSession(Process process, PausedReason pausedReason) { this.process = process; this.pausedReason = pausedReason; }