public void AttachEvents() { ThreadHelper.ThrowIfNotOnUIThread(); if (!subscribed) { subscribed = true; var res = VsDebugger.AdviseDebugEventCallback(this); } }
bool IDebuggerEventSink.QueryRuntimeFrozen() { var debugMode = new DBGMODE[1]; int res = VSConstants.S_FALSE; vsDebuggerThreadDispatcher .BeginInvoke(new Action(() => res = VsDebugger.GetMode(debugMode)), new object[0]) .Wait(); if (res != VSConstants.S_OK) { return(false); } return(debugMode[0] != DBGMODE.DBGMODE_Run); }
protected override void DisposeManaged() { Debugger.Dispose(); if (VsDebugger != null) { VsDebugger.UnadviseDebugEventCallback(this as IDebugEventCallback2); } lock (criticalSectionGlobal) { runningPrograms--; if (runningPrograms == 0) { BreakAllProcesses = originalBreakAllProcesses; } } }
bool IDebuggerEventSink.QueryRuntimeFrozen() { var debugMode = new DBGMODE[1]; int res = VSConstants.S_FALSE; QtVsToolsPackage.Instance.JoinableTaskFactory.Run(async() => { await QtVsToolsPackage.Instance.JoinableTaskFactory.SwitchToMainThreadAsync(); res = VsDebugger.GetMode(debugMode); }); if (res != VSConstants.S_OK) { return(false); } return(debugMode[0] != DBGMODE.DBGMODE_Run); }
protected override void DisposeManaged() { Debugger.Dispose(); if (VsDebugger != null) { ThreadHelper.JoinableTaskFactory.Run(async() => { await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync(); VsDebugger.UnadviseDebugEventCallback(this as IDebugEventCallback2); }); } lock (criticalSectionGlobal) { runningPrograms--; if (runningPrograms == 0) { BreakAllProcesses = originalBreakAllProcesses; } } }