Package org.eclipse.jdt.debug.core
Interface IJavaStackFrame
-
- All Superinterfaces:
IAdaptable
,IDebugElement
,IDropToFrame
,IFilteredStep
,IJavaModifiers
,IStackFrame
,IStep
,ISuspendResume
,ITerminate
public interface IJavaStackFrame extends IStackFrame, IJavaModifiers, IFilteredStep, IDropToFrame
A stack frame in a thread on a Java virtual machine.Since 3.1,
IJavaStackFrame
also implementsIDropToFrame
.- See Also:
IStackFrame
- Restriction:
- This interface is not intended to be implemented by clients.
- Restriction:
- This interface is not intended to be extended by clients.
-
-
Field Summary
Fields Modifier and Type Field Description static int
ERR_INVALID_STACK_FRAME
Status code indicating a stack frame is invalid.
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description boolean
canForceReturn()
Returns whether this frame currently supports a force return operation.IJavaVariable
findVariable(String variableName)
Returns the local, static, or "this" variable with the given name, ornull
if unable to resolve a variable with the name.void
forceReturn(IJavaValue value)
Steps out of this frame's method returning the given value.List<String>
getArgumentTypeNames()
Returns a list of fully qualified type names of the arguments for the method associated with this stack frame.IJavaClassType
getDeclaringType()
Deprecated.UsegetReferenceType()
instead, as a method is not restricted to occur in a class.String
getDeclaringTypeName()
Returns the fully qualified name of the type that declares the method associated with this stack frame.int
getLineNumber(String stratum)
Returns the line number of the instruction pointer in this stack frame that corresponds to the line in the associated source element in the specified stratum, or-1
if line number information is unavailable.IJavaVariable[]
getLocalVariables()
Returns a collection of local variables that are visible at the current point of execution in this stack frame.String
getMethodName()
Returns the name of the method associated with this stack frameString
getReceivingTypeName()
Returns the fully qualified name of the type that is the receiving object associated with this stack frameIJavaReferenceType
getReferenceType()
Returns the type in which this stack frame's method is declared.String
getSignature()
Returns the JNI signature for the method this stack frame is associated with.String
getSourceName()
Returns the source name debug attribute associated with the declaring type of this stack frame, ornull
if the source name debug attribute not present.String
getSourceName(String stratum)
Returns the source name debug attribute associated with the declaring type of this stack frame in the specified stratum, ornull
if the source name debug attribute not present.String
getSourcePath()
Returns the source path debug attribute associated with this stack frame, ornull
if the source path is not known.String
getSourcePath(String stratum)
Returns the source path debug attribute associated with this stack frame in the specified stratum, ornull
if the source path is not known.IJavaObject
getThis()
Returns a reference to the receiver of the method associated with this stack frame, ornull
if this stack frame represents a static method.boolean
isConstructor()
Returns whether the method associated with this stack frame is a constructor.boolean
isNative()
Returns whether the method associated with this stack frame has been declared as native.boolean
isObsolete()
Returns whether the method associated with this stack frame is obsolete, that is, it is running old byte codes that have been replaced in the VM.boolean
isOutOfSynch()
Returns whether the method associated with this stack frame is running code in the VM that is out of synch with the code in the workspace.boolean
isStaticInitializer()
Returns whether the method associated with this stack frame is a static initializer.boolean
isSynchronized()
Returns whether the method associated with this stack frame has been declared as synchronized.boolean
isVarArgs()
Returns whether the method associated with this stack frame accepts a variable number of arguments.boolean
supportsDropToFrame()
Deprecated.since 3.1, IJavaStackFrame extends org.eclipse.debug.core.IDropToFrame which defines canDropToFrame().boolean
wereLocalsAvailable()
Returns whether local variable information was available when local variables were retrieved from the target for this frame.-
Methods inherited from interface org.eclipse.core.runtime.IAdaptable
getAdapter
-
Methods inherited from interface org.eclipse.debug.core.model.IDebugElement
getDebugTarget, getLaunch, getModelIdentifier
-
Methods inherited from interface org.eclipse.debug.core.model.IDropToFrame
canDropToFrame, dropToFrame
-
Methods inherited from interface org.eclipse.debug.core.model.IFilteredStep
canStepWithFilters, stepWithFilters
-
Methods inherited from interface org.eclipse.jdt.debug.core.IJavaModifiers
isFinal, isPackagePrivate, isPrivate, isProtected, isPublic, isStatic, isSynthetic
-
Methods inherited from interface org.eclipse.debug.core.model.IStackFrame
getCharEnd, getCharStart, getLineNumber, getName, getRegisterGroups, getThread, getVariables, hasRegisterGroups, hasVariables
-
Methods inherited from interface org.eclipse.debug.core.model.IStep
canStepInto, canStepOver, canStepReturn, isStepping, stepInto, stepOver, stepReturn
-
Methods inherited from interface org.eclipse.debug.core.model.ISuspendResume
canResume, canSuspend, isSuspended, resume, suspend
-
Methods inherited from interface org.eclipse.debug.core.model.ITerminate
canTerminate, isTerminated, terminate
-
-
-
-
Field Detail
-
ERR_INVALID_STACK_FRAME
static final int ERR_INVALID_STACK_FRAME
Status code indicating a stack frame is invalid. A stack frame becomes invalid when the thread containing the stack frame resumes. A stack frame may or may not be valid if the thread subsequently suspends, depending on the location where the thread suspends.- Since:
- 3.1
- See Also:
- Constant Field Values
-
-
Method Detail
-
supportsDropToFrame
@Deprecated boolean supportsDropToFrame()
Deprecated.since 3.1, IJavaStackFrame extends org.eclipse.debug.core.IDropToFrame which defines canDropToFrame(). Use this method instead.Returns whether this stack frame currently supports the drop to frame operation. Note that not all VMs support the operation.- Returns:
- whether this stack frame currently supports drop to frame
-
isConstructor
boolean isConstructor() throws DebugException
Returns whether the method associated with this stack frame is a constructor.- Returns:
- whether this stack frame is associated with a constructor
- Throws:
DebugException
- if this method fails. Reasons include:- Failure communicating with the VM. The DebugException's status code contains the underlying exception responsible for the failure.
- This stack frame is no longer valid. That is, the thread containing this stack frame has since been resumed.
-
isNative
boolean isNative() throws DebugException
Returns whether the method associated with this stack frame has been declared as native.- Returns:
- whether this stack frame has been declared as native
- Throws:
DebugException
- if this method fails. Reasons include:- Failure communicating with the VM. The DebugException's status code contains the underlying exception responsible for the failure.
- This stack frame is no longer valid. That is, the thread containing this stack frame has since been resumed.
-
isStaticInitializer
boolean isStaticInitializer() throws DebugException
Returns whether the method associated with this stack frame is a static initializer.- Returns:
- whether this stack frame is a static initializer
- Throws:
DebugException
- if this method fails. Reasons include:- Failure communicating with the VM. The DebugException's status code contains the underlying exception responsible for the failure.
- This stack frame is no longer valid. That is, the thread containing this stack frame has since been resumed.
-
isSynchronized
boolean isSynchronized() throws DebugException
Returns whether the method associated with this stack frame has been declared as synchronized.- Returns:
- whether this stack frame has been declared as synchronized
- Throws:
DebugException
- if this method fails. Reasons include:- Failure communicating with the VM. The DebugException's status code contains the underlying exception responsible for the failure.
- This stack frame is no longer valid. That is, the thread containing this stack frame has since been resumed.
-
isOutOfSynch
boolean isOutOfSynch() throws DebugException
Returns whether the method associated with this stack frame is running code in the VM that is out of synch with the code in the workspace.- Returns:
- whether this stack frame is out of synch with the workspace.
- Throws:
DebugException
- if this method fails. Reasons include:- Failure communicating with the VM. The DebugException's status code contains the underlying exception responsible for the failure.
- This stack frame is no longer valid. That is, the thread containing this stack frame has since been resumed.
- Since:
- 2.0
-
isObsolete
boolean isObsolete() throws DebugException
Returns whether the method associated with this stack frame is obsolete, that is, it is running old byte codes that have been replaced in the VM. This can occur when a hot code replace succeeds but the VM is unable to pop a call to an affected method from the call stack.- Returns:
- whether this stack frame's method is obsolete
- Throws:
DebugException
- if this method fails. Reasons include:- Failure communicating with the VM. The DebugException's status code contains the underlying exception responsible for the failure.
- This stack frame is no longer valid. That is, the thread containing this stack frame has since been resumed.
- Since:
- 2.0
-
getDeclaringTypeName
String getDeclaringTypeName() throws DebugException
Returns the fully qualified name of the type that declares the method associated with this stack frame.- Returns:
- declaring type name
- Throws:
DebugException
- if this method fails. Reasons include:- Failure communicating with the VM. The DebugException's status code contains the underlying exception responsible for the failure.
- This stack frame is no longer valid. That is, the thread containing this stack frame has since been resumed.
-
getReceivingTypeName
String getReceivingTypeName() throws DebugException
Returns the fully qualified name of the type that is the receiving object associated with this stack frame- Returns:
- receiving type name
- Throws:
DebugException
- if this method fails. Reasons include:- Failure communicating with the VM. The DebugException's status code contains the underlying exception responsible for the failure.
- This stack frame is no longer valid. That is, the thread containing this stack frame has since been resumed.
-
getSignature
String getSignature() throws DebugException
Returns the JNI signature for the method this stack frame is associated with.- Returns:
- signature
- Throws:
DebugException
- if this method fails. Reasons include:- Failure communicating with the VM. The DebugException's status code contains the underlying exception responsible for the failure.
- This stack frame is no longer valid. That is, the thread containing this stack frame has since been resumed.
-
getArgumentTypeNames
List<String> getArgumentTypeNames() throws DebugException
Returns a list of fully qualified type names of the arguments for the method associated with this stack frame.- Returns:
- argument type names, or an empty list if this method has no arguments
- Throws:
DebugException
- if this method fails. Reasons include:- Failure communicating with the VM. The DebugException's status code contains the underlying exception responsible for the failure.
- This stack frame is no longer valid. That is, the thread containing this stack frame has since been resumed.
-
getMethodName
String getMethodName() throws DebugException
Returns the name of the method associated with this stack frame- Returns:
- method name
- Throws:
DebugException
- if this method fails. Reasons include:- Failure communicating with the VM. The DebugException's status code contains the underlying exception responsible for the failure.
- This stack frame is no longer valid. That is, the thread containing this stack frame has since been resumed.
-
findVariable
IJavaVariable findVariable(String variableName) throws DebugException
Returns the local, static, or "this" variable with the given name, ornull
if unable to resolve a variable with the name.- Parameters:
variableName
- the name of the variable to search for- Returns:
- a variable, or
null
if none - Throws:
DebugException
- if this method fails. Reasons include:- Failure communicating with the VM. The DebugException's status code contains the underlying exception responsible for the failure.
- This stack frame is no longer valid. That is, the thread containing this stack frame has since been resumed.
-
getLineNumber
int getLineNumber(String stratum) throws DebugException
Returns the line number of the instruction pointer in this stack frame that corresponds to the line in the associated source element in the specified stratum, or-1
if line number information is unavailable.- Parameters:
stratum
- the stratum to use.- Returns:
- line number of instruction pointer in this stack frame, or
-1
if line number information is unavailable - Throws:
DebugException
- if this method fails. Reasons include:- Failure communicating with the debug target. The DebugException's status code contains the underlying exception responsible for the failure.
- Since:
- 3.0
-
getSourceName
String getSourceName() throws DebugException
Returns the source name debug attribute associated with the declaring type of this stack frame, ornull
if the source name debug attribute not present.- Returns:
- source name debug attribute, or
null
- Throws:
DebugException
- if this method fails. Reasons include:- Failure communicating with the VM. The DebugException's status code contains the underlying exception responsible for the failure.
- This stack frame is no longer valid. That is, the thread containing this stack frame has since been resumed.
-
getSourceName
String getSourceName(String stratum) throws DebugException
Returns the source name debug attribute associated with the declaring type of this stack frame in the specified stratum, ornull
if the source name debug attribute not present.- Parameters:
stratum
- the stratum to use.- Returns:
- source name debug attribute, or
null
- Throws:
DebugException
- if this method fails. Reasons include:- Failure communicating with the VM. The DebugException's status code contains the underlying exception responsible for the failure.
- This stack frame is no longer valid. That is, the thread containing this stack frame has since been resumed.
- Since:
- 3.0
-
getSourcePath
String getSourcePath(String stratum) throws DebugException
Returns the source path debug attribute associated with this stack frame in the specified stratum, ornull
if the source path is not known.- Parameters:
stratum
- the stratum to use.- Returns:
- source path debug attribute, or
null
- Throws:
DebugException
- if this method fails. Reasons include:- Failure communicating with the VM. The DebugException's status code contains the underlying exception responsible for the failure.
- This stack frame is no longer valid. That is, the thread containing this stack frame has since been resumed.
- Since:
- 3.0
-
getSourcePath
String getSourcePath() throws DebugException
Returns the source path debug attribute associated with this stack frame, ornull
if the source path is not known.- Returns:
- source path debug attribute, or
null
- Throws:
DebugException
- if this method fails. Reasons include:- Failure communicating with the VM. The DebugException's status code contains the underlying exception responsible for the failure.
- This stack frame is no longer valid. That is, the thread containing this stack frame has since been resumed.
- Since:
- 3.0
-
getLocalVariables
IJavaVariable[] getLocalVariables() throws DebugException
Returns a collection of local variables that are visible at the current point of execution in this stack frame. The list includes arguments.- Returns:
- collection of locals and arguments
- Throws:
DebugException
- if this method fails. Reasons include:- Failure communicating with the VM. The DebugException's status code contains the underlying exception responsible for the failure.
- This stack frame is no longer valid. That is, the thread containing this stack frame has since been resumed.
- Since:
- 2.0
-
getThis
IJavaObject getThis() throws DebugException
Returns a reference to the receiver of the method associated with this stack frame, ornull
if this stack frame represents a static method.- Returns:
- 'this' object, or
null
- Throws:
DebugException
- if this method fails. Reasons include:- Failure communicating with the VM. The DebugException's status code contains the underlying exception responsible for the failure.
- This stack frame is no longer valid. That is, the thread containing this stack frame has since been resumed.
-
getDeclaringType
@Deprecated IJavaClassType getDeclaringType() throws DebugException
Deprecated.UsegetReferenceType()
instead, as a method is not restricted to occur in a class. An interface may contain a synthetic class initializer methods. Since 3.1, this method throws aDebugException
when a stack frame's method is contained in an interface.Returns the class in which this stack frame's method is declared.- Returns:
- the class in which this stack frame's method is declared
- Throws:
DebugException
- if this method fails. Reasons include:- Failure communicating with the VM. The DebugException's status code contains the underlying exception responsible for the failure.
- This stack frame is no longer valid. That is, the thread containing this stack frame has since been resumed.
- Since:
- 2.0
-
getReferenceType
IJavaReferenceType getReferenceType() throws DebugException
Returns the type in which this stack frame's method is declared.- Returns:
- the type in which this stack frame's method is declared
- Throws:
DebugException
- if this method fails. Reasons include:- Failure communicating with the VM. The DebugException's status code contains the underlying exception responsible for the failure.
- This stack frame is no longer valid. That is, the thread containing this stack frame has since been resumed.
- Since:
- 3.1
-
wereLocalsAvailable
boolean wereLocalsAvailable()
Returns whether local variable information was available when local variables were retrieved from the target for this frame. Returnstrue
if locals have never been retrieved. This data is available after the fact, since variable retrieval is expensive.- Returns:
- whether local variable information was available when variables
were retrieved from the target. Returns
true
if locals have never been retrieved - Since:
- 2.0
-
isVarArgs
boolean isVarArgs() throws DebugException
Returns whether the method associated with this stack frame accepts a variable number of arguments.- Returns:
true
if the method associated with this stack frame accepts a variable number of arguments,false
otherwise.- Throws:
DebugException
- if this method fails. Reasons include:- Failure communicating with the VM. The DebugException's status code contains the underlying exception responsible for the failure.
- This stack frame is no longer valid. That is, the thread containing this stack frame has since been resumed.
- Since:
- 3.1
-
canForceReturn
boolean canForceReturn()
Returns whether this frame currently supports a force return operation. That is, can this method force a return before it reaches a return statement. Not all VMs support this feature.Force return is only available when a thread is suspended.
- Returns:
- whether force return can be performed currently
- Since:
- 3.3
-
forceReturn
void forceReturn(IJavaValue value) throws DebugException
Steps out of this frame's method returning the given value. No further instructions in the method are executed but locks acquired by entering synchronized blocks are released. The following conditions must be satisfied:- This frame must be suspended in a non-native method.
- The return value must be assignment compatible with this frame's
method's return type. Use a void value when a method return type is void
(see
IJavaDebugTarget.voidValue()
).
- Parameters:
value
- return value that must be assignment compatible with this frame's method's return value- Throws:
DebugException
- if the operation fails- Since:
- 3.3
-
-