Esempio n. 1
0
        public void AttachEvents()
        {
            ThreadHelper.ThrowIfNotOnUIThread();
            if (!subscribed)
            {
                subscribed = true;

                var res = VsDebugger.AdviseDebugEventCallback(this);
            }
        }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
        protected override void DisposeManaged()
        {
            Debugger.Dispose();
            if (VsDebugger != null)
            {
                VsDebugger.UnadviseDebugEventCallback(this as IDebugEventCallback2);
            }

            lock (criticalSectionGlobal) {
                runningPrograms--;
                if (runningPrograms == 0)
                {
                    BreakAllProcesses = originalBreakAllProcesses;
                }
            }
        }
Esempio n. 4
0
        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);
        }
Esempio n. 5
0
        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;
                }
            }
        }