Ejemplo n.º 1
0
        ILProperty ResolveMemberAccessExpression(MemberAcessExpression exp, uint dwTimeout)
        {
            ILProperty body   = Resolve(exp.Body, dwTimeout);
            string     member = exp.Member;
            ILProperty prop;

            if (body != null)
            {
                if (!body.Children.TryGetValue(member, out prop))
                {
                    VariableReference reference = body.GetVariableReference();
                    if (reference != null)
                    {
                        uint threadHash;
                        frame.Thread.GetThreadId(out threadHash);

                        if (reference.Type < VariableTypes.Error)
                        {
                            if (exp.IsRoot)
                            {
                                var info = frame.Engine.DebuggedProcess.ResolveVariable(reference, member, (int)threadHash, dwTimeout);
                                prop                  = new AD7.ILProperty(frame.Engine, frame.Thread, info);
                                prop.Parent           = body;
                                body.Children[member] = prop;
                            }
                            else
                            {
                                var info = VariableInfo.FromObject(null);
                                info.Type   = VariableTypes.FieldReference;
                                info.Name   = member;
                                prop        = new ILProperty(frame.Engine, frame.Thread, info);
                                prop.Parent = body;
                            }
                        }
                        else if (reference.Type == VariableTypes.NotFound)
                        {
                            if (exp.IsRoot)
                            {
                                var info = frame.Engine.DebuggedProcess.ResolveVariable(null, reference.Name + "." + member, (int)threadHash, dwTimeout);
                                prop = new AD7.ILProperty(frame.Engine, frame.Thread, info);
                            }
                            else
                            {
                                var info = VariableInfo.FromObject(null);
                                info.Type = VariableTypes.FieldReference;
                                info.Name = reference.Name + "." + member;
                                prop      = new ILProperty(frame.Engine, frame.Thread, info);
                            }
                        }
                    }
                }
            }
            else
            {
                prop = new ILProperty(frame.Engine, frame.Thread, VariableInfo.NullReferenceExeption);
            }
            return(prop);
        }
Ejemplo n.º 2
0
        IProperty ResolveMemberAccessExpression(IStackFrame frame, MemberAcessExpression exp, uint dwTimeout)
        {
            IProperty body   = Resolve(frame, exp.Body, dwTimeout);
            string    member = exp.Member;
            IProperty prop   = null;

            if (body != null)
            {
                VariableReference reference = body.GetVariableReference();
                if (reference != null)
                {
                    if (reference.Type < VariableTypes.Error)
                    {
                        if (exp.IsRoot)
                        {
                            var info = ResolveVariable(reference, member, frame.ThreadID, frame.Index, dwTimeout);
                            prop        = CreateProperty(frame, info);
                            prop.Parent = body;
                        }
                        else
                        {
                            var info = VariableInfo.FromObject(null);
                            info.Type   = VariableTypes.FieldReference;
                            info.Name   = member;
                            prop        = CreateProperty(frame, info);
                            prop.Parent = body;
                        }
                    }
                    else if (reference.Type == VariableTypes.NotFound)
                    {
                        if (exp.IsRoot)
                        {
                            var info = ResolveVariable(null, reference.Name + "." + member, frame.ThreadID, frame.Index, dwTimeout);
                            prop = CreateProperty(frame, info);
                        }
                        else
                        {
                            var info = VariableInfo.FromObject(null);
                            info.Type = VariableTypes.FieldReference;
                            info.Name = reference.Name + "." + member;
                            prop      = CreateProperty(frame, info);
                        }
                    }
                }
            }
            else
            {
                prop = CreateProperty(frame, VariableInfo.NullReferenceExeption);
            }
            return(prop);
        }