use of com.google.security.zynamics.binnavi.disassembly.UnrelocatedAddress in project binnavi by google.
the class BreakpointHelpersTest method testGetBreakpointsNode.
@Test
public void testGetBreakpointsNode() {
assertTrue(BreakpointHelpers.getBreakpoints(m_debugger, m_node).isEmpty());
m_debugger.getBreakpointManager().getNative().addBreakpoints(BreakpointType.REGULAR, Sets.newHashSet(new BreakpointAddress(m_module, new UnrelocatedAddress(new CAddress(0x1234)))));
final List<Address> breakpoints = BreakpointHelpers.getBreakpoints(m_debugger, m_node);
assertEquals(1, breakpoints.size());
assertEquals(0x1234, breakpoints.get(0).toLong());
try {
BreakpointHelpers.getBreakpoints(null, m_node);
fail();
} catch (final NullPointerException exception) {
}
try {
BreakpointHelpers.getBreakpoints(m_debugger, (CodeNode) null);
fail();
} catch (final NullPointerException exception) {
}
}
use of com.google.security.zynamics.binnavi.disassembly.UnrelocatedAddress in project binnavi by google.
the class BreakpointHelpersTest method testGetBreakpointsView.
@Test
public void testGetBreakpointsView() {
assertTrue(BreakpointHelpers.getBreakpoints(m_debugger, m_view).isEmpty());
m_debugger.getBreakpointManager().getNative().addBreakpoints(BreakpointType.REGULAR, Sets.newHashSet(new BreakpointAddress(m_module, new UnrelocatedAddress(new CAddress(0x1234)))));
m_debugger.getBreakpointManager().getNative().addBreakpoints(BreakpointType.REGULAR, Sets.newHashSet(new BreakpointAddress(m_module, new UnrelocatedAddress(new CAddress(0x123)))));
final List<Address> breakpoints = BreakpointHelpers.getBreakpoints(m_debugger, m_view);
assertEquals(2, breakpoints.size());
assertEquals(0x1234, breakpoints.get(0).toLong());
assertEquals(0x123, breakpoints.get(1).toLong());
try {
BreakpointHelpers.getBreakpoints(null, m_view);
fail();
} catch (final NullPointerException exception) {
}
try {
BreakpointHelpers.getBreakpoints(m_debugger, (View) null);
fail();
} catch (final NullPointerException exception) {
}
}
use of com.google.security.zynamics.binnavi.disassembly.UnrelocatedAddress in project binnavi by google.
the class BreakpointHelpersTest method testGetEchoBreakpointsView.
@Test
public void testGetEchoBreakpointsView() {
assertTrue(BreakpointHelpers.getEchoBreakpoints(m_debugger, m_view).isEmpty());
m_debugger.getBreakpointManager().getNative().addBreakpoints(BreakpointType.ECHO, Sets.newHashSet(new BreakpointAddress(m_module, new UnrelocatedAddress(new CAddress(0x1234)))));
m_debugger.getBreakpointManager().getNative().addBreakpoints(BreakpointType.ECHO, Sets.newHashSet(new BreakpointAddress(m_module, new UnrelocatedAddress(new CAddress(0x123)))));
final List<Address> breakpoints = BreakpointHelpers.getEchoBreakpoints(m_debugger, m_view);
assertEquals(2, breakpoints.size());
assertEquals(0x1234, breakpoints.get(0).toLong());
assertEquals(0x123, breakpoints.get(1).toLong());
try {
BreakpointHelpers.getEchoBreakpoints(null, m_view);
fail();
} catch (final NullPointerException exception) {
}
try {
BreakpointHelpers.getEchoBreakpoints(m_debugger, (View) null);
fail();
} catch (final NullPointerException exception) {
}
}
use of com.google.security.zynamics.binnavi.disassembly.UnrelocatedAddress in project binnavi by google.
the class BreakpointManagerTest method testAddMultipleNative.
@Test
public void testAddMultipleNative() {
internalManager.addBreakpoints(BreakpointType.ECHO, Sets.newHashSet(new BreakpointAddress(CommonTestObjects.MODULE, new UnrelocatedAddress(new CAddress(0x124)))));
assertTrue(apiManager.hasEchoBreakpoint(module, new Address(0x124)));
internalManager.clearBreakpointsPassive(BreakpointType.ECHO);
}
use of com.google.security.zynamics.binnavi.disassembly.UnrelocatedAddress in project binnavi by google.
the class BreakpointManagerTest method testRemoveBreakpoint.
@Test
public void testRemoveBreakpoint() {
try {
apiManager.removeBreakpoint(null, null);
fail();
} catch (final NullPointerException exception) {
}
apiManager.setBreakpoint(module, new Address(0x123));
apiManager.setBreakpoint(module, new Address(0x124));
apiManager.addListener(mockListener);
apiManager.removeBreakpoint(module, new Address(0x123));
internalManager.removeBreakpoints(BreakpointType.REGULAR, Sets.newHashSet(new BreakpointAddress(CommonTestObjects.MODULE, new UnrelocatedAddress(new CAddress(0x124)))));
assertEquals("removedBreakpoint/124;", mockListener.events);
assertEquals(1, apiManager.getBreakpoints().size());
apiManager.removeListener(mockListener);
}
Aggregations