Package gnu.classpath.jdwp.id

Examples of gnu.classpath.jdwp.id.ObjectId


  }

  private void executeGetValues(ByteBuffer bb, DataOutputStream os)
      throws JdwpException, IOException
  {
    ObjectId tId = idMan.readObjectId(bb);
    Thread thread = (Thread) tId.getObject();

    // Although Frames look like other ids they are not. First they are not
    // ObjectIds since they don't exist in the users code. Storing them as an
    // ObjectId would mean they could be garbage collected since no one else
    // has a reference to them. Furthermore they are not ReferenceTypeIds since
View Full Code Here


  }

  private void executeSetValues(ByteBuffer bb, DataOutputStream os)
      throws JdwpException, IOException
  {
    ObjectId tId = idMan.readObjectId(bb);
    Thread thread = (Thread) tId.getObject();

    VMFrame frame = VMVirtualMachine.getFrame(thread, bb);

    int slots = bb.getInt();
    for (int i = 0; i < slots; i++)
View Full Code Here

  }

  private void executeThisObject(ByteBuffer bb, DataOutputStream os)
      throws JdwpException, IOException
  {
    ObjectId tId = idMan.readObjectId(bb);
    Thread thread = (Thread) tId.getObject();

    VMFrame frame = VMVirtualMachine.getFrame(thread, bb);

    Object thisObject = frame.getObject();
    Value.writeTaggedValue(os, thisObject);
View Full Code Here

  {
    ReferenceTypeId refId = idMan.readReferenceTypeId(bb);

    Class clazz = refId.getType();
    ClassLoader loader = clazz.getClassLoader();
    ObjectId oid = idMan.getObjectId(loader);
    oid.write(os);
  }
View Full Code Here

    int numFields = bb.getInt();
    os.writeInt(numFields); // Looks pointless but this is the protocol
    for (int i = 0; i < numFields; i++)
      {
        ObjectId fieldId = idMan.readObjectId(bb);
        Field field = (Field) (fieldId.getObject());
        Class fieldClazz = field.getDeclaringClass();

        // We don't actually need the clazz to get the field but we might as
        // well check that the debugger got it right
        if (fieldClazz.isAssignableFrom(clazz))
          {
            try
              {
                field.setAccessible(true); // Might be a private field
                Object value = field.get(null);
                Value.writeTaggedValue(os, value);
              }
            catch (IllegalArgumentException ex)
              {
                // I suppose this would best qualify as an invalid field then
                throw new InvalidFieldException(ex);
              }
            catch (IllegalAccessException ex)
              {
                // Since we set it as accessible this really shouldn't happen
                throw new JdwpInternalErrorException(ex);
              }
          }
        else
          throw new InvalidFieldException(fieldId.getId());
      }
  }
View Full Code Here

  private void executeClassObject(ByteBuffer bb, DataOutputStream os)
    throws JdwpException, IOException
  {
    ReferenceTypeId refId = idMan.readReferenceTypeId(bb);
    Class clazz = refId.getType();
    ObjectId clazzObjectId = idMan.getObjectId(clazz);
    clazzObjectId.write(os);
  }
View Full Code Here

  }

  private void executeReferenceType(ByteBuffer bb, DataOutputStream os)
    throws JdwpException, IOException
  {
    ObjectId oid = idMan.readObjectId(bb);
    Object obj = oid.getObject();
    Class clazz = obj.getClass();
    ReferenceTypeId refId = idMan.getReferenceTypeId(clazz);
    refId.writeTagged(os);
  }
View Full Code Here

  }

  private void executeGetValues(ByteBuffer bb, DataOutputStream os)
    throws JdwpException, IOException
  {
    ObjectId oid = idMan.readObjectId(bb);
    Object obj = oid.getObject();

    int numFields = bb.getInt();

    os.writeInt(numFields); // Looks pointless but this is the protocol
View Full Code Here

  }

  private void executeSetValues(ByteBuffer bb, DataOutputStream os)
    throws JdwpException, IOException
  {
    ObjectId oid = idMan.readObjectId(bb);
    Object obj = oid.getObject();

    int numFields = bb.getInt();

    for (int i = 0; i < numFields; i++)
      {
View Full Code Here

  }

  private void executeInvokeMethod(ByteBuffer bb, DataOutputStream os)
    throws JdwpException, IOException
  {
    ObjectId oid = idMan.readObjectId(bb);
    Object obj = oid.getObject();

    ObjectId tid = idMan.readObjectId(bb);
    Thread thread = (Thread) tid.getObject();

    ReferenceTypeId rid = idMan.readReferenceTypeId(bb);
    Class clazz = rid.getType();

    ObjectId mid = idMan.readObjectId(bb);
    Method method = (Method) mid.getObject();

    int args = bb.getInt();
    Object[] values = new Object[args];

    for (int i = 0; i < args; i++)
      {
        values[i] = Value.getObj(bb);
      }

    int invokeOptions = bb.getInt();
    boolean suspend = ((invokeOptions
      & JdwpConstants.InvokeOptions.INVOKE_SINGLE_THREADED)
           != 0);
    if (suspend)
      {
  // We must suspend all other running threads first
        VMVirtualMachine.suspendAllThreads ();
      }

    boolean nonVirtual = ((invokeOptions
         & JdwpConstants.InvokeOptions.INVOKE_NONVIRTUAL)
        != 0);

    MethodResult mr = VMVirtualMachine.executeMethod(obj, thread,
                 clazz, method,
                 values, nonVirtual);
    Object value = mr.getReturnedValue();
    Exception exception = mr.getThrownException();

    ObjectId eId = idMan.getObjectId(exception);
    Value.writeTaggedValue(os, value);
    eId.writeTagged(os);
  }
View Full Code Here

TOP

Related Classes of gnu.classpath.jdwp.id.ObjectId

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.