Package com.sun.jdi

Examples of com.sun.jdi.ObjectReference.referenceType()


      } else {
        ObjectReference thisObj = stackFrame.thisObject();
        if (thisObj == null) {
          return "can't find field or variable with name '"+name+"'";
        }
        ReferenceType refType = thisObj.referenceType();
        Field field = refType.fieldByName(name);
        thisObj.setValue(field, value);
      }
    } catch (Throwable e) {
      return e.getMessage();
View Full Code Here


    SuspendThreadStack threadStack = SuspendThreadStack.getInstance();
    StringBuilder sb = new StringBuilder();
    try {
      StackFrame stackFrame = threadRef.frame(threadStack.getCurFrame());
      ObjectReference thisObj = stackFrame.thisObject();
      Map<Field, Value> values = thisObj.getValues(thisObj.referenceType().visibleFields());
      List<String> fieldNames = new ArrayList<String>();
      for (Field field : values.keySet()) {
        fieldNames.add(field.name());
      }
      int maxLen = getMaxLength(fieldNames)+2;
View Full Code Here

    if (value instanceof ObjectReference) {
      sb.append(exp).append(" = ");
      sb.append(value.type().name()).append("\n");
     
      ObjectReference objRef = (ObjectReference) value;
      Map<Field, Value> values = objRef.getValues(objRef.referenceType().visibleFields());
      List<String> fieldNames = new ArrayList<String>();
      for (Field field : values.keySet()) {
        if (field.isStatic()) continue;
        fieldNames.add(field.name());
      }
View Full Code Here

    if (invoker instanceof ClassType) {
      refType = (ClassType)invoker;
        methods = refType.methodsByName(methodName);
    } else {
       obj = (ObjectReference)invoker;
       methods = obj.referenceType().methodsByName(methodName);
    }
    if (methods == null || methods.size() == 0) {
      throw new ExpressionEvalException("eval expression error, method '" + methodName + "' can't be found");
    }
    if (methods.size() == 1) {
View Full Code Here

    SuspendThreadStack threadStack = SuspendThreadStack.getInstance();
    StringBuilder sb = new StringBuilder();
    try {
      StackFrame stackFrame = threadRef.frame(threadStack.getCurFrame());
      ObjectReference thisObj = stackFrame.thisObject();
      Map<Field, Value> values = thisObj.getValues(thisObj.referenceType().visibleFields());
      List<String> fieldNames = new ArrayList<String>();
      for (Field field : values.keySet()) {
        fieldNames.add(field.name());
      }
      int maxLen = getMaxLength(fieldNames)+2;
View Full Code Here

    if (value instanceof ObjectReference) {
      sb.append(exp.getOriExp()).append(" = ");
      sb.append(value.type().name()).append("\n");
     
      ObjectReference objRef = (ObjectReference) value;
      Map<Field, Value> values = objRef.getValues(objRef.referenceType().visibleFields());
      List<String> fieldNames = new ArrayList<String>();
      for (Field field : values.keySet()) {
        if (field.isStatic()) continue;
        fieldNames.add(field.name());
      }
View Full Code Here

    if (invoker instanceof ClassType) {
      refType = (ClassType)invoker;
        methods = refType.methodsByName(methodName);
    } else {
       obj = (ObjectReference)invoker;
       methods = obj.referenceType().methodsByName(methodName);
    }
    if (methods == null || methods.size() == 0) {
      throw new ExpressionEvalException("eval expression error, method '" + methodName + "' can't be found");
    }
    if (methods.size() == 1) {
View Full Code Here

          throw e;
        }
      } else {
        List<Field> fields = null;
        try {
          ReferenceType refType = object.referenceType();
          fields = refType.allFields();
        } catch (ObjectCollectedException e) {
          return Collections.EMPTY_LIST;
        } catch (RuntimeException e) {
          targetRequestFailed(
View Full Code Here

          ObjectReference thisObject = getUnderlyingThisObject();
          if (thisObject == null) {
            fReceivingTypeName = getDeclaringTypeName();
          } else {
            fReceivingTypeName = JDIReferenceType
                .getGenericName(thisObject.referenceType());
          }
        }
      } catch (RuntimeException e) {
        if (getThread().isSuspended()) {
          targetRequestFailed(
View Full Code Here

        }
        // handle objects
        if (getType() == TYPE_OBJECT) { // this also rules out null
            // check if this object has any fields
            ObjectReference obj = (ObjectReference) value;
            return !obj.referenceType().visibleFields().isEmpty();
        }

        return false;
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.