예제 #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(AD7ThreadCreateEvent.IID);

            _eventCallback.Event(_engine, _engine.RemoteProcess, _engine, thread, new AD7ThreadCreateEvent(), ref iid,
                                 AD7StoppingEvent.Attributes);
        }
예제 #3
0
        internal void StartDebugging()
        {
            if (_vm != null)
            {
                return;
            }

            _vm = VirtualMachineManager.Connect(new IPEndPoint(_ipAddress, 11000));
            _vm.EnableEvents(EventType.AssemblyLoad,
                             EventType.ThreadStart,
                             EventType.ThreadDeath,
                             EventType.AssemblyUnload,
                             EventType.UserBreak,
                             EventType.Exception,
                             EventType.UserLog,
                             EventType.KeepAlive,
                             EventType.TypeLoad);

            EventSet set = _vm.GetNextEventSet();

            if (set.Events.OfType <VMStartEvent>().Any())
            {
                //TODO: review by techcap
                _mainThread = new AD7Thread(_engine, new DebuggedThread(set.Events[0].Thread, _engine));
                _engine.Callback.ThreadStarted(_mainThread);

                Task.Factory.StartNew(ReceiveThread, TaskCreationOptions.LongRunning);
            }
            else
            {
                throw new Exception("Didnt get VMStart-Event!");
            }
        }
예제 #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 DebuggedThread(ThreadMirror thread, AD7Engine engine)
 {
     Thread = thread;
     Id = thread.TID;
     Name = "";
     TargetId = thread.TID;
     AD7Thread ad7Thread = new AD7Thread(engine, this);
     Client = ad7Thread;
 }
예제 #6
0
        internal void Step(AD7Thread thread, enum_STEPKIND sk, enum_STEPUNIT stepUnit)
        {
            if (!isStepping)
            {
                if (currentStepRequest == null)
                {
                    currentStepRequest = _vm.CreateStepRequest(thread.ThreadMirror);
                }
                else
                {
                    currentStepRequest.Disable();
                }

                isStepping = true;
                if (stepUnit == enum_STEPUNIT.STEP_LINE || stepUnit == enum_STEPUNIT.STEP_STATEMENT)
                {
                    switch (sk)
                    {
                    case enum_STEPKIND.STEP_INTO:
                        currentStepRequest.Depth = StepDepth.Into;
                        break;

                    case enum_STEPKIND.STEP_OUT:
                        currentStepRequest.Depth = StepDepth.Out;
                        break;

                    case enum_STEPKIND.STEP_OVER:
                        currentStepRequest.Depth = StepDepth.Over;
                        break;

                    default:
                        return;
                    }
                }
                else if (stepUnit == enum_STEPUNIT.STEP_INSTRUCTION)
                {
                    //TODO: by techcap
                }
                else
                {
                    throw new NotImplementedException();
                }

                currentStepRequest.Size = StepSize.Line;
                currentStepRequest.Enable();
            }

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

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

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

            //if(threadContext.IsNativeTransition)
            //{

            //}

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

            this.LocalVariables = threadContext.GetVisibleVariables().Select(x => new MonoProperty(threadContext, x)).ToList();
        }
예제 #8
0
        public AD7StackFrame(AD7Engine engine, AD7Thread thread, Mono.Debugger.Soft.StackFrame threadContext)
        {
            Debug.Assert(threadContext != null, "ThreadContext is null");

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

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

            //if(threadContext.IsNativeTransition)
            //{

            //}

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

            this.LocalVariables = threadContext.GetVisibleVariables().Select(x => new MonoProperty(threadContext, x)).ToList();
        }
예제 #9
0
        internal void StartDebugging()
        {
            if (_vm != null)
                return;

            _vm = VirtualMachineManager.Connect(new IPEndPoint(_ipAddress, 11000));
            _vm.EnableEvents(EventType.AssemblyLoad,
                EventType.ThreadStart,
                EventType.ThreadDeath,
                EventType.AssemblyUnload,
                EventType.UserBreak,
                EventType.Exception,
                EventType.UserLog,
                EventType.KeepAlive,
                EventType.TypeLoad);

            EventSet set = _vm.GetNextEventSet();
            if (set.Events.OfType<VMStartEvent>().Any())
            {
                //TODO: review by techcap
                _mainThread = new AD7Thread(_engine, new DebuggedThread(set.Events[0].Thread, _engine));
                _engine.Callback.ThreadStarted(_mainThread);

                Task.Factory.StartNew(ReceiveThread, TaskCreationOptions.LongRunning);
            }
            else
                throw new Exception("Didnt get VMStart-Event!");
        }
예제 #10
0
        internal void Step(AD7Thread thread, enum_STEPKIND sk, enum_STEPUNIT stepUnit)
        {
            if (!isStepping)
            {
                if (currentStepRequest == null)
                    currentStepRequest = _vm.CreateStepRequest(thread.ThreadMirror);
                else
                {
                    currentStepRequest.Disable();
                }

                isStepping = true;
                if (stepUnit == enum_STEPUNIT.STEP_LINE || stepUnit == enum_STEPUNIT.STEP_STATEMENT)
                {
                    switch (sk)
                    {
                        case enum_STEPKIND.STEP_INTO:
                            currentStepRequest.Depth = StepDepth.Into;
                            break;
                        case enum_STEPKIND.STEP_OUT:
                            currentStepRequest.Depth = StepDepth.Out;
                            break;
                        case enum_STEPKIND.STEP_OVER:
                            currentStepRequest.Depth = StepDepth.Over;
                            break;
                        default:
                            return;
                    }
                }
                else if (stepUnit == enum_STEPUNIT.STEP_INSTRUCTION)
                {
                    //TODO: by techcap
                }
                else
                    throw new NotImplementedException();

                currentStepRequest.Size = StepSize.Line;
                currentStepRequest.Enable();
            }

            _vm.Resume();
        }
예제 #11
0
        //internal void Resume()
        //{
        //    _vm.Resume();
        //}

        /// <summary>
        /// For Run
        /// </summary>
        /// <param name="debuggedMonoThread"></param>
        internal void Execute(AD7Thread debuggedMonoThread)
        {
            _vm.Resume();
        }
예제 #12
0
        //internal void Resume()
        //{
        //    _vm.Resume();
        //}

        /// <summary>
        /// For Run
        /// </summary>
        /// <param name="debuggedMonoThread"></param>
        internal void Execute(AD7Thread debuggedMonoThread)
        {
            _vm.Resume();
        }
예제 #13
0
 internal void StepCompleted(AD7Thread thread)
 {
     var iid = new Guid(AD7StepCompleteEvent.IID);
     _eventCallback.Event(_engine, _engine.RemoteProcess, _engine, thread, new AD7StepCompleteEvent(), ref iid,
         AD7StoppingEvent.Attributes);
 }
예제 #14
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);
 }