Ejemplo n.º 1
0
        public void TestBreakpointFailed()
        {
            var debugger = new PythonDebugger();

            PythonThread     thread     = null;
            PythonBreakpoint breakPoint = null;
            var process = DebugProcess(debugger, DebuggerTestPath + "BreakpointTest.py", (newproc, newthread) => {
                breakPoint = newproc.AddBreakPoint("doesnotexist.py", 1);
                breakPoint.Add();
                thread = newthread;
            });

            bool bindFailed = false;

            process.BreakpointBindFailed += (sender, args) => {
                bindFailed = true;
                Assert.AreEqual(args.Breakpoint, breakPoint);
            };
            process.ExceptionRaised += (sender, args) => {
                args.Thread.Resume();
            };

            process.Start();

            process.WaitForExit();

            Assert.AreEqual(bindFailed, true);
        }
Ejemplo n.º 2
0
        // Called by the debugger UI when the user is enabling or disabling a breakpoint.
        int IDebugBoundBreakpoint2.Enable(int fEnable)
        {
            AssertMainThread();

            bool enabled = fEnable == 0 ? false : true;

            if (_enabled != enabled)
            {
                if (!enabled)
                {
                    _breakpoint.Disable();
                }
                else
                {
                    _breakpoint.Add();
                }
            }
            _enabled = enabled;
            return(VSConstants.S_OK);
        }