当前位置: 首页>>代码示例>>C#>>正文


C# IDebugEvent2类代码示例

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


IDebugEvent2类属于命名空间,在下文中一共展示了IDebugEvent2类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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 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

示例4: 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

示例5: 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

示例6: 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

示例7: 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

示例8: 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

示例9: 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

示例10: 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

示例11: 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

示例12: DebugWriteCommand

        // Called by the SDM to indicate that a synchronous debug event, previously sent by the DE to the SDM,
        // was received and processed. The only event we send in this fashion is Program Destroy.
        // It responds to that event by shutting down the engine.
        int IDebugEngine2.ContinueFromSynchronousEvent(IDebugEvent2 eventObject) {
            DebugWriteCommand("ContinueFromSynchronousEvent");
            AssertMainThread();

            if (eventObject is AD7ProgramDestroyEvent) {
                var debuggedProcess = _process;

                _events = null;
                _process = null;
                _ad7ProgramId = Guid.Empty;
                _threads.Clear();
                _modules.Clear();

                if (_trackFileChanges) {
                    _documentEvents.DocumentSaved -= OnDocumentSaved;
                    _documentEvents = null;
                }

                debuggedProcess.Close();
            } else {
                Debug.Fail("Unknown synchronous event");
            }

            return VSConstants.S_OK;
        }
开发者ID:chanchaldabriya,项目名称:nodejstools,代码行数:28,代码来源:AD7Engine.cs

示例13: Send

 internal void Send(IDebugEvent2 eventObject, string iidEvent)
 {
     Send(eventObject, iidEvent, this);
 }
开发者ID:e42s,项目名称:VSLua,代码行数:4,代码来源:AD7Engine.cs

示例14:

 // Called by the SDM to indicate that a synchronous debug event, previously sent by the DE to the SDM,
 // was received and processed. The only event the sample engine sends in this fashion is Program Destroy.
 // It responds to that event by shutting down the engine.
 int IDebugEngine2.ContinueFromSynchronousEvent(IDebugEvent2 eventObject)
 {
     AD7ProgramCreateEvent programCreate = eventObject as AD7ProgramCreateEvent;
     if (programCreate != null)
     {
         _programCreateContinued.Set();
     }
     
     return VSConstants.S_OK;
 }
开发者ID:e42s,项目名称:VSLua,代码行数:13,代码来源:AD7Engine.cs

示例15: Broadcast

    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

    public void Broadcast (IDebugEvent2 debugEvent, IDebugProgram2 program, IDebugThread2 thread)
    {
      Guid eventGuid = ComUtils.GuidOf (debugEvent);

      if ((m_cLangCallback != null) && (m_cLangCallback.IsRegistered (ref eventGuid)))
      {
        Broadcast (m_cLangCallback, debugEvent, program, thread);
      }
      else if ((m_javaLangCallback != null) && (m_javaLangCallback.IsRegistered (ref eventGuid)))
      {
        Broadcast (m_javaLangCallback, debugEvent, program, thread);
      }
      else
      {
        Broadcast (m_sdmCallback, debugEvent, program, thread);
      }
    }
开发者ID:ashumeow,项目名称:android-plus-plus,代码行数:21,代码来源:DebugEngine.cs


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