Package flash.tools.debugger

Examples of flash.tools.debugger.Value


   * Resolve the object into a variable by various means and
   * using the current context.
   */
  Value resolveToValue(Object o) throws PlayerDebugException
  {
    Value v = null;

    // if o is a variable or a value already, then we're done!
    if (o instanceof Value)
      return (Value)o;
    else if (o instanceof Variable)
View Full Code Here


   * @throws NoSuchVariableException if id is UNKNOWN_ID
   */
  Variable memberNamed(long id, String name) throws NoSuchVariableException, PlayerDebugException
  {
    Variable v = null;
    Value parent = getSession().getValue(id);

    if (parent == null)
      throw new NoSuchVariableException(name);

    /* got a variable now return the member if any */
    v = parent.getMemberNamed(getSession(), name);

    return v;
  }
View Full Code Here

      int depth = ((Integer)m_cache.get(DebugCLI.DISPLAY_FRAME_NUMBER)).intValue();
      baseId -= depth;

      // obtain data about our current state
      Variable contextVar = null;
      Value contextVal = null;
      Value val = null;

      // look for 'name' starting from local scope
      if ( (val = locateParentForNamed(baseId, name, false)) != null)
        ;

      // get the this pointer, then look for 'name' starting from that point
      else if ( ( (contextVar = locateForNamed(baseId, "this", false)) != null ) &&  //$NON-NLS-1$
            ( setName("this") && (val = locateParentForNamed(contextVar.getValue().getId(), name, true)) != null ) ) //$NON-NLS-1$
        ;

      // now try to see if 'name' exists off of _root
      else if ( setName("_root") && (val = locateParentForNamed(Value.ROOT_ID, name, true)) != null ) //$NON-NLS-1$
        ;

      // now try to see if 'name' exists off of _global
      else if ( setName("_global") && (val = locateParentForNamed(Value.GLOBAL_ID, name, true)) != null ) //$NON-NLS-1$
        ;

      // now try off of class level, if such a thing can be found
      else if ( ( (contextVal = locate(Value.GLOBAL_ID, getCurrentPackageName(), false)) != null ) &&
            ( setName("_global."+getCurrentPackageName()) && (val = locateParentForNamed(contextVal.getId(), name, true)) != null ) ) //$NON-NLS-1$
        ;

      // if we found it then stake this as our context!
      if (val != null)
      {
        id = val.getId();
        pushName(name);
        lockName();
      }
    }
   
View Full Code Here

  Value locateParentForNamed(long id, String name, boolean traverseProto) throws PlayerDebugException
  {
    StringBuilder sb = new StringBuilder();

    Variable var = null;
    Value val = null;
    try
    {
      var = memberNamed(id, name);

      // see if we need to traverse the proto chain
View Full Code Here

  // variant of locateParentForNamed, whereby we return the child variable
  Variable locateForNamed(long id, String name, boolean traverseProto) throws PlayerDebugException
  {
    Variable var = null;
    Value v = locateParentForNamed(id, name, traverseProto);
    if (v != null)
    {
      try
      {
        var = memberNamed(v.getId(), name);
      }
      catch(NoSuchVariableException nse)
      {
        v = null;
      }
View Full Code Here

    if (dottedName == null)
      return null;

    // first rip apart the dottedName
    StringTokenizer names = new StringTokenizer(dottedName, "."); //$NON-NLS-1$
    Value val = getSession().getValue(startingId);

    while(names.hasMoreTokens() && val != null)
      val = locateForNamed(val.getId(), names.nextToken(), traverseProto).getValue();

    return val;
  }
View Full Code Here

   * @param o
   *            the value to format.
   */
  public static void appendVariableValue(StringBuilder sb, final Object o)
  {
    Value v;

    if (o instanceof Value) {
      v = (Value) o;
    } else {
      v = new Value() {
        public int getAttributes() {
          return 0;
        }

        public String[] getClassHierarchy(boolean allLevels) {
View Full Code Here

      return;

    tree.put(result, name)// place it

    // first iterate over our members looking for 'member'
    Value proto = result;
    boolean done = false;
    while(!done && proto != null)
    {
      Variable[] members = proto.getMembers(m_session);
      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++)
      {
View Full Code Here

      VariableFacade result = (VariableFacade)(evalExpression(expr).value);

      // extract the 2 pieces and get the raw variable.
      int varId = result.getContext(); // TODO fix this???  -mike
      String memberName = result.getName();
      Value v = m_session.getValue(varId);

      // attempt to set.
      Watch w = m_session.setWatch(v, memberName, flags);
      if (w == null)
      {
View Full Code Here

        {
          err("Illegal argument");
          return;
        }

        Value type = null;
        if (typeToCatch.equals("*")) //$NON-NLS-1$
        {
          typeToCatch = null;
        }
        else
        {
          type = getSession().getGlobal(typeToCatch);
          if (type == null)
          {
            err("Type not found.");
            return;
          }

          String typeName = type.getTypeName();
          int at = typeName.indexOf('@');
          if (at != -1)
            typeName = typeName.substring(0, at);
          if (!typeName.endsWith("$"))
          {
View Full Code Here

TOP

Related Classes of flash.tools.debugger.Value

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.