Package com.sun.jdi

Examples of com.sun.jdi.Value


 

  public static Value findValueInFrame(ThreadReference threadRef, String name,
      ObjectReference thisObj)  {
   
    Value value = null;
    try {
      SuspendThreadStack threadStack = SuspendThreadStack.getInstance();
      StackFrame stackFrame = threadRef.frame(threadStack.getCurFrame());
     
      LocalVariable localVariable;
View Full Code Here


  }
 
  public static Value invoke(Object invoker, String methodName, List args) {
    SuspendThreadStack threadStack = SuspendThreadStack.getInstance();
    ThreadReference threadRef = threadStack.getCurThreadRef();
    Value value = null;
    Method matchedMethod = null;
    List<Method> methods = null;
    ClassType refType = null;
    ObjectReference obj  = null;
    if (invoker instanceof ClassType) {
View Full Code Here

    }
    Iterator typeIter = argTypes.iterator();
    Iterator valIter = arguments.iterator();
    while (typeIter.hasNext()) {
      Type argType = (Type) typeIter.next();
      Value value = (Value) valIter.next();
      if (value == null) {
        if (isPrimitiveType(argType.name()))
          return false;
      }
      if (!value.type().equals(argType)) {
        if (isAssignableTo(value.type(), argType)) {
          return true;
        } else {
          return false;
        }
      }
View Full Code Here

      }
      sb.deleteCharAt(sb.length() - 1);
      sb.append("]");
      return sb.toString();
    } else if (var instanceof ObjectReference) {
      Value strValue = invoke((ObjectReference) var, "toString",
          new ArrayList());
      return strValue.toString();
    } else if (var instanceof String) {
      return "\"" + (String)var + "\"";
     
    } else {
      return var.toString();
View Full Code Here

   
    for (Expression exp :exps) {
      count ++;
      sb.append(padStr(maxLen,exp.getOriExp())).append(":");
      try {
        Value value = getJdiValue(exp);
        sb.append(getPrettyPrintStr(value)).append("\n");
      } catch (ExpressionEvalException e) {
        sb.append("exception in calc the value");
      }
    }
View Full Code Here

        LocalVariable var = (LocalVariable) method.variables().get( 0 );//frame

        ClassType frameType = (ClassType) var.type();

        StackFrame frame = getUnderlyingStackFrame();
        Value value = frame.getValue( var );
        //getThread().getTopStackFrame().get

        //IValue value = jdivar.getValue();
        ObjectReferenceImpl o = (ObjectReferenceImpl) value;

        //if ( value instanceof JDINullValue ) {
        // return null;
        // }

        //ObjectReference o = (ObjectReference) ((JDIObjectValue) value).getUnderlyingObject();
        if ( o == null ) {
            return null;
        }

        Field field = frameType.fieldByName( methodName );
        Value val = o.getValue( field );
        return val;
    }
View Full Code Here

      }
    }
   
    void classJarsDebug(ReferenceType rt, ThreadReference thr, ClassLoaderReference clr, String classLoaderClassName, String iHashCode) {
      try {
      Value vURLs = null;
      String pathFound = null;
      if(classloadersWithNoGetURLsMethod.contains(classLoaderClassName)) { return; }
      try {
        vURLs = simpleInvokeVMMethod(thr, clr, "getURLs");
      }
View Full Code Here

      StringReference vToString = (StringReference) simpleInvokeVMMethod(thr, clr, "toString");
      String clrToString = vToString.value();
     
      classLoaderNames.put(iHashCode, clrToString);
     
      Value vParent = simpleInvokeVMMethod(thr, clr, "getParent");
      ObjectReference oParent = (ObjectReference) vParent;
     
      if(oParent!=null) {
        StringReference vParentToString = (StringReference) simpleInvokeVMMethod(thr, oParent, "toString");
        String parentToString = vParentToString.value();
View Full Code Here

  void exceptionEventDebug(ExceptionEvent exc) {
    try {
      ReferenceType rt = exc.exception().referenceType();
      Field field = rt.fieldByName("detailMessage");
      //detailMessage
      Value v = exc.exception().getValue(field);
      if(exc.catchLocation()!=null) {
        logException.debug("CaughtEx: [" + exc.location() + " | catchLoc: " + exc.catchLocation() + "] "+exc.exception().referenceType().name()+": "+v.toString());
      }
      else {
        logException.debug("UncaughtEx: [" + exc.location() + "] "+exc.exception().referenceType().name()+": "+v.toString());
      }
    }
    catch(RuntimeException e) {
      log.warn("ExceptionEvent: runtime-exception: "+e);
    }
View Full Code Here

        LocalVariable var = (LocalVariable) method.variables().get( 0 );//frame

        ClassType frameType = (ClassType) var.type();

        StackFrame frame = getUnderlyingStackFrame();
        Value value = frame.getValue( var );
        //getThread().getTopStackFrame().get

        //IValue value = jdivar.getValue();
        ObjectReferenceImpl o = (ObjectReferenceImpl) value;

        //if ( value instanceof JDINullValue ) {
        // return null;
        // }

        //ObjectReference o = (ObjectReference) ((JDIObjectValue) value).getUnderlyingObject();
        if ( o == null ) {
            return null;
        }

        Field field = frameType.fieldByName( methodName );
        Value val = o.getValue( field );
        return val;
    }
View Full Code Here

TOP

Related Classes of com.sun.jdi.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.