Package flash.tools.debugger

Examples of flash.tools.debugger.Value


      String name = (cli.hasMoreTokens()) ? cli.nextToken() : null;

      StringBuilder sb = new StringBuilder();
      sb.append(name);
      sb.append(" = "); //$NON-NLS-1$
      Value v = ((PlayerSession)session).getValue(id, name);
            cli.m_exprCache.appendVariableValue(sb, v);
      cli.out( sb.toString() );
    }
    catch(NullPointerException npe)
    {
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

    }

    if (e instanceof ExceptionFault)
    {
      ExceptionFault ef = (ExceptionFault) e;
      Value thrownValue = ef.getThrownValue();
      if (thrownValue != null)
      {
        if (!ef.willExceptionBeCaught())
        {
          stop = true;
        }
        else
        {
          stop = false;

          String typeName = thrownValue.getTypeName();
          int at = typeName.indexOf('@');
          if (at != -1)
            typeName = typeName.substring(0, at);

          for (int i=0; i<catchpointCount(); ++i)
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));
        }
      }
    }
    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);
      else
            m_cache.appendVariableValue(sb, val);

    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().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

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.