public interface DebugContext
Modifier and Type | Method and Description |
---|---|
boolean |
adjustForScope(Scope s,
ScopeTest stt)
Changes the scope of this context to the scope for the closest stack
frame that matches a desired scope and test.
|
String |
canInvokeOrEval()
Determines whether or not method invoking, expression evaluation, and
other methods that require method invoking can be executed.
|
Value |
createNullValue()
Creates a new null value.
|
Value |
createPrimitiveValue(String typeName,
String value)
Creates a new Value corresponding to a primitive type.
|
ValueAndType |
evaluate(String expression,
Value thisObject,
NameToValue[] valueMap)
Evaluates an expression (may have some limitations) in the debugger.
|
String |
getArrayElementTypeName(String arrayTypeName)
Gets the array element type name from an array type name.
|
Type |
getContextClass()
Gets the type corresponding to the current execution point and stack
frame.
|
Scope |
getContextScope()
Gets the scope corresponding to the current execution point.
|
LocalVariable[] |
getLocalVariables()
Gets the local variables for the current state.
|
int |
getTargetMajorVersionNumber()
Gets the major version number for the target system.
|
Type |
getType(String typeName)
Gets a type in the currently executing workspace or debugger.
|
Value |
getValue(LocalVariable lv)
Gets the current value of a local variable.
|
boolean |
isArrayName(String typeName)
Determines if a type name is an array type name.
|
boolean |
isDalvikVM()
Determines if the target debug machine is the Android Dalvik VM.
|
boolean |
isObjectName(String typeName)
Determines if a type name is an Object type name.
|
void |
restoreDefaultScope()
Changes the scope of this context to the default.
|
boolean adjustForScope(Scope s, ScopeTest stt)
s
- the scope to be matched.stt
- the scope test to be used.String canInvokeOrEval()
Value createNullValue()
Value createPrimitiveValue(String typeName, String value) throws ViewerException
typeName
- the name of the primitive type. For example "int". For
Java (JDI), this method can also be used to create Strings, by using the
type name "String" or "java.lang.String".value
- an acceptable string representation of the primitive value.
What is acceptable is target-specific. For Java, you can use anything
that Type.parseType(String) (Long.parseLong(String) etc.) would accept.BadFormatException
- if the value parameter has an invalid format.UnknownTypeException
- if the requested type does not exist in the
workbench or debugger.ViewerException
- if a JDI error occurs while creating the
value.ValueAndType evaluate(String expression, Value thisObject, NameToValue[] valueMap) throws ViewerException
expression
- the expression.thisObject
- object to serve as "this" in the expression. If
thisObject is null, then "this" will be the actual "this" for the current
debugger context.valueMap
- a mapping from names to values that will take precedence
over actual mappings, such as local variables and fields in the current
context. This may be null.ViewerException
- if there is an error parsing the expression, an
exception is thrown by a method called in the expression, or the debugger
is in an invalid state for evaluating expressions.Type getContextClass()
Scope getContextScope()
LocalVariable[] getLocalVariables() throws LocalsNotAvailableException
LocalsNotAvailableException
- if locals are not available.int getTargetMajorVersionNumber()
Type getType(String typeName) throws NoSuchTypeException
typeName
- the full type name.NoSuchTypeException
- if the type could not be found in the
currently executing debugger.Value getValue(LocalVariable lv)
lv
- the local variable of interest.void restoreDefaultScope()
String getArrayElementTypeName(String arrayTypeName)
arrayTypeName
- the array type name.boolean isObjectName(String typeName)
typeName
- the type name of interest.boolean isArrayName(String typeName)
typeName
- the type name of interest.boolean isDalvikVM()