Package com.sun.jdi

Examples of com.sun.jdi.ArrayReference


                                                                   frameLocal.getValue() );

                JDIObjectValue vvv = (JDIObjectValue) knownVars;

                if ( vvv != null && ((ArrayReference) vvv.getUnderlyingObject()).length() > 0 ) {
                    ArrayReference arr = (ArrayReference) vvv.getUnderlyingObject();

                    Iterator<Value> varIter = arr.getValues().iterator();

                    while ( varIter.hasNext() ) {
                        final String varName = ((StringReference) varIter.next()).value();

                        IJavaValue val = (IJavaValue) DebugUtil.getValueByExpression( "return getFactory().getVariableResolver(\"" + varName + "\").getValue();",
View Full Code Here


                                                                   frameLocal.getValue() );

                JDIObjectValue vvv = (JDIObjectValue) knownVars;

                if ( vvv != null && ((ArrayReference) vvv.getUnderlyingObject()).length() > 0 ) {
                    ArrayReference arr = (ArrayReference) vvv.getUnderlyingObject();

                    Iterator varIter = arr.getValues().iterator();

                    while ( varIter.hasNext() ) {
                        final String varName = ((StringReference) varIter.next()).value();

                        IJavaValue val = (IJavaValue) DebugUtil.getValueByExpression( "return getFactory().getVariableResolver(\"" + varName + "\").getValue();",
View Full Code Here

 
  private static Value evalJdiArray(CommonTree node) {
    CommonTree arrayNode = (CommonTree)node.getChild(0);
    CommonTree indexExpNode = (CommonTree)node.getChild(1);
   
    ArrayReference array = (ArrayReference)evalTreeNode(arrayNode);
    Object arrayIdxValue = evalTreeNode((CommonTree)indexExpNode.getChild(0));
    if (arrayIdxValue instanceof IntegerValue ) {
      int idx = ((IntegerValue)arrayIdxValue).value();
      return  array.getValue(idx);
    } else if (arrayIdxValue instanceof Integer) {
      int idx = ((Integer)arrayIdxValue).intValue();
      return  array.getValue(idx);
    else {
      throw new ExpressionEvalException("eval expression error, array index is not int type.");
    }
  }
View Full Code Here

  public static String getPrettyPrintStr(Object var) {
    if (var == null)
      return "null";
    if (var instanceof ArrayReference) {
      StringBuilder sb = new StringBuilder("[");
      ArrayReference arrayObj = (ArrayReference) var;
      if (arrayObj.length() == 0)
        return "[]";
      List<Value> values = arrayObj.getValues();
      for (Value value : values) {
        sb.append(getPrettyPrintStr(value)).append(",");
      }
      sb.deleteCharAt(sb.length() - 1);
      sb.append("]");
View Full Code Here

      basicExpValue = invoke((ObjectReference) thisObj, expName, arguments);
    }
     
    if (exp.isArrayExp()) {
      if (basicExpValue instanceof ArrayReference) {
        ArrayReference array = (ArrayReference)basicExpValue;
        Value arrayIdxValue = eval(threadRef, exp.getArrayIdxExp(), thisObj,false);
        if (arrayIdxValue instanceof IntegerValue ) {
          int idx = ((IntegerValue)arrayIdxValue).value();
          basicExpValue = array.getValue(idx);
        else {
          throw new ExpressionEvalException("eval expression error, array index is not int type.");
        }
      }
    }
View Full Code Here

  public static String getPrettyPrintStr(Value var) {
    if (var == null)
      return "null";
    if (var instanceof ArrayReference) {
      StringBuilder sb = new StringBuilder("[");
      ArrayReference arrayObj = (ArrayReference) var;
      if (arrayObj.length() == 0)
        return "[]";
      List<Value> values = arrayObj.getValues();
      for (Value value : values) {
        sb.append(getPrettyPrintStr(value)).append(",");
      }
      sb.deleteCharAt(sb.length() - 1);
      sb.append("]");
View Full Code Here

                                                                   frameLocal.getValue() );

                JDIObjectValue vvv = (JDIObjectValue) knownVars;

                if ( vvv != null && ((ArrayReference) vvv.getUnderlyingObject()).length() > 0 ) {
                    ArrayReference arr = (ArrayReference) vvv.getUnderlyingObject();

                    Iterator varIter = arr.getValues().iterator();

                    while ( varIter.hasNext() ) {
                        final String varName = ((StringReference) varIter.next()).value();

                        IJavaValue val = (IJavaValue) DebugUtil.getValueByExpression( "return getFactory().getVariableResolver(\"" + varName + "\").getValue();",
View Full Code Here

        logClazz.warn(nsme.getMessage());
        classloadersWithNoGetURLsMethod.add(classLoaderClassName);
      }
      if(vURLs==null) { return; }
      //logClazz.debug("   CL-URL:"+vURLs.toString()+"/"+vURLs.type());
      ArrayReference arURLs = (ArrayReference) vURLs;
      List<Value> values = arURLs.getValues();
     
      //XXX: get all StringReferences first, then find() in new thread (so method returns and eventSet may be resumed)
      for(Value vURL: values) {
        ObjectReference or = (ObjectReference) vURL;
        //logClazz.debug("   u:"+vURL.toString()+"/"+vURL.type());
View Full Code Here

                                                                   frameLocal.getValue() );

                JDIObjectValue vvv = (JDIObjectValue) knownVars;

                if ( vvv != null && ((ArrayReference) vvv.getUnderlyingObject()).length() > 0 ) {
                    ArrayReference arr = (ArrayReference) vvv.getUnderlyingObject();

                    Iterator varIter = arr.getValues().iterator();

                    while ( varIter.hasNext() ) {
                        final String varName = ((StringReference) varIter.next()).value();

                        IJavaValue val = (IJavaValue) DebugUtil.getValueByExpression( "return getFactory().getVariableResolver(\"" + varName + "\").getValue();",
View Full Code Here

    this._URLClassLoader = loadClass("java.net.URLClassLoader");
    final ClassType _Byte = loadClass("java.lang.Byte");
    this._byte = (ClassType) ((ClassObjectReference) _Byte.getValue(_Byte.fieldByName("TYPE"))).reflectedType();

    // get an empty URL[] and use it to create an URLClassLoader
    final ArrayReference urls = buildArray(loadClass("java.net.URL"), 0);
    myClassLoader = newInstance(_URLClassLoader, "([Ljava/net/URL;)V", new Value[] { urls });
  }
View Full Code Here

TOP

Related Classes of com.sun.jdi.ArrayReference

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.