コード例 #1
0
 IKRequest <TNodeId> Decode(IKMessageContext <TNodeId> context, Request message)
 {
     return(message.Body switch
     {
         PingRequest ping => new KRequest <TNodeId, KPingRequest <TNodeId> >(Decode(context, message.Header), Decode(context, ping)),
         StoreRequest store => new KRequest <TNodeId, KStoreRequest <TNodeId> >(Decode(context, message.Header), Decode(context, store)),
         FindNodeRequest findNode => new KRequest <TNodeId, KFindNodeRequest <TNodeId> >(Decode(context, message.Header), Decode(context, findNode)),
         FindValueRequest findValue => new KRequest <TNodeId, KFindValueRequest <TNodeId> >(Decode(context, message.Header), Decode(context, findValue)),
         _ => throw new InvalidOperationException(),
     });
コード例 #2
0
        public override Task <FindValueResponse> FindValue(FindValueRequest request,
                                                           ServerCallContext context)
        {
            RemoteFrame frame    = frameStore.GetObject(request.Frame.Id);
            RemoteValue variable = frame.FindValue(request.VariableName,
                                                   request.ValueType.ConvertTo <LldbApi.ValueType>());

            var response = new FindValueResponse();

            if (variable != null)
            {
                response.Variable = GrpcFactoryUtils.CreateValue(
                    variable, valueStore.AddObject(variable));
            }

            return(Task.FromResult(response));
        }
コード例 #3
0
        public RemoteValue FindValue(string varName, DebuggerApi.ValueType value_type)
        {
            var request = new FindValueRequest
            {
                Frame        = grpcSbFrame,
                VariableName = varName,
                ValueType    = value_type.ConvertTo <Debugger.Common.ValueType>(),
            };
            FindValueResponse response = null;

            if (connection.InvokeRpc(() =>
            {
                response = client.FindValue(request);
            }))
            {
                if (response.Variable != null && response.Variable.Id != 0)
                {
                    return(valueFactory.Create(connection, response.Variable));
                }
            }
            return(null);
        }