• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# IDebugThread2类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中IDebugThread2的典型用法代码示例。如果您正苦于以下问题:C# IDebugThread2类的具体用法?C# IDebugThread2怎么用?C# IDebugThread2使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



IDebugThread2类属于命名空间,在下文中一共展示了IDebugThread2类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: Event

        public int Event(IDebugEngine2 engine, IDebugProcess2 process, IDebugProgram2 program, 
			IDebugThread2 thread, IDebugEvent2 debugEvent, ref Guid riidEvent, uint attributes)
        {
            if (!(debugEvent is IDebugProcessCreateEvent2) &&
                !(debugEvent is IDebugProcessDestroyEvent2))
                return VSConstants.S_OK;

            var target = GetTargetFromProcess(process);
            if (target == null)
            {
                _package.Reporter.ReportWarning("Can't find target from process {0} ({1}). Event: {2}.",
                    process.GetName(), process.GetProcessId(), TypeHelper.GetDebugEventTypeName(debugEvent));
                return VSConstants.S_OK;
            }

            if (debugEvent is IDebugProcessCreateEvent2)
            {
                target.IsAttached = true;
                _package.History.Items.AddFirst(target);
                _package.Ui.Update();
            }
            else
            {
                target.IsAttached = false;
                _package.Ui.Update();
            }

            return VSConstants.S_OK;
        }
开发者ID:ticoaraujo,项目名称:ReAttach,代码行数:29,代码来源:ReAttachDebugger.cs


示例2: Send

    public void Send(IDebugEvent2 eventObject, string iidEvent, IDebugProgram2 program, IDebugThread2 thread) {
      uint attributes;
      var riidEvent = new Guid(iidEvent);

      EngineUtils.RequireOk(eventObject.GetAttributes(out attributes));
      EngineUtils.RequireOk(m_ad7Callback.Event(m_engine, null, program, thread, eventObject, ref riidEvent, attributes));
    }
开发者ID:Orvid,项目名称:Cosmos,代码行数:7,代码来源:EngineCallback.cs


示例3: Event

        public static int Event(this IDebugEventCallback2 callback, IDebugEngine2 engine, IDebugProcess2 process, IDebugProgram2 program, IDebugThread2 thread, DebugEvent debugEvent)
        {
            Contract.Requires<ArgumentNullException>(callback != null, "callback");
            Contract.Requires<ArgumentNullException>(debugEvent != null, "debugEvent");
            Contract.Requires<ArgumentNullException>(engine != null, "engine");

            return callback.Event(engine, process, program, thread, debugEvent, debugEvent.EventGuid, (uint)debugEvent.Attributes);
        }
开发者ID:fjnogueira,项目名称:JavaForVS,代码行数:8,代码来源:DebugEventCallbackExtensions.cs


示例4: Send

 /// <summary>
 /// Perform actual send
 /// </summary>
 private void Send(IDebugProcess2 process, IDebugProgram2 program, IDebugThread2 thread, BaseEvent @event)
 {
     var guid = @event.IID;
     DLog.Debug(DContext.VSDebuggerEvent, "DebugEngine Event {0} {1}", @event.GetType().Name, guid);
     var rc = callback.Event(engine, process, program, thread, @event, ref guid, (uint)@event.Attributes);
     if (!ErrorHandler.Succeeded(rc))
     {
         DLog.Error(DContext.VSDebuggerEvent, "DebugEngine Event failed {0}", rc);
     }
 }
开发者ID:Xtremrules,项目名称:dot42,代码行数:13,代码来源:EngineEventCallback.cs


示例5: DebugBreakpointResolution

        public DebugBreakpointResolution(IDebugProgram2 program, IDebugThread2 thread, enum_BP_TYPE breakpointType, BreakpointResolutionLocation location)
        {
            Contract.Requires<ArgumentNullException>(program != null, "program");
            Contract.Requires<ArgumentNullException>(location != null, "location");

            _program = program;
            _thread = thread;
            _breakpointType = breakpointType;
            _location = location;
        }
开发者ID:Kav2018,项目名称:JavaForVS,代码行数:10,代码来源:DebugBreakpointResolution.cs


示例6: Event

        public int Event(IDebugEngine2 pEngine, IDebugProcess2 pProcess, IDebugProgram2 pProgram, IDebugThread2 pThread, IDebugEvent2 pEvent, ref Guid riidEvent, uint dwAttrib)
        {
            if (pEvent is IRunspaceRequest)
            {
                var request = pEvent as IRunspaceRequest;
                request.SetRunspace(_runspace, _breakpoints);
            }

            return VSConstants.S_OK;
        }
开发者ID:vairam-svs,项目名称:poshtools,代码行数:10,代码来源:DebugEventManager.cs


示例7: Send

        public void Send(IDebugEvent2 eventObject, string iidEvent, IDebugThread2 thread)
        {
            IDebugProgram2 program = _engine;
            if (!_engine.ProgramCreateEventSent)
            {
                // Any events before programe create shouldn't include the program
                program = null;
            }

            Send(eventObject, iidEvent, program, thread);
        }
开发者ID:rajkumar42,项目名称:MIEngine,代码行数:11,代码来源:EngineCallback.cs


示例8: Event

        public int Event( IDebugEngine2 pEngine,
            IDebugProcess2 pProcess,
            IDebugProgram2 pProgram,
            IDebugThread2 pThread,
            IDebugEvent2 pEvent,
            ref Guid riidEvent,
            uint dwAttrib)
        {
            Logger.Debug( string.Empty );

            return VSConstants.S_OK;
        }
开发者ID:IntelliTect,项目名称:PowerStudio,代码行数:12,代码来源:PowerShellDebuggerEvents.cs


示例9: Event

        public int Event(IDebugEngine2 engine, IDebugProcess2 process, IDebugProgram2 program,
            IDebugThread2 thread, IDebugEvent2 debugEvent, ref Guid riidEvent, uint attributes)
        {
            if (process == null)
                return VSConstants.S_OK;
            string processName;
            if (process.GetName((uint) enum_GETNAME_TYPE.GN_FILENAME, out processName) != VSConstants.S_OK)
                return VSConstants.S_OK;
            if (processName.EndsWith("vshost.exe"))
                return VSConstants.S_OK;

            var shortName = Path.GetFileName(processName);

            if (debugEvent is IDebugProcessCreateEvent2)
            {
                Log.Instance.SetStatus("[attaching...] {0}", shortName);
                Storage.Instance.SubscribeProcess(processName);
            }
            if (debugEvent is IDebugProcessDestroyEvent2)
            {
                Log.Instance.SetStatus("[detached] {0}", shortName);
                Log.Instance.AppendLine("[detached] {0}", shortName);
            }
            if (debugEvent is  IDebugLoadCompleteEvent2)
            {
                if (program != null)
                {
                    string engineName;
                    Guid engineId;
                    if (program.GetEngineInfo(out engineName, out engineId) == VSConstants.S_OK)
                    {
                        var fields = new PROCESS_INFO[1];
                        if (process.GetInfo((uint)enum_PROCESS_INFO_FIELDS.PIF_PROCESS_ID, fields) != VSConstants.S_OK)
                            return VSConstants.S_OK;
                        Storage.Instance.SubscribeEngine(processName, engineId);
                        AttachCenter.Instance.Freeze();

                        Log.Instance.SetStatus("[attached] {0}", shortName);
                        Log.Instance.AppendLine("[attached] {0} ({1}) / {2}", shortName, fields[0].ProcessId.dwProcessId, engineName);
                    }
                }
            }
            return VSConstants.S_OK;
        }
开发者ID:modulexcite,项目名称:Resurrect,代码行数:44,代码来源:DebugEventsHunter.cs


示例10: Event

        public int Event(IDebugEngine2 engine, IDebugProcess2 process, IDebugProgram2 program,
            IDebugThread2 thread, IDebugEvent2 debugEvent, ref Guid riidEvent, uint attributes)
        {
            // Ignore a few events right away.
            if (debugEvent is IDebugModuleLoadEvent2 ||
                debugEvent is IDebugThreadCreateEvent2 ||
                debugEvent is IDebugThreadDestroyEvent2)
                return VSConstants.S_OK;

            if (process == null)
                return VSConstants.S_OK;

            if (debugEvent is IDebugProcessCreateEvent2) {
                State.IsAttached = true;
            }
            else if (debugEvent is IDebugProcessDestroyEvent2) {
                State.IsAttached = false;
            }

            return VSConstants.S_OK;
        }
开发者ID:modulexcite,项目名称:AttachToolbar,代码行数:21,代码来源:AttachToolbarController.cs


示例11: Event

        public int Event(IDebugEngine2 engine, IDebugProcess2 process, IDebugProgram2 program, 
			IDebugThread2 thread, IDebugEvent2 debugEvent, ref Guid riidEvent, uint attributes)
        {
            // Ignore a few events right away.
            if (debugEvent is IDebugModuleLoadEvent2 ||
                debugEvent is IDebugThreadCreateEvent2 ||
                debugEvent is IDebugThreadDestroyEvent2)
                return VSConstants.S_OK;

            // Trace.WriteLine(TypeHelper.GetDebugEventTypeName(debugEvent)); // TODO: Remove me.

            if (process == null)
                return VSConstants.S_OK;

            var target = GetTargetFromProcess(process);

            if (target == null)
            {
                _package.Reporter.ReportWarning("Can't find target from process {0} ({1}). Event: {2}.",
                    process.GetName(), process.GetProcessId(), TypeHelper.GetDebugEventTypeName(debugEvent));
                return VSConstants.S_OK;
            }
            if (debugEvent is IDebugProcessCreateEvent2)
            {
                target.IsAttached = true;
                _package.History.Items.AddFirst(target);
                _package.Ui.Update();
                return VSConstants.S_OK;
            }

            if (debugEvent is IDebugProcessDestroyEvent2)
            {
                target.IsAttached = false;
                _package.Ui.Update();
                return VSConstants.S_OK;
            }

            return VSConstants.S_OK;
        }
开发者ID:jijamw,项目名称:ReAttach,代码行数:39,代码来源:ReAttachDebugger.cs


示例12: Event

        public int Event(IDebugEngine2 pEngine, IDebugProcess2 pProcess, IDebugProgram2 pProgram, IDebugThread2 pThread, IDebugEvent2 pEvent, ref Guid riidEvent, uint dwAttrib)
        {
            if (riidEvent == typeof(IDebugOutputStringEvent2).GUID)
            {
                IDebugOutputStringEvent2 ev = pEvent as IDebugOutputStringEvent2;
                if (ev != null)
                {
                    string message;
                    if (ErrorHandler.Succeeded(ev.GetString(out message)))
                    {
                        var lines = message.Split(sp, StringSplitOptions.RemoveEmptyEntries);

                        foreach(var line in lines)
                        {
                            HandleMessage(line);
                        }
                    }
                }
            }

            return VSConstants.S_OK;
        }
开发者ID:rugbbyli,项目名称:VSLogcat,代码行数:22,代码来源:IDebugOutputStringEvent2.cs


示例13: Event

        public int Event(IDebugEngine2 engine, IDebugProcess2 process, IDebugProgram2 program, 
			IDebugThread2 thread, IDebugEvent2 debugEvent, ref Guid riidEvent, uint attributes)
        {
            // _package.Reporter.ReportTrace(TypeHelper.GetDebugEventTypeName(debugEvent));

            if (!(debugEvent is IDebugProcessCreateEvent2) &&
                !(debugEvent is IDebugProcessDestroyEvent2))
                return VSConstants.S_OK;

            var target = GetTargetFromProcess(process);
            if (target == null)
            {
                _package.Reporter.ReportWarning("Can't find target from process {0} ({1}). Event: {2}.",
                    process.GetName(), process.GetProcessId(), TypeHelper.GetDebugEventTypeName(debugEvent));
                return VSConstants.S_OK;
            }

            if (debugEvent is IDebugProcessCreateEvent2)
            {
                var engines = target.Engines.Where(e => _engines.ContainsKey(e)).Select(e => _engines[e]).ToArray();

                var mode = new DBGMODE[1];
                _debugger.GetMode(mode);
                if (mode[0] == DBGMODE.DBGMODE_Design)
                    return VSConstants.S_OK;

                target.IsAttached = true;
                _package.History.Items.AddFirst(target);
                _package.Ui.Update();
            }
            else
            {
                target.IsAttached = false;
                _package.Ui.Update();
            }

            return VSConstants.S_OK;
        }
开发者ID:erlandranvinge,项目名称:ReAttach,代码行数:38,代码来源:ReAttachDebugger.cs


示例14: Event

        public int Event(IDebugEngine2 pEngine, IDebugProcess2 pProcess, IDebugProgram2 pProgram, IDebugThread2 pThread, IDebugEvent2 pEvent, ref Guid riidEvent, uint dwAttrib) {
            if (riidEvent == typeof(IDebugProgramCreateEvent2).GUID) {
                Guid processId;

                // A program was created and attached
                if (pProcess != null) {
                    if (VSConstants.S_OK == pProcess.GetProcessId(out processId)) {
                        DkmProcess dkmProcess = DkmProcess.FindProcess(processId);

                        if (dkmProcess != null) {
                            var debugTrigger = DkmExceptionCodeTrigger.Create(DkmExceptionProcessingStage.Thrown, null, DkmExceptionCategory.Win32, RemoteDebugStartExceptionCode);
                            var attachTrigger = DkmExceptionCodeTrigger.Create(DkmExceptionProcessingStage.Thrown, null, DkmExceptionCategory.Win32, RemoteDebugAttachExceptionCode);

                            // Try to add exception trigger for when a remote debugger server is started for Python
                            dkmProcess.AddExceptionTrigger(RemoteDebugExceptionGuid, debugTrigger);
                            dkmProcess.AddExceptionTrigger(RemoteDebugExceptionGuid, attachTrigger);
                        }
                    }
                }
            }

            return VSConstants.S_OK;
        }
开发者ID:omnimark,项目名称:PTVS,代码行数:23,代码来源:PythonRemoteDebugEvents.cs


示例15: Continue

        // Continue is called from the SDM when it wants execution to continue in the debugee
        // but have stepping state remain. An example is when a tracepoint is executed,
        // and the debugger does not want to actually enter break mode.
        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;

            try
            {
                if (_pollThread.IsPollThread())
                {
                    _debuggedProcess.Continue(thread?.GetDebuggedThread());
                }
                else
                {
                    _pollThread.RunOperation(() => _debuggedProcess.Continue(thread?.GetDebuggedThread()));
                }
            }
            catch (InvalidCoreDumpOperationException)
            {
                return AD7_HRESULT.E_CRASHDUMP_UNSUPPORTED;
            }

            return Constants.S_OK;
        }
开发者ID:wesrupert,项目名称:MIEngine,代码行数:26,代码来源:AD7Engine.cs


示例16: ExecuteOnThread

 /// <summary>
 /// Executes the debugger program. The thread is returned to give the debugger information on which
 /// thread the user is viewing when executing the program.
 /// </summary>
 /// <param name="pThread">An IDebugThread2 object.</param>
 /// <returns>If successful, returns S_OK; otherwise, returns an error code.</returns>
 /// <remarks>
 /// There are three different ways that a debugger can resume execution after stopping:
 ///
 /// <list type="bullet">
 /// <item>Execute: Cancel any previous step, and run until the next breakpoint and so on.</item>
 /// <item>Step: Cancel any old step, and run until the new step completes.</item>
 /// <item>Continue: Run again, and leave any old step active.</item>
 /// </list>
 ///
 /// The thread passed to ExecuteOnThread is useful when deciding which step to cancel. If you do not
 /// know the thread, running execute cancels all steps. With knowledge of the thread, you only need
 /// to cancel the step on the active thread.
 /// </remarks>
 public int ExecuteOnThread(IDebugThread2 pThread)
 {
     Task.Factory.StartNew(() => _causeBreakRequest.IsEnabled = false);
     return Continue(pThread);
 }
开发者ID:Kav2018,项目名称:JavaForVS,代码行数:24,代码来源:JavaDebugProgram.cs


示例17: Step

        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;
        }
开发者ID:Kav2018,项目名称:JavaForVS,代码行数:60,代码来源:JavaDebugProgram.cs


示例18: EnumCodePaths

 public int EnumCodePaths(IDebugThread2 pThread, IDebugCodeContext2 pStart, /*enum_STEPUNIT*/uint stepUnit, out IEnumDebugCodePaths90 ppEnum)
 {
     throw new NotImplementedException();
 }
开发者ID:Kav2018,项目名称:JavaForVS,代码行数:4,代码来源:JavaDebugProgram.cs


示例19: Continue

        /// <summary>
        /// Continues running this program from a stopped state. Any previous execution state (such
        /// as a step) is preserved, and the program starts executing again.
        /// </summary>
        /// <param name="pThread">An IDebugThread2 object that represents the thread.</param>
        /// <returns>If successful, returns S_OK; otherwise, returns an error code.</returns>
        /// <remarks>
        /// This method is called on this program regardless of how many programs are being debugged,
        /// or which program generated the stopping event. The implementation must retain the previous
        /// execution state (such as a step) and continue execution as though it had never stopped
        /// before completing its prior execution. That is, if a thread in this program was doing a
        /// step-over operation and was stopped because some other program stopped, and then this
        /// method was called, the program must complete the original step-over operation.
        /// 
        /// 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 int Continue(IDebugThread2 pThread)
        {
#if true
            if (_suspended != 0)
            {
                Interlocked.Decrement(ref _suspended);
                Task.Factory.StartNew(VirtualMachine.Resume).HandleNonCriticalExceptions();
            }

            return VSConstants.S_OK;
#else
            if (pThread == null)
            {
                Task.Factory.StartNew(VirtualMachine.Resume).HandleNonCriticalExceptions();
                return VSConstants.S_OK;
            }

            JavaDebugThread javaThread = pThread as JavaDebugThread;
            if (javaThread == null)
                return VSConstants.E_INVALIDARG;

            Task.Factory.StartNew(() => javaThread.Resume()).HandleNonCriticalExceptions();
            return VSConstants.S_OK;
#endif
        }
开发者ID:Kav2018,项目名称:JavaForVS,代码行数:42,代码来源:JavaDebugProgram.cs


示例20: Execute

 public int Execute(IDebugThread2 pThread)
 {
   Debug.WriteLine("AD7Process: Execute");
   return VSConstants.E_NOTIMPL;
 }
开发者ID:jimmy00784,项目名称:mysql-connector-net,代码行数:5,代码来源:AD7Process.cs



注:本文中的IDebugThread2类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# IDeclaration类代码示例发布时间:2022-05-24
下一篇:
C# IDebugStackFrame2类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap