Esempio n. 1
0
        private IPropertyInfo[] GetChildren(IDebugProperty2 debugProperty, IExpandablePropertyInfo parent)
        {
            var logger = Logger.GetLogger();

            logger.Info("EnumChildren");

            IEnumDebugPropertyInfo2 debugPropertyEnum;

            debugProperty.EnumChildren(
                enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_STANDARD | enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_FULLNAME,
                10,
                dbgGuids.guidFilterLocals,
                enum_DBG_ATTRIB_FLAGS.DBG_ATTRIB_ALL,
                "",
                Configuration.DefaultTimeoutForVSCalls,
                out debugPropertyEnum).ThrowOnFailure();

            uint count;

            debugPropertyEnum.GetCount(out count).ThrowOnFailure();
            DEBUG_PROPERTY_INFO[] debugPropInfos = new DEBUG_PROPERTY_INFO[ITEMS_TO_FETCH];
            uint fetched;

            logger.Info($"Fetch children");

            List <IPropertyInfo> result = new List <IPropertyInfo>();

            do
            {
                // TODO: Performance bottlneck
                debugPropertyEnum.Next(ITEMS_TO_FETCH, debugPropInfos, out fetched).ThrowOnFailure();

                logger.Info("Received next {0} of children", ITEMS_TO_FETCH);
                foreach (var p in debugPropInfos.Take((int)fetched))
                {
                    // this properties are not evaluated
                    var child = _propertyInfoFactory.Create(p, parent);
                    logger.Info("Returning property: '{0}'", child.Name);
                    result.Add(child);
                }
            } while (fetched >= ITEMS_TO_FETCH);

            logger.Info("All children returned");
            return(result.ToArray());
        }
Esempio n. 2
0
 int IDebugProperty3.EnumChildren(enum_DEBUGPROP_INFO_FLAGS dwFields, uint dwRadix, ref Guid guidFilter, enum_DBG_ATTRIB_FLAGS dwAttribFilter, string pszNameFilter, uint dwTimeout, out IEnumDebugPropertyInfo2 ppEnum)
 {
     return(IDebugProperty2.EnumChildren(dwFields, dwRadix, guidFilter, dwAttribFilter, pszNameFilter, dwTimeout, out ppEnum));
 }
Esempio n. 3
0
        private void ReportResult(IDebugProperty2 property)
        {
            var infos = new DEBUG_PROPERTY_INFO[1];
            int hr    = property.GetPropertyInfo(
                enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_ATTRIB |
                enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_NO_NONPUBLIC_MEMBERS |
                enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_TYPE |
                enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_VALUE |
                enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_VALUE_AUTOEXPAND,
                RequestRadix,
                RequestTimeout,
                null,
                0,
                infos);

            if (hr != VSConstants.S_OK)
            {
                return;
            }

            var info = infos[0];

            _output.WriteLine("[{0}, {1}]", info.bstrValue, info.bstrType);

            // If expandable, expand the first level. This matches
            // the Dev12 Immediate Window behavior.
            if (((info.dwFields & enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_ATTRIB) != 0) &&
                (info.dwAttrib & enum_DBG_ATTRIB_FLAGS.DBG_ATTRIB_OBJ_IS_EXPANDABLE) != 0)
            {
                IEnumDebugPropertyInfo2 children;
                var filter = default(Guid);
                property.EnumChildren(
                    enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_ATTRIB |
                    enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_NAME |
                    enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_TYPE |
                    enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_VALUE,
                    RequestRadix,
                    ref filter,
                    enum_DBG_ATTRIB_FLAGS.DBG_ATTRIB_ACCESS_ALL,
                    null,
                    RequestTimeout,
                    out children);
                if (hr != VSConstants.S_OK)
                {
                    return;
                }

                uint n;
                hr = children.GetCount(out n);
                if (hr != VSConstants.S_OK)
                {
                    return;
                }

                n     = Math.Min(n, MaxChildren);
                infos = new DEBUG_PROPERTY_INFO[n];
                hr    = children.Next(n, infos, out n);
                if (hr != VSConstants.S_OK)
                {
                    return;
                }

                for (int i = 0; i < n; i++)
                {
                    info = infos[i];
                    _output.WriteLine("[{0}, {1}, {2}]", info.bstrName, info.bstrValue, info.bstrType);
                }
            }
        }
Esempio n. 4
0
        private void ReportResult(IDebugProperty2 property)
        {
            var infos = new DEBUG_PROPERTY_INFO[1];
            int hr = property.GetPropertyInfo(
                enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_ATTRIB |
                enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_NO_NONPUBLIC_MEMBERS |
                enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_TYPE |
                enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_VALUE |
                enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_VALUE_AUTOEXPAND,
                RequestRadix,
                RequestTimeout,
                null,
                0,
                infos);
            if (hr != VSConstants.S_OK)
            {
                return;
            }

            var info = infos[0];
            _output.WriteLine("[{0}, {1}]", info.bstrValue, info.bstrType);

            // If expandable, expand the first level. This matches
            // the Dev12 Immediate Window behavior.
            if (((info.dwFields & enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_ATTRIB) != 0) &&
                (info.dwAttrib & enum_DBG_ATTRIB_FLAGS.DBG_ATTRIB_OBJ_IS_EXPANDABLE) != 0)
            {
                IEnumDebugPropertyInfo2 children;
                var filter = default(Guid);
                property.EnumChildren(
                    enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_ATTRIB |
                    enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_NAME |
                    enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_TYPE |
                    enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_VALUE,
                    RequestRadix,
                    ref filter,
                    enum_DBG_ATTRIB_FLAGS.DBG_ATTRIB_ACCESS_ALL,
                    null,
                    RequestTimeout,
                    out children);
                if (hr != VSConstants.S_OK)
                {
                    return;
                }

                uint n;
                hr = children.GetCount(out n);
                if (hr != VSConstants.S_OK)
                {
                    return;
                }

                n = Math.Min(n, MaxChildren);
                infos = new DEBUG_PROPERTY_INFO[n];
                hr = children.Next(n, infos, out n);
                if (hr != VSConstants.S_OK)
                {
                    return;
                }

                for (int i = 0; i < n; i++)
                {
                    info = infos[i];
                    _output.WriteLine("[{0}, {1}, {2}]", info.bstrName, info.bstrValue, info.bstrType);
                }
            }
        }