diff options
| author | Camille Mougey <camille.mougey@cea.fr> | 2015-10-19 17:18:22 +0200 |
|---|---|---|
| committer | Camille Mougey <camille.mougey@cea.fr> | 2015-10-19 17:18:22 +0200 |
| commit | 449999fe65bbf500574d92d7ebf55304ba725e67 (patch) | |
| tree | a8661f7847cab745be0d0ab338a96b91038a9dd5 /miasm2/analysis/debugging.py | |
| parent | 4d8d7e01c63c7d3ae502bc1f9caa3368d951112f (diff) | |
| download | miasm-449999fe65bbf500574d92d7ebf55304ba725e67.tar.gz miasm-449999fe65bbf500574d92d7ebf55304ba725e67.zip | |
Debugging: handle breakpoint stop with a proper state
Diffstat (limited to 'miasm2/analysis/debugging.py')
| -rw-r--r-- | miasm2/analysis/debugging.py | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/miasm2/analysis/debugging.py b/miasm2/analysis/debugging.py index 592e21ff..3fffbf66 100644 --- a/miasm2/analysis/debugging.py +++ b/miasm2/analysis/debugging.py @@ -22,6 +22,16 @@ class DebugBreakpointSoft(DebugBreakpoint): return "Soft BP @0x%08x" % self.addr +class DebugBreakpointTerminate(DebugBreakpoint): + "Stand for an execution termination" + + def __init__(self, status): + self.status = status + + def __str__(self): + return "Terminate with %s" % self.status + + class DebugBreakpointMemory(DebugBreakpoint): "Stand for memory breakpoint" @@ -131,8 +141,9 @@ class Debugguer(object): self.myjit.jit.log_newbloc = newbloc def handle_exception(self, res): - if res is None: - return + if not res: + # A breakpoint has stopped the execution + return DebugBreakpointTerminate(res) if isinstance(res, DebugBreakpointSoft): print "Breakpoint reached @0x%08x" % res.addr |