static IEnumerable <RemoteValue> GetPointerChildren(RemoteValue value, int offset, int count) { var result = new List <RemoteValue>(); SbType pointeeType = value.GetTypeInfo()?.GetPointeeType(); if (pointeeType == null) { // If we cannot get the pointee type, just return the empty list. return(result); } ulong byteSize = pointeeType.GetByteSize(); ulong baseAddress = value.GetValueAsUnsigned() + (ulong)offset * byteSize; for (int n = 0; n < count; ++n) { ulong address = baseAddress + (ulong)n * byteSize; RemoteValue childValue = value.CreateValueFromAddress($"[{offset + n}]", address, pointeeType); if (childValue != null) { result.Add(childValue); } } return(result); }
public override Task <GetByteSizeResponse> GetByteSize(GetByteSizeRequest request, ServerCallContext context) { SbType type = typeStore.GetObject(request.Type.Id); return(Task.FromResult(new GetByteSizeResponse { ByteSize = type.GetByteSize() })); }