use of com.google.security.zynamics.binnavi.debug.debugger.DebuggerTemplate in project binnavi by google.
the class CDebuggersModel method delete.
@Override
public void delete() {
final DebuggerTemplateManager debuggerManager = m_database.getContent().getDebuggerTemplateManager();
debuggerManager.removeListener(m_debuggerManagerListener);
for (final DebuggerTemplate debugger : debuggerManager) {
debugger.removeListener(m_debuggerListener);
}
}
use of com.google.security.zynamics.binnavi.debug.debugger.DebuggerTemplate in project binnavi by google.
the class CDatabaseFunctions method deleteDebuggers.
/**
* Deletes a debugger template from the database.
*
* @param parent Parent frame used for dialogs.
* @param database The database where the debugger template is stored.
* @param debuggers The debugger templates to be deleted.
* @param updater Updates the project tree if deletion was successful.
*/
public static void deleteDebuggers(final JFrame parent, final IDatabase database, final DebuggerTemplate[] debuggers, final ITreeUpdater updater) {
if (CMessageBox.showYesNoQuestion(parent, String.format("Do you really want to delete the following debuggers from the database?\n\n%s", CNameListGenerators.getNameList(debuggers))) == JOptionPane.YES_OPTION) {
for (final DebuggerTemplate debugger : debuggers) {
new Thread() {
@Override
public void run() {
final CDefaultProgressOperation operation = new CDefaultProgressOperation("", false, true);
operation.getProgressPanel().setMaximum(1);
operation.getProgressPanel().setText("Removing debugger" + ": " + debugger.getName());
operation.getProgressPanel().next();
try {
database.getContent().getDebuggerTemplateManager().removeDebugger(debugger);
updater.update();
} catch (final CouldntDeleteException exception) {
CUtilityFunctions.logException(exception);
final String message = "E00030: " + "Debugger could not be deleted";
final String description = CUtilityFunctions.createDescription(String.format("The debugger '%s' could not be deleted. " + "Try to delete the debugger again. " + "If the problem persists, disconnect from and " + "reconnect to the database, restart BinNavi, " + "or contact the BinNavi support.", debugger.getName()), new String[] { "Database connection problems." }, new String[] { "The debugger still exists." });
NaviErrorDialog.show(parent, message, description, exception);
} finally {
operation.stop();
}
}
}.start();
}
}
}
use of com.google.security.zynamics.binnavi.debug.debugger.DebuggerTemplate in project binnavi by google.
the class CNameListGenerators method getNameList.
/**
* Generates a name list from the names of the given debuggers.
*
* @param debuggers The debuggers that provide the names.
*
* @return The generated name list.
*/
public static String getNameList(final DebuggerTemplate[] debuggers) {
int count = 0;
final StringBuilder list = new StringBuilder();
for (final DebuggerTemplate debugger : debuggers) {
list.append("- ");
list.append(debugger.getName());
list.append('\n');
count++;
if ((count == MAX_LIST_LENGTH) && (debuggers.length != MAX_LIST_LENGTH)) {
list.append("\n... ");
list.append(String.format("%d others ...", debuggers.length - count));
break;
}
}
return list.toString();
}
use of com.google.security.zynamics.binnavi.debug.debugger.DebuggerTemplate in project binnavi by google.
the class ViewEdgeTest method setUp.
@Before
public void setUp() throws CouldntLoadDataException, LoadCancelledException {
final MockSqlProvider provider = new MockSqlProvider();
final Database database = new Database(new MockDatabase());
final CModule internalModule = new CModule(123, "Name", "Comment", new Date(), new Date(), "12345678123456781234567812345678", "1234567812345678123456781234567812345678", 55, 66, new CAddress(0x555), new CAddress(0x666), new DebuggerTemplate(1, "Mock Debugger", "localhaus", 88, provider), null, Integer.MAX_VALUE, false, provider);
internalModule.load();
final TagManager nodeTagManager = new TagManager(new MockTagManager(com.google.security.zynamics.binnavi.Tagging.TagType.NODE_TAG));
final TagManager viewTagManager = new TagManager(new MockTagManager(com.google.security.zynamics.binnavi.Tagging.TagType.VIEW_TAG));
final Module module = new Module(database, internalModule, nodeTagManager, viewTagManager);
internalModule.getContent().getViewContainer().createView("", "");
// new View(module, mockView, nodeTagManager,
final View view = module.getViews().get(2);
// viewTagManager);
final ArrayList<IComment> comment = Lists.<IComment>newArrayList(new CComment(null, CommonTestObjects.TEST_USER_1, null, " COMMENT "));
m_source = view.createTextNode(comment);
m_target = view.createTextNode(comment);
// m_internalEdge = new CNaviEdge(1, internalNode, internalNode,
// com.google.security.zynamics.zylib.gui.zygraph.edges.EdgeType.JUMP_UNCONDITIONAL, 0, 0, 0, 0,
// Color.MAGENTA,
// false, true, "", new FilledList<CBend>(), new MockSqlProvider());
// new
m_edge = view.createEdge(m_source, m_target, EdgeType.JumpUnconditional);
// ViewEdge(m_internalEdge,
// m_source,
// m_target);
}
use of com.google.security.zynamics.binnavi.debug.debugger.DebuggerTemplate in project binnavi by google.
the class ProjectFactory method get.
public static Project get() {
final MockSqlProvider provider = new MockSqlProvider();
final Date creationDate = new Date();
final Date modificationDate = new Date();
final CProject internalProject = new CProject(123, "Name", "Comment", creationDate, modificationDate, 55, new FilledList<DebuggerTemplate>(), provider);
final TagManager nodeTagManager = new TagManager(new CTagManager(new Tree<CTag>(new TreeNode<CTag>(new CTag(0, "", "", TagType.NODE_TAG, provider))), TagType.NODE_TAG, provider));
final TagManager viewTagManager = new TagManager(new CTagManager(new Tree<CTag>(new TreeNode<CTag>(new CTag(0, "", "", TagType.VIEW_TAG, provider))), TagType.VIEW_TAG, provider));
final Database db = new Database(new MockDatabase());
return new Project(db, internalProject, nodeTagManager, viewTagManager);
}
Aggregations