use of com.google.security.zynamics.binnavi.models.Bookmarks.memory.BookmarkManager in project binnavi by google.
the class CBookmarkTableModel method getBookmarkDescription.
/**
* Finds the bookmark description of the bookmark that is displayed in a given row of the table.
*
* @param row The table row where the bookmark is displayed.
*
* @return The bookmark description of the bookmark in the given row.
*/
private String getBookmarkDescription(final int row) {
final Triple<IDebugger, BookmarkManager, Integer> bookmarkTriple = CBookmarkTableHelpers.findBookmark(m_debuggerProvider, row);
final BookmarkManager manager = bookmarkTriple.second();
final int index = bookmarkTriple.third();
return manager.getBookmark(index).getDescription();
}
use of com.google.security.zynamics.binnavi.models.Bookmarks.memory.BookmarkManager in project binnavi by google.
the class CBookmarkFunctions method deleteBookmarks.
/**
* Deletes a list of bookmarks.
*
* @param provider Contains the debuggers where bookmarks can be set.
* @param rows The rows of the bookmarks to delete.
*/
public static void deleteBookmarks(final BackEndDebuggerProvider provider, final int[] rows) {
Preconditions.checkNotNull(provider, "IE01329: Provider argument can not be null");
Preconditions.checkNotNull(rows, "IE01330: Rows argument can not be null");
final ArrayList<Pair<BookmarkManager, CBookmark>> bookmarks = new ArrayList<Pair<BookmarkManager, CBookmark>>();
for (final int row : rows) {
final Triple<IDebugger, BookmarkManager, Integer> bookmarkTriple = CBookmarkTableHelpers.findBookmark(provider, row);
final BookmarkManager manager = bookmarkTriple.second();
final int index = bookmarkTriple.third();
bookmarks.add(Pair.make(manager, manager.getBookmark(index)));
}
for (final Pair<BookmarkManager, CBookmark> p : bookmarks) {
p.first().removeBookmark(p.second());
}
}
use of com.google.security.zynamics.binnavi.models.Bookmarks.memory.BookmarkManager in project binnavi by google.
the class BookmarkManagerTest method testPreinitialized.
@Test
public void testPreinitialized() {
final BookmarkManager nativeManager = new BookmarkManager();
nativeManager.addBookmark(new CBookmark(new CAddress(0), "foo"));
final com.google.security.zynamics.binnavi.API.debug.BookmarkManager apiManager = new com.google.security.zynamics.binnavi.API.debug.BookmarkManager(nativeManager);
final Bookmark bm = apiManager.getBookmark(0);
assertEquals(0, bm.getAddress().toLong());
assertEquals("foo", bm.getDescription());
}
Aggregations