Package ghidra.trace.database.breakpoint

# Class DBTraceBreakpointSpec

java.lang.Object
ghidra.trace.database.breakpoint.DBTraceBreakpointSpec

All Implemented Interfaces:
  `DBTraceObjectInterface`, `TraceBreakpointCommon`, `TraceBreakpointSpec`, `TraceObjectInterface`, `TraceUniqueObject`

public class DBTraceBreakpointSpec extends Object implements TraceBreakpointSpec, DBTraceObjectInterface

- ## Nested Class Summary

  ## Nested classes/interfaces inherited from interface ghidra.trace.database.target.DBTraceObjectInterface

  `DBTraceObjectInterface.Translator<T>`

- ## Field Summary

  ### Fields inherited from interface ghidra.trace.model.breakpoint.TraceBreakpointSpec

  `KEY_AS_BPT, KEY_EXPRESSION, KEY_KINDS`

  ### Fields inherited from interface ghidra.trace.model.target.iface.TraceObjectInterface

  `KEY_COMMENT, KEY_DISPLAY, KEY_KIND, KEY_MODIFIED, KEY_ORDER, KEY_SHORT_DISPLAY, KEY_TYPE, KEY_VALUE`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `DBTraceBreakpointSpec(DBTraceObject object)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `delete()`
  Delete this breakpoint from the trace
  `String`
  `getComment(long snap)`
  Get the comment on this breakpoint
  `String`
  `getExpression(long snap)`
  Get the expression used to specify this breakpoint.
  `Set<TraceBreakpointKind>`
  `getKinds(long snap)`
  Get the kinds included in this breakpoint
  `Collection<? extends TraceBreakpointLocation>`
  `getLocations(long snap)`
  Get the locations for this breakpoint
  `protected Collection<? extends TraceBreakpointLocation>`
  `getLocations(Lifespan span)`
  `String`
  `getName(long snap)`
  Get the "short name" of this breakpoint
  `TraceObject`
  `getObject()`
  Get the object backing this implementation
  `String`
  `getPath()`
  Get the "full name" of this breakpoint
  `Trace`
  `getTrace()`
  Get the trace containing this breakpoint
  `boolean`
  `isAlive(Lifespan span)`
  Check if the breakpoint is present for any of the given span
  `boolean`
  `isEnabled(long snap)`
  Check whether this breakpoint is enabled or disabled at the given snap
  `boolean`
  `isValid(long snap)`
  Check if the breakpoint is present at the given snapshot
  `void`
  `remove(long snap)`
  Remove this breakpoint from the given snap on
  `void`
  `setComment(long snap, String comment)`
  Set a comment on this breakpoint
  `void`
  `setComment(Lifespan lifespan, String comment)`
  Set a comment on this breakpoint
  `void`
  `setEnabled(long snap, boolean enabled)`
  Set whether this breakpoint was enabled or disabled
  `void`
  `setEnabled(Lifespan lifespan, boolean enabled)`
  Set whether this breakpoint was enabled or disabled
  `void`
  `setKinds(long snap, Collection<TraceBreakpointKind> kinds)`
  Set the kinds included in this breakpoint
  `void`
  `setKinds(Lifespan lifespan, Collection<TraceBreakpointKind> kinds)`
  Set the kinds included in this breakpoint
  `void`
  `setName(long snap, String name)`
  Set the "short name" of this breakpoint
  `void`
  `setName(Lifespan lifespan, String name)`
  Set the "short name" of this breakpoint
  `TraceChangeRecord<?,?>`
  `translateEvent(TraceChangeRecord<?,?> rec)`
  Translate an object event into the interface-specific event

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

  ### Methods inherited from interface ghidra.trace.database.target.DBTraceObjectInterface

  `getObjectKey, isDeleted, spaceForValue`

- ## Constructor Details

  - ### DBTraceBreakpointSpec

    public DBTraceBreakpointSpec(DBTraceObject object)

- ## Method Details

  - ### getTrace

    public Trace getTrace()
    Description copied from interface: `TraceBreakpointCommon`
    Get the trace containing this breakpoint
    Specified by:
      `getTrace` in interface `TraceBreakpointCommon`
    Returns:
      the trace

  - ### getPath

    public String getPath()
    Description copied from interface: `TraceBreakpointCommon`
    Get the "full name" of this breakpoint

    This is a name unique to this breakpoint, which may not be suitable for display on the screen.

    Specified by:
      `getPath` in interface `TraceBreakpointCommon`
    Returns:
      the path

  - ### setName

    public void setName(Lifespan lifespan, String name)
    Description copied from interface: `TraceBreakpointCommon`
    Set the "short name" of this breakpoint

    This should be a name suitable for display on the screen

    Specified by:
      `setName` in interface `TraceBreakpointCommon`
    Parameters:
      `lifespan` - the span of time
      `name` - the new name

  - ### setName

    public void setName(long snap, String name)
    Description copied from interface: `TraceBreakpointCommon`
    Set the "short name" of this breakpoint

    This should be a name suitable for display on the screen

    Specified by:
      `setName` in interface `TraceBreakpointCommon`
    Parameters:
      `snap` - the first effective snap
      `name` - the new name

  - ### getName

    public String getName(long snap)
    Description copied from interface: `TraceBreakpointCommon`
    Get the "short name" of this breakpoint

    This defaults to the "full name," but can be modified via `TraceBreakpointCommon.setName(long, String)`

    Specified by:
      `getName` in interface `TraceBreakpointCommon`
    Parameters:
      `snap` - the snap
    Returns:
      the name

  - ### setEnabled

    public void setEnabled(Lifespan lifespan, boolean enabled)
    Description copied from interface: `TraceBreakpointCommon`
    Set whether this breakpoint was enabled or disabled
    Specified by:
      `setEnabled` in interface `TraceBreakpointCommon`
    Parameters:
      `lifespan` - the span of time
      `enabled` - true if enabled, false if disabled

  - ### setEnabled

    public void setEnabled(long snap, boolean enabled)
    Description copied from interface: `TraceBreakpointCommon`
    Set whether this breakpoint was enabled or disabled
    Specified by:
      `setEnabled` in interface `TraceBreakpointCommon`
    Parameters:
      `snap` - the first effective snap
      `enabled` - true if enabled, false if disabled

  - ### isEnabled

    public boolean isEnabled(long snap)
    Description copied from interface: `TraceBreakpointCommon`
    Check whether this breakpoint is enabled or disabled at the given snap
    Specified by:
      `isEnabled` in interface `TraceBreakpointCommon`
    Parameters:
      `snap` - the snap
    Returns:
      true if enabled, false if disabled

  - ### setKinds

    public void setKinds(Lifespan lifespan, Collection<TraceBreakpointKind> kinds)
    Description copied from interface: `TraceBreakpointSpec`
    Set the kinds included in this breakpoint

    See `TraceBreakpointSpec.getKinds(long)`. Note that it is unusual for a breakpoint to change kinds during its life. Nevertheless, in the course of recording a trace, it may happen, or at least appear to happen.

    Specified by:
      `setKinds` in interface `TraceBreakpointSpec`
    Parameters:
      `lifespan` - the span of time
      `kinds` - the set of kinds

  - ### setKinds

    public void setKinds(long snap, Collection<TraceBreakpointKind> kinds)
    Description copied from interface: `TraceBreakpointSpec`
    Set the kinds included in this breakpoint

    See `TraceBreakpointSpec.getKinds(long)`. Note that it is unusual for a breakpoint to change kinds during its life. Nevertheless, in the course of recording a trace, it may happen, or at least appear to happen.

    Specified by:
      `setKinds` in interface `TraceBreakpointSpec`
    Parameters:
      `snap` - the snap
      `kinds` - the set of kinds

  - ### getKinds

    public Set<TraceBreakpointKind> getKinds(long snap)
    Description copied from interface: `TraceBreakpointSpec`
    Get the kinds included in this breakpoint

    For example, an "access breakpoint" or "access watchpoint," depending on terminology, would include both `TraceBreakpointKind.READ` and `TraceBreakpointKind.WRITE`.

    Specified by:
      `getKinds` in interface `TraceBreakpointSpec`
    Parameters:
      `snap` - the snap
    Returns:
      the set of kinds

  - ### getExpression

    public String getExpression(long snap)
    Description copied from interface: `TraceBreakpointSpec`
    Get the expression used to specify this breakpoint.
    Specified by:
      `getExpression` in interface `TraceBreakpointSpec`
    Parameters:
      `snap` - the snap
    Returns:
      the expression

  - ### setComment

    public void setComment(Lifespan lifespan, String comment)
    Description copied from interface: `TraceBreakpointCommon`
    Set a comment on this breakpoint
    Specified by:
      `setComment` in interface `TraceBreakpointCommon`
    Parameters:
      `lifespan` - the span of time
      `comment` - the comment, possibly `null`

  - ### setComment

    public void setComment(long snap, String comment)
    Description copied from interface: `TraceBreakpointCommon`
    Set a comment on this breakpoint
    Specified by:
      `setComment` in interface `TraceBreakpointCommon`
    Parameters:
      `snap` - the snap
      `comment` - the comment, possibly `null`

  - ### getComment

    public String getComment(long snap)
    Description copied from interface: `TraceBreakpointCommon`
    Get the comment on this breakpoint
    Specified by:
      `getComment` in interface `TraceBreakpointCommon`
    Parameters:
      `snap` - the snap
    Returns:
      the comment, possibly `null`

  - ### delete

    public void delete()
    Description copied from interface: `TraceBreakpointCommon`
    Delete this breakpoint from the trace
    Specified by:
      `delete` in interface `TraceBreakpointCommon`

  - ### remove

    public void remove(long snap)
    Description copied from interface: `TraceBreakpointCommon`
    Remove this breakpoint from the given snap on
    Specified by:
      `remove` in interface `TraceBreakpointCommon`
    Parameters:
      `snap` - the snap

  - ### isValid

    public boolean isValid(long snap)
    Description copied from interface: `TraceBreakpointCommon`
    Check if the breakpoint is present at the given snapshot

    In object mode, a breakpoint's life may be disjoint, so checking if the snap occurs between creation and destruction is not quite sufficient. This method encapsulates validity. In object mode, it checks that the breakpoint object has a canonical parent at the given snapshot. In table mode, it checks that the lifespan contains the snap.

    Specified by:
      `isValid` in interface `TraceBreakpointCommon`
    Parameters:
      `snap` - the snapshot key
    Returns:
      true if valid, false if not

  - ### isAlive

    public boolean isAlive(Lifespan span)
    Description copied from interface: `TraceBreakpointCommon`
    Check if the breakpoint is present for any of the given span
    Specified by:
      `isAlive` in interface `TraceBreakpointCommon`
    Parameters:
      `span` - the span
    Returns:
      true if its life intersects the span

  - ### getObject

    public TraceObject getObject()
    Description copied from interface: `TraceObjectInterface`
    Get the object backing this implementation
    Specified by:
      `getObject` in interface `TraceObjectInterface`
    Returns:
      the object

  - ### getLocations

    protected Collection<? extends TraceBreakpointLocation> getLocations(Lifespan span)

  - ### getLocations

    public Collection<? extends TraceBreakpointLocation> getLocations(long snap)
    Description copied from interface: `TraceBreakpointSpec`
    Get the locations for this breakpoint
    Specified by:
      `getLocations` in interface `TraceBreakpointSpec`
    Parameters:
      `snap` - the snap
    Returns:
      the locations

  - ### translateEvent

    public TraceChangeRecord<?,?> translateEvent(TraceChangeRecord<?,?> rec)
    Description copied from interface: `DBTraceObjectInterface`
    Translate an object event into the interface-specific event

    Both the object event and the interface-specific event, if applicable, will be emitted. If multiple events need to be emitted, then this method may emit them directly via its object's trace. If exactly one event needs to be emitted, then this method should return the translated record. If no translation applies, or if the translated event(s) were emitted directly, this method returns `null`.

    Specified by:
      `translateEvent` in interface `DBTraceObjectInterface`
    Parameters:
      `rec` - the object event
    Returns:
      the interface-specific event to emit, or `null`