Package ghidra.trace.model.time
Interface TraceTimeManager
- All Known Implementing Classes:
DBTraceTimeManager
public interface TraceTimeManager
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe attribute key for controlling the time radix -
Method Summary
Modifier and TypeMethodDescriptioncreateSnapshot(String description) Create a new snapshot after the latestfindScratchSnapshot(TraceSchedule schedule) Find or create a the snapshot with the given scheduleCollection<? extends TraceSnapshot> List all snapshots in the traceGet maximum snapshot key that has ever existed, usually that of the latest snapshot Note, the corresponding snapshot need not exist, as it may have been deleted.getMostRecentSnapshot(long snap) Get the most recent snapshot since a given keygetSnapshot(long snap, boolean createIfAbsent) Get the snapshot with the given key, optionally creating itlongGet the number of snapshotsCollection<? extends TraceSnapshot> getSnapshots(long fromSnap, boolean fromInclusive, long toSnap, boolean toInclusive) List all snapshots between two given snaps in the traceCollection<? extends TraceSnapshot> getSnapshotsWithSchedule(TraceSchedule schedule) Get all snapshots with the given scheduleGet the radix for displaying and parsing time (snapshots and step counts)voidSet the radix for displaying and parsing time (snapshots and step counts)
-
Field Details
-
KEY_TIME_RADIX
The attribute key for controlling the time radix- See Also:
-
-
Method Details
-
createSnapshot
Create a new snapshot after the latest- Parameters:
description- a description of the new snapshot, i.e., the reason for advancing- Returns:
- the created snapshot
-
getSnapshot
Get the snapshot with the given key, optionally creating it- Parameters:
snap- the snapshot keycreateIfAbsent- create the snapshot if it's missing- Returns:
- the snapshot or
null
-
getMostRecentSnapshot
Get the most recent snapshot since a given key- Parameters:
snap- the snapshot key- Returns:
- the snapshot or
null
-
getSnapshotsWithSchedule
Get all snapshots with the given scheduleIdeally, the snapshot schedules should be managed such that the returned collection contains at most one snapshot.
- Parameters:
schedule- the schedule to find- Returns:
- the snapshots
-
findScratchSnapshot
Find or create a the snapshot with the given scheduleIf a snapshot with the given schedule already exists, this returns the first such snapshot found. Ideally, there is exactly one. If this method is consistently used for creating scratch snapshots, then that should always be the case. If no such snapshot exists, this creates a snapshot with the minimum available negative snapshot key, that is starting at
Long.MIN_VALUEand increasing from there.- Parameters:
schedule- the schedule to find- Returns:
- the snapshot
-
getAllSnapshots
Collection<? extends TraceSnapshot> getAllSnapshots()List all snapshots in the trace- Returns:
- the set of snapshots
-
getSnapshots
Collection<? extends TraceSnapshot> getSnapshots(long fromSnap, boolean fromInclusive, long toSnap, boolean toInclusive) List all snapshots between two given snaps in the trace- Parameters:
fromSnap- the starting snapfromInclusive- whether to include the from snaptoSnap- the ending snaptoInclusive- when to include the to snap- Returns:
- the set of snapshots
-
getMaxSnap
Long getMaxSnap()Get maximum snapshot key that has ever existed, usually that of the latest snapshot Note, the corresponding snapshot need not exist, as it may have been deleted.- Returns:
- the key, or
nullif no snapshots have existed
-
getSnapshotCount
long getSnapshotCount()Get the number of snapshots- Returns:
- the count
-
setTimeRadix
Set the radix for displaying and parsing time (snapshots and step counts)This only affects the GUI, but storing it in the trace gives the back end a means of controlling it.
- Parameters:
radix- the radix
-
getTimeRadix
TraceSchedule.TimeRadix getTimeRadix()Get the radix for displaying and parsing time (snapshots and step counts)- Returns:
- radix the radix
- See Also:
-