Package flash.tools.debugger

Examples of flash.tools.debugger.Value


  {
    String key = value.getTypeName() + " " + op + " " + type + " " + String.valueOf(isolateId); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
    Boolean retval = m_evalIsAndInstanceofCache.get(key);
    if (retval == null)
    {
      Value typeval = getGlobalWorker(type, isolateId);
      if (typeval == null)
        retval = Boolean.FALSE;
      else
        retval = new Boolean(ECMA.toBoolean(evalBinaryOp(op, value, typeval, isolateId)));
      m_evalIsAndInstanceofCache.put(key, retval);
View Full Code Here


    if (!result)
      throw new NoResponseException(timeout);

    DVariable lastBinaryOp = m_manager.lastBinaryOp(isolateId);
    Value v;
    if (lastBinaryOp != null)
      v = lastBinaryOp.getValue();
    else
      v = DValue.forPrimitive(Value.UNDEFINED, isolateId);

    if (v.isAttributeSet(ValueAttribute.IS_EXCEPTION))
      throw new PlayerFaultException(new ExceptionFault(v.getValueAsString(), false, v, isolateId));

    return v;
  }
View Full Code Here

      }

      // if the attempt to get the variable's value threw an exception inside the
      // player (most likely because the variable is actually a getter, and the
      // getter threw something), then throw something here
      Value resultValue = null;

      if (result instanceof Variable)
      {
        if (result instanceof VariableFacade && ((VariableFacade)result).getVariable() == null)
          resultValue = null;
        else
          resultValue = ((Variable)result).getValue();
      }
      else if (result instanceof Value)
      {
        resultValue = (Value) result;
      }

      if (resultValue != null)
      {
        if (resultValue.isAttributeSet(ValueAttribute.IS_EXCEPTION))
        {
          String value = resultValue.getValueAsString();
          throw new PlayerFaultException(new ExceptionFault(value, false, resultValue, resultValue.getIsolateId()));
        }
      }
    }
    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)
    {
      throw new NoSuchVariableException(o);
    }
    catch(PlayerDebugException pde)
    {
      throw new NoSuchVariableException(o); // not quite right...
    }

      StringBuilder sb = new StringBuilder();

      if (var != null)
            m_cache.appendVariable(sb, var, m_isolateId);
      else
            m_cache.appendVariableValue(sb, val, m_isolateId);

    boolean 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 && getSession().getPreference(SessionManager.PREF_HIERARCHICAL_VARIABLES) != 0)
    {
      for (int c=0; c<classHierarchy.length; ++c)
      {
        String classname = classHierarchy[c];
View Full Code Here

   * 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().getWorkerSession(m_isolateId).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().getWorkerSession(m_isolateId).getValue(startingId);

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

    return val;
  }
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.