use of com.google.security.zynamics.zylib.types.lists.FilledList in project binnavi by google.
the class CDebugBottomPanel method getPanels.
/**
* Creates the panels that are shown in the panel.
*
* @param model Provides the data needed by the components in the panel.
* @param debugPerspectiveModel Describes the debug perspective.
*
* @return The created panels.
*/
private static IFilledList<IResultsPanel> getPanels(final CGraphModel model, final CDebugPerspectiveModel debugPerspectiveModel) {
final IFilledList<IResultsPanel> debugPanels = new FilledList<IResultsPanel>();
debugPanels.add(new CCombinedMemoryPanel(model.getParent(), debugPerspectiveModel));
debugPanels.add(new CModulesPanel(debugPerspectiveModel));
debugPanels.add(new CThreadInformationPanel(debugPerspectiveModel));
debugPanels.add(new CBreakpointPanel(model.getParent(), model.getDebuggerProvider(), model.getGraph(), model.getViewContainer()));
debugPanels.add(new CTracesPanel(debugPerspectiveModel, model.getGraph(), model.getViewContainer().getTraceProvider(), model.getGraphPanel()));
debugPanels.add(new CBookmarkPanel(model.getDebuggerProvider()));
debugPanels.add(new CDebuggerHistoryPanel(debugPerspectiveModel));
return debugPanels;
}
use of com.google.security.zynamics.zylib.types.lists.FilledList in project binnavi by google.
the class CProject method load.
@Override
public void load() throws CouldntLoadDataException, LoadCancelledException {
synchronized (m_loadReporter) {
if (isLoaded()) {
return;
}
m_isLoading = true;
try {
if (!m_loadReporter.report(ProjectLoadEvents.Starting)) {
throw new LoadCancelledException();
}
if (!m_loadReporter.report(ProjectLoadEvents.LoadingAddressSpaces)) {
throw new LoadCancelledException();
}
final List<CAddressSpace> addressSpaces = m_provider.loadAddressSpaces(this);
for (final CAddressSpace space : addressSpaces) {
space.load();
}
if (!m_loadReporter.report(ProjectLoadEvents.LoadingCallgraphViews)) {
throw new LoadCancelledException();
}
final List<ICallgraphView> userCallgraphs = m_provider.loadCallgraphViews(this);
if (!m_loadReporter.report(ProjectLoadEvents.LoadingFlowgraphViews)) {
throw new LoadCancelledException();
}
final List<IFlowgraphView> userFlowgraphs = m_provider.loadFlowgraphs(this);
if (!m_loadReporter.report(ProjectLoadEvents.LoadingMixedgraphViews)) {
throw new LoadCancelledException();
}
final List<INaviView> userMixedgraphs = m_provider.loadMixedgraphs(this);
if (!m_loadReporter.report(ProjectLoadEvents.LoadingTraces)) {
throw new LoadCancelledException();
}
final List<TraceList> traces = m_provider.loadTraces(this);
final ArrayList<INaviView> views = new ArrayList<INaviView>(userCallgraphs);
views.addAll(userFlowgraphs);
views.addAll(userMixedgraphs);
m_content = new CProjectContent(this, m_listeners, m_provider, addressSpaces, views, new FilledList<TraceList>(traces));
} catch (CouldntLoadDataException | LoadCancelledException e) {
m_isLoading = false;
throw e;
} finally {
m_loadReporter.report(ProjectLoadEvents.Finished);
}
for (final IProjectListener listener : m_listeners) {
try {
listener.loadedProject(this);
} catch (final Exception exception) {
CUtilityFunctions.logException(exception);
}
}
m_isLoading = false;
}
}
use of com.google.security.zynamics.zylib.types.lists.FilledList in project binnavi by google.
the class ProcessTest method testLifeCycle.
@Test
public void testLifeCycle() {
final MockProcessListener listener = new MockProcessListener();
final ProcessManager manager = new ProcessManager();
final Process process = new Process(manager);
process.addListener(listener);
manager.setAttached(true);
assertEquals("attached;", listener.events);
process.removeListener(listener);
manager.setTargetInformation(new com.google.security.zynamics.binnavi.debug.models.targetinformation.TargetInformation(5, new FilledList<RegisterDescription>(), new DebuggerOptions(false, false, false, false, false, false, false, false, false, false, 12, 0, new ArrayList<DebuggerException>(), false, false, false)));
manager.addThread(new TargetProcessThread(0, ThreadState.RUNNING));
manager.addModule(new MemoryModule("Hannes", "C:\\Hannes.dll", new RelocatedAddress(new CAddress(0x100)), 0x100));
manager.setMemoryMap(new com.google.security.zynamics.binnavi.debug.models.processmanager.MemoryMap(Lists.newArrayList(new com.google.security.zynamics.binnavi.debug.models.processmanager.MemorySection(new CAddress(0), new CAddress(0x100)))));
manager.getMemory().store(0, new byte[] { 0, 1, 2, 3 });
process.addListener(listener);
manager.setTargetInformation(new com.google.security.zynamics.binnavi.debug.models.targetinformation.TargetInformation(5, new FilledList<RegisterDescription>(), new DebuggerOptions(false, false, false, false, false, false, false, false, false, false, 12, 0, new ArrayList<DebuggerException>(), false, false, false)));
assertEquals(0, process.getThreads().size());
assertEquals(0, process.getModules().size());
assertEquals(0, process.getMemoryMap().getSections().size());
assertEquals(false, process.getMemory().hasData(0, 4));
manager.setAttached(false);
assertEquals("attached;changedTargetInformation;detached;", listener.events);
assertEquals(0, process.getThreads().size());
assertEquals(0, process.getModules().size());
assertEquals(null, process.getTargetInformation());
assertEquals(0, process.getMemoryMap().getSections().size());
assertEquals(false, process.getMemory().hasData(0, 4));
process.removeListener(listener);
}
use of com.google.security.zynamics.zylib.types.lists.FilledList in project binnavi by google.
the class PostgreSQLProviderTest method testCModuleFunctionsgetViewsWithAddresses1.
@Test
public void testCModuleFunctionsgetViewsWithAddresses1() throws CouldntLoadDataException, LoadCancelledException {
final INaviModule module = getProvider().loadModules().get(0);
module.load();
final IFilledList<UnrelocatedAddress> addresses = new FilledList<UnrelocatedAddress>();
List<INaviView> views = PostgreSQLModuleFunctions.getViewsWithAddresses((AbstractSQLProvider) getProvider(), module, addresses, true);
assertEquals(0, views.size());
addresses.add(new UnrelocatedAddress(new CAddress(0x10033DCL)));
views = PostgreSQLModuleFunctions.getViewsWithAddresses((AbstractSQLProvider) getProvider(), module, addresses, true);
assertEquals(1, views.size());
addresses.add(new UnrelocatedAddress(new CAddress(0x1003429)));
views = PostgreSQLModuleFunctions.getViewsWithAddresses((AbstractSQLProvider) getProvider(), module, addresses, true);
assertEquals(0, views.size());
views = PostgreSQLModuleFunctions.getViewsWithAddresses((AbstractSQLProvider) getProvider(), module, addresses, false);
assertEquals(2, views.size());
}
use of com.google.security.zynamics.zylib.types.lists.FilledList in project binnavi by google.
the class PostgreSQLProviderTest method testCProjectFunctionsgetViewsWithAddresses1.
@Test
public void testCProjectFunctionsgetViewsWithAddresses1() throws CouldntLoadDataException, LoadCancelledException {
final INaviProject project = getProvider().loadProjects().get(0);
project.load();
final IFilledList<UnrelocatedAddress> addresses = new FilledList<UnrelocatedAddress>();
List<INaviView> views = PostgreSQLProjectFunctions.getViewsWithAddresses((AbstractSQLProvider) getProvider(), project, addresses, true);
assertEquals(0, views.size());
addresses.add(new UnrelocatedAddress(new CAddress(0x10033DCL)));
views = PostgreSQLProjectFunctions.getViewsWithAddresses((AbstractSQLProvider) getProvider(), project, addresses, true);
assertEquals(0, views.size());
addresses.add(new UnrelocatedAddress(new CAddress(0x1003429)));
views = PostgreSQLProjectFunctions.getViewsWithAddresses((AbstractSQLProvider) getProvider(), project, addresses, true);
assertEquals(0, views.size());
views = PostgreSQLProjectFunctions.getViewsWithAddresses((AbstractSQLProvider) getProvider(), project, addresses, false);
assertEquals(0, views.size());
}
Aggregations