Enum Class LogicalBreakpoint.State

java.lang.Object
java.lang.Enum<LogicalBreakpoint.State>
ghidra.debug.api.breakpoint.LogicalBreakpoint.State
All Implemented Interfaces:
Serializable, Comparable<LogicalBreakpoint.State>, Constable
Enclosing interface:
LogicalBreakpoint

public static enum LogicalBreakpoint.State extends Enum<LogicalBreakpoint.State>
The state of a logical breakpoint

Because a breakpoint is comprised of possibly many locations on target or among several targets, as well as a saved bookmark in a program, the "state" can get fairly complex. This is an attempt to enumerate these states while preserving enough information about the breakpoint to display it in various contexts, hopefully informing more than confusing.

In essence, this is the cross product of LogicalBreakpoint.Mode and LogicalBreakpoint.Consistency with an additional NONE option.

A breakpoint is simply ENABLED or DISABLED if it is maped and all its locations and bookmark agree. Ideally, all breakpoints would be in one of these two states.

  • Enum Constant Details

    • NONE

      public static final LogicalBreakpoint.State NONE
      A placeholder state, usually indicating the logical breakpoint should not exist

      This state should not ever be assigned to any actual breakpoint, except if that breakpoint is ephemeral and about to be removed. This value may appear during computations and is a suitable default placeholder for editors and renderers.

    • ENABLED

      public static final LogicalBreakpoint.State ENABLED
      The breakpoint is enabled, and all locations and its bookmark agree
    • DISABLED

      public static final LogicalBreakpoint.State DISABLED
      The breakpoint is disabled, and all locations and its bookmark agree
    • MIXED

      public static final LogicalBreakpoint.State MIXED
      There are multiple logical breakpoints at this address, and they are all saved and effective, but some are enabled, and some are disabled.
    • INEFFECTIVE_ENABLED

      public static final LogicalBreakpoint.State INEFFECTIVE_ENABLED
      The breakpoint is saved as enabled, but one or more trace locations are absent.
    • INEFFECTIVE_DISABLED

      public static final LogicalBreakpoint.State INEFFECTIVE_DISABLED
      The breakpoint is saved as disabled, and one or more trace locations are absent.
    • INEFFECTIVE_MIXED

      public static final LogicalBreakpoint.State INEFFECTIVE_MIXED
      There are multiple logical breakpoints at this address, and they are all saved, but at least one is ineffective; furthermore, some are enabled, and some are disabled.
    • INCONSISTENT_ENABLED

      public static final LogicalBreakpoint.State INCONSISTENT_ENABLED
      The breakpoint is enabled, and all locations agree, but the bookmark is absent or disagrees.
    • INCONSISTENT_DISABLED

      public static final LogicalBreakpoint.State INCONSISTENT_DISABLED
      The breakpoint is disabled, and all locations agree, but the bookmark is absent or disagrees.
    • INCONSISTENT_MIXED

      public static final LogicalBreakpoint.State INCONSISTENT_MIXED
      The breakpoint is terribly inconsistent: its locations disagree, and the bookmark may be absent.
  • Field Details

  • Method Details

    • values

      public static LogicalBreakpoint.State[] 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

      public static LogicalBreakpoint.State valueOf(String name)
      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 name
      NullPointerException - if the argument is null
    • fromFields

      public static LogicalBreakpoint.State fromFields(LogicalBreakpoint.Mode mode, LogicalBreakpoint.Consistency consistency)
    • sameAdddress

      For logical breakpoints which appear at the same address, compose their state

      This can happen when two logical breakpoints, having different attributes (size, kinds, etc.) coincide at the same address. This should be used only when deciding how to mark or choose actions for the address.

      Parameters:
      that - the other state.
      Returns:
      the composed state
    • sameAddress

      For logical breakpoints which appear at the same address, compose their state
      Parameters:
      col - a collection of states derived from logical breakpoints at the same address
      Returns:
      the composed state
      See Also:
    • getToggled

      public LogicalBreakpoint.State getToggled(boolean mapped)
      Get the desired state were the logical breakpoint to be toggled

      The expected "action" when toggling a breakpoint may vary depending on whether or not the breakpoint is mapped, and the notion of "mapped" may vary depending on other settings. In general, if the breakpoint is not in a consistent, enabled, and effective state, but it could be, then toggling it should attempt to make it so. If it is consistent, enabled, and effective, then toggling it should make it consistent, disabled, and effective. If it is not mapped, the state should toggle between enabled and disabled, but ineffective.

      This will always return one of ENABLED or DISABLED, indicating what action should be taken on the logical breakpoint. A breakpoint that is ineffective, because it is not mapped, will remain ineffective.

      Parameters:
      mapped - true if the breakpoint is mapped, as interpreted by the action context
      Returns:
      the resulting state
    • isNormal

      public boolean isNormal()
    • isEnabled

      public boolean isEnabled()
    • isEffective

      public boolean isEffective()
    • isIneffective

      public boolean isIneffective()