use of com.google.security.zynamics.binnavi.debug.debugger.DebuggerTemplateManager 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.DebuggerTemplateManager in project binnavi by google.
the class CDatabase method load.
@Override
public void load() throws CouldntLoadDataException, InvalidDatabaseVersionException, LoadCancelledException {
Preconditions.checkArgument(isConnected(), "IE00686: Not connected to the database");
try {
if (!loadReporter.report(LoadEvents.LOADING_DATABASE)) {
throw new LoadCancelledException();
}
if (!loadReporter.report(LoadEvents.DETERMINING_DATABASE_VERSION)) {
throw new LoadCancelledException();
}
final DatabaseVersion databaseVersion = provider.getDatabaseVersion();
final DatabaseVersion currentVersion = new DatabaseVersion(Constants.PROJECT_VERSION);
if ((databaseVersion.compareTo(currentVersion) != 0) && currentVersion.needsUpgrading(databaseVersion)) {
throw new InvalidDatabaseVersionException(databaseVersion);
}
if (!loadReporter.report(LoadEvents.LOADING_USERS)) {
throw new LoadCancelledException();
}
loadUserManager();
if (!loadReporter.report(LoadEvents.LOADING_VIEW_TAGS)) {
throw new LoadCancelledException();
}
final CTagManager viewTagManager = loadViewTagManager();
if (!loadReporter.report(LoadEvents.LOADING_NODE_TAGS)) {
throw new LoadCancelledException();
}
final CTagManager nodeTagManager = loadNodeTagManager();
if (!loadReporter.report(LoadEvents.LOADING_DEBUGGERS)) {
throw new LoadCancelledException();
}
final DebuggerTemplateManager debuggerDescriptionManager = provider.loadDebuggers();
if (!loadReporter.report(LoadEvents.LOADING_PROJECTS)) {
throw new LoadCancelledException();
}
final List<INaviProject> projects = provider.loadProjects();
if (!loadReporter.report(LoadEvents.LOADING_RAW_MODULES)) {
throw new LoadCancelledException();
}
final List<INaviRawModule> rawModules = provider.loadRawModules();
if (!loadReporter.report(LoadEvents.LOADING_MODULES)) {
throw new LoadCancelledException();
}
final List<INaviModule> modules = provider.loadModules();
debuggerDescriptionManager.addListener(internalDebuggerTemplateListener);
content = new CDatabaseContent(provider, this, listeners, projects, modules, rawModules, viewTagManager, nodeTagManager, debuggerDescriptionManager);
} catch (final CouldntLoadDataException exception) {
loadReporter.report(LoadEvents.LOADING_FINISHED);
close();
throw exception;
} catch (final InvalidDatabaseVersionException exception) {
loadReporter.report(LoadEvents.LOADING_FINISHED);
throw exception;
} catch (final LoadCancelledException exception) {
loadReporter.report(LoadEvents.LOADING_FINISHED);
close();
throw exception;
} finally {
isLoading = false;
}
content.initializeRawModules(content.getModules(), content.getRawModules());
for (final IDatabaseListener listener : listeners) {
try {
listener.loadedDatabase(this);
} catch (final Exception exception) {
CUtilityFunctions.logException(exception);
}
}
loadReporter.report(LoadEvents.LOADING_FINISHED);
}
use of com.google.security.zynamics.binnavi.debug.debugger.DebuggerTemplateManager in project binnavi by google.
the class CDebuggerContainerNode method dispose.
@Override
public void dispose() {
super.dispose();
final DebuggerTemplateManager debuggerManager = m_database.getContent().getDebuggerTemplateManager();
debuggerManager.removeListener(m_debuggerManagerListener);
deleteChildren();
}
use of com.google.security.zynamics.binnavi.debug.debugger.DebuggerTemplateManager in project binnavi by google.
the class PostgreSQLProviderTest method testCAddressSpaceLoaderLoadAddressSpaces1.
@Test
public void testCAddressSpaceLoaderLoadAddressSpaces1() throws CouldntLoadDataException, LoadCancelledException, CouldntSaveDataException {
final DebuggerTemplateManager debuggerManager = new DebuggerTemplateManager(getProvider());
final CProject project = getProvider().createProject("PROJECT_234");
getProvider().createAddressSpace(project, "ADDRESS_SPACE_234");
final List<INaviModule> modules = getProvider().loadModules();
final List<INaviModule> convertedModules = new ArrayList<INaviModule>();
convertedModules.add(modules.get(0));
final List<CAddressSpace> addressSpaces = PostgreSQLAddressSpaceLoader.loadAddressSpaces((AbstractSQLProvider) getProvider(), project, debuggerManager, convertedModules);
final CAddressSpace addressSpace = addressSpaces.get(0);
addressSpace.load();
addressSpace.getContent().addModule(modules.get(0));
addressSpace.getContent().setImageBase(modules.get(0), new CAddress(0x1234));
@SuppressWarnings("unused") final List<CAddressSpace> addressSpaces2 = PostgreSQLAddressSpaceLoader.loadAddressSpaces((AbstractSQLProvider) getProvider(), project, debuggerManager, convertedModules);
}
use of com.google.security.zynamics.binnavi.debug.debugger.DebuggerTemplateManager in project binnavi by google.
the class PostgreSQLProviderTest method testCAddressSpaceLoaderLoadAddressSpaces5.
@Test(expected = NullPointerException.class)
public void testCAddressSpaceLoaderLoadAddressSpaces5() throws CouldntLoadDataException {
final CProject project = (CProject) getProvider().loadProjects().get(0);
final DebuggerTemplateManager debuggerManager = new DebuggerTemplateManager(getProvider());
PostgreSQLAddressSpaceLoader.loadAddressSpaces((AbstractSQLProvider) getProvider(), project, debuggerManager, null);
}
Aggregations