Class DBTraceSnapshot
- All Implemented Interfaces:
TraceSnapshot
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final Stringfinal DBTraceTimeManagerprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final StringFields inherited from class ghidra.program.database.DatabaseObject
key -
Constructor Summary
ConstructorsConstructorDescriptionDBTraceSnapshot(DBTraceTimeManager manager, DBCachedObjectStore<?> store, DBRecord record) -
Method Summary
Modifier and TypeMethodDescriptionvoiddelete()Delete this snapshot This does not delete any entries in other managers associated with this snapshot.protected voidfresh(boolean created) Extension point: Called when the object's fields are populated.Get the description of the snapshotIf this snapshot was created because of an event, get the thread that caused itlongGet the real creation time of this snapshot in milliseconds since the epochGet the schedule, if applicable and known, relating this snapshot to a previous oneGet the string representation of the schedulegetTrace()longGet the snapshot's version, esp., when it represents a cache entryprotected voidvoidsetDescription(String description) Set the human-consumable description of the snapshotvoidsetEventThread(TraceThread thread) If this snapshot was create because of an event, set the thread that caused itvoidsetRealTime(long millis) Set the real creation time of this snapshot in milliseconds since Jan 1, 1970 12:00 AM (UTC)voidsetSchedule(TraceSchedule schedule) Set the schedule from some previous snapshot to this onevoidsetVersion(long version) Set the snapshot's version, esp., when it represents a cache entrytoString()Methods inherited from class ghidra.util.database.DBAnnotatedObject
doRefresh, doUpdateAll, doUpdated, doWrite, getObjectKey, getTableName, isDeleted, refresh, refresh, update, update, update, updateMethods inherited from class ghidra.program.database.DatabaseObject
checkDeleted, checkIsValid, checkIsValid, getKey, isDeleted, isInvalid, keyChanged, setDeleted, setInvalid, validateMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface ghidra.trace.model.time.TraceSnapshot
getKey
-
Field Details
-
TABLE_NAME
- See Also:
-
REAL_TIME_COLUMN_NAME
- See Also:
-
SCHEDULE_COLUMN_NAME
- See Also:
-
VERSION_COLUMN_NAME
- See Also:
-
DESCRIPTION_COLUMN_NAME
- See Also:
-
THREAD_COLUMN_NAME
- See Also:
-
manager
-
-
Constructor Details
-
DBTraceSnapshot
-
-
Method Details
-
fresh
Description copied from class:DBAnnotatedObjectExtension point: Called when the object's fields are populated.This provides an opportunity for the object to initialize any non-database-backed fields that depend on the database-backed fields. Note that its use may indicate a situation better solved by a custom
DBCachedObjectStoreFactory.DBFieldCodec. If both the database-backed and non-database-backed fields are used frequently, then a codec may not be indicated. If the database-backed fields are only used in this method or to encode another frequently-used field, then a codec is likely better.For a new object, the database-backed fields remain at their initial values. They will be saved after this method returns, so they may be further initialized with custom logic.
For an object loaded from the database, the database-backed fields are already populated from the record when this method is called. They are not automatically saved after this method returns. This method should not further initialize database-backed fields in this case.
- Overrides:
freshin classDBAnnotatedObject- Parameters:
created-truewhen object is being created, orfalsewhen it is being loaded.- Throws:
IOException- if further initialization fails.
-
toString
-
set
-
getTrace
- Specified by:
getTracein interfaceTraceSnapshot
-
getRealTime
public long getRealTime()Description copied from interface:TraceSnapshotGet the real creation time of this snapshot in milliseconds since the epoch- Specified by:
getRealTimein interfaceTraceSnapshot- Returns:
- the real time
-
setRealTime
public void setRealTime(long millis) Description copied from interface:TraceSnapshotSet the real creation time of this snapshot in milliseconds since Jan 1, 1970 12:00 AM (UTC)- Specified by:
setRealTimein interfaceTraceSnapshot- Parameters:
millis- the real time
-
getDescription
Description copied from interface:TraceSnapshotGet the description of the snapshot- Specified by:
getDescriptionin interfaceTraceSnapshot- Returns:
-
setDescription
Description copied from interface:TraceSnapshotSet the human-consumable description of the snapshot- Specified by:
setDescriptionin interfaceTraceSnapshot- Parameters:
description- the description
-
getEventThread
Description copied from interface:TraceSnapshotIf this snapshot was created because of an event, get the thread that caused it- Specified by:
getEventThreadin interfaceTraceSnapshot- Returns:
- the event thread, if applicable
-
setEventThread
Description copied from interface:TraceSnapshotIf this snapshot was create because of an event, set the thread that caused it- Specified by:
setEventThreadin interfaceTraceSnapshot- Parameters:
thread- the event thread, if applicable
-
getSchedule
Description copied from interface:TraceSnapshotGet the schedule, if applicable and known, relating this snapshot to a previous oneThis information is not always known, or even applicable. If recording a single step, ideally, this is simply the previous snap plus one step of the event thread, e.g., for snap 6, the schedule would be "5:1". For an emulated machine cached in scratch space, this should be the schedule that would recover the same machine state.
The object managers in the trace pay no heed to this schedule. In particular, when retrieving the "most-recent" information from a snapshot with a known schedule, the "previous snap" part of that schedule is not taken into account. In other words, the managers still interpret time linearly, even though this schedule field might imply built-in forking.
- Specified by:
getSchedulein interfaceTraceSnapshot- Returns:
- the (possibly null) schedule
-
getScheduleString
Description copied from interface:TraceSnapshotGet the string representation of the schedule- Specified by:
getScheduleStringin interfaceTraceSnapshot- Returns:
- the (possibly empty) string representation of the schedule
-
setSchedule
Description copied from interface:TraceSnapshotSet the schedule from some previous snapshot to this one- Specified by:
setSchedulein interfaceTraceSnapshot- Parameters:
schedule- the schedule
-
getVersion
public long getVersion()Description copied from interface:TraceSnapshotGet the snapshot's version, esp., when it represents a cache entry- Specified by:
getVersionin interfaceTraceSnapshot- Returns:
- the version
- See Also:
-
setVersion
public void setVersion(long version) Description copied from interface:TraceSnapshotSet the snapshot's version, esp., when it represents a cache entry- Specified by:
setVersionin interfaceTraceSnapshot- Parameters:
version- the version- See Also:
-
delete
public void delete()Description copied from interface:TraceSnapshotDelete this snapshot This does not delete any entries in other managers associated with this snapshot. This simply deletes the marker and accompanying metadata. However, entries associated with deleted or otherwise non-existent snapshot keys may cause interesting behavior, especially for keys which exceed the latest snapshot key.- Specified by:
deletein interfaceTraceSnapshot
-