Beispiel #1
0
        public LineEntryInfo GetLineEntry()
        {
            GetLineEntryResponse response = null;

            if (connection.InvokeRpc(() =>
            {
                response = client.GetLineEntry(
                    new GetLineEntryRequest {
                    Address = grpcSbAddress
                });
            }))
            {
                if (response.LineEntry != null)
                {
                    return(new LineEntryInfo
                    {
                        FileName = response.LineEntry.FileName,
                        Directory = response.LineEntry.Directory,
                        Line = response.LineEntry.Line,
                        Column = response.LineEntry.Column,
                    });
                }
            }
            return(null);
        }
 internal bool Create(string platformName)
 {
     return(connection.InvokeRpc(() =>
     {
         client.Create(new CreateRequest {
             PlatformName = platformName
         });
     }));
 }
Beispiel #3
0
        public void Delete()
        {
            DeleteResponse response = null;

            connection.InvokeRpc(() =>
            {
                response = client.Delete(new DeleteRequest {
                    Breakpoint = grpcSbBreakpoint
                });
            });
        }
Beispiel #4
0
        public DebuggerApi.SectionType GetSectionType()
        {
            GetSectionTypeResponse response = null;

            if (connection.InvokeRpc(() =>
            {
                response = client.GetSectionType(
                    new GetSectionTypeRequest {
                    Section = grpcSbSection
                });
            }))
            {
                return(response.SectionType.ConvertTo <DebuggerApi.SectionType>());
            }
            return(DebuggerApi.SectionType.Invalid);
        }
Beispiel #5
0
        public int GetId()
        {
            GetIdResponse response = null;

            if (connection.InvokeRpc(() =>
            {
                response = client.GetId(
                    new GetIdRequest {
                    Watchpoint = grpcSbWatchpoint
                });
            }))
            {
                return(response.Id);
            }
            return(0);
        }
Beispiel #6
0
        public bool Succeeded()
        {
            SucceededResponse response = null;

            if (connection.InvokeRpc(() =>
            {
                response = client.Succeeded(
                    new SucceededRequest {
                    ReturnObject = grpcSbReturnObject
                });
            }))
            {
                return(response.Succeeded);
            }
            return(false);
        }
 internal bool Create(bool sourceInitFiles, TimeSpan retryWaitTime)
 {
     return(connection.InvokeRpc(() =>
     {
         client.Create(
             new CreateRequest {
             SourceInitFiles = sourceInitFiles
         },
             new CallOptions()
             .WithDeadline(DateTime.UtcNow.Add(retryWaitTime))
             .WithWaitForReady());
     }));
 }
Beispiel #8
0
        internal bool Create(string name)
        {
            CreateResponse response = null;

            if (connection.InvokeRpc(() =>
            {
                response = client.Create(new CreateRequest()
                {
                    Name = name
                });
            }))
            {
                grpcListener = response.Listener;
                return(true);
            }
            return(false);
        }
Beispiel #9
0
        public bool GetShouldStop(int signalNumber)
        {
            GetShouldStopResponse response = null;

            if (connection.InvokeRpc(() =>
            {
                response = client.GetShouldStop(
                    new GetShouldStopRequest
                {
                    Signals = grpcSbUnixSignals,
                    SignalNumber = signalNumber
                });
            }))
            {
                return(response.ShouldStop);
            }
            return(false);
        }
Beispiel #10
0
        public SbTypeMember GetDirectBaseClassAtIndex(uint index)
        {
            GetDirectBaseClassAtIndexResponse response = null;

            if (connection.InvokeRpc(() =>
            {
                response = client.GetDirectBaseClassAtIndex(
                    new GetDirectBaseClassAtIndexRequest {
                    Type = grpcSbType, Index = index
                });
            }))
            {
                if (response.TypeMember != null && response.TypeMember.Id != 0)
                {
                    return(typeMemberFactory.Create(connection, response.TypeMember));
                }
            }
            return(null);
        }
Beispiel #11
0
        public SbAddress GetStartAddress()
        {
            GetStartAddressResponse response = null;

            if (connection.InvokeRpc(() =>
            {
                response = client.GetStartAddress(
                    new GetStartAddressRequest {
                    Symbol = grpcSbSymbol
                });
            }))
            {
                if (response.Address != null && response.Address.Id != 0)
                {
                    return(addressFactory.Create(connection, response.Address));
                }
            }
            return(null);
        }
        public ReturnStatus HandleCommand(string command, out SbCommandReturnObject result)
        {
            result = null;

            HandleCommandResponse response = null;

            if (connection.InvokeRpc(() =>
            {
                response = client.HandleCommand(
                    new HandleCommandRequest {
                    Command = command,
                    Interpreter = grpcSbInterpreter
                });
            }))
            {
                if (response.ReturnObject != null && response.ReturnObject.Id != 0)
                {
                    result = returnObjectFactory.Create(connection, response.ReturnObject);
                    return(response.ReturnStatus.ConvertTo <ReturnStatus>());
                }
            }

            return(ReturnStatus.Invalid);
        }
        public virtual void Delete(GrpcConnection connection, GrpcSbFrame grpcSbFrame)
        {
            var client = new RemoteFrameRpcService.RemoteFrameRpcServiceClient(
                connection.CallInvoker);

            connection
            .GetOrCreateBulkDeleter <GrpcSbFrame>()
            .QueueForDeletion(grpcSbFrame, (List <GrpcSbFrame> frames) =>
            {
                var request = new BulkDeleteRequest();
                request.Frames.AddRange(frames);
                connection.InvokeRpc(() =>
                {
                    client.BulkDelete(request);
                });
            });
        }
Beispiel #14
0
        public SbType GetTypeInfo()
        {
            GetTypeInfoResponse response = null;

            if (connection.InvokeRpc(() =>
            {
                response = client.GetTypeInfo(
                    new GetTypeInfoRequest {
                    TypeMember = grpcSbTypeMember
                });
            }))
            {
                if (response.Type != null && response.Type.Id != 0)
                {
                    return(typeFactory.Create(connection, response.Type));
                }
            }
            return(null);
        }
        public SbAddress GetAddress()
        {
            GetAddressResponse response = null;

            if (connection.InvokeRpc(() =>
            {
                response = client.GetAddress(
                    new GetAddressRequest {
                    BreakpointLocation = grpcSbBreakpointLocation
                });
            }))
            {
                if (response.Address != null && response.Address.Id != 0)
                {
                    return(addressFactory.Create(connection, response.Address));
                }
            }
            return(null);
        }
Beispiel #16
0
        public SbProcess AttachToProcessWithID(SbListener listener, ulong pid, out SbError error)
        {
            var request = new AttachToProcessWithIDRequest()
            {
                Target   = grpcSbTarget,
                Listener = new GrpcSbListener()
                {
                    Id = listener.GetId()
                },
                Pid = pid,
            };
            AttachToProcessWithIDResponse response = null;

            if (connection.InvokeRpc(() =>
            {
                response = client.AttachToProcessWithID(request);
            }))
            {
                error = errorFactory.Create(response.Error);
                if (response.Process == null)
                {
                    return(null);
                }
                return(processFactory.Create(connection, response.Process));
            }
            var grpcError = new GrpcSbError
            {
                Success = false,
                Error   = "Rpc error while calling AttachToProcessWithId."
            };

            error = errorFactory.Create(grpcError);
            return(null);
        }
 // Disposing indicates whether this method has been called by user's code or by the
 // the destructor. In the latter case, we should not reference managed objects as we cannot
 // know if they have already been reclaimed by the garbage collector.
 protected virtual void Dispose(bool disposing)
 {
     if (!disposed)
     {
         // We only have unmanaged resources to dispose of in this class.
         connection
         .GetOrCreateBulkDeleter <GrpcSbFrame>()
         .QueueForDeletion(grpcSbFrame, (List <GrpcSbFrame> frames) =>
         {
             var request = new BulkDeleteRequest();
             request.Frames.AddRange(frames);
             connection.InvokeRpc(() =>
             {
                 client.BulkDelete(request);
             });
         });
         gcHandle.Free();
         disposed = true;
     }
 }
Beispiel #18
0
        public RemoteTarget GetTarget()
        {
            GetTargetResponse response = null;

            if (connection.InvokeRpc(() =>
            {
                response = client.GetTarget(
                    new GetTargetRequest()
                {
                    Process = grpcSbProcess
                });
            }))
            {
                return(targetFactory.Create(connection, response.Target));
            }
            return(null);
        }
Beispiel #19
0
        public string GetValue(DebuggerApi.ValueFormat format)
        {
            GetValueResponse response = null;

            if (connection.InvokeRpc(() =>
            {
                response = client.GetValue(
                    new GetValueRequest
                {
                    Value = grpcSbValue,
                    Format = format.ConvertTo <Debugger.Common.ValueFormat>()
                });
            }))
            {
                return(response.Value);
            }
            return("");
        }