Package flash.tools.debugger

Examples of flash.tools.debugger.Variable


   * name.
   * @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);

View Full Code Here


      long baseId = Value.BASE_ID;
      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$
        ;
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
      while (var == null && traverseProto)
      {
        // first attempt to get __proto__, then resolve name
        Variable proto = memberNamed(id, "__proto__"); //$NON-NLS-1$
         sb.append("__proto__"); //$NON-NLS-1$
        if (proto == null)
          traverseProto = false;
        else
        {
          id = proto.getValue().getId();
          var = memberNamed(id, name);
          if (var == null)
            sb.append('.');
        }
      }
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
      {
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

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

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

View Full Code Here

      long baseId = Value.BASE_ID;
      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$
        ;
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
      while (var == null && traverseProto)
      {
        // first attempt to get __proto__, then resolve name
        Variable proto = memberNamed(id, "__proto__"); //$NON-NLS-1$
         sb.append("__proto__"); //$NON-NLS-1$
        if (proto == null)
          traverseProto = false;
        else
        {
          id = proto.getValue().getId();
          var = memberNamed(id, name);
          if (var == null)
            sb.append('.');
        }
      }
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.