コード例 #1
0
        /// <summary>
        /// Get the variable assignment expression as a string. Returns null if the value is
        /// constant or invalid.
        /// </summary>
        public static string GetVariableAssignExpression(this RemoteValue remoteValue)
        {
            var valueType = remoteValue.GetValueType();

            if (valueType == ValueType.Invalid)
            {
                return(null);
            }

            if (valueType == ValueType.Register)
            {
                return($"${remoteValue.GetName()}");
            }

            TypeFlags?typeFlags = remoteValue.GetTypeInfo()?.GetTypeFlags();

            if (typeFlags.HasValue && typeFlags.Value.HasFlag(TypeFlags.IS_ARRAY))
            {
                return(null);
            }

            string variableExpression = remoteValue.GetFullName();

            if (variableExpression == null)
            {
                variableExpression = remoteValue.GetMemoryAddressAssignExpression();
            }
            return(variableExpression);
        }
コード例 #2
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);
        }
コード例 #3
0
        public virtual string FormatValue(RemoteValue remoteValue, ValueFormat fallbackValueFormat)
        {
            string displayValue = remoteValue.GetDisplayValue(GetValueFormat(fallbackValueFormat));

            // TODO: Remove trailing zeros from ST registers summary.
            if (remoteValue.GetValueType() == ValueType.Register &&
                remoteValue.GetTypeName().Contains("ext_vector_type"))
            {
                // Ensure consistency across all the registers presented as vectors.
                return(TrySwitchFromParenthesesToBrackets(displayValue));
            }
            return(displayValue);
        }
コード例 #4
0
 public string GetValueForAssignment(
     RemoteValue remoteValue, ValueFormat fallbackValueFormat)
 => remoteValue.GetValueType() == ValueType.Register ?
 FormatValue(remoteValue, fallbackValueFormat) :
 remoteValue.GetValue(GetValueFormat(fallbackValueFormat));
コード例 #5
0
ファイル: Variables.cs プロジェクト: googlestadia/vsi-lldb
 public string Fullname() => _remoteValue.GetValueType() == DebuggerApi.ValueType.Register
     ? $"{ExpressionConstants.RegisterPrefix}{_remoteValue.GetName()}"
     : _remoteValue.GetFullName();
コード例 #6
0
 public virtual DebuggerApi.ValueType GetValueType()
 {
     return(value.GetValueType());
 }