Package flash.tools.debugger

Examples of flash.tools.debugger.Variable


            validFrame = false;
        }
        else
    {
      Variable[] var = ctx.getArguments(m_session);
      Variable dis = ctx.getThis(m_session);
      boolean displayArgs = (func != null) || (var != null);

      sb.append('#');
      FieldFormat.formatLong(sb, i, 3);
      sb.append(' ');

      if (showThis && dis != null)
      {
                m_exprCache.appendVariable(sb, dis);
        sb.append("."); //$NON-NLS-1$
      }

      if (func != null)
        sb.append(func);

      if (displayArgs)
      {
        sb.append('(');
        for (int j=0; j<var.length; j++)
        {
          Variable v = var[j];
          sb.append(v.getName());
          sb.append('=');
                    m_exprCache.appendVariableValue(sb, v.getValue());
          if ((j+1)<var.length)
            sb.append(", "); //$NON-NLS-1$
        }
        sb.append(")"); //$NON-NLS-1$
        sb.append(getLocalizationManager().getLocalizedTextString("atFilename")); //$NON-NLS-1$
View Full Code Here


    try
    {
      Variable[] vars = m_session.getVariableList();
      for(int i=0; i<vars.length; i++)
      {
        Variable v = vars[i];

        // all non-local and non-arg variables
        if ( !v.isAttributeSet(VariableAttribute.IS_LOCAL) &&
           !v.isAttributeSet(VariableAttribute.IS_ARGUMENT) )
        {
          m_exprCache.appendVariable(sb, vars[i]);
          sb.append(m_newline);
        }
      }
View Full Code Here

      Frame ctx = ar[num];
      Variable[] vars = ctx.getLocals(m_session);

      for(int i=0; i<vars.length; i++)
      {
        Variable v = vars[i];

        // see if variable is local
        if ( v.isAttributeSet(VariableAttribute.IS_LOCAL) )
        {
                    m_exprCache.appendVariable(sb, v);
          sb.append(m_newline);
        }
      }
View Full Code Here

      Frame ctx = ar[num];
      Variable[] scopes = ctx.getScopeChain(m_session);

      for(int i=0; i<scopes.length; i++)
      {
        Variable scope = scopes[i];
                m_exprCache.appendVariable(sb, scope);
        sb.append(m_newline);
      }
    }
    catch(NullPointerException npe)
View Full Code Here

      proto = null;

      // see if we find one called 'member'
      for(int i=0; i<members.length; i++)
      {
        Variable m = members[i];
        String memName = m.getName();
        if (memName.equals(member) && !tree.containsKey(m))
        {
          e.add(name);
          e.add(result);
          e.add(m);
          tree.put(m, name+"."+memName); //$NON-NLS-1$
          done = true;
        }
        else if (memName.equals("__proto__")) //$NON-NLS-1$
          proto = members[i].getValue();
      }
    }

    // now traverse other mcs recursively
    done = false;
    proto = result;
    while(!done && proto != null)
    {
      Variable[] members = proto.getMembers(m_session);
      proto = null;

      // see if we find an mc
      for(int i=0; i<members.length; i++)
      {
        Variable m = members[i];
        String memName = m.getName();

        // if our type is NOT object or movieclip then we are done
        if (m.getValue().getType() != VariableType.OBJECT && m.getValue().getType() != VariableType.MOVIECLIP)
          ;
        else if (m.getValue().getId() != Value.UNKNOWN_ID)
          dumpTree(tree, e, name, m.getValue(), member);
        else if (memName.equals("__proto__")) //$NON-NLS-1$
        {
          proto = m.getValue();
//          name = name + ".__proto__";
        }
      }
    }
  }
View Full Code Here

    // walk the list
    Iterator<Object> i = e.iterator();
    while(i.hasNext())
    {
      String name = (String) i.next();
      Variable key = (Variable) i.next();
      Variable val = (Variable)i.next();

//      sb.append(key);
//      sb.append(".");
//      sb.append(val.getName());
      if (fullName)
        sb.append(name);
            m_exprCache.appendVariableValue(sb, key.getValue(), key.getName());
      sb.append("."); //$NON-NLS-1$
      sb.append(memName);
      sb.append(" = "); //$NON-NLS-1$
            m_exprCache.appendVariableValue(sb, val.getValue(), val.getName());
      sb.append(m_newline);
    }
    return sb;
  }
View Full Code Here

      /* dump the output */
      StringBuilder sb = new StringBuilder();

      if (result instanceof Variable)
      {
        Variable v = (Variable) result;

        // if it has a path then display it!
        if (v.isAttributeSet(VariableAttribute.IS_LOCAL))
          s = getLocalizationManager().getLocalizedTextString("localVariable"); //$NON-NLS-1$
        else if (v.isAttributeSet(VariableAttribute.IS_ARGUMENT))
          s = getLocalizationManager().getLocalizedTextString("functionArgumentVariable"); //$NON-NLS-1$
        else if ( (v instanceof VariableFacade) && (s = ((VariableFacade)v).getPath()) != null && s.length() > 0 )
          ;
        else
          s = "_global"; //$NON-NLS-1$
View Full Code Here

      }
      else
      {
        boolean wasCreateIfMissing = m_createIfMissing;
        createPseudoVariables(true);
        Variable var = null;
        try {
          var = resolveToVariable(o);
        } finally {
          createPseudoVariables(wasCreateIfMissing);
        }

        if (var == null)
          throw new NoSuchVariableException((var == null) ? m_current : var.getName());

        // set the value, for the case of a variable that does not exist it will not have a type
        // so we try to glean one from v.
        FaultEvent faultEvent = var.setValue(getSession(), v.getType(), v.getValueAsString());
        if (faultEvent != null)
          throw new PlayerFaultException(faultEvent);
      }
    }
    catch(PlayerDebugException pde)
View Full Code Here

  }

  /* returns a string consisting of formatted member names and values */
  public Object lookupMembers(Object o) throws NoSuchVariableException
  {
    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(getSession());
    }
    catch(NullPointerException npe)
View Full Code Here

   * using the current context.
   * @return variable, or <code>null</code>
   */
  Variable resolveToVariable(Object o) throws PlayerDebugException
  {
    Variable v = null;

    // if o is a variable already, then we're done!
    if (o instanceof Variable)
      return (Variable)o;

View Full Code Here

TOP

Related Classes of flash.tools.debugger.Variable

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.