示例#1
0
        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>
        /// Return the expression path of the remoteValue. Don't return LLDB scratch variables like
        /// "$23" because they sometimes don't behave as expected when assigning values to them
        /// and they don't persist across debug sessions correctly.
        /// </summary>
        public static string GetFullName(this RemoteValue remoteValue)
        {
            string expressionPath;

            if (remoteValue.GetExpressionPath(out expressionPath) &&
                !string.IsNullOrEmpty(expressionPath) &&
                !expressionPath.Contains("$"))
            {
                return(expressionPath);
            }
            return(null);
        }
 public virtual bool GetExpressionPath(out string path)
 {
     return(value.GetExpressionPath(out path));
 }