public interface TypeDataBase
Modifier and Type | Method and Description |
---|---|
boolean |
addressTypeIsEqualToType(Address addr,
Type type)
This is an experimental interface emulating C++'s run-time
type information (RTTI) mechanism: determines whether the given
address is a pointer to the start of a C++ object of precisely
the given type -- it does not search superclasses of the type.
|
Type |
findDynamicTypeForAddress(Address addr,
Type baseType)
Helper routine for guessing the most derived type of a
polymorphic C++ object.
|
long |
getAddressSize()
Returns the size of a C address in bytes.
|
java.util.Iterator |
getIntConstants()
Returns an Iterator over the String names of the integer
constants in the database.
|
Type |
getJBooleanType()
Accessors for types representing the Java primitive types; used
for both proper type checking and for walking down Java arrays.
|
Type |
getJByteType() |
Type |
getJCharType() |
Type |
getJDoubleType() |
Type |
getJFloatType() |
Type |
getJIntType() |
Type |
getJLongType() |
Type |
getJShortType() |
java.util.Iterator |
getLongConstants()
Returns an Iterator over the String names of the long constants
in the database.
|
long |
getOopSize()
Returns the size of an oop in bytes.
|
java.util.Iterator |
getTypes()
Returns an Iterator over the Types in the database.
|
Type |
guessTypeForAddress(Address addr)
Helper routine for guessing the most derived type of a
polymorphic C++ object.
|
java.lang.Integer |
lookupIntConstant(java.lang.String constantName)
Equivalent to lookupIntConstant(constantName, true)
|
java.lang.Integer |
lookupIntConstant(java.lang.String constantName,
boolean throwException) |
java.lang.Long |
lookupLongConstant(java.lang.String constantName)
Equivalent to lookupLongConstant(constantName, true)
|
java.lang.Long |
lookupLongConstant(java.lang.String constantName,
boolean throwException) |
Type |
lookupType(java.lang.String cTypeName)
Equivalent to lookupType(cTypeName, true)
|
Type |
lookupType(java.lang.String cTypeName,
boolean throwException)
For simplicity of the initial implementation, this is not
guaranteed to work for primitive types.
|
Type lookupType(java.lang.String cTypeName)
Type lookupType(java.lang.String cTypeName, boolean throwException)
java.lang.Integer lookupIntConstant(java.lang.String constantName)
java.lang.Integer lookupIntConstant(java.lang.String constantName, boolean throwException)
java.lang.Long lookupLongConstant(java.lang.String constantName)
java.lang.Long lookupLongConstant(java.lang.String constantName, boolean throwException)
Type getJBooleanType()
Type getJByteType()
Type getJCharType()
Type getJDoubleType()
Type getJFloatType()
Type getJIntType()
Type getJLongType()
Type getJShortType()
long getAddressSize()
long getOopSize()
boolean addressTypeIsEqualToType(Address addr, Type type)
This is an experimental interface emulating C++'s run-time type information (RTTI) mechanism: determines whether the given address is a pointer to the start of a C++ object of precisely the given type -- it does not search superclasses of the type. The convention is that this returns false for the null pointer. It is needed to allow wrapper Java objects of the appropriate type to be constructed for existing C++ objects of polymorphic type. This method is only intended to work for C++ types (implying that we should rename this package and the classes contained within back to "ctypes"). Further, since the vptr offset in an object is known at compile time but not necessarily at runtime (unless debugging information is available), it is reasonable for an implementation of this method to search nearby memory for the (known) vtbl value for the given type. For this reason, this method is not intended to support scans through memory finding C++ objects, but is instead targeted towards discovering the true type of a pointer assumed to be intact.
The reason this method was placed in the type database is that the latter is the first level at which it could be exposed, and placing it here could avoid modifying the Type interface. It is unclear what other, if any, vtbl access would be useful (or implementable), so we are trying to avoid changing interfaces at this point to support this kind of functionality.
This method necessarily does not support multiple inheritance.
Type guessTypeForAddress(Address addr)
Type findDynamicTypeForAddress(Address addr, Type baseType)
java.util.Iterator getTypes()
java.util.Iterator getIntConstants()
java.util.Iterator getLongConstants()
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.