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,
IJavaStackFramealso 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 intERR_INVALID_STACK_FRAMEStatus code indicating a stack frame is invalid.
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description booleancanForceReturn()Returns whether this frame currently supports a force return operation.IJavaVariablefindVariable(String variableName)Returns the local, static, or "this" variable with the given name, ornullif unable to resolve a variable with the name.voidforceReturn(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.IJavaClassTypegetDeclaringType()Deprecated.UsegetReferenceType()instead, as a method is not restricted to occur in a class.StringgetDeclaringTypeName()Returns the fully qualified name of the type that declares the method associated with this stack frame.intgetLineNumber(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-1if 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.StringgetMethodName()Returns the name of the method associated with this stack frameStringgetReceivingTypeName()Returns the fully qualified name of the type that is the receiving object associated with this stack frameIJavaReferenceTypegetReferenceType()Returns the type in which this stack frame's method is declared.StringgetSignature()Returns the JNI signature for the method this stack frame is associated with.StringgetSourceName()Returns the source name debug attribute associated with the declaring type of this stack frame, ornullif the source name debug attribute not present.StringgetSourceName(String stratum)Returns the source name debug attribute associated with the declaring type of this stack frame in the specified stratum, ornullif the source name debug attribute not present.StringgetSourcePath()Returns the source path debug attribute associated with this stack frame, ornullif the source path is not known.StringgetSourcePath(String stratum)Returns the source path debug attribute associated with this stack frame in the specified stratum, ornullif the source path is not known.IJavaObjectgetThis()Returns a reference to the receiver of the method associated with this stack frame, ornullif this stack frame represents a static method.booleanisConstructor()Returns whether the method associated with this stack frame is a constructor.booleanisNative()Returns whether the method associated with this stack frame has been declared as native.booleanisObsolete()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.booleanisOutOfSynch()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.booleanisStaticInitializer()Returns whether the method associated with this stack frame is a static initializer.booleanisSynchronized()Returns whether the method associated with this stack frame has been declared as synchronized.booleanisVarArgs()Returns whether the method associated with this stack frame accepts a variable number of arguments.booleansupportsDropToFrame()Deprecated.since 3.1, IJavaStackFrame extends org.eclipse.debug.core.IDropToFrame which defines canDropToFrame().booleanwereLocalsAvailable()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 DebugExceptionReturns 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 DebugExceptionReturns 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 DebugExceptionReturns 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 DebugExceptionReturns 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 DebugExceptionReturns 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 DebugExceptionReturns 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, ornullif unable to resolve a variable with the name.- Parameters:
variableName- the name of the variable to search for- Returns:
- a variable, or
nullif 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-1if line number information is unavailable.- Parameters:
stratum- the stratum to use.- Returns:
- line number of instruction pointer in this stack frame, or
-1if 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, ornullif 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, ornullif 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, ornullif 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, ornullif 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, ornullif 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 aDebugExceptionwhen 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. Returnstrueif 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
trueif locals have never been retrieved - Since:
- 2.0
-
isVarArgs
boolean isVarArgs() throws DebugExceptionReturns whether the method associated with this stack frame accepts a variable number of arguments.- Returns:
trueif the method associated with this stack frame accepts a variable number of arguments,falseotherwise.- 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
-
-