Search in sources :

Example 1 with DebuggerTemplateManager

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);
    }
}
Also used : DebuggerTemplate(com.google.security.zynamics.binnavi.debug.debugger.DebuggerTemplate) DebuggerTemplateManager(com.google.security.zynamics.binnavi.debug.debugger.DebuggerTemplateManager)

Example 2 with DebuggerTemplateManager

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);
}
Also used : InvalidDatabaseVersionException(com.google.security.zynamics.binnavi.Database.Exceptions.InvalidDatabaseVersionException) CouldntLoadDataException(com.google.security.zynamics.binnavi.Database.Exceptions.CouldntLoadDataException) CTagManager(com.google.security.zynamics.binnavi.Tagging.CTagManager) DebuggerTemplateManager(com.google.security.zynamics.binnavi.debug.debugger.DebuggerTemplateManager) IDatabaseListener(com.google.security.zynamics.binnavi.Database.Interfaces.IDatabaseListener) LoadCancelledException(com.google.security.zynamics.binnavi.Database.Exceptions.LoadCancelledException) CouldntInitializeDatabaseException(com.google.security.zynamics.binnavi.Database.Exceptions.CouldntInitializeDatabaseException) CouldntLoadDriverException(com.google.security.zynamics.binnavi.Database.Exceptions.CouldntLoadDriverException) InvalidExporterDatabaseFormatException(com.google.security.zynamics.binnavi.Database.Exceptions.InvalidExporterDatabaseFormatException) SQLException(java.sql.SQLException) InvalidDatabaseException(com.google.security.zynamics.binnavi.Database.Exceptions.InvalidDatabaseException) CouldntConnectException(com.google.security.zynamics.binnavi.Database.Exceptions.CouldntConnectException) CouldntSaveDataException(com.google.security.zynamics.binnavi.Database.Exceptions.CouldntSaveDataException) CouldntLoadDataException(com.google.security.zynamics.binnavi.Database.Exceptions.CouldntLoadDataException) CouldntUpdateDatabaseException(com.google.security.zynamics.binnavi.Database.Exceptions.CouldntUpdateDatabaseException) InvalidDatabaseVersionException(com.google.security.zynamics.binnavi.Database.Exceptions.InvalidDatabaseVersionException) INaviRawModule(com.google.security.zynamics.binnavi.disassembly.INaviRawModule) INaviProject(com.google.security.zynamics.binnavi.disassembly.INaviProject) INaviModule(com.google.security.zynamics.binnavi.disassembly.INaviModule) LoadCancelledException(com.google.security.zynamics.binnavi.Database.Exceptions.LoadCancelledException)

Example 3 with DebuggerTemplateManager

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();
}
Also used : DebuggerTemplateManager(com.google.security.zynamics.binnavi.debug.debugger.DebuggerTemplateManager)

Example 4 with DebuggerTemplateManager

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);
}
Also used : CProject(com.google.security.zynamics.binnavi.disassembly.CProject) INaviModule(com.google.security.zynamics.binnavi.disassembly.INaviModule) ArrayList(java.util.ArrayList) DebuggerTemplateManager(com.google.security.zynamics.binnavi.debug.debugger.DebuggerTemplateManager) CAddressSpace(com.google.security.zynamics.binnavi.disassembly.AddressSpaces.CAddressSpace) CAddress(com.google.security.zynamics.zylib.disassembly.CAddress) ExpensiveBaseTest(com.google.security.zynamics.binnavi.disassembly.types.ExpensiveBaseTest) Test(org.junit.Test)

Example 5 with DebuggerTemplateManager

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);
}
Also used : CProject(com.google.security.zynamics.binnavi.disassembly.CProject) DebuggerTemplateManager(com.google.security.zynamics.binnavi.debug.debugger.DebuggerTemplateManager) ExpensiveBaseTest(com.google.security.zynamics.binnavi.disassembly.types.ExpensiveBaseTest) Test(org.junit.Test)

Aggregations

DebuggerTemplateManager (com.google.security.zynamics.binnavi.debug.debugger.DebuggerTemplateManager)5 CProject (com.google.security.zynamics.binnavi.disassembly.CProject)2 INaviModule (com.google.security.zynamics.binnavi.disassembly.INaviModule)2 ExpensiveBaseTest (com.google.security.zynamics.binnavi.disassembly.types.ExpensiveBaseTest)2 Test (org.junit.Test)2 CouldntConnectException (com.google.security.zynamics.binnavi.Database.Exceptions.CouldntConnectException)1 CouldntInitializeDatabaseException (com.google.security.zynamics.binnavi.Database.Exceptions.CouldntInitializeDatabaseException)1 CouldntLoadDataException (com.google.security.zynamics.binnavi.Database.Exceptions.CouldntLoadDataException)1 CouldntLoadDriverException (com.google.security.zynamics.binnavi.Database.Exceptions.CouldntLoadDriverException)1 CouldntSaveDataException (com.google.security.zynamics.binnavi.Database.Exceptions.CouldntSaveDataException)1 CouldntUpdateDatabaseException (com.google.security.zynamics.binnavi.Database.Exceptions.CouldntUpdateDatabaseException)1 InvalidDatabaseException (com.google.security.zynamics.binnavi.Database.Exceptions.InvalidDatabaseException)1 InvalidDatabaseVersionException (com.google.security.zynamics.binnavi.Database.Exceptions.InvalidDatabaseVersionException)1 InvalidExporterDatabaseFormatException (com.google.security.zynamics.binnavi.Database.Exceptions.InvalidExporterDatabaseFormatException)1 LoadCancelledException (com.google.security.zynamics.binnavi.Database.Exceptions.LoadCancelledException)1 IDatabaseListener (com.google.security.zynamics.binnavi.Database.Interfaces.IDatabaseListener)1 CTagManager (com.google.security.zynamics.binnavi.Tagging.CTagManager)1 DebuggerTemplate (com.google.security.zynamics.binnavi.debug.debugger.DebuggerTemplate)1 CAddressSpace (com.google.security.zynamics.binnavi.disassembly.AddressSpaces.CAddressSpace)1 INaviProject (com.google.security.zynamics.binnavi.disassembly.INaviProject)1