Ejemplo n.º 1
0
        public int EnumChildren(enum_DEBUGPROP_INFO_FLAGS dwFields, uint dwRadix, ref Guid guidFilter,
                                enum_DBG_ATTRIB_FLAGS dwAttribFilter, string pszNameFilter, uint dwTimeout,
                                out IEnumDebugPropertyInfo2 ppEnum)
        {
            uint thId;

            thread.GetThreadId(out thId);
            var children = engine.DebuggedProcess.EnumChildren(GetVariableReference(), (int)thId, dwTimeout);

            DEBUG_PROPERTY_INFO[] info = new DEBUG_PROPERTY_INFO[children.Length];
            for (int i = 0; i < children.Length; i++)
            {
                var        vi   = children[i];
                ILProperty prop = new ILProperty(engine, thread, vi);
                if (vi.Type == VariableTypes.IndexAccess)
                {
                    prop.Parameters = new VariableReference[] { VariableReference.GetInteger(vi.Offset) }
                }
                ;
                prop.Parent = this;
                info[i]     = prop.GetDebugPropertyInfo(dwFields);
            }
            ppEnum = new AD7PropertyInfoEnum(info);
            return(Constants.S_OK);
        }
Ejemplo n.º 2
0
        public VSCodeVariable[] EnumChildren(int dwTimeout)
        {
            var thread   = frame.Thread;
            var c        = thread.Engine.EnumChildren(GetVariableReference(), thread.ThreadID, frame.Index, (uint)Math.Max(dwTimeout, 5000));
            var children = new VSCodeVariable[c.Length];

            for (int i = 0; i < c.Length; i++)
            {
                var            vi = c[i];
                VSCodeVariable v  = new VSCodeVariable(frame, vi);
                if (vi.Type == VariableTypes.IndexAccess)
                {
                    v.Parameters = new VariableReference[] { VariableReference.GetInteger(vi.Offset) }
                }
                ;
                v.Parent = this;
                frame.RegisterVariable(v);
                children[i] = v;
            }

            return(children);
        }
Ejemplo n.º 3
0
        IProperty ResolveIndexAccessExpression(IStackFrame frame, IndexAccessExpression exp, uint dwTimeout)
        {
            IProperty body = Resolve(frame, exp.Body, dwTimeout);
            IProperty prop = null;

            if (body != null)
            {
                VariableReference reference = body.GetVariableReference();
                if (reference != null)
                {
                    uint threadHash;

                    if (reference.Type < VariableTypes.Error)
                    {
                        var idxExp            = exp.Index;
                        VariableReference idx = null;
                        if (idxExp is NameExpression)
                        {
                            int idxInt;
                            var content = ((NameExpression)idxExp).Content;
                            if (content == "true")
                            {
                                idx = VariableReference.True;
                            }
                            else if (content == "false")
                            {
                                idx = VariableReference.False;
                            }
                            else if (content == "null")
                            {
                                idx = VariableReference.Null;
                            }
                            else if (int.TryParse(content, out idxInt))
                            {
                                idx = VariableReference.GetInteger(idxInt);
                            }
                            else
                            {
                                var info = ResolveNameExpression(frame, (NameExpression)idxExp, dwTimeout);
                                idx = info.GetVariableReference();
                            }
                        }
                        else if (idxExp is StringLiteralExpression)
                        {
                            idx = VariableReference.GetString(((StringLiteralExpression)idxExp).Content);
                        }
                        else
                        {
                            var info = Resolve(frame, idxExp, dwTimeout);
                            idx = info.GetVariableReference();
                        }
                        if (idx != null && idx.Type < VariableTypes.Error)
                        {
                            if (exp.IsRoot)
                            {
                                var info = ResolveIndexAccess(reference, idx, frame.ThreadID, frame.Index, dwTimeout);
                                prop            = CreateProperty(frame, info);
                                prop.Parent     = body;
                                prop.Parameters = new VariableReference[] { idx };
                            }
                            else
                            {
                                var info = VariableInfo.FromObject(null);
                                info.Type       = VariableTypes.IndexAccess;
                                prop            = CreateProperty(frame, info);
                                prop.Parent     = body;
                                prop.Parameters = new VariableReference[] { idx };
                            }
                        }
                    }
                }
            }
            else
            {
                prop = CreateProperty(frame, VariableInfo.NullReferenceExeption);
            }
            return(prop);
        }