APIdia Launch Partner
Top Description Methods
sun.jvm.hotspot.types

public Interface Field

Known Direct Subinterfaces
sun.jvm.hotspot.types.JBooleanField, sun.jvm.hotspot.types.JByteField, sun.jvm.hotspot.types.JCharField, sun.jvm.hotspot.types.JDoubleField, sun.jvm.hotspot.types.JFloatField, sun.jvm.hotspot.types.JIntField, sun.jvm.hotspot.types.JLongField, sun.jvm.hotspot.types.JShortField, sun.jvm.hotspot.types.OopField, sun.jvm.hotspot.types.AddressField, sun.jvm.hotspot.types.CIntegerField
Known Direct Implementers
sun.jvm.hotspot.types.basic.BasicField, sun.jvm.hotspot.types.basic.BasicFieldWrapper
Imports
sun.jvm.hotspot.debugger.*

This is the basic interface which describes a field in a C/C++ data structure or a Java object.

The accessors in this class are designed to allow manual coercion of the data within the field, which is often necessary when interfacing with C programs. Therefore, the accessors here do not perform any type checking. Specializations of the Field interface, such as JByteField, provide getValue() methods which both perform type checking and return the appropriate specialized type.

See @see CIntegerType for a description of why all C integer types are bundled into the category "CIntegerType".

As an example, coercing a pointer field into an int can be done in the following fashion (assuming the application has registered an integer type in the type database called "intptr_t"):

{
  ...
  Address myObject = ...;
  CIntegerType intptr_tType = (CIntegerType) db.lookupType("intptr_t");
  long addrVal = field.getCInteger(myObject, intptr_tType);
  ...
}
FIXME: among other things, this interface is not sufficient to describe fields which are themselves arrays (like Symbol's u1 _body[1]).

Method Summary

Modifier and TypeMethod and Description
public Address
public Address
public long
public long
public boolean
getJBoolean(Address addr)

These accessors require that the field be nonstatic; otherwise, a WrongTypeException will be thrown.

public boolean
getJBoolean()

These accessors require that the field be static; otherwise, a WrongTypeException will be thrown.

public byte
public byte
public char
public char
public double
public double
public float
public float
public int
public int
public long
public long
public short
public short
public String
getName()

Get the name of this field

public OopHandle
public OopHandle
public long
getOffset()

The offset of this field, in bytes, in its containing data structure, if nonstatic.

public OopHandle
public OopHandle
public long
getSize()

Get the size, in bytes, of this field.

public Address
getStaticFieldAddress()

The address of this field, if it is a static field.

public Type
getType()

Get the type of this field

public boolean
isStatic()

Is this a static field?

Method Detail

getAddressback to summary
public Address getAddress(Address addr) throws UnmappedAddressException, UnalignedAddressException, WrongTypeException
getAddressback to summary
public Address getAddress() throws UnmappedAddressException, UnalignedAddressException
getCIntegerback to summary
public long getCInteger(Address addr, CIntegerType type) throws UnmappedAddressException, UnalignedAddressException, WrongTypeException
getCIntegerback to summary
public long getCInteger(CIntegerType type) throws UnmappedAddressException, UnalignedAddressException, WrongTypeException
getJBooleanback to summary
public boolean getJBoolean(Address addr) throws UnmappedAddressException, UnalignedAddressException, WrongTypeException

These accessors require that the field be nonstatic; otherwise, a WrongTypeException will be thrown. Note that type checking is not performed by these accessors in order to allow manual type coercion of field data. For better protection when accessing primitive fields, use the get(Type)Field accessors in Type.java.

NOTE that the Address passed in to these routines may, in fact, be an OopHandle. Specifically, in a reflective system, dereferencing operations applied to the OopHandle must be performed atomically with respect to GC.

See @see CIntegerType for a description of why all C integer types are bundled into the category "CIntegerType".

getJBooleanback to summary
public boolean getJBoolean() throws UnmappedAddressException, UnalignedAddressException, WrongTypeException

These accessors require that the field be static; otherwise, a WrongTypeException will be thrown. Note that type checking is not performed by these accessors in order to allow manual type coercion of field data. For better protection when accessing primitive fields, use the get(Type)Field accessors in Type.java.

NOTE that the Address passed in to these routines may, in fact, be an OopHandle. Specifically, in a reflective system, dereferencing operations applied to the OopHandle must be performed atomically with respect to GC.

See @see CIntegerType for a description of why all C integer types are bundled into the category "CIntegerType".

getJByteback to summary
public byte getJByte(Address addr) throws UnmappedAddressException, UnalignedAddressException, WrongTypeException
getJByteback to summary
public byte getJByte() throws UnmappedAddressException, UnalignedAddressException, WrongTypeException
getJCharback to summary
public char getJChar(Address addr) throws UnmappedAddressException, UnalignedAddressException, WrongTypeException
getJCharback to summary
public char getJChar() throws UnmappedAddressException, UnalignedAddressException, WrongTypeException
getJDoubleback to summary
public double getJDouble(Address addr) throws UnmappedAddressException, UnalignedAddressException, WrongTypeException
getJDoubleback to summary
public double getJDouble() throws UnmappedAddressException, UnalignedAddressException, WrongTypeException
getJFloatback to summary
public float getJFloat(Address addr) throws UnmappedAddressException, UnalignedAddressException, WrongTypeException
getJFloatback to summary
public float getJFloat() throws UnmappedAddressException, UnalignedAddressException, WrongTypeException
getJIntback to summary
public int getJInt(Address addr) throws UnmappedAddressException, UnalignedAddressException, WrongTypeException
getJIntback to summary
public int getJInt() throws UnmappedAddressException, UnalignedAddressException, WrongTypeException
getJLongback to summary
public long getJLong(Address addr) throws UnmappedAddressException, UnalignedAddressException, WrongTypeException
getJLongback to summary
public long getJLong() throws UnmappedAddressException, UnalignedAddressException, WrongTypeException
getJShortback to summary
public short getJShort(Address addr) throws UnmappedAddressException, UnalignedAddressException, WrongTypeException
getJShortback to summary
public short getJShort() throws UnmappedAddressException, UnalignedAddressException, WrongTypeException
getNameback to summary
public String getName()

Get the name of this field

getNarrowOopHandleback to summary
public OopHandle getNarrowOopHandle(Address addr) throws UnmappedAddressException, UnalignedAddressException, WrongTypeException, NotInHeapException
getNarrowOopHandleback to summary
public OopHandle getNarrowOopHandle() throws UnmappedAddressException, UnalignedAddressException, NotInHeapException
getOffsetback to summary
public long getOffset() throws WrongTypeException

The offset of this field, in bytes, in its containing data structure, if nonstatic. If this is a static field, throws a WrongTypeException.

getOopHandleback to summary
public OopHandle getOopHandle(Address addr) throws UnmappedAddressException, UnalignedAddressException, WrongTypeException, NotInHeapException
getOopHandleback to summary
public OopHandle getOopHandle() throws UnmappedAddressException, UnalignedAddressException, NotInHeapException
getSizeback to summary
public long getSize()

Get the size, in bytes, of this field. Used for manual data structure traversal where necessary.

getStaticFieldAddressback to summary
public Address getStaticFieldAddress() throws WrongTypeException

The address of this field, if it is a static field. If this is a nonstatic field, throws a WrongTypeException.

getTypeback to summary
public Type getType()

Get the type of this field

isStaticback to summary
public boolean isStatic()

Is this a static field?