/// <summary> /// Attaches the debugger to a process /// </summary> public void Attach(ServerProcess process) { lock (_syncHandle) { process.SetDebuggedBy(this); _processes.Add(process); } }
// StartProcess public IServerProcess StartProcess(ProcessInfo processInfo) { try { ServerProcess process = new ServerProcess(this, processInfo); _processes.Add(process); // Is protected by a latch in the ServerChildObjects collection return(process); } catch (Exception E) { throw WrapException(E); } }
/// <summary> /// Yields the current program to the debugger if a breakpoint or break condition is satisfied. /// </summary> public void Yield(ServerProcess process, PlanNode node) { if (!process.IsLoading()) { try { Monitor.Enter(_syncHandle); try { if (ShouldBreak(process, node)) { _brokenProcesses.Add(process); InternalPause(); } while (_isPauseRequested && _processes.Contains(process)) { _pausedCount++; Monitor.Exit(_syncHandle); try { #if !SILVERLIGHT WaitHandle.SignalAndWait(_waitSignal, _pauseSignal); #endif } finally { Monitor.Enter(_syncHandle); _pausedCount--; } } } finally { Monitor.Exit(_syncHandle); } } catch { // Do nothing, no error should ever be thrown from here } } }