Package ghidra.trace.database.bookmark
Class DBTraceBookmarkManager
java.lang.Object
ghidra.trace.database.space.AbstractDBTraceSpaceBasedManager<DBTraceBookmarkSpace>
ghidra.trace.database.bookmark.DBTraceBookmarkManager
- All Implemented Interfaces:
ErrorHandler,DBTraceManager,DBTraceDelegatingManager<DBTraceBookmarkSpace>,TraceBookmarkManager,TraceBookmarkOperations
public class DBTraceBookmarkManager
extends AbstractDBTraceSpaceBasedManager<DBTraceBookmarkSpace>
implements TraceBookmarkManager, DBTraceDelegatingManager<DBTraceBookmarkSpace>
-
Nested Class Summary
Nested classes/interfaces inherited from class ghidra.trace.database.space.AbstractDBTraceSpaceBasedManager
AbstractDBTraceSpaceBasedManager.DBTraceSpaceEntryNested classes/interfaces inherited from interface ghidra.trace.database.space.DBTraceDelegatingManager
DBTraceDelegatingManager.ExcConsumer<T,E extends Throwable>, DBTraceDelegatingManager.ExcFunction<T, R, E extends Throwable>, DBTraceDelegatingManager.ExcPredicate<T, E extends Throwable>, DBTraceDelegatingManager.ExcSupplier<T, E extends Throwable> -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final longprotected static final intstatic final Stringprotected static final intFor non-register space:+---12----+----52----+ | SpaceID | Key | +---------+----------+protected static final intprotected final Map<String, DBTraceBookmarkType> protected final Collection<DBTraceBookmarkType> Fields inherited from class ghidra.trace.database.space.AbstractDBTraceSpaceBasedManager
baseLanguage, dbh, lock, name, NO_ADDRESS_SPACE, regSpacesByContainer, spaces, spaceStore, spacesView, threadManager, trace -
Constructor Summary
ConstructorsConstructorDescriptionDBTraceBookmarkManager(DBHandle dbh, OpenMode openMode, ReadWriteLock lock, TaskMonitor monitor, Language baseLanguage, DBTrace trace, DBTraceThreadManager threadManager) -
Method Summary
Modifier and TypeMethodDescriptionaddBookmark(Lifespan lifespan, Address address, TraceBookmarkType type, String category, String comment) Add a bookmark at the given location.protected DBTraceBookmarkSpacedefineBookmarkType(String typeName, Icon icon, Color color, int priority) Define (or redefine) a bookmark type.Collection<? extends DBTraceBookmark> getBookmark(long id) getBookmarkRegisterSpace(TraceStackFrame frame, boolean createIfAbsent) getBookmarkRegisterSpace(TraceThread thread, boolean createIfAbsent) Collection<? extends DBTraceBookmark> getBookmarksAdded(long from, long to) Iterable<? extends DBTraceBookmark> getBookmarksAt(long snap, Address address) getBookmarksByType(String typeName) Iterable<? extends DBTraceBookmark> getBookmarksEnclosed(Lifespan lifespan, AddressRange range) Iterable<? extends DBTraceBookmark> getBookmarksIntersecting(Lifespan lifespan, AddressRange range) getBookmarkSpace(AddressSpace space, boolean createIfAbsent) Collection<? extends DBTraceBookmark> getBookmarksRemoved(long from, long to) getBookmarkType(String typeName) Get all the categories used for a given typeCollection<? extends DBTraceBookmarkType> Get the defined bookmark types.getForSpace(AddressSpace space, boolean createIfAbsent) getOrDefineBookmarkType(String typeName) booleanisDefinedType(String type) protected static longpackId(long key, AddressSpace space) readLock()protected static longunpackKey(long id) protected static AddressSpaceunpackSpace(long id, AddressFactory addressFactory) protected static intunpackSpaceId(long id) Methods inherited from class ghidra.trace.database.space.AbstractDBTraceSpaceBasedManager
dbError, get, getActiveSpaces, getBaseLanguage, getForRegisterSpace, getForRegisterSpace, getForRegisterSpace, getLock, getSpaceByName, getTabledSpaces, getTrace, invalidateCache, loadSpaces, tableNameMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ghidra.trace.database.space.DBTraceDelegatingManager
checkIsInMemory, delegateAddressSet, delegateAny, delegateCollection, delegateDeleteB, delegateDeleteV, delegateFirst, delegateHashSet, delegateRead, delegateRead, delegateReadB, delegateReadI, delegateReadI, delegateReadOr, delegateWrite, delegateWriteAll, delegateWriteI, delegateWriteV
-
Field Details
-
NAME
- See Also:
-
SPACE_ID_MASK
protected static final int SPACE_ID_MASKFor non-register space:+---12----+----52----+ | SpaceID | Key | +---------+----------+- See Also:
-
SPACE_ID_SHIFT
protected static final int SPACE_ID_SHIFT- See Also:
-
MEM_KEY_MASK
protected static final long MEM_KEY_MASK- See Also:
-
MEM_KEY_SHIFT
protected static final int MEM_KEY_SHIFT- See Also:
-
typesByName
-
typesView
-
-
Constructor Details
-
DBTraceBookmarkManager
public DBTraceBookmarkManager(DBHandle dbh, OpenMode openMode, ReadWriteLock lock, TaskMonitor monitor, Language baseLanguage, DBTrace trace, DBTraceThreadManager threadManager) throws VersionException, IOException - Throws:
VersionExceptionIOException
-
-
Method Details
-
packId
-
unpackSpaceId
protected static int unpackSpaceId(long id) -
unpackKey
protected static long unpackKey(long id) -
unpackSpace
-
createSpace
protected DBTraceBookmarkSpace createSpace(AddressSpace space, AbstractDBTraceSpaceBasedManager.DBTraceSpaceEntry ent) throws VersionException, IOException - Specified by:
createSpacein classAbstractDBTraceSpaceBasedManager<DBTraceBookmarkSpace>- Throws:
VersionExceptionIOException
-
getBookmarkSpace
- Specified by:
getBookmarkSpacein interfaceTraceBookmarkManager
-
getBookmarkRegisterSpace
- Specified by:
getBookmarkRegisterSpacein interfaceTraceBookmarkManager
-
getBookmarkRegisterSpace
- Specified by:
getBookmarkRegisterSpacein interfaceTraceBookmarkManager
-
getForSpace
- Specified by:
getForSpacein interfaceDBTraceDelegatingManager<DBTraceBookmarkSpace>- Overrides:
getForSpacein classAbstractDBTraceSpaceBasedManager<DBTraceBookmarkSpace>
-
readLock
- Specified by:
readLockin interfaceDBTraceDelegatingManager<DBTraceBookmarkSpace>
-
writeLock
- Specified by:
writeLockin interfaceDBTraceDelegatingManager<DBTraceBookmarkSpace>
-
getOrDefineBookmarkType
-
isDefinedType
-
defineBookmarkType
public DBTraceBookmarkType defineBookmarkType(String typeName, Icon icon, Color color, int priority) Description copied from interface:TraceBookmarkManagerDefine (or redefine) a bookmark type. Bookmark type metadata are not stored in the database. To customize these things, a plugin must call this method for every opened program- Specified by:
defineBookmarkTypein interfaceTraceBookmarkManager- Parameters:
typeName- a name to uniquely identify the typeicon- an icon for displaying the mark (usually in the listing margin)color- a color for displaying the mark (usually in the listing background)priority- a priority to determine which mark is displayed when multiple are present at the same location- Returns:
- the newly-defined type
-
getDefinedBookmarkTypes
Description copied from interface:TraceBookmarkManagerGet the defined bookmark types.- Specified by:
getDefinedBookmarkTypesin interfaceTraceBookmarkManager- Returns:
- the types
-
getBookmarkType
- Specified by:
getBookmarkTypein interfaceTraceBookmarkManager
-
getBookmark
- Specified by:
getBookmarkin interfaceTraceBookmarkManager
-
getBookmarksByType
-
getCategoriesForType
Description copied from interface:TraceBookmarkOperationsGet all the categories used for a given type- Specified by:
getCategoriesForTypein interfaceTraceBookmarkOperations- Parameters:
type- the bookmark type- Returns:
- the set of categories
-
addBookmark
public DBTraceBookmark addBookmark(Lifespan lifespan, Address address, TraceBookmarkType type, String category, String comment) Description copied from interface:TraceBookmarkOperationsAdd a bookmark at the given location. The category need not be created explicitly beforehand. It will be created implicitly if it does not already exist.- Specified by:
addBookmarkin interfaceTraceBookmarkOperations- Parameters:
lifespan- the span of snaps to bookmarkaddress- the address to bookmarktype- the type of the bookmarkcategory- a category for the bookmarkcomment- a comment to add to the bookmark- Returns:
- the new bookmark
-
getAllBookmarks
- Specified by:
getAllBookmarksin interfaceTraceBookmarkOperations
-
getBookmarksAt
- Specified by:
getBookmarksAtin interfaceTraceBookmarkOperations
-
getBookmarksEnclosed
public Iterable<? extends DBTraceBookmark> getBookmarksEnclosed(Lifespan lifespan, AddressRange range) - Specified by:
getBookmarksEnclosedin interfaceTraceBookmarkOperations
-
getBookmarksIntersecting
public Iterable<? extends DBTraceBookmark> getBookmarksIntersecting(Lifespan lifespan, AddressRange range) - Specified by:
getBookmarksIntersectingin interfaceTraceBookmarkOperations
-
getBookmarksAdded
- Specified by:
getBookmarksAddedin interfaceTraceBookmarkManager
-
getBookmarksRemoved
- Specified by:
getBookmarksRemovedin interfaceTraceBookmarkManager
-