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); }
public DebuggerClient(AsyncProtobufClient client, StoryDebugInfo debugInfo) { Client = client; Client.MessageReceived = this.MessageReceived; DebugInfo = debugInfo; }