private GrpcValueInfo CreateValueInfoAndUpdateStores(RemoteValue remoteValue) { if (remoteValue == null) { return(null); } string expressionPath; var hasExpressionPath = remoteValue.GetExpressionPath(out expressionPath); var valueInfo = new GrpcValueInfo { ExpressionPath = expressionPath ?? "", HasExpressionPath = hasExpressionPath, NumChildren = remoteValue.GetNumChildren(), Summary = remoteValue.GetSummary() ?? "", TypeName = remoteValue.GetTypeName() ?? "", Value = remoteValue.GetValue() ?? "", ValueType = EnumUtil.ConvertTo <Debugger.Common.ValueType>( remoteValue.GetValueType()), IsPointerType = remoteValue.TypeIsPointerType(), ByteSize = remoteValue.GetByteSize(), }; var typeInfo = remoteValue.GetTypeInfo(); if (typeInfo != null) { valueInfo.Type = GrpcFactoryUtils.CreateType( typeInfo, typeStore.AddObject(typeInfo)); } return(valueInfo); }
/// <summary> /// Returns |remoteValue|'s summary if present and its value otherwise, formatted using /// |valueFormat|. /// </summary> public static string GetDisplayValue(this RemoteValue remoteValue, ValueFormat valueFormat) { var strValue = remoteValue.GetSummary(valueFormat); if (!string.IsNullOrEmpty(strValue)) { return(TryConvertToUtf8(strValue)); } return(remoteValue.GetValue(valueFormat)); }
void UpdateFormat(ValueFormat format) { // Changing the format may cause the value/summary to change, so update their content. if (valueFormat != format) { valueFormat = format; value = remoteProxy.GetValue(format); summary = remoteProxy.GetSummary(format); } }
/// <summary> /// Similar to base.FormatValue(), but removes the prefix for hex and binary integers. /// </summary> public override string FormatValue(RemoteValue remoteValue, ValueFormat fallbackValueFormat) { ValueFormat valueFormat = GetValueFormat(fallbackValueFormat); string summary = remoteValue.GetSummary(valueFormat); if (!string.IsNullOrEmpty(summary)) { return(summary); } string value = remoteValue.GetValue(valueFormat); if (value.StartsWith("0x") || value.StartsWith("0b")) { return(value.Substring(2)); } return(value); }
public virtual string GetSummary(ValueFormat format) { return(value.GetSummary(format)); }