-
- All Known Implementing Classes:
DTFJJavaStackFrame
,JavaLocation
,JCJavaLocation
,PHDCorruptJavaLocation
,PHDJavaLocation
public interface JavaLocation
Represents a point of execution within a Java method.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
equals(Object obj)
Compares the argument to the receiver, and answers true if they represent the same object using a class specific comparison.ImagePointer
getAddress()
Fetches the absolute address of the code which this location represents.int
getCompilationLevel()
Get the compilation level for this location.String
getFilename()
Get the source file name.int
getLineNumber()
Get the line number.JavaMethod
getMethod()
Get the method which contains the point of execution.int
hashCode()
Answers an integer hash code for the receiver.String
toString()
Answers a string containing a concise, human-readable description of the receiver.
-
-
-
Method Detail
-
getAddress
ImagePointer getAddress() throws CorruptDataException
Fetches the absolute address of the code which this location represents. This pointer will be contained within one of the segments returned by getBytecodeSections() or getCompiledSections() of the method returned by getMethod().null may be returned, particularly for methods with no bytecode or compiled sections (e.g. some native methods)
Although an offset into the method may be calculated using this pointer, caution should be exercised in attempting to map this offset to an offset within the original class file. Various transformations may have been applied to the bytecodes by the VM or other agents which may make the offset difficult to interpret.
For native methods, the address may be meaningless.
- Returns:
- the address in memory of the managed code
- Throws:
CorruptDataException
-
getLineNumber
int getLineNumber() throws DataUnavailable, CorruptDataException
Get the line number.- Returns:
- the line number, if available, or throws DataUnavailable if it is not available Line numbers are counted from 1
- Throws:
DataUnavailable
- if the line number data is not available for this locationCorruptDataException
-
getFilename
String getFilename() throws DataUnavailable, CorruptDataException
Get the source file name.- Returns:
- the name of the source file, if available, or throws DataUnavailable if it is not available
- Throws:
DataUnavailable
- if the source file name is unavailable in the coreCorruptDataException
-
getCompilationLevel
int getCompilationLevel() throws CorruptDataException
Get the compilation level for this location. This is an implementation defined number indicating the level at which the current location was compiled. 0 indicates interpreted. Any positive number indicates some level of JIT compilation. Typically, higher numbers indicate more aggressive compilation strategiesFor native methods, a non-zero compilation level indicates that some level of JIT compilation has been applied to the native call (e.g. a custom native call stub). To determine if the method is native, use getMethod().getModifiers().
- Returns:
- the compilation level
- Throws:
CorruptDataException
-
getMethod
JavaMethod getMethod() throws CorruptDataException
Get the method which contains the point of execution.- Returns:
- the method which contains the point of execution
- Throws:
CorruptDataException
-
toString
String toString()
Description copied from class:java.lang.Object
Answers a string containing a concise, human-readable description of the receiver.
-
equals
boolean equals(Object obj)
Description copied from class:java.lang.Object
Compares the argument to the receiver, and answers true if they represent the same object using a class specific comparison. The implementation in Object answers true only if the argument is the exact same object as the receiver (==).- Overrides:
equals
in classObject
- Parameters:
obj
-- Returns:
- True if the given object refers to the same Java Location in the image
- See Also:
Object.hashCode()
-
hashCode
int hashCode()
Description copied from class:java.lang.Object
Answers an integer hash code for the receiver. Any two objects which answertrue
when passed to.equals
must answer the same value for this method.- Overrides:
hashCode
in classObject
- Returns:
- the receiver's hash.
- See Also:
Object.equals(java.lang.Object)
-
-