Exemplo n.º 1
0
        private string event_TypeResolverHandler(string identifier, SourceLocation location)
        {
            if (_alreadyResolving.Contains(identifier))
            {
                return(null);
            }

            if (identifier == "__EXCEPTION_OBJECT__")
            {
                return(null);
            }

            foreach (var loc in ActiveFrame.GetAllLocals())
            {
                if (loc.Name == identifier)
                {
                    return(null);
                }
            }

            //TODO: HACK
            _alreadyResolving.Add(identifier);
            ObjectValue resolvedValue = ActiveFrame.GetExpressionValue(identifier, EvaluationOptions.DefaultOptions);

            _alreadyResolving.Remove(identifier);

            if (resolvedValue != null && !resolvedValue.IsUnknown && !resolvedValue.IsError && !(resolvedValue.HasFlag(ObjectValueFlags.Namespace) && resolvedValue.HasFlag(ObjectValueFlags.Object)))
            {
                return(null);
            }

            return(identifier);
        }
Exemplo n.º 2
0
        public DEBUG_PROPERTY_INFO CreatePropertyInfo(uint dwFields)
        {
            DEBUG_PROPERTY_INFO info = new DEBUG_PROPERTY_INFO();

            if ((dwFields & (uint)enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_FULLNAME) != 0)
            {
                info.bstrFullName = _expression;
                info.dwFields    |= (uint)enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_FULLNAME;
            }

            if ((dwFields & (uint)enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_NAME) != 0)
            {
                info.bstrName  = _value.Name;
                info.dwFields |= (uint)enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_NAME;
            }

            if ((dwFields & (uint)enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_TYPE) != 0)
            {
                info.bstrType  = _value.TypeName;
                info.dwFields |= (uint)enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_TYPE;
            }

            if ((dwFields & (uint)enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_VALUE) != 0)
            {
                if (_value.HasFlag(ObjectValueFlags.Namespace) && _value.HasFlag(ObjectValueFlags.Object))
                {
                    info.bstrValue = "Unavailable";
                }
                else if (_value.IsError)
                {
                    info.bstrValue = "Evaluation error; " + _value.DisplayValue;
                }
                else if (_value.IsUnknown)
                {
                    info.bstrValue = "Unknown value";
                }
                else
                {
                    info.bstrValue = _value.DisplayValue;
                }
                info.dwFields |= (uint)enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_VALUE;
            }

            if ((dwFields & (uint)enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_ATTRIB) != 0)
            {
                info.dwAttrib |= (uint)0x0000000000000010; //enum_DBG_ATTRIB_FLAGS.DBG_ATTRIB_VALUE_READONLY

                if (_value.HasChildren)
                {
                    info.dwAttrib |= (uint)0x0000000000000001; //enum_DBG_ATTRIB_FLAGS.DBG_ATTRIB_OBJ_IS_EXPANDABLE
                }
            }

            if (((dwFields & (uint)enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_PROP) != 0) || _value.HasChildren)
            {
                info.pProperty = this;
                info.dwFields |= (uint)enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_PROP;
            }

            return(info);
        }