예제 #1
0
        // TODO: handle the situation when raw and expand formatter are both present
        public virtual IVariableInformation Create(
            RemoteValue remoteValue, string displayName = null,
            FormatSpecifier formatSpecifier             = null,
            CustomVisualizer customVisualizer           = CustomVisualizer.None)
        {
            IVariableInformation varInfo =
                _varInfoFactory.Create(remoteValue, displayName, formatSpecifier, customVisualizer);

            // Don't use Natvis for raw format specifier (!), e.g. "myvar,!".
            if (FormatSpecifierUtil.HasRawFormatSpecifier(varInfo.FormatSpecifier))
            {
                return(new CachingVariableInformation(varInfo));
            }

            var natvisVarInfo = new NatvisVariableInformation(_natvisExpander, varInfo);

            if (ExpandFormatSpecifierUtil.TryParseExpandFormatSpecifier(
                    natvisVarInfo.FormatSpecifier, out int expandedIndex))
            {
                return(new CachingVariableInformation(
                           _expandVariableFactory.Create(natvisVarInfo, expandedIndex)));
            }

            return(new CachingVariableInformation(natvisVarInfo));
        }
예제 #2
0
        private IEnumerable <IVariableInformation> BuildRealSets()
        {
            var varInfos = new List <IVariableInformation>();
            // Registers being included in more than one set must use different handles.
            // New handles can be obtained by calling frame.GetRegisters().
            var  values     = frame.GetRegisters();
            bool firstGroup = true;

            foreach (var value in values)
            {
                // Change the display name for the first group of registers to "CPU".
                // Visual Studio will display the "CPU" register group by default.
                var newName = firstGroup ? "CPU" : value.GetName();
                firstGroup = false;
                varInfos.Add(varInfoFactory.Create(value, newName));
            }
            return(varInfos);
        }
예제 #3
0
        public virtual IVariableInformation Create(
            RemoteValue remoteValue, string displayName = null,
            FormatSpecifier formatSpecifier             = null,
            CustomVisualizer customVisualizer           = CustomVisualizer.None)
        {
            IVariableInformation varInfo =
                _varInfoFactory.Create(remoteValue, displayName, formatSpecifier, customVisualizer);

            if (customVisualizer != CustomVisualizer.None)
            {
                varInfo = new NatvisVariableInformation(_natvisExpander, varInfo);
            }

            if (ExpandFormatSpecifierUtil.TryParseExpandFormatSpecifier(varInfo.FormatSpecifier,
                                                                        out int expandedIndex))
            {
                varInfo = _expandVariableFactory.Create(varInfo, expandedIndex);
            }

            return(new CachingVariableInformation(varInfo));
        }
 IVariableInformation CreateVarInfo(RemoteValue remoteValue) =>
 _varInfoFactory.Create(remoteValue);
예제 #5
0
 /// <summary>
 /// Create an IVariableInformation instance from an expression. The expression may or
 /// may not contain a format specifier.
 /// </summary>
 /// <param name="remoteValue">The remote value associated with the expression.</param>
 /// <param name="displayName">
 /// The display name of the expression. Uses the value's name if not specified.
 /// </param>
 /// <param name="formatSpecifier">Value format specifier.</param>
 /// <returns></returns>
 public IVariableInformation Create(RemoteValue remoteValue, string displayName = null,
                                    FormatSpecifier formatSpecifier             = null)
 {
     return(varInfoFactory.Create(remoteValue, displayName, formatSpecifier));
 }