Example #1
0
 /// <summary>
 /// Default ctor
 /// </summary>
 internal DebugProgram(DebugProcess process, DebuggerLib.Debugger debugger, string apkPath, MapFile mapFile, EngineEventCallback eventCallback)
     : base(debugger, mapFile, apkPath)
 {
     this.process       = process;
     this.apkPath       = apkPath;
     this.eventCallback = eventCallback;
     programGuid        = Guid.NewGuid();
     modules.Add(new DebugModule());
 }
Example #2
0
 /// <summary>
 /// Default ctor
 /// </summary>
 internal DebugProgram(DebugProcess process, DebuggerLib.Debugger debugger, string apkPath, MapFile mapFile, EngineEventCallback eventCallback)
     : base(debugger, mapFile)
 {
     this.process = process;
     this.apkPath = apkPath;
     this.eventCallback = eventCallback;
     programGuid = Guid.NewGuid();
     modules.Add(new DebugModule());
 }
Example #3
0
        /// <summary>
        /// Launch the actual debug process.
        /// </summary>
        public int LaunchSuspended(string pszServer, IDebugPort2 pPort, string pszExe, string pszArgs, string pszDir, string bstrEnv, string pszOptions, enum_LAUNCH_FLAGS dwLaunchFlags, uint hStdInput, uint hStdOutput, uint hStdError, IDebugEventCallback2 pCallback, out IDebugProcess2 ppProcess)
        {
            DLog.Debug(DContext.VSDebuggerComCall, "IDebugEngine2.LaunchSuspended");

            ppProcess = null;
            var port = pPort as DebugPort;

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

            // Create event callback
            eventCallback = new EngineEventCallback(this, pCallback);

            // Notify creation
            eventCallback.Send(new EngineCreateEvent(this));

            // Get debugger
            var guid     = new Guid(pszOptions);
            var debugger = Launcher.GetAndRemoveDebugger(guid, out stateUpdate);

            // Load map file
            var mapFilePath = Path.ChangeExtension(pszExe, ".d42map");
            var mapFile     = File.Exists(mapFilePath) ? new MapFile(mapFilePath) : new MapFile();

            // copy exception to program now, in case it was delayed
            CopyExceptionMapToProgramIfDirty();

            // Create new process
            var process = new DebugProcess(this, port, debugger, Environment.TickCount, guid, pszExe, mapFile, eventCallback);
            var program = process.Program;

            process.Terminated += (s, x) => ((IDebugEngine2)this).DestroyProgram(program);

            // Record process
            ((DebugPort)pPort).RecordProcess(process);
            // Return result
            ppProcess = process;
            return(VSConstants.S_OK);
        }
Example #4
0
        /// <summary>
        /// Launch the actual debug process.
        /// </summary>
        public int LaunchSuspended(string pszServer, IDebugPort2 pPort, string pszExe, string pszArgs, string pszDir, string bstrEnv, string pszOptions, enum_LAUNCH_FLAGS dwLaunchFlags, uint hStdInput, uint hStdOutput, uint hStdError, IDebugEventCallback2 pCallback, out IDebugProcess2 ppProcess)
        {
            DLog.Debug(DContext.VSDebuggerComCall, "IDebugEngine2.LaunchSuspended");

            ppProcess = null;
            var port = pPort as DebugPort;
            if (pPort == null)
                return VSConstants.E_INVALIDARG;

            // Create event callback
            eventCallback = new EngineEventCallback(this, pCallback);

            // Notify creation
            eventCallback.Send(new EngineCreateEvent(this));

            // Get debugger
            var guid = new Guid(pszOptions);
            var debugger = Launcher.GetAndRemoveDebugger(guid, out stateUpdate);

            // Load map file
            var mapFilePath = Path.ChangeExtension(pszExe, ".d42map");
            var mapFile = File.Exists(mapFilePath) ? new MapFile(mapFilePath) : new MapFile();
            
            // Create new process
            var process = new DebugProcess(this, port, debugger, Environment.TickCount, guid, pszExe, mapFile, eventCallback);
            var program = process.Program;
            process.Terminated += (s, x) => ((IDebugEngine2)this).DestroyProgram(program);

            // Record process
            ((DebugPort)pPort).RecordProcess(process);
            // Return result
            ppProcess = process;
            return VSConstants.S_OK;
        }
Example #5
0
 /// <summary>
 /// Record a process launch using this port.
 /// </summary>
 internal void RecordProcess(DebugProcess process)
 {
     processes.Add(process);
 }
Example #6
0
 /// <summary>
 /// Record a process launch using this port.
 /// </summary>
 internal void RecordProcess(DebugProcess process)
 {
     processes.Add(process);
 }