예제 #1
0
        // Engines notify the debugger about the results of a symbol serach by sending an instance of IDebugSymbolSearchEvent2
        public void OnSymbolSearch(AD7Module module, string status, enum_MODULE_INFO_FLAGS dwStatusFlags)
        {
            string statusString = (dwStatusFlags == enum_MODULE_INFO_FLAGS.MIF_SYMBOLS_LOADED ? "Symbols Loaded - " : "No symbols loaded") + status;

            AD7SymbolSearchEvent eventObject = new AD7SymbolSearchEvent(module, statusString, dwStatusFlags);

            Send(eventObject, AD7SymbolSearchEvent.IID, null);
        }
예제 #2
0
    public void OnModuleLoad(AD7Module aModule) {
      // This will get called when the entrypoint breakpoint is fired because the engine sends a mod-load event
      // for the exe.
      //if (m_engine.DebuggedProcess != null) {
      //    System.Diagnostics.Debug.Assert(Worker.CurrentThreadId == m_engine.DebuggedProcess.PollThreadId);
      //}

      AD7ModuleLoadEvent eventObject = new AD7ModuleLoadEvent(aModule, true /* this is a module load */);
      Send(eventObject, AD7ModuleLoadEvent.IID, null);
    }
예제 #3
0
        public void OnModuleLoad(AD7Module aModule)
        {
            // This will get called when the entrypoint breakpoint is fired because the engine sends a mod-load event
            // for the exe.
            //if (m_engine.DebuggedProcess != null) {
            //    System.Diagnostics.Debug.Assert(Worker.CurrentThreadId == m_engine.DebuggedProcess.PollThreadId);
            //}

            AD7ModuleLoadEvent eventObject = new AD7ModuleLoadEvent(aModule, true /* this is a module load */);

            Send(eventObject, AD7ModuleLoadEvent.IID, null);
        }
예제 #4
0
파일: AD7Engine.cs 프로젝트: zer09/Cosmos
        // During startup these methods are called in this order:
        // -LaunchSuspended
        // -ResumeProcess
        //   -Attach - Triggered by Attach

        int IDebugEngineLaunch2.LaunchSuspended(string aPszServer, IDebugPort2 aPort, string aDebugInfo
                                                , string aArgs, string aDir, string aEnv, string aOptions, enum_LAUNCH_FLAGS aLaunchFlags
                                                , uint aStdInputHandle, uint aStdOutputHandle, uint hStdError, IDebugEventCallback2 aAD7Callback
                                                , out IDebugProcess2 oProcess)
        {
            // Launches a process by means of the debug engine.
            // Normally, Visual Studio launches a program using the IDebugPortEx2::LaunchSuspended method and then attaches the debugger
            // to the suspended program. However, there are circumstances in which the debug engine may need to launch a program
            // (for example, if the debug engine is part of an interpreter and the program being debugged is an interpreted language),
            // in which case Visual Studio uses the IDebugEngineLaunch2::LaunchSuspended method
            // The IDebugEngineLaunch2::ResumeProcess method is called to start the process after the process has been successfully launched in a suspended state.

            oProcess = null;
            try {
                mEngineCallback = new EngineCallback(this, aAD7Callback);

                var xDebugInfo = new NameValueCollection();
                NameValueCollectionHelper.LoadFromString(xDebugInfo, aDebugInfo);

                //TODO: In the future we might support command line args for kernel etc
                //string xCmdLine = EngineUtils.BuildCommandLine(exe, args);
                //var processLaunchInfo = new ProcessLaunchInfo(exe, xCmdLine, dir, env, options, launchFlags, hStdInput, hStdOutput, hStdError);

                AD7EngineCreateEvent.Send(this);
                oProcess = mProcess = new AD7Process(xDebugInfo, mEngineCallback, this, aPort);
                // We only support one process, so just use its ID for the program ID
                mProgramID = mProcess.ID;
                //AD7ThreadCreateEvent.Send(this, xProcess.Thread);
                mModule   = new AD7Module();
                mProgNode = new AD7ProgramNode(mProcess.PhysID);
            } catch (NotSupportedException) {
                return(VSConstants.S_FALSE);
            } catch (Exception e) {
                return(EngineUtils.UnexpectedException(e));
            }
            return(VSConstants.S_OK);
        }
예제 #5
0
파일: AD7Events.cs 프로젝트: zer09/Cosmos
 public AD7SymbolSearchEvent(AD7Module module, string searchInfo, enum_MODULE_INFO_FLAGS symbolFlags)
 {
     m_module      = module;
     m_searchInfo  = searchInfo;
     m_symbolFlags = symbolFlags;
 }
예제 #6
0
파일: AD7Events.cs 프로젝트: zer09/Cosmos
        internal static void Send(AD7Engine engine, AD7Module aModule, bool fLoad)
        {
            var eventObject = new AD7ModuleLoadEvent(aModule, fLoad);

            engine.Callback.Send(eventObject, IID, null);
        }
예제 #7
0
파일: AD7Events.cs 프로젝트: zer09/Cosmos
 public AD7ModuleLoadEvent(AD7Module module, bool fLoad)
 {
     m_module = module;
     m_fLoad  = fLoad;
 }
예제 #8
0
파일: AD7Events.cs 프로젝트: iSalva/Cosmos
 public AD7SymbolSearchEvent(AD7Module module, string searchInfo, enum_MODULE_INFO_FLAGS symbolFlags)
 {
     m_module = module;
     m_searchInfo = searchInfo;
     m_symbolFlags = symbolFlags;
 }
예제 #9
0
파일: AD7Events.cs 프로젝트: iSalva/Cosmos
 internal static void Send(AD7Engine engine, AD7Module aModule, bool fLoad)
 {
     var eventObject = new AD7ModuleLoadEvent(aModule, fLoad);
     engine.Callback.Send(eventObject, IID, null);
 }
예제 #10
0
파일: AD7Events.cs 프로젝트: iSalva/Cosmos
 public AD7ModuleLoadEvent(AD7Module module, bool fLoad)
 {
     m_module = module;
     m_fLoad = fLoad;
 }
예제 #11
0
    // Engines notify the debugger about the results of a symbol serach by sending an instance of IDebugSymbolSearchEvent2
    public void OnSymbolSearch(AD7Module module, string status, enum_MODULE_INFO_FLAGS dwStatusFlags) {
      string statusString = (dwStatusFlags == enum_MODULE_INFO_FLAGS.MIF_SYMBOLS_LOADED ? "Symbols Loaded - " : "No symbols loaded") + status;

      AD7SymbolSearchEvent eventObject = new AD7SymbolSearchEvent(module, statusString, dwStatusFlags);
      Send(eventObject, AD7SymbolSearchEvent.IID, null);
    }