Example #1
0
        public int Step(IDebugThread2 pThread, enum_STEPKIND kind, enum_STEPUNIT unit)
        {
            AD7Thread thread = (AD7Thread)pThread;

            try
            {
                if (null == thread || null == thread.GetDebuggedThread())
                {
                    return(Constants.E_FAIL);
                }

                _debuggedProcess.WorkerThread.RunOperation(() => _debuggedProcess.Step(thread.GetDebuggedThread().Id, kind, unit));
            }
            catch (InvalidCoreDumpOperationException)
            {
                return(AD7_HRESULT.E_CRASHDUMP_UNSUPPORTED);
            }

            return(Constants.S_OK);
        }
Example #2
0
 public int /*IDebugProgram3*/ Step(
     IDebugThread2 pThread,
     enum_STEPKIND sk,
     enum_STEPUNIT Step)
 {
     if (sk == enum_STEPKIND.STEP_OVER)
     {
         Debugger.StepOver();
     }
     else if (sk == enum_STEPKIND.STEP_INTO)
     {
         Debugger.StepInto();
     }
     else if (sk == enum_STEPKIND.STEP_OUT)
     {
         Debugger.StepOut();
     }
     else
     {
         return(VSConstants.E_FAIL);
     }
     return(VSConstants.S_OK);
 }
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

        public int Step(IDebugThread2 pThread, enum_STEPKIND sk, enum_STEPUNIT Step)
        {
            //
            // Performs a step.
            //

            LoggingUtils.PrintFunction();

            try
            {
                LoggingUtils.RequireOk(AttachedEngine.NativeDebugger.NativeProgram.Step(pThread, sk, Step));

                //LoggingUtils.RequireOk (AttachedEngine.JavaDebugger.JavaProgram.Step (pThread, sk, Step));

                return(Constants.S_OK);
            }
            catch (Exception e)
            {
                LoggingUtils.HandleException(e);

                return(Constants.E_FAIL);
            }
        }
Example #4
0
        public int Step(IDebugThread2 pThread, enum_STEPKIND sk, enum_STEPUNIT Step)
        {
            uint threadHash;

            pThread.GetThreadId(out threadHash);
            StepTypes type = StepTypes.None;

            switch (sk)
            {
            case enum_STEPKIND.STEP_INTO:
                type = StepTypes.Into;
                break;

            case enum_STEPKIND.STEP_OVER:
                type = StepTypes.Over;
                break;

            case enum_STEPKIND.STEP_OUT:
                type = StepTypes.Out;
                break;
            }
            debugged.SendStep((int)threadHash, type);
            return(Constants.S_OK);
        }
Example #5
0
        public async Task Step(int threadId, enum_STEPKIND kind, enum_STEPUNIT unit)
        {
            await ExceptionManager.EnsureSettingsUpdated();

            if ((unit == enum_STEPUNIT.STEP_LINE) || (unit == enum_STEPUNIT.STEP_STATEMENT))
            {
                switch (kind)
                {
                case enum_STEPKIND.STEP_INTO:
                    await MICommandFactory.ExecStep(threadId);

                    break;

                case enum_STEPKIND.STEP_OVER:
                    await MICommandFactory.ExecNext(threadId);

                    break;

                case enum_STEPKIND.STEP_OUT:
                    await MICommandFactory.ExecFinish(threadId);

                    break;

                default:
                    throw new NotImplementedException();
                }
            }
            else if (unit == enum_STEPUNIT.STEP_INSTRUCTION)
            {
                await MICommandFactory.ExecStepInstruction(threadId);
            }
            else
            {
                throw new NotImplementedException();
            }
        }
Example #6
0
 public int Step(IDebugThread2 pThread, enum_STEPKIND sk, enum_STEPUNIT Step)
 {
     return(VSConstants.E_NOTIMPL);
 }
Example #7
0
        public int Step(IDebugThread2 pThread, enum_STEPKIND sk, enum_STEPUNIT Step)
        {
            Debug.WriteLine("AD7Process: Step");

            return(VSConstants.S_OK);
        }
        public bool Step(enum_STEPKIND kind, enum_STEPUNIT unit)
        {
            if (kind == enum_STEPKIND.STEP_BACKWARDS)
            {
                return(false);
            }

            EventHandler <TargetEventArgs> stepFinished = null;

            stepFinished = (sender, args) =>
            {
                Session.TargetStopped -= stepFinished;

                // Skip anything for which source is unavailable
                if (!CurrentFrameContainsKnownCode(args.Thread))
                {
                    if (ThreadContainsKnownCode(args.Thread))
                    {
                        Step(kind, unit);
                        return;
                    }

                    Continue();
                    return;
                }

                _engine.Callback.Send(new MonoStepCompleteEvent(), MonoStepCompleteEvent.Iid,
                                      _threadManager[args.Thread]);
            };
            Session.TargetStopped += stepFinished;

            switch (kind)
            {
            case enum_STEPKIND.STEP_OVER:
                switch (unit)
                {
                case enum_STEPUNIT.STEP_INSTRUCTION:
                    Session.NextInstruction();
                    break;

                default:
                    Session.NextLine();
                    break;
                }
                break;

            case enum_STEPKIND.STEP_INTO:
                switch (unit)
                {
                case enum_STEPUNIT.STEP_INSTRUCTION:
                    Session.StepInstruction();
                    break;

                default:
                    Session.StepLine();
                    break;
                }
                break;

            case enum_STEPKIND.STEP_OUT:
                Session.Finish();
                break;
            }
            return(true);
        }
 /// <summary>
 /// Performs a step. This method is deprecated. Use the IDebugProcess3::Step method instead. 
 /// (http://msdn.microsoft.com/en-us/library/bb162134.aspx)
 /// Not implemented because this class is not used by the debug engine. Read the description of this class at the top.
 /// </summary>
 /// <param name="pThread"> An IDebugThread2 object that represents the thread being stepped. </param>
 /// <param name="sk"> A value from the STEPKIND enumeration that specifies the kind of step. </param>
 /// <param name="Step"> A value from the STEPUNIT enumeration that specifies the unit of step. </param>
 /// <returns> If successful, returns S_OK; otherwise, returns an error code. </returns>
 public int Step(IDebugThread2 pThread, enum_STEPKIND sk, enum_STEPUNIT Step)
 {
     return VSConstants.S_OK;
 }
Example #10
0
 // This method is deprecated. Use the IDebugProcess3::Step method instead.
 public int Step(IDebugThread2 pThread, enum_STEPKIND sk, enum_STEPUNIT Step)
 {
     EnqueueCommand(new Command(CommandKind.Step));
     return VSConstants.S_OK;
 }
 public int Step(IDebugThread2 pThread, enum_STEPKIND sk, enum_STEPUNIT stepUnit)
 {
     var thread = (AD7Thread) pThread;
     _dispatcher.Queue(() => DebuggedProcess.Step(thread, sk, stepUnit));
     return VSConstants.S_OK;
 }
Example #12
0
        // This method is deprecated. Use the IDebugProcess3::Step method instead.
        public int Step(IDebugThread2 pThread, enum_STEPKIND sk, enum_STEPUNIT Step)
        {
            // Don't allow stepping through unknown code because it can lead to future problems with stepping and break-all
            //            resetStackFrames();
            if (VSNDK.DebugEngine.EventDispatcher.m_unknownCode)
            {
                m_state = AD7Engine.DE_STATE.STEP_MODE;
                m_eventDispatcher.continueExecution();

                return VSConstants.S_OK;
            }

            if (sk == enum_STEPKIND.STEP_INTO)
            {
                // F11
                GDBParser.addGDBCommand("-exec-step --thread " + this.m_threads[this._currentThreadIndex]._id);
                // ??? Create a method to inspect all of the current variables
            }
            else if (sk == enum_STEPKIND.STEP_OVER)
            {
                // F10
                GDBParser.addGDBCommand("-exec-next --thread " + this.m_threads[this._currentThreadIndex]._id);
                // ??? Create a method to inspect all of the current variables
            }
            else if (sk == enum_STEPKIND.STEP_OUT)
            {
                // Shift-F11
                if (eDispatcher.getStackDepth(this.m_threads[this._currentThreadIndex]._id) > 1)
                {
                    GDBParser.addGDBCommand("-exec-finish --thread " + this.m_threads[this._currentThreadIndex]._id + " --frame 0");
                }
                else
                {
                    // If this the only frame left, do a step-over
                    GDBParser.addGDBCommand("-exec-next --thread " + this.m_threads[this._currentThreadIndex]._id);
                }
                // ??? Create a method to inspect all of the current variables
            }
            else if (sk == enum_STEPKIND.STEP_BACKWARDS)
            {
                return VSConstants.E_NOTIMPL;
            }
            else
            {
                m_engineCallback.OnStepComplete(); // Have to call this otherwise VS gets "stuck"
            }

            // Transition DE state
            //            Debug.Assert(m_state == AD7Engine.DE_STATE.BREAK_MODE);
            m_state = AD7Engine.DE_STATE.STEP_MODE;

            return VSConstants.S_OK;
        }
Example #13
0
 // This method is deprecated. Use the IDebugProcess3::Step method instead.
 public int Step(IDebugThread2 pThread, enum_STEPKIND sk, enum_STEPUNIT Step)
 {
     return(Constants.S_OK);
 }
Example #14
0
 /// <summary>
 /// Steps forward one instruction or statement in the process.
 /// </summary>
 int IDebugProcess3.Step(IDebugThread2 pThread, enum_STEPKIND stepKind, enum_STEPUNIT stepUnit)
 {
     DLog.Debug(DContext.VSDebuggerComCall, "IDebugProcess3.Step");
     return(VSConstants.S_OK);
 }
Example #15
0
 int IDebugProgram2.Step(IDebugThread2 pThread, enum_STEPKIND sk, enum_STEPUNIT Step)
 {
     throw new NotImplementedException();
 }
Example #16
0
 // This method is deprecated. Use the IDebugProcess3::Step method instead.
 public int Step(IDebugThread2 pThread, enum_STEPKIND sk, enum_STEPUNIT Step)
 {
     return(debuggedProcess.Step(pThread, sk, Step));
 }
Example #17
0
 // This method is deprecated. Use the IDebugProcess3::Step method instead.
 public int Step(IDebugThread2 pThread, enum_STEPKIND sk, enum_STEPUNIT Step)
 {
     EnqueueCommand(new Command(CommandKind.Step));
     return(VSConstants.S_OK);
 }
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

        public int Step(IDebugThread2 pThread, enum_STEPKIND sk, enum_STEPUNIT Step)
        {
            //
            // Performs a step.
            //

            LoggingUtils.PrintFunction();

            try
            {
                JavaLangDebuggeeThread thread = pThread as JavaLangDebuggeeThread;

                uint threadId;

                LoggingUtils.RequireOk(thread.GetThreadId(out threadId));

                JdbClient.StepType stepType = (JdbClient.StepType)Step;

                switch (sk)
                {
                case enum_STEPKIND.STEP_INTO:
                {
                    m_debugger.JdbClient.StepInto(threadId, stepType, false);

                    break;
                }

                case enum_STEPKIND.STEP_OVER:
                {
                    m_debugger.JdbClient.StepOver(threadId, stepType, false);

                    break;
                }

                case enum_STEPKIND.STEP_OUT:
                {
                    m_debugger.JdbClient.StepOut(threadId, stepType, false);

                    break;
                }

                case enum_STEPKIND.STEP_BACKWARDS:
                {
                    throw new NotImplementedException();
                }
                }

                return(Constants.S_OK);
            }
            catch (NotImplementedException e)
            {
                LoggingUtils.HandleException(e);

                return(Constants.E_NOTIMPL);
            }
            catch (Exception e)
            {
                LoggingUtils.HandleException(e);

                return(Constants.E_FAIL);
            }
        }
Example #19
0
 /// <summary>
 /// Causes the process to step one instruction or statement.
 /// ** This method should be used instead of IDebugProgram2::Step.
 /// </summary>
 /// <param name="pThread">An IDebugThread2 object representing the thread being stepped.</param>
 /// <param name="sk">One of the STEPKIND values.</param>
 /// <param name="Step">One of the STEPUNIT values.</param>
 /// <returns>If successful, returns S_OK; otherwise returns error code.</returns>
 /// <remarks>
 /// In case there is any thread synchronization or communication between threads, other threads in the process should run when a particular thread is stepping.
 /// 
 /// Warning   Do not send a stopping event or an immediate (synchronous) event to IDebugEventCallback2::Event while handling this call; otherwise the debugger might stop responding.
 /// </remarks>
 public virtual int Step( IDebugThread2 pThread, enum_STEPKIND sk, enum_STEPUNIT Step )
 {
     Logger.Debug( string.Empty );
     return VSConstants.E_NOTIMPL;
 }
Example #20
0
 // This method is deprecated. Use the IDebugProcess3::Step method instead.
 public int Step(IDebugThread2 pThread, enum_STEPKIND sk, enum_STEPUNIT Step)
 {
     m_debuggedProcess.Step(((AD7Thread)pThread).GetDebuggedThread(), sk);
     return Constants.S_OK;
 }
Example #21
0
        public int Step(IDebugThread2 pThread, enum_STEPKIND kind, enum_STEPUNIT unit)
        {
            AD7Thread thread = (AD7Thread)pThread;

            _debuggedProcess.WorkerThread.RunOperation(() => _debuggedProcess.Step(thread.GetDebuggedThread().Id, kind, unit));

            return Constants.S_OK;
        }
Example #22
0
        // This method is deprecated. Use the IDebugProcess3::Step method instead.
        /// <summary>
        ///     Performs a step.
        ///     In case there is any thread synchronization or communication between threads, other threads in the program should run when a particular thread is stepping.
        /// </summary>
        public int Step(IDebugThread2 pThread, enum_STEPKIND sk, enum_STEPUNIT step)
        {
            switch (sk)
            {
                case enum_STEPKIND.STEP_INTO:
                    _process.Debugger.StepInto();
                    break;

                case enum_STEPKIND.STEP_OUT:
                    _process.Debugger.StepOut();
                    break;

                case enum_STEPKIND.STEP_OVER:
                    Process.Debugger.StepOver();
                    break;
            }
            return VSConstants.S_OK;
        }
Example #23
0
        public int Step(IDebugThread2 pThread, enum_STEPKIND sk, enum_STEPUNIT Step)
        {
            JavaDebugThread thread = pThread as JavaDebugThread;
            if (thread == null)
                return VSConstants.E_INVALIDARG;

            StepSize size;
            StepDepth depth;
            switch (Step)
            {
            case enum_STEPUNIT.STEP_INSTRUCTION:
                size = StepSize.Instruction;
                break;

            case enum_STEPUNIT.STEP_LINE:
                size = StepSize.Line;
                break;

            case enum_STEPUNIT.STEP_STATEMENT:
                size = VirtualMachine.GetCanStepByStatement() ? StepSize.Statement : StepSize.Line;
                break;

            default:
                throw new NotSupportedException();
            }

            switch (sk)
            {
            case enum_STEPKIND.STEP_INTO:
                depth = StepDepth.Into;
                break;

            case enum_STEPKIND.STEP_OUT:
                depth = StepDepth.Out;
                break;

            case enum_STEPKIND.STEP_OVER:
                depth = StepDepth.Over;
                break;

            case enum_STEPKIND.STEP_BACKWARDS:
            default:
                throw new NotSupportedException();
            }

            IStepRequest stepRequest = thread.GetStepRequest(size, depth);
            if (stepRequest == null)
                throw new InvalidOperationException();

            Task.Factory.StartNew(() =>
                {
                    // make sure the global "Break All" step request is disabled
                    this._causeBreakRequest.IsEnabled = false;
                    stepRequest.IsEnabled = true;
                    VirtualMachine.Resume();
                    Interlocked.Decrement(ref _suspended);
                }).HandleNonCriticalExceptions();

            return VSConstants.S_OK;
        }
        public int Step(IDebugThread2 pThread, enum_STEPKIND sk, enum_STEPUNIT Step)
        {
            JavaDebugThread thread = pThread as JavaDebugThread;

            if (thread == null)
            {
                return(VSConstants.E_INVALIDARG);
            }

            StepSize  size;
            StepDepth depth;

            switch (Step)
            {
            case enum_STEPUNIT.STEP_INSTRUCTION:
                size = StepSize.Instruction;
                break;

            case enum_STEPUNIT.STEP_LINE:
                size = StepSize.Line;
                break;

            case enum_STEPUNIT.STEP_STATEMENT:
                size = VirtualMachine.GetCanStepByStatement() ? StepSize.Statement : StepSize.Line;
                break;

            default:
                throw new NotSupportedException();
            }

            switch (sk)
            {
            case enum_STEPKIND.STEP_INTO:
                depth = StepDepth.Into;
                break;

            case enum_STEPKIND.STEP_OUT:
                depth = StepDepth.Out;
                break;

            case enum_STEPKIND.STEP_OVER:
                depth = StepDepth.Over;
                break;

            case enum_STEPKIND.STEP_BACKWARDS:
            default:
                throw new NotSupportedException();
            }

            IStepRequest stepRequest = thread.GetStepRequest(size, depth);

            if (stepRequest == null)
            {
                throw new InvalidOperationException();
            }

            Task.Factory.StartNew(() =>
            {
                // make sure the global "Break All" step request is disabled
                this._causeBreakRequest.IsEnabled = false;
                stepRequest.IsEnabled             = true;
                VirtualMachine.Resume();
                Interlocked.Decrement(ref _suspended);
            }).HandleNonCriticalExceptions();

            return(VSConstants.S_OK);
        }
Example #25
0
 int IDebugProgram3.Step(IDebugThread2 pThread, enum_STEPKIND sk, enum_STEPUNIT Step)
 {
     return(IDebugProgram2.Step(pThread, sk, Step));
 }
Example #26
0
        int IDebugProgram2.Step(IDebugThread2 pThread, enum_STEPKIND sk, enum_STEPUNIT Step) {
            ThrowIfDisposed();

            Task<bool> step;
            switch (sk) {
                case enum_STEPKIND.STEP_OVER:
                    step = Tracer.StepOverAsync();
                    break;
                case enum_STEPKIND.STEP_INTO:
                    step = Tracer.StepIntoAsync();
                    break;
                case enum_STEPKIND.STEP_OUT:
                    goto default;
                //    step = DebugSession.StepOutAsync();
                //    break;
                default:
                    return VSConstants.E_NOTIMPL;
            }

            step.ContinueWith(t => {
                // If step was interrupted midway (e.g. by a breakpoint), we have already reported breakpoint
                // hit event, and so we must not report step complete. Note that interrupting is not the same
                // as canceling, and if step was canceled, we must report step completion.

                bool completed = true;
                try {
                    completed = t.GetAwaiter().GetResult();
                } catch (OperationCanceledException) {
                }

                if (completed) {
                    Send(new AD7SteppingCompleteEvent(), AD7SteppingCompleteEvent.IID);
                }
            });

            return VSConstants.S_OK;
        }
Example #27
0
 public int Step(IDebugThread2 pThread, enum_STEPKIND sk, enum_STEPUNIT Step)
 {
     Log.Debug("ScriptProgramNode: Entering Step");
     switch(sk)
     {
         case enum_STEPKIND.STEP_OVER:
             Debugger.StepOver();
             break;
         case enum_STEPKIND.STEP_INTO:
            Debugger.StepInto();
             break;
         case enum_STEPKIND.STEP_OUT:
            Debugger.StepOut();
             break;
     }
     return VSConstants.S_OK;
 }
Example #28
0
 int IDebugProgram3.Step(IDebugThread2 pThread, enum_STEPKIND sk, enum_STEPUNIT Step) {
     return IDebugProgram2.Step(pThread, sk, Step);
 }
Example #29
0
 public async Task Step(int threadId, enum_STEPKIND kind, enum_STEPUNIT unit)
 {
     if ((unit == enum_STEPUNIT.STEP_LINE) || (unit == enum_STEPUNIT.STEP_STATEMENT))
     {
         switch (kind)
         {
             case enum_STEPKIND.STEP_INTO:
                 await MICommandFactory.ExecStep(threadId);
                 break;
             case enum_STEPKIND.STEP_OVER:
                 await MICommandFactory.ExecNext(threadId);
                 break;
             case enum_STEPKIND.STEP_OUT:
                 await MICommandFactory.ExecFinish(threadId);
                 break;
             default:
                 throw new NotImplementedException();
         }
     }
     else if (unit == enum_STEPUNIT.STEP_INSTRUCTION)
     {
         await MICommandFactory.ExecStepInstruction(threadId);
     }
     else
     {
         throw new NotImplementedException();
     }
 }
Example #30
0
 public int Step(IDebugThread2 pThread, enum_STEPKIND sk, enum_STEPUNIT Step)
 {
     DebugHelper.TraceEnteringMethod();
     return(VSConstants.S_OK);
 }
Example #31
0
        // This method is deprecated. Use the IDebugProcess3::Step method instead.

        /// <summary>
        /// Performs a step. 
        /// 
        /// In case there is any thread synchronization or communication between threads, other threads in the program should run when a particular thread is stepping.
        /// </summary>
        public int Step(IDebugThread2 pThread, enum_STEPKIND sk, enum_STEPUNIT step) {
            DebugWriteCommand("Step");
            var thread = ((AD7Thread)pThread).GetDebuggedThread();
            switch (sk) {
                case enum_STEPKIND.STEP_INTO: thread.StepInto(); break;
                case enum_STEPKIND.STEP_OUT: thread.StepOut(); break;
                case enum_STEPKIND.STEP_OVER: thread.StepOver(); break;
            }
            return VSConstants.S_OK;
        }
 public int Step(IDebugThread2 pThread, enum_STEPKIND sk, enum_STEPUNIT Step)
 {
     return(COM_HResults.S_OK);
 }
Example #33
0
 public int Step(IDebugThread2 pThread, enum_STEPKIND sk, enum_STEPUNIT Step)
 {
     DebugHelper.TraceEnteringMethod();
     return VSConstants.S_OK;
 }
Example #34
0
 /// <summary>
 /// Performs a step.
 /// </summary>
 public int Step(IDebugThread2 pThread, enum_STEPKIND stepKind, enum_STEPUNIT stepUnit)
 {
     // This method is deprecated. Use the IDebugProcess3::Step method instead.
     DLog.Debug(DContext.VSDebuggerComCall, "IDebugProgram2.Step kind={0}, step={1}", stepKind, stepUnit);
     Jdwp.StepDepth stepDepth;
     switch (stepKind)
     {
         case enum_STEPKIND.STEP_INTO:
             stepDepth = Jdwp.StepDepth.Into;
             break;
         case enum_STEPKIND.STEP_BACKWARDS:
             return VSConstants.E_NOTIMPL;
         case enum_STEPKIND.STEP_OVER:
             stepDepth = Jdwp.StepDepth.Over;
             break;
         case enum_STEPKIND.STEP_OUT:
             stepDepth = Jdwp.StepDepth.Out;
             break;
         default:
             return VSConstants.E_INVALIDARG;
     }
     StepAsync(new StepRequest((DalvikThread) pThread, stepDepth));
     return VSConstants.S_OK;
 }
Example #35
0
        public async Task Step(int threadId, enum_STEPKIND kind, enum_STEPUNIT unit)
        {
            this.VerifyNotDebuggingCoreDump();

            await ExceptionManager.EnsureSettingsUpdated();

            if ((unit == enum_STEPUNIT.STEP_LINE) || (unit == enum_STEPUNIT.STEP_STATEMENT))
            {
                switch (kind)
                {
                    case enum_STEPKIND.STEP_INTO:
                        await MICommandFactory.ExecStep(threadId);
                        break;
                    case enum_STEPKIND.STEP_OVER:
                        await MICommandFactory.ExecNext(threadId);
                        break;
                    case enum_STEPKIND.STEP_OUT:
                        await MICommandFactory.ExecFinish(threadId);
                        break;
                    default:
                        throw new NotImplementedException();
                }
            }
            else if (unit == enum_STEPUNIT.STEP_INSTRUCTION)
            {
                switch (kind)
                {
                    case enum_STEPKIND.STEP_INTO:
                        await MICommandFactory.ExecStepInstruction(threadId);
                        break;
                    case enum_STEPKIND.STEP_OVER:
                        await MICommandFactory.ExecNextInstruction(threadId);
                        break;
                    case enum_STEPKIND.STEP_OUT:
                        await MICommandFactory.ExecFinish(threadId);
                        break;
                    default:
                        throw new NotImplementedException();
                }
            }
            else
            {
                throw new NotImplementedException();
            }
        }
Example #36
0
 int IDebugProgram2.Step(IDebugThread2 pThread, enum_STEPKIND sk, enum_STEPUNIT Step)
 {
     throw new NotImplementedException();
 }
Example #37
0
 public int Step(IDebugThread2 pThread, enum_STEPKIND sk, enum_STEPUNIT Step)
 {
     throw new NotImplementedException();
 }
 int IDebugProgram2.Step(IDebugThread2 pThread, enum_STEPKIND sk, enum_STEPUNIT Step)
 {
   Debug.WriteLine("AD7ProgramNode: Entering Step");
   if (sk == enum_STEPKIND.STEP_BACKWARDS)
     return VSConstants.E_NOTIMPL;
   
   Thread thread = new Thread(new ThreadStart(() => { 
     // Just to ensure main method returns before running thread.
     Thread.Sleep(10);
     SteppingTypeEnum stepping = SteppingTypeEnum.None;
     switch (sk)
     {
       case enum_STEPKIND.STEP_INTO:
         stepping = SteppingTypeEnum.StepInto;
         break;
       case enum_STEPKIND.STEP_OVER:
         stepping = SteppingTypeEnum.StepOver;
         break;
       case enum_STEPKIND.STEP_OUT:
         stepping = SteppingTypeEnum.StepOut;
         break;
     }
     DebuggerManager.Instance.SteppingType = stepping;
     DebuggerManager.Instance.Run();
     //Debugger.Step();
   }));
   thread.Start();
   return VSConstants.S_OK;
 }
        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();
        }
    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

    public int Step (IDebugThread2 pThread, enum_STEPKIND sk, enum_STEPUNIT Step)
    {
      // 
      // Performs a step.
      // 

      LoggingUtils.PrintFunction ();

      try
      {
        CLangDebuggeeThread thread = pThread as CLangDebuggeeThread;

        uint threadId;

        LoggingUtils.RequireOk (thread.GetThreadId (out threadId));

        GdbClient.StepType stepType = (GdbClient.StepType)Step;

        switch (sk)
        {
          case enum_STEPKIND.STEP_INTO:
          {
            m_debugger.GdbClient.StepInto (threadId, stepType, false);

            break;
          }
          case enum_STEPKIND.STEP_OVER:
          {
            m_debugger.GdbClient.StepOver (threadId, stepType, false);

            break;
          }
          case enum_STEPKIND.STEP_OUT:
          {
            m_debugger.GdbClient.StepOut (threadId, stepType, false);

            break;
          }
          case enum_STEPKIND.STEP_BACKWARDS:
          {
            throw new NotImplementedException ();
          }
        }

        return Constants.S_OK;
      }
      catch (NotImplementedException e)
      {
        LoggingUtils.HandleException (e);

        return Constants.E_NOTIMPL;
      }
      catch (Exception e)
      {
        LoggingUtils.HandleException (e);

        return Constants.E_FAIL;
      }
    }
Example #41
0
 public int Step(IDebugThread2 pThread, enum_STEPKIND sk, enum_STEPUNIT Step) {
     throw new NotImplementedException();
 }
Example #42
0
 /// <summary>
 /// Steps forward one instruction or statement in the process.
 /// </summary>
 int IDebugProcess3.Step(IDebugThread2 pThread, enum_STEPKIND stepKind, enum_STEPUNIT stepUnit)
 {
     DLog.Debug(DContext.VSDebuggerComCall, "IDebugProcess3.Step");
     return VSConstants.S_OK;
 }
Example #43
0
        // This method is deprecated. Use the IDebugProcess3::Step method instead.
        /// <summary>
        /// Performs a step. 
        /// 
        /// In case there is any thread synchronization or communication between threads, other threads in the program should run when a particular thread is stepping.
        /// </summary>
        public int Step(IDebugThread2 pThread, enum_STEPKIND sk, enum_STEPUNIT Step)
        {
            if (_mixedMode) {
                return VSConstants.E_NOTIMPL;
            }

            var thread = ((AD7Thread)pThread).GetDebuggedThread();
            switch (sk) {
                case enum_STEPKIND.STEP_INTO: thread.StepInto(); break;
                case enum_STEPKIND.STEP_OUT: thread.StepOut(); break;
                case enum_STEPKIND.STEP_OVER: thread.StepOver(); break;
            }
            return VSConstants.S_OK;
        }
Example #44
0
        /// <summary>
        /// Performs a step. This method is deprecated. Use the IDebugProcess3::Step method instead. 
        /// (http://msdn.microsoft.com/en-us/library/bb162134.aspx)
        /// </summary>
        /// <param name="pThread"> An IDebugThread2 object that represents the thread being stepped. </param>
        /// <param name="sk"> A value from the STEPKIND enumeration that specifies the kind of step. </param>
        /// <param name="Step"> A value from the STEPUNIT enumeration that specifies the unit of step. </param>
        /// <returns> If successful, returns S_OK; otherwise, returns an error code. </returns>
        public int Step(IDebugThread2 pThread, enum_STEPKIND sk, enum_STEPUNIT Step)
        {
            // Don't allow stepping through unknown code because it can lead to future problems with stepping and break-all.
            if (VSNDK.DebugEngine.EventDispatcher.m_unknownCode)
            {
                m_state = AD7Engine.DE_STATE.STEP_MODE;
                m_eventDispatcher.continueExecution();

                return VSConstants.S_OK;
            }

            if (sk == enum_STEPKIND.STEP_INTO)
            {
                // Equivalent to F11 hotkey.
                // Sends the GDB command that resumes the execution of the inferior program, stopping at the next instruction, diving
                // into function if it is a function call. (http://sourceware.org/gdb/onlinedocs/gdb/GDB_002fMI-Program-Execution.html)
                GDBParser.addGDBCommand("-exec-step --thread " + this.m_threads[this._currentThreadIndex]._id);
            }
            else if (sk == enum_STEPKIND.STEP_OVER)
            {
                // Equivalent to F10 hotkey.
                // Sends the GDB command that resumes the execution of the inferior program, stopping at the next instruction, but
                // without diving into functions. (http://sourceware.org/gdb/onlinedocs/gdb/GDB_002fMI-Program-Execution.html)
                GDBParser.addGDBCommand("-exec-next --thread " + this.m_threads[this._currentThreadIndex]._id);
            }
            else if (sk == enum_STEPKIND.STEP_OUT)
            {
                // Equivalent to Shift-F11 hotkey.
                if (eDispatcher.getStackDepth(this.m_threads[this._currentThreadIndex]._id) > 1)
                {
                    // Sends the GDB command that resumes the execution of the inferior program until the current function is exited.
                    // (http://sourceware.org/gdb/onlinedocs/gdb/GDB_002fMI-Program-Execution.html)
                    GDBParser.addGDBCommand("-exec-finish --thread " + this.m_threads[this._currentThreadIndex]._id + " --frame 0");
                }
                else
                {
                    // If this the only frame left, do a step-over.
                    // Sends the GDB command that resumes the execution of the inferior program, stopping at the next instruction, but
                    // without diving into functions. (http://sourceware.org/gdb/onlinedocs/gdb/GDB_002fMI-Program-Execution.html)
                    GDBParser.addGDBCommand("-exec-next --thread " + this.m_threads[this._currentThreadIndex]._id);
                }
            }
            else if (sk == enum_STEPKIND.STEP_BACKWARDS)
            {
                return VSConstants.E_NOTIMPL;
            }
            else
            {
                m_engineCallback.OnStepComplete(); // Have to call this otherwise VS gets "stuck"
            }

            // Transition DE state
            m_state = AD7Engine.DE_STATE.STEP_MODE;

            return VSConstants.S_OK;
        }
 public int Step(IDebugThread2 pThread, enum_STEPKIND sk, enum_STEPUNIT Step)
 {
   Debug.WriteLine("AD7Process: Step");
   
   return VSConstants.S_OK;
 }
Example #46
0
 public int Step(IDebugThread2 pThread, enum_STEPKIND sk, enum_STEPUNIT Step)
 {
     Logger.Debug(string.Empty);
     return(VSConstants.E_NOTIMPL);
 }
Example #47
0
        public int Step(IDebugThread2 pThread, enum_STEPKIND kind, enum_STEPUNIT unit)
        {
            AD7Thread thread = (AD7Thread)pThread;

            try
            {
                if (null == thread || null == thread.GetDebuggedThread())
                {
                    return Constants.E_FAIL;
                }

                _debuggedProcess.WorkerThread.RunOperation(() => _debuggedProcess.Step(thread.GetDebuggedThread().Id, kind, unit));
            }
            catch (InvalidCoreDumpOperationException)
            {
                return AD7_HRESULT.E_CRASHDUMP_UNSUPPORTED;
            }

            return Constants.S_OK;
        }
Example #48
0
        // This method is deprecated. Use the IDebugProcess3::Step method instead.
        public int Step(IDebugThread2 pThread, enum_STEPKIND sk, enum_STEPUNIT Step)
        {
            Debug.Assert(Worker.MainThreadId == Worker.CurrentThreadId);

            AD7Thread thread = (AD7Thread)pThread;

            // RunOperationAsync
            m_pollThread.RunOperation(new Operation(delegate
            {
                m_debuggedProcess.Step(thread.GetDebuggedThread(), (int)sk, (int)Step);
            }));

            return Constants.S_OK;
        }