exported / paimei

Automatically exported from code.google.com/p/paimei
GNU General Public License v2.0
1 stars 0 forks source link

Hardware breakpints do not work correctly. #5

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
The hardware breakpoint handler is executed only once and then the debugger
stops the application. 

Seems like the single step exception handler does not reset
_restore_breakpoint properly. The next changes to pydbg.py worked for me.

=========================================
--- pydbg.py.orig   2009-03-12 22:41:02.000000000 -0400
+++ pydbg.py    2009-03-12 22:51:45.000000000 -0400
@@ -1698,7 +1698,10 @@

         else:
             continue_status = DBG_EXCEPTION_NOT_HANDLED
-
+            
+        # reset restore breakpoint variable.
+        self._restore_breakpoint     = None
+        
         # if we are handling a hardware breakpoint hit and it still
exists, ie: the user didn't erase it during the
         # callback, and the breakpoint is flagged for restore, then tell
the single step handler about it. furthermore,
         # check if the debugger is still active, that way we don't try and
single step if the user requested a detach.
@@ -1714,11 +1717,11 @@
                         self._restore_breakpoint = prev
                         self.single_step(True)

+
                     self.bp_del_hw(slot=prev.slot)

-        # reset the hardware breakpoint hit flag and restore breakpoint
variable.
-        self.hardware_breakpoint_hit = None
-        self._restore_breakpoint     = None
+        # reset the hardware breakpoint hit flag.
            f.hardware_breakpoint_hit = None

         return continue_status
=========================================

Original issue reported on code.google.com by dima...@gmail.com on 13 Mar 2009 at 3:03