Package ghidra.debug.api.control
Enum Class ControlMode
- All Implemented Interfaces:
Serializable,Comparable<ControlMode>,Constable
The control / state editing modes
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionControl actions, breakpoint commands are directed to the target, but state edits are rejected.Control actions activate trace snapshots, breakpoint commands are directed to the emulator, and state edits are rejected.Control actions, breakpoint commands, and state edits are directed to the emulator.Control actions, breakpoint commands, and state edits are all directed to the target.Control actions activate trace snapshots, breakpoint commands are directed to the emulator, and state edits modify the current trace snapshot. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final List<ControlMode> static final ControlModefinal Iconfinal String -
Method Summary
Modifier and TypeMethodDescriptionabstract booleancanEdit(DebuggerCoordinates coordinates) Check if (broadly speaking) the mode supports editing the given coordinatesabstract booleanCheck if the UI should keep its active snapshot in sync with the recorder's latest.getAlternative(DebuggerCoordinates coordinates) If the mode can no longer be selected for new coordinates, get the new modebooleanisSelectable(DebuggerCoordinates coordinates) Check if this mode can be selected for the given coordinatesabstract booleanisTarget()Indicates whether this mode controls the targetabstract booleanisVariableEditable(DebuggerCoordinates coordinates, Address address, int length) Check if the given variable can be edited under this modemodeOnChange(DebuggerCoordinates coordinates) Find the new mode (or same) mode when activating the given coordinatesprotected TracePlatformplatformFor(DebuggerCoordinates coordinates, Address address) abstract CompletableFuture<Void> setVariable(PluginTool tool, DebuggerCoordinates coordinates, Address address, byte[] data) Set the value of a variableabstract booleanCheck if this mode operates on target breakpoints or emulator breakpointsvalidateCoordinates(PluginTool tool, DebuggerCoordinates coordinates, DebuggerTraceManagerService.ActivationCause cause) Validate and/or adjust the given coordinates pre-activationstatic ControlModeReturns the enum constant of this class with the specified name.static ControlMode[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
RO_TARGET
Control actions, breakpoint commands are directed to the target, but state edits are rejected. -
RW_TARGET
Control actions, breakpoint commands, and state edits are all directed to the target. -
RO_TRACE
Control actions activate trace snapshots, breakpoint commands are directed to the emulator, and state edits are rejected. -
RW_TRACE
Control actions activate trace snapshots, breakpoint commands are directed to the emulator, and state edits modify the current trace snapshot. -
RW_EMULATOR
Control actions, breakpoint commands, and state edits are directed to the emulator.Edits are accomplished by appending patch steps to the current schedule and activating that schedule.
-
-
Field Details
-
ALL
-
DEFAULT
-
name
-
icon
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
followsPresent
public abstract boolean followsPresent()Check if the UI should keep its active snapshot in sync with the recorder's latest.- Returns:
- true to follow, false if not
-
validateCoordinates
public DebuggerCoordinates validateCoordinates(PluginTool tool, DebuggerCoordinates coordinates, DebuggerTraceManagerService.ActivationCause cause) Validate and/or adjust the given coordinates pre-activationThis is called by the trace manager whenever there is a request to activate new coordinates. The control mode may adjust or reject the request before the trace manager actually performs and notifies the activation.
- Parameters:
tool- the tool for displaying status messagescoordinates- the requested coordinatescause- the cause of the activation- Returns:
- the effective coordinates or null to reject
-
platformFor
-
canEdit
Check if (broadly speaking) the mode supports editing the given coordinates- Parameters:
coordinates- the coordinates to check- Returns:
- true if editable, false if not
-
isVariableEditable
public abstract boolean isVariableEditable(DebuggerCoordinates coordinates, Address address, int length) Check if the given variable can be edited under this mode- Parameters:
coordinates- the coordinates to checkaddress- the address of the variablelength- the length of the variable, in bytes- Returns:
- true if editable, false if not
-
setVariable
public abstract CompletableFuture<Void> setVariable(PluginTool tool, DebuggerCoordinates coordinates, Address address, byte[] data) Set the value of a variableBecause the edit may be directed to a live target, the return value is a
CompletableFuture. Additionally, when directed to the emulator, this allows the emulated state to be computed in the background.- Parameters:
tool- the tool requesting the editcoordinates- the coordinates of the editaddress- the address of the variabledata- the desired value of the variable- Returns:
- a future which completes when the edit is finished
-
useEmulatedBreakpoints
public abstract boolean useEmulatedBreakpoints()Check if this mode operates on target breakpoints or emulator breakpoints- Returns:
- false for target, true for emulator
-
isSelectable
Check if this mode can be selected for the given coordinates- Parameters:
coordinates- the current coordinates- Returns:
- true to enable selection, false to disable
-
getAlternative
If the mode can no longer be selected for new coordinates, get the new modeFor example, if a target terminates while the mode is
RO_TARGET, this specifies the new mode.- Parameters:
coordinates- the new coordinates- Returns:
- the new mode
-
modeOnChange
Find the new mode (or same) mode when activating the given coordinatesThe default is implemented using
isSelectable(DebuggerCoordinates)followed bygetAlternative(DebuggerCoordinates).- Parameters:
coordinates- the new coordinates- Returns:
- the mode
-
isTarget
public abstract boolean isTarget()Indicates whether this mode controls the target- Returns:
- true if it controls the target
-