Package com.sun.jdi

Examples of com.sun.jdi.ObjectReference


        try {
            Object o = getRemoteVar( "label" );
            if ( o == null ) {
                return -1;
            }
            ObjectReference obj = (ObjectReference) o;
            ClassType frameType = (ClassType) obj.type();
            Field field = frameType.fieldByName( "lineNumber" );
            o = obj.getValue( field );
            if ( o == null ) {
                return -1;
            }
            IntegerValue val = (IntegerValue) o;
            int realval = val.value();
View Full Code Here


            try {
                Object rem = getRemoteVar( "label" );
                if ( rem == null ) {
                    return null;
                }
                ObjectReference obj = (ObjectReference) rem;
                ClassType frameType = (ClassType) obj.type();
                Field field = frameType.fieldByName( "sourceFile" );
                rem = obj.getValue( field );
                if ( rem == null ) {
                    return null;
                }
                StringReference res = (StringReference) rem;
                String realres = res.value();
View Full Code Here

      byteValues[i] = virtualMachine.mirrorOf(clazz[i]);
    }
    array.setValues(Arrays.asList(byteValues));

    // load the class with the class loader
    final ObjectReference loadedClazz = (ObjectReference) invokeMethod(myClassLoader, _URLClassLoader, "defineClass", "([BII)Ljava/lang/Class;", new Value[] { array, virtualMachine.mirrorOf(0), virtualMachine.mirrorOf(clazz.length) });
    final ClassType _clazz = (ClassType) ((ClassObjectReference) loadedClazz).reflectedType();

    if (argsForInstantiate != null) {
      // prepare the class
      invokeMethod(myClassLoader, _URLClassLoader, "resolveClass", "(Ljava/lang/Class;)V", new Value[] { loadedClazz });
      invokeMethod(loadedClazz, _Class, "getMethods", "()[Ljava/lang/reflect/Method;", new Value[0]);

      // invoke its constructor
      final ObjectReference loadedInstance = newInstance(_clazz, "()V", new Value[0]);

      // invoke its go method
      invokeMethod(loadedInstance, _clazz, "go", "(Ljava/lang/String;)V", new Value[] { virtualMachine.mirrorOf(argsForInstantiate) });
    }
   
View Full Code Here

   */
  @Override
  public boolean handleBreakpointEvent(Event event, JDIThread thread,
      boolean suspendVote) {
    if (event instanceof ExceptionEvent) {
      ObjectReference ex = ((ExceptionEvent) event).exception();
      fLastTarget = thread.getJavaDebugTarget();
      fLastException = ex;
      String name = null;
      try {
        name = ex.type().name();
        if (!name.equals(getTypeName())) {
          if (!isSuspendOnSubclasses()
              & isSubclass((ClassType) ex.type(), getTypeName())) {
            return true;
          }
        }
      } catch (VMDisconnectedException e) {
        return true;
View Full Code Here

      JdwpReplyPacket replyPacket = requestVM(
          JdwpCommandPacket.SF_THIS_OBJECT, outBytes);
      defaultReplyErrorHandler(replyPacket.errorCode());

      DataInputStream replyData = replyPacket.dataInStream();
      ObjectReference result = ObjectReferenceImpl.readObjectRefWithTag(
          this, replyData);
      return result;
    } catch (IOException e) {
      defaultIOExceptionHandler(e);
      return null;
View Full Code Here

    } catch (DebugException e) {
      getResult().setException(e);

      Throwable underlyingException = e.getStatus().getException();
      if (underlyingException instanceof InvocationException) {
        ObjectReference theException = ((InvocationException) underlyingException)
            .exception();
        if (theException != null) {
          try {
            try {
              IJavaObject v = (IJavaObject) JDIValue.createValue(
View Full Code Here

    if (isInvokingMethod()) {
      requestFailed(
          JDIDebugModelMessages.JDIThread_Cannot_perform_nested_evaluations_2,
          null);
    }
    ObjectReference result = null;
    int timeout = getRequestTimeout();
    try {
      // set the request timeout to be infinite
      setRequestTimeout(Integer.MAX_VALUE);
      setRunning(true);
View Full Code Here

      IJavaObject[] javaOwnedMonitors = new IJavaObject[ownedMonitors
          .size()];
      Iterator<ObjectReference> itr = ownedMonitors.iterator();
      int i = 0;
      while (itr.hasNext()) {
        ObjectReference element = itr.next();
        javaOwnedMonitors[i] = new JDIObjectValue(target, element);
        i++;
      }
      return javaOwnedMonitors;
    } catch (IncompatibleThreadStateException e) {
View Full Code Here

  /**
   * @see org.eclipse.jdt.debug.core.IJavaThread#getContendedMonitor()
   */
  public IJavaObject getContendedMonitor() throws DebugException {
    try {
      ObjectReference monitor = fThread.currentContendedMonitor();
      if (monitor != null) {
        return new JDIObjectValue((JDIDebugTarget) getDebugTarget(),
            monitor);
      }
    } catch (IncompatibleThreadStateException e) {
View Full Code Here

   */
  protected synchronized List<IJavaVariable> getVariablesList() throws DebugException {
    if (fVariables != null) {
      return fVariables;
    } else if (fValue instanceof ObjectReference) {
      ObjectReference object = (ObjectReference) fValue;
      fVariables = new ArrayList<IJavaVariable>();
      if (isArray()) {
        try {
          int length = getArrayLength();
          for (int i = 0; i < length; i++) {
            fVariables.add(new JDIArrayEntryVariable(
                getJavaDebugTarget(), getArrayReference(), i,
                fLogicalParent));
          }
        } catch (DebugException e) {
          if (e.getCause() instanceof ObjectCollectedException) {
            return Collections.EMPTY_LIST;
          }
          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

TOP

Related Classes of com.sun.jdi.ObjectReference

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.