Ejemplo n.º 1
0
        private void OnDebuggerReady(BkDebuggerReady msg)
        {
            DbgCli.SendUpdateSettings(Config.breakOnError, Config.breakOnGenericError);

            SendOutput("console", "Debugger backend ready\r\n");
            Initialized = true;

            var initializedEvt = new DAPInitializedEvent();

            Stream.SendEvent("initialized", initializedEvt);
        }
Ejemplo n.º 2
0
        private void HandleLaunchRequest(DAPRequest request, DAPLaunchRequest launch)
        {
            Config  = launch.dbgOptions;
            ModUuid = launch.modUuid;

            if (!File.Exists(launch.debugInfoPath))
            {
                throw new RequestFailedException("Story debug file does not exist: " + launch.debugInfoPath);
            }

            DebugInfoPath = launch.debugInfoPath;

            try
            {
                DbgClient = new AsyncProtobufClient(launch.backendHost, launch.backendPort);
            }
            catch (SocketException e)
            {
                throw new RequestFailedException("Could not connect to Osiris backend server: " + e.Message);
            }

            DbgCli = new DebuggerClient(DbgClient, DebugInfo)
            {
                OnStoryLoaded               = this.OnStoryLoaded,
                OnDebugSessionEnded         = this.OnDebugSessionEnded,
                OnBackendInfo               = this.OnBackendInfo,
                OnBreakpointTriggered       = this.OnBreakpointTriggered,
                OnGlobalBreakpointTriggered = this.OnGlobalBreakpointTriggered,
                OnStorySyncData             = this.OnStorySyncData,
                OnStorySyncFinished         = this.OnStorySyncFinished,
                OnDebugOutput               = this.OnDebugOutput
            };
            if (LogStream != null)
            {
                DbgCli.EnableLogging(LogStream);
            }

            DbgCli.SendIdentify(DBGProtocolVersion);

            DbgThread = new Thread(new ThreadStart(DebugThreadMain));
            DbgThread.Start();

            Breakpoints = new BreakpointManager(DbgCli);

            var reply = new DAPLaunchResponse();

            Stream.SendReply(request, reply);

            var initializedEvt = new DAPInitializedEvent();

            Stream.SendEvent("initialized", initializedEvt);
        }