Exemplo n.º 1
0
 public BreakpointManager(IDebugProgram2 program, BasmBreakpointBackend backend, SourceFile sourceFile, EngineCallbacks callbacks)
 {
     _program    = program;
     _sourceFile = sourceFile;
     _backend    = backend;
     _callbacks  = callbacks;
 }
Exemplo n.º 2
0
        public PendingBreakpoint(BreakpointManager manager, BasmBreakpointBackend backend, EngineCallbacks callbacks, IDebugBreakpointRequest2 pBPRequest)
        {
            _manager   = manager;
            _backend   = backend;
            _callbacks = callbacks;
            _bpRequest = pBPRequest;

            BP_REQUEST_INFO[] requestInfo = new BP_REQUEST_INFO[1];
            EngineUtils.RequireOk(_bpRequest.GetRequestInfo(enum_BPREQI_FIELDS.BPREQI_BPLOCATION, requestInfo));
            _requestInfo = requestInfo[0];
        }
Exemplo n.º 3
0
        public int ContinueFromSynchronousEvent(IDebugEvent2 eventObject)
        {
            if (eventObject is AD7ProgramDestroyEvent)
            {
                _breakpointManager = null;
                _program           = null;
                _callbacks         = null;
            }
            if (eventObject is AD7LoadCompleteEvent)
            {
                _program.Launch();
            }

            return(VSConstants.S_OK);
        }
Exemplo n.º 4
0
        // After engine initialization, SDM calls LaunchSuspended to start the debuggee in a suspended state.
        // ResumeProcess and Attach are invoked next.

        public int LaunchSuspended(string pszServer, IDebugPort2 port, string exe, string args, string dir, string env, string options, enum_LAUNCH_FLAGS launchFlags, uint hStdInput, uint hStdOutput, uint hStdError, IDebugEventCallback2 ad7Callback, out IDebugProcess2 process)
        {
            Debug.Assert(_program == null);

            var sourceFile = new SourceFile(Path.Combine(dir, exe));
            var runner     = new BasmRunner(sourceFile, OnProgramStop);
            var bpBackend  = new BasmBreakpointBackend(runner, OnProgramStepComplete, OnProgramBreakComplete);

            _program = new Program(runner, bpBackend, sourceFile);

            var processId = _program.StartBasmProcess();

            EngineUtils.RequireOk(port.GetProcess(processId, out process));

            _callbacks         = new EngineCallbacks(this, _program, process, ad7Callback);
            _breakpointManager = new BreakpointManager(_program, bpBackend, sourceFile, _callbacks);

            Debug.WriteLine("IDebugEngineLaunch2.LaunchSuspended: returning S_OK");
            return(VSConstants.S_OK);
        }