public override Task <BreakpointCreateByNameResponse> BreakpointCreateByName(
            BreakpointCreateByNameRequest request, ServerCallContext context)
        {
            if (!_targetStore.TryGetValue(request.Target.Id, out RemoteTarget target))
            {
                ErrorUtils.ThrowError(StatusCode.Internal,
                                      "Could not find target in store: " + request.Target.Id);
            }

            var response = new BreakpointCreateByNameResponse();
            RemoteBreakpoint breakpoint = target.BreakpointCreateByName(request.SymbolName);

            if (breakpoint != null)
            {
                response.Breakpoint = new GrpcSbBreakpoint {
                    Target = request.Target,
                    Id     = breakpoint.GetId(),
                };
            }
            return(Task.FromResult(response));
        }
Ejemplo n.º 2
0
        public RemoteBreakpoint BreakpointCreateByName(string symbolName)
        {
            var request = new BreakpointCreateByNameRequest()
            {
                Target     = grpcSbTarget,
                SymbolName = symbolName,
            };
            BreakpointCreateByNameResponse response = null;

            if (connection.InvokeRpc(() =>
            {
                response = client.BreakpointCreateByName(request);
            }))
            {
                if (response.Breakpoint != null && response.Breakpoint.Id != 0)
                {
                    return(breakpointFactory.Create(connection, response.Breakpoint));
                }
            }
            return(null);
        }