async Task <bool> RemoveBreakpoint(MessageId msg_id, JObject args, CancellationToken token) { var bpid = args? ["breakpointId"]?.Value <string> (); var context = GetContext(msg_id); if (!context.BreakpointRequests.TryGetValue(bpid, out var breakpointRequest)) { return(false); } foreach (var bp in breakpointRequest.Locations) { var res = await SendMonoCommand(msg_id, MonoCommands.RemoveBreakpoint(bp.RemoteId), token); var ret_code = res.Value? ["result"]? ["value"]?.Value <int> (); if (ret_code.HasValue) { bp.RemoteId = -1; bp.State = BreakpointState.Disabled; } } breakpointRequest.Locations.Clear(); return(false); }
async Task <Result> RemoveBreakpoint(SessionId sessionId, Breakpoint bp, CancellationToken token) { var res = await SendMonoCommand(sessionId, MonoCommands.RemoveBreakpoint(bp.RemoteId), token); var ret_code = res.Value? ["result"]? ["value"]?.Value <int> (); if (ret_code.HasValue) { bp.RemoteId = -1; bp.State = BreakpointState.Disabled; } return(res); }