mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-07-30 07:18:37 -09:00
GP-6517 Additional fix for missing bookmark table
This commit is contained in:
@@ -76,12 +76,11 @@ public class BookmarkDBAdapterV3 extends BookmarkDBAdapter {
|
||||
int id = typeIDs[i];
|
||||
String tableName = BOOKMARK_TABLE_NAME + id;
|
||||
Table table = handle.getTable(tableName);
|
||||
if (table == null) {
|
||||
throw new IOException("Missing bookmark table: " + tableName);
|
||||
}
|
||||
int schemaVersion = table.getSchema().getVersion();
|
||||
if (version >= 0 && schemaVersion != version) {
|
||||
throw new IOException("Inconsistent bookmark table versions");
|
||||
if (table != null) {
|
||||
int schemaVersion = table.getSchema().getVersion();
|
||||
if (version >= 0 && schemaVersion != version) {
|
||||
throw new IOException("Inconsistent bookmark table versions");
|
||||
}
|
||||
}
|
||||
tables[id] = table;
|
||||
}
|
||||
|
||||
@@ -103,7 +103,7 @@ public class BookmarkDBManager implements BookmarkManager, ErrorHandler, Manager
|
||||
int typeId = (int) rec.getKey();
|
||||
BookmarkTypeDB type =
|
||||
new BookmarkTypeDB(typeId, rec.getString(BookmarkTypeDBAdapter.TYPE_NAME_COL));
|
||||
type.setHasBookmarks(true);
|
||||
type.setHasBookmarks(bookmarkAdapter.hasTable(typeId));
|
||||
typesByName.put(type.getTypeString(), type);
|
||||
typesArray.put(typeId, type);
|
||||
}
|
||||
@@ -208,9 +208,11 @@ public class BookmarkDBManager implements BookmarkManager, ErrorHandler, Manager
|
||||
typesArray.put(typeId, bmt);
|
||||
}
|
||||
if (create && !bmt.hasBookmarks()) {
|
||||
|
||||
// Ensure that both type record and bookmarks table exists
|
||||
bookmarkTypeAdapter.addType(bmt.getTypeId(), bmt.getTypeString());
|
||||
bmt.setHasBookmarks(true);
|
||||
bookmarkAdapter.addType(bmt.getTypeId());
|
||||
bmt.setHasBookmarks(true);
|
||||
|
||||
// fire event
|
||||
program.setObjChanged(ProgramEvent.BOOKMARK_TYPE_ADDED, bmt, null, null);
|
||||
|
||||
Reference in New Issue
Block a user