예제 #1
0
        internal void BreakpointHit(AD7PendingBreakpoint breakpoint, AD7Thread thread)
        {
            var iid = new Guid(AD7BreakpointEvent.IID);

            _eventCallback.Event(_engine, _engine.RemoteProcess, _engine, thread, new AD7BreakpointEvent(breakpoint), ref iid,
                                 AD7StoppingEvent.Attributes);
        }
예제 #2
0
        internal void ThreadStarted(AD7Thread thread)
        {
            var iid = new Guid(Microsoft.MIDebugEngine.AD7ThreadCreateEvent.IID);

            _eventCallback.Event(_engine, _engine.RemoteProcess, _engine, thread, new Microsoft.MIDebugEngine.AD7ThreadCreateEvent(), ref iid,
                                 AD7StoppingEvent.Attributes);
        }
 internal VariableInformation(string expr, ThreadContext ctx, AD7Engine engine, AD7Thread thread, bool isParameter = false)
 {
     Name        = expr;
     _ctx        = ctx;
     _engine     = engine;
     Client      = thread;
     IsParameter = isParameter;
 }
예제 #4
0
        public int Continue(IDebugThread2 pThread)
        {
            // VS Code currently isn't providing a thread Id in certain cases. Work around this by handling null values.
            AD7Thread thread = pThread as AD7Thread;

            _dispatcher.Queue(() => DebuggedProcess.Continue(thread?.GetDebuggedThread()));
            return(VSConstants.S_OK);
        }
예제 #5
0
        public AD7StackFrame(AD7Engine engine, AD7Thread thread, PythonStackFrame threadContext)
        {
            _engine     = engine;
            _thread     = thread;
            _stackFrame = threadContext;

            _parameters = threadContext.Parameters.ToArray();
            _locals     = threadContext.Locals.ToArray();
        }
예제 #6
0
        public void OnLoadComplete(AD7Thread aThread)
        {
            var xMsg = new AD7LoadCompleteEvent();

            Send(xMsg, AD7LoadCompleteEvent.IID, aThread);
            //AD7Thread ad7Thread = (AD7Thread)thread.Client;
            //AD7LoadCompleteEvent eventObject = new AD7LoadCompleteEvent();
            //Send(eventObject, AD7LoadCompleteEvent.IID, ad7Thread);
        }
        public DebuggedThread(int id, AD7Engine engine)
        {
            Id       = id;
            Name     = "";
            TargetId = (uint)id;
            AD7Thread ad7Thread = new AD7Thread(engine, this);

            Client = ad7Thread;
        }
예제 #8
0
        public DebuggedThread(ThreadMirror thread, AD7Engine engine)
        {
            Thread   = thread;
            Id       = thread.TID;
            Name     = "";
            TargetId = thread.TID;
            AD7Thread ad7Thread = new AD7Thread(engine, this);

            Client = ad7Thread;
        }
예제 #9
0
        public void OnThreadExit(DebuggedThread debuggedThread, uint exitCode)
        {
            Debug.Assert(_engine.DebuggedProcess.WorkerThread.IsPollThread());

            AD7Thread ad7Thread = (AD7Thread)debuggedThread.Client;

            Debug.Assert(ad7Thread != null);

            AD7ThreadDestroyEvent eventObject = new AD7ThreadDestroyEvent(exitCode);

            Send(eventObject, AD7ThreadDestroyEvent.IID, ad7Thread);
        }
예제 #10
0
        public void OnAsyncBreakComplete(AD7Thread aThread)
        {
            // This will get called when the engine receives the breakpoint event that is created when the user
            // hits the pause button in vs.
            //System.Diagnostics.Debug.Assert(Worker.CurrentThreadId == m_engine.DebuggedProcess.PollThreadId);

            var xEvent = new AD7AsyncBreakCompleteEvent();

            Send(xEvent, AD7AsyncBreakCompleteEvent.IID, aThread);
            //AD7Thread ad7Thread = (AD7Thread)thread.Client;
            //AD7AsyncBreakCompleteEvent eventObject = new AD7AsyncBreakCompleteEvent();
            //Send(eventObject, AD7AsyncBreakCompleteEvent.IID, ad7Thread);
        }
예제 #11
0
        public void OnThreadStart(AD7Thread debuggedThread)
        {
            // This will get called when the entrypoint breakpoint is fired because the engine sends a thread start event
            // for the main thread of the application.
            //if (m_engine.DebuggedProcess != null)
            //{
            //    System.Diagnostics.Debug.Assert(Worker.CurrentThreadId == m_engine.DebuggedProcess.PollThreadId);
            //}

            var eventObject = new AD7ThreadCreateEvent();

            Send(eventObject, AD7ThreadCreateEvent.IID, debuggedThread);
        }
        public async Task <List <VariableInformation> > GetLocalsAndParameters(AD7Thread thread, ThreadContext ctx)
        {
            var vars = await CommandFactory.GetVariables();

            var res = new List <VariableInformation>();

            foreach (var variable in vars)
            {
                res.Add(await variable.CreateMIDebuggerVariable(ctx, Engine, thread));
            }

            return(res);
        }
예제 #13
0
        public AD7StackFrame(AD7Engine engine, AD7Thread thread, Mono.Debugger.Soft.StackFrame threadContext)
        {
            Debug.Assert(threadContext != null, "ThreadContext is null");

            Engine        = engine;
            Thread        = thread;
            ThreadContext = threadContext;

            _textPosition = RoslynHelper.GetStatementRange(ThreadContext.FileName, ThreadContext.LineNumber, ThreadContext.ColumnNumber);
            _functionName = threadContext.Method.Name;

            if (_textPosition != null)
            {
                docContext = new AD7DocumentContext(_textPosition);
            }

            this.LocalVariables = threadContext.GetVisibleVariables().Select(x => new MonoProperty(threadContext, x)).ToList();
        }
예제 #14
0
        public void OnBreakpoint(AD7Thread thread, IList <IDebugBoundBreakpoint2> clients)
        {
            var boundBreakpoints = new IDebugBoundBreakpoint2[clients.Count];
            int i = 0;

            foreach (var objCurrentBreakpoint in clients)
            {
                boundBreakpoints[i] = objCurrentBreakpoint;
                i++;
            }

            // An engine that supports more advanced breakpoint features such as hit counts, conditions and filters
            // should notify each bound breakpoint that it has been hit and evaluate conditions here.
            // The sample engine does not support these features.
            var boundBreakpointsEnum = new AD7BoundBreakpointsEnum(boundBreakpoints);
            var eventObject          = new AD7BreakpointEvent(boundBreakpointsEnum);

            Send(eventObject, AD7BreakpointEvent.IID, thread);
        }
예제 #15
0
        public void OnBreakpoint(DebuggedThread thread, ReadOnlyCollection <object> clients)
        {
            IDebugBoundBreakpoint2[] boundBreakpoints = new IDebugBoundBreakpoint2[clients.Count];

            int i = 0;

            foreach (object objCurrentBreakpoint in clients)
            {
                boundBreakpoints[i] = (IDebugBoundBreakpoint2)objCurrentBreakpoint;
                i++;
            }

            // An engine that supports more advanced breakpoint features such as hit counts, conditions and filters
            // should notify each bound breakpoint that it has been hit and evaluate conditions here.
            // The sample engine does not support these features.

            AD7BoundBreakpointsEnum boundBreakpointsEnum = new AD7BoundBreakpointsEnum(boundBreakpoints);

            AD7BreakpointEvent eventObject = new AD7BreakpointEvent(boundBreakpointsEnum);

            AD7Thread ad7Thread = (AD7Thread)thread.Client;

            Send(eventObject, AD7BreakpointEvent.IID, ad7Thread);
        }
 public async Task <List <SimpleVariableInformation> > GetParameterInfoOnly(AD7Thread thread, ThreadContext ctx)
 {
     throw new NotImplementedException();
 }
예제 #17
0
        public void OnBreak(AD7Thread aThread)
        {
            var mBreak = new AD7BreakEvent();

            Send(mBreak, AD7BreakEvent.IID, aThread);
        }
        internal async Task <VariableInformation> CreateMIDebuggerVariable(ThreadContext ctx, AD7Engine engine, AD7Thread thread)
        {
            VariableInformation vi = new VariableInformation(Name, ctx, engine, thread, IsParameter);
            await vi.Eval();

            return(vi);
        }