Record Class ActionName

java.lang.Object
java.lang.Record
ghidra.debug.api.target.ActionName
Record Components:
name - the name of the action (given as the action attribute on method annotations)
show - when to show the general UI action for this debugger action
enabler - determines when the action is enabled, based on the object
display - the default text to display
icon - the default icon for menus and dialogs
okText - the default text for confirm buttons in dialogs

public record ActionName(String name, ActionName.Show show, ActionName.Enabler enabler, String display, Icon icon, String okText) extends Record
A name for a commonly-recognized target action.

Many common commands/actions have varying names across different back-end debuggers. We'd like to present common idioms for these common actions, but allow them to keep the names used by the back-end, because those names are probably better known to users of that back-end than Ghidra's action names are known. The action hints will affect the icon and placement of the action in the UI, but the display name will still reflect the name given by the back-end. Note that the "stock" action names are not a fixed enumeration. These are just the ones that might get special treatment from Ghidra. All methods should appear somewhere (at least, e.g., in context menus for applicable objects), even if the action name is unspecified or does not match a stock name. This list may change over time, but that shouldn't matter much. Each back-end should make its best effort to match its methods to these stock actions where applicable, but ultimately, it is up to the UI to decide what is presented where.

  • Field Details

    • REFRESH

      public static final ActionName REFRESH
    • ACTIVATE

      public static final ActionName ACTIVATE
      Activate a given object and optionally a time

      Forms: (focus:Object), (focus:Object, snap:LONG), (focus:Object, time:STR)

    • FOCUS

      public static final ActionName FOCUS
      A weaker form of activate.

      The user has expressed interest in an object, but has not activated it yet. This is often used to communicate selection (i.e., highlight) of the object. Whereas, double-clicking or pressing enter would more likely invoke 'activate.'

    • TOGGLE

      public static final ActionName TOGGLE
    • DELETE

      public static final ActionName DELETE
    • EXECUTE

      public static final ActionName EXECUTE
      Execute a CLI command

      Forms: (cmd:STRING):STRING; Optional arguments: capture:BOOL

    • CONNECT

      public static final ActionName CONNECT
      Connect the back-end to a (usually remote) target

      Forms: (spec:STRING)

    • ATTACH

      public static final ActionName ATTACH
      Forms: (target:Attachable), (pid:INT), (spec:STRING)
    • DETACH

      public static final ActionName DETACH
    • LAUNCH

      public static final ActionName LAUNCH
      Forms: (command_line:STRING), (file:STRING,args:STRING), (file:STRING,args:STRING_ARRAY), (ANY*)
    • KILL

      public static final ActionName KILL
    • RESUME

      public static final ActionName RESUME
    • INTERRUPT

      public static final ActionName INTERRUPT
    • STEP_INTO

      public static final ActionName STEP_INTO
      All of these will show in the "step" portion of the control toolbar, if present. The difference in each "step_x" is minor. The icon will indicate which form, and the positions will be shifted so they appear in a consistent order. The display name is determined by the method name, not the action name. For stepping actions that don't fit the standards, use STEP_EXT. There should be at most one of each standard applicable for any given context. (Multiple will appear, but may confuse the user.) You can have as many extended step actions as you like. They will be ordered lexicographically by name.
    • STEP_OVER

      public static final ActionName STEP_OVER
    • STEP_OUT

      public static final ActionName STEP_OUT
    • STEP_SKIP

      public static final ActionName STEP_SKIP
      Skip is not typically available, except in emulators. If the back-end debugger does not have a command for this action out-of-the-box, we do not recommend trying to implement it yourself. The purpose of these actions just to expose/map each command to the UI, not to invent new features for the back-end debugger.
    • STEP_BACK

      public static final ActionName STEP_BACK
      Step back is not typically available, except in emulators and timeless (or time-travel) debuggers.
    • STEP_EXT

      public static final ActionName STEP_EXT
      The action for steps that don't fit one of the common stepping actions.
    • BREAK_SW_EXECUTE

      public static final ActionName BREAK_SW_EXECUTE
      Forms: (addr:ADDRESS), R/W(rng:RANGE), (expr:STRING)

      Optional arguments: condition:STRING, commands:STRING

      The client may pass either null or "" for condition and/or commands to indicate omissions of those arguments.

    • BREAK_HW_EXECUTE

      public static final ActionName BREAK_HW_EXECUTE
    • BREAK_READ

      public static final ActionName BREAK_READ
    • BREAK_WRITE

      public static final ActionName BREAK_WRITE
    • BREAK_ACCESS

      public static final ActionName BREAK_ACCESS
    • BREAK_EXT

      public static final ActionName BREAK_EXT
    • READ_MEM

      public static final ActionName READ_MEM
      Forms: (rng:RANGE)
    • WRITE_MEM

      public static final ActionName WRITE_MEM
      Forms: (addr:ADDRESS,data:BYTES)
    • WRITE_REG

      public static final ActionName WRITE_REG
      Forms: (frame:Frame,name:STRING,value:BYTES), (register:Register,value:BYTES)
  • Constructor Details

    • ActionName

      public ActionName(String name, ActionName.Show show, ActionName.Enabler enabler, String display, Icon icon, String okText)
      Creates an instance of a ActionName record class.
      Parameters:
      name - the value for the name record component
      show - the value for the show record component
      enabler - the value for the enabler record component
      display - the value for the display record component
      icon - the value for the icon record component
      okText - the value for the okText record component
  • Method Details

    • name

      public static ActionName name(String name)
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • name

      public String name()
      Returns the value of the name record component.
      Returns:
      the value of the name record component
    • show

      public ActionName.Show show()
      Returns the value of the show record component.
      Returns:
      the value of the show record component
    • enabler

      public ActionName.Enabler enabler()
      Returns the value of the enabler record component.
      Returns:
      the value of the enabler record component
    • display

      public String display()
      Returns the value of the display record component.
      Returns:
      the value of the display record component
    • icon

      public Icon icon()
      Returns the value of the icon record component.
      Returns:
      the value of the icon record component
    • okText

      public String okText()
      Returns the value of the okText record component.
      Returns:
      the value of the okText record component