about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--miasm2/analysis/dse.py20
1 files changed, 19 insertions, 1 deletions
diff --git a/miasm2/analysis/dse.py b/miasm2/analysis/dse.py
index 0a5445a6..427a8bd0 100644
--- a/miasm2/analysis/dse.py
+++ b/miasm2/analysis/dse.py
@@ -192,7 +192,25 @@ class DSEEngine(object):
 
     def attach(self, emulator):
         """Attach the DSE to @emulator
-        @emulator: jitload (or API equivalent) instance"""
+        @emulator: jitload (or API equivalent) instance
+
+        To attach *DURING A BREAKPOINT*, one may consider using the following snippet:
+
+        def breakpoint(self, jitter):
+            ...
+            dse.attach(jitter)
+            dse.update...
+            ...
+            # Additionnal call to the exec callback is necessary, as breakpoints are
+            # honored AFTER exec callback
+            jitter.exec_cb(jitter)
+
+            return True
+
+        Without it, one may encounteer a DriftException error due to a
+        "desynchronization" between jitter and dse states. Indeed, on 'handle'
+        call, the jitter must be one instruction AFTER the dse.
+        """
         self.jitter = emulator
         self.prepare()