use of com.google.security.zynamics.binnavi.models.Bookmarks.memory.CBookmark in project binnavi by google.
the class BookmarkManager method removeBookmark.
// ! Removes a bookmark.
/**
* Removes the memory bookmark at the given address.
*
* @param address Address of the bookmark.
*/
public void removeBookmark(final Address address) {
Preconditions.checkNotNull(address, "Error: Address argument can not be null");
final CBookmark bookmark = m_bookmarkManager.getBookmark(new CAddress(address.toLong()));
Preconditions.checkNotNull(bookmark, "Error: No bookmark exists at the specified address");
m_bookmarkManager.removeBookmark(bookmark);
}
use of com.google.security.zynamics.binnavi.models.Bookmarks.memory.CBookmark 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.CBookmark 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