Package ghidra.trace.database.thread

# Class DBTraceThread

java.lang.Object
ghidra.trace.database.thread.DBTraceThread

All Implemented Interfaces:
  `DBTraceObjectInterface`, `TraceObjectInterface`, `TraceThread`, `TraceUniqueObject`

public class DBTraceThread extends Object implements TraceThread, DBTraceObjectInterface

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `protected class`
  `DBTraceThread.ThreadChangeTranslator`

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

  `DBTraceObjectInterface.Translator<T>`

- ## Field Summary

  ### 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`

  ### Fields inherited from interface ghidra.trace.model.thread.TraceThread

  `KEY_TID`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `DBTraceThread(DBTraceObject object)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `delete()`
  Delete this thread from the trace
  `String`
  `getComment(long snap)`
  Get the comment on this thread
  `long`
  `getKey()`
  Get a key identifying this thread, unique among all threads in this trace for all time
  `String`
  `getName(long snap)`
  Get the "short name" of this thread
  `DBTraceObject`
  `getObject()`
  Get the object backing this implementation
  `String`
  `getPath()`
  Get the "full name" of this thread
  `Trace`
  `getTrace()`
  Get the trace containing this thread
  `boolean`
  `isAlive(Lifespan span)`
  Check if the module is alive for any of the given span
  `boolean`
  `isValid(long snap)`
  Check if the thread is valid at the given snapshot
  `void`
  `remove(long snap)`
  Remove this thread from the given snapshot on
  `void`
  `setComment(long snap, String comment)`
  Set a comment on this thread
  `void`
  `setName(long snap, String name)`
  Set the "short name" of this thread
  `void`
  `setName(Lifespan lifespan, String name)`
  Set the "short name" of this thread
  `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`

  ### Methods inherited from interface ghidra.trace.model.thread.TraceThread

  `getRegisters`

- ## Constructor Details

  - ### DBTraceThread

    public DBTraceThread(DBTraceObject object)

- ## Method Details

  - ### getObject

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

  - ### getTrace

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

  - ### getKey

    public long getKey()
    Description copied from interface: `TraceThread`
    Get a key identifying this thread, unique among all threads in this trace for all time
    Specified by:
      `getKey` in interface `TraceThread`
    Returns:
      the key

  - ### getPath

    public String getPath()
    Description copied from interface: `TraceThread`
    Get the "full name" of this thread
    Specified by:
      `getPath` in interface `TraceThread`
    Returns:
      the path

  - ### getName

    public String getName(long snap)
    Description copied from interface: `TraceThread`
    Get the "short name" of this thread
    Specified by:
      `getName` in interface `TraceThread`
    Parameters:
      `snap` - the snap
    Returns:
      the name

  - ### setName

    public void setName(Lifespan lifespan, String name)
    Description copied from interface: `TraceThread`
    Set the "short name" of this thread
    Specified by:
      `setName` in interface `TraceThread`
    Parameters:
      `lifespan` - the span of time
      `name` - the name

  - ### setName

    public void setName(long snap, String name)
    Description copied from interface: `TraceThread`
    Set the "short name" of this thread
    Specified by:
      `setName` in interface `TraceThread`
    Parameters:
      `snap` - the starting snap
      `name` - the name

  - ### setComment

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

  - ### getComment

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

  - ### delete

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

  - ### remove

    public void remove(long snap)
    Description copied from interface: `TraceThread`
    Remove this thread from the given snapshot on
    Specified by:
      `remove` in interface `TraceThread`
    Parameters:
      `snap` - the snapshot key

  - ### isValid

    public boolean isValid(long snap)
    Description copied from interface: `TraceThread`
    Check if the thread is valid at the given snapshot

    In object mode, a thread'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 thread 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 `TraceThread`
    Parameters:
      `snap` - the snapshot key
    Returns:
      true if valid, false if not

  - ### isAlive

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

  - ### 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`