Exemplo n.º 1
0
        public Dictionary <string, EnvDTE.Expression> GetLocalVariables()
        {
            Dictionary <string, EnvDTE.Expression> debugVariables = new Dictionary <string, Expression>(StringComparer.CurrentCultureIgnoreCase);
            DTE dte = m_textSelection.DTE;

            if (dte.Debugger.CurrentStackFrame != null)
            {
                EnvDTE.Expressions locals = dte.Debugger.CurrentStackFrame.Locals;
                foreach (EnvDTE.Expression local in locals)
                {
                    string name = local.Name;
                    debugVariables[name] = local;
                }
            }
            return(debugVariables);
        }
Exemplo n.º 2
0
        public static List <string> GetMembersName(string expression)
        {
            string key = nameof(GetMembersName) + expression;

            if (DebuggerHelper.KnownValues.ContainsKey(key))
            {
                return((List <string>)DebuggerHelper.KnownValues[key]);
            }
            DebuggerHelper.KnownValues.Add(key, (object)null);
            EnvDTE.Expressions dataMembers = DebuggerHelper.Debugger.GetExpression(expression, false, -1).DataMembers;
            List <string>      stringList  = new List <string>();

            foreach (Expression expression1 in dataMembers)
            {
                stringList.Add(expression1[]);
            }
            DebuggerHelper.KnownValues[key] = (object)stringList;
            return(stringList);
        }
Exemplo n.º 3
0
        public EnvDTE.Expression GetDebugVariable(string varName)
        {
            DTE dte = this.DTE;

            debugger   = dte.Debugger;
            stackFrame = debugger.CurrentStackFrame;
            if (stackFrame != null)
            {
                locals = stackFrame.Locals;
                foreach (EnvDTE.Expression local in locals)
                {
                    string name = local.Name;
                    if (name == varName)
                    {
                        return(local);
                    }
                }
            }
            return(null);
        }