Ejemplo n.º 1
0
        /// <summary>
        /// Unmarshaller the response from the service to the response class.
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context)
        {
            GetFunctionResponse response = new GetFunctionResponse();

            context.Read();
            int targetDepth = context.CurrentDepth;

            while (context.ReadAtDepth(targetDepth))
            {
                if (context.TestExpression("Code", targetDepth))
                {
                    var unmarshaller = FunctionCodeLocationUnmarshaller.Instance;
                    response.Code = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("Configuration", targetDepth))
                {
                    var unmarshaller = FunctionConfigurationUnmarshaller.Instance;
                    response.Configuration = unmarshaller.Unmarshall(context);
                    continue;
                }
            }

            return(response);
        }
Ejemplo n.º 2
0
        public async Task Invalidate()
        {
            var fbb = Debugger.BeginRequest();
            int requestDataOffset = GetFunctionRequest.CreateGetFunctionRequest(fbb, Identifier);
            var response          = await Debugger.CommitRequest(
                fbb, RequestData.GetFunctionRequest, requestDataOffset);

            var responseData = new GetFunctionResponse();

            response.GetResponseData(responseData);
            var functionData = responseData.Function;

            this.AddressEnd = functionData.AddressEnd;

            this.MachineCodeStart = functionData.MachineCodeStart;
            this.MachineCodeEnd   = functionData.MachineCodeEnd;

            this.DisasmHirUnoptimized = functionData.DisasmHirRaw;
            this.DisasmHirOptimized   = functionData.DisasmHirOpt;
            if (DisasmHirUnoptimized != null)
            {
                DisasmHirUnoptimized = DisasmHirUnoptimized.Replace("\n", "\r\n");
            }
            if (DisasmHirOptimized != null)
            {
                DisasmHirOptimized = DisasmHirOptimized.Replace("\n", "\r\n");
            }

            OnChanged();
        }
Ejemplo n.º 3
0
        public override Task <GetFunctionResponse> GetFunction(GetFunctionRequest request,
                                                               ServerCallContext context)
        {
            RemoteFrame frame    = frameStore.GetObject(request.Frame.Id);
            SbFunction  function = frame.GetFunction();

            var response = new GetFunctionResponse();

            if (function != null)
            {
                response.Function = new GrpcSbFunction {
                    Id = functionStore.AddObject(function)
                };
            }
            return(Task.FromResult(response));
        }
Ejemplo n.º 4
0
        public SbFunction GetFunction()
        {
            GetFunctionResponse response = null;

            if (connection.InvokeRpc(() =>
            {
                response = client.GetFunction(
                    new GetFunctionRequest()
                {
                    Frame = grpcSbFrame
                });
            }))
            {
                if (response.Function != null && response.Function.Id != 0)
                {
                    return(functionFactory.Create(connection, response.Function));
                }
            }
            return(null);
        }
        /// <summary>
        /// Unmarshaller the response from the service to the response class.
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context)
        {
            GetFunctionResponse response = new GetFunctionResponse();

            var ms = new MemoryStream();

            Amazon.Util.AWSSDKUtils.CopyStream(context.Stream, ms);
            ms.Seek(0, SeekOrigin.Begin);
            response.FunctionCode = ms;

            if (context.ResponseData.IsHeaderPresent("Content-Type"))
            {
                response.ContentType = context.ResponseData.GetHeaderValue("Content-Type");
            }
            if (context.ResponseData.IsHeaderPresent("ETag"))
            {
                response.ETag = context.ResponseData.GetHeaderValue("ETag");
            }

            return(response);
        }