internal String m_newline = Environment.NewLine; //$NON-NLS-1$
		
		// used when evaluating an expression 
		public ExpressionContext(ExpressionCache cache)
		{
			m_cache = cache;
			m_current = null;
			m_createIfMissing = false;
			m_namedPath = System.Collections.ArrayList.Synchronized(new System.Collections.ArrayList(10));
			m_nameLocked = false;
		}
Beispiel #2
0
        internal String m_newline = Environment.NewLine;         //$NON-NLS-1$

        // used when evaluating an expression
        public ExpressionContext(ExpressionCache cache)
        {
            m_cache           = cache;
            m_current         = null;
            m_createIfMissing = false;
            m_namedPath       = System.Collections.ArrayList.Synchronized(new System.Collections.ArrayList(10));
            m_nameLocked      = false;
        }
        // Raw direct call to Player
        public static void  doShowVariable(DebugCLI cli)
        {
            cli.waitTilHalted();
            try
            {
                // an integer followed by a variable name
                Session session = cli.Session;
                int     id      = cli.nextIntToken();
                String  name    = (cli.hasMoreTokens())?cli.nextToken():null;

                System.Text.StringBuilder sb = new System.Text.StringBuilder();
                sb.Append(name);
                sb.Append(" = ");                 //$NON-NLS-1$
                Value v = ((PlayerSession)session).getValue(id, name);
                ExpressionCache.appendVariableValue(sb, v);
                cli.output(sb.ToString());
            }
            catch (NullReferenceException)
            {
                cli.err(LocalizationManager.getLocalizedTextString("key26"));                 //$NON-NLS-1$
            }
        }
Beispiel #4
0
        /* returns a string consisting of formatted member names and values */
        public virtual Object lookupMembers(Object o)
        {
            Variable var = null;
            Value    val = null;

            Variable[] mems = null;
            try
            {
                var = resolveToVariable(o);
                if (var != null)
                {
                    val = var.getValue();
                }
                else
                {
                    val = resolveToValue(o);
                }
                mems = val.getMembers(Session);
            }
            catch (NullReferenceException)
            {
                throw new NoSuchVariableException(o);
            }
            catch (PlayerDebugException)
            {
                throw new NoSuchVariableException(o);                 // not quite right...
            }

            System.Text.StringBuilder sb = new System.Text.StringBuilder();

            if (var != null)
            {
                ExpressionCache.appendVariable(sb, var);
            }
            else
            {
                ExpressionCache.appendVariableValue(sb, val);
            }

            bool attrs = m_cache.propertyEnabled(DebugCLI.DISPLAY_ATTRIBUTES);

            if (attrs && var != null)
            {
                ExpressionCache.appendVariableAttributes(sb, var);
            }

            // [mmorearty] experimenting with hierarchical display of members
            String[] classHierarchy = val.getClassHierarchy(false);
            if (classHierarchy != null && Session.getPreference(SessionManager.PREF_HIERARCHICAL_VARIABLES) != 0)
            {
                for (int c = 0; c < classHierarchy.Length; ++c)
                {
                    String classname = classHierarchy[c];
                    sb.Append(m_newline + "(Members of " + classname + ")");                     //$NON-NLS-1$ //$NON-NLS-2$
                    for (int i = 0; i < mems.Length; ++i)
                    {
                        if (classname.Equals(mems[i].getDefiningClass()))
                        {
                            sb.Append(m_newline + " ");                             //$NON-NLS-1$
                            ExpressionCache.appendVariable(sb, mems[i]);
                            if (attrs)
                            {
                                ExpressionCache.appendVariableAttributes(sb, mems[i]);
                            }
                        }
                    }
                }
            }
            else
            {
                for (int i = 0; i < mems.Length; i++)
                {
                    sb.Append(m_newline + " ");                     //$NON-NLS-1$
                    ExpressionCache.appendVariable(sb, mems[i]);
                    if (attrs)
                    {
                        ExpressionCache.appendVariableAttributes(sb, mems[i]);
                    }
                }
            }

            return(sb.ToString());
        }
Beispiel #5
0
		public DebugCLI()
		{
			m_fullnameOption = false;
			m_exprCache = new ExpressionCache(this);
			m_faultTable = new FaultActions();
			m_breakpoints = System.Collections.ArrayList.Synchronized(new System.Collections.ArrayList(10));
			m_watchpoints = System.Collections.ArrayList.Synchronized(new System.Collections.ArrayList(10));
			m_displays = new System.Collections.ArrayList();
			m_keyboardInput = System.Collections.ArrayList.Synchronized(new System.Collections.ArrayList(10));
			m_mruURI = null;
			m_sourceDirectories = new System.Collections.ArrayList();
			
			initProperties();
			populateFaultTable();
		}