private void HandleSetBreakpointsRequest(DAPRequest request, DAPSetBreakpointsRequest breakpoints) { if (Breakpoints != null) { var goalName = Path.GetFileNameWithoutExtension(breakpoints.source.name); Breakpoints.ClearGoalBreakpoints(goalName); var reply = new DAPSetBreakpointsResponse { breakpoints = new List <DAPBreakpoint>() }; foreach (var breakpoint in breakpoints.breakpoints) { var bp = Breakpoints.AddBreakpoint(breakpoints.source, breakpoint); reply.breakpoints.Add(bp.ToDAP()); } Breakpoints.UpdateBreakpointsOnBackend(); Stream.SendReply(request, reply); } else { throw new RequestFailedException("Cannot add breakpoint - breakpoint manager not yet initialized"); } }
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 void SendReply(DAPRequest request, string errorText) { var reply = new DAPResponse { type = "response", request_seq = request.seq, success = false, command = request.command, message = errorText }; Send(reply); }
public void SendReply(DAPRequest request, IDAPMessagePayload response) { var reply = new DAPResponse { type = "response", request_seq = request.seq, success = true, command = request.command, body = response }; Send(reply); }
private void HandleInitializeRequest(DAPRequest request, DAPInitializeRequest init) { var reply = new DAPCapabilities { supportsConfigurationDoneRequest = true, supportsEvaluateForHovers = true }; Stream.SendReply(request, reply); var versionInfo = new DAPCustomVersionInfoEvent { version = DAPProtocolVersion }; Stream.SendEvent("osirisProtocolVersion", versionInfo); }