MCPcopy Create free account
hub / github.com/Vector35/debugger / test_breakpoint

Method test_breakpoint

test/debugger_test.py:167–183  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

165 self.assertEqual(reason, DebugStopReason.ProcessExited)
166
167 def test_breakpoint(self):
168 fpath = name_to_fpath('helloworld', self.arch)
169 bv = load(fpath)
170 dbg = DebuggerController(bv)
171 self.assertNotIn(dbg.launch_and_wait(), [DebugStopReason.ProcessExited, DebugStopReason.InternalError])
172 # TODO: right now we are not returning whether the operation succeeds, so we cannot use assertTrue/assertFalse
173 # breakpoint set/clear should fail at 0
174 self.assertIsNone(dbg.add_breakpoint(0))
175 self.assertIsNone(dbg.delete_breakpoint(0))
176
177 # breakpoint set/clear should succeed at entrypoint
178 entry = dbg.data.entry_point
179 self.assertIsNone(dbg.delete_breakpoint(entry))
180 self.assertIsNone(dbg.add_breakpoint(entry))
181
182 self.assertEqual(dbg.ip, entry)
183 dbg.quit_and_wait()
184
185 def test_register_read_write(self):
186 fpath = name_to_fpath('helloworld', self.arch)

Callers

nothing calls this directly

Calls 6

launch_and_waitMethod · 0.95
add_breakpointMethod · 0.95
delete_breakpointMethod · 0.95
quit_and_waitMethod · 0.95
DebuggerControllerClass · 0.90
name_to_fpathFunction · 0.85

Tested by

no test coverage detected