mirror of
https://github.com/hakril/PythonForWindows
synced 2026-06-08 14:31:45 +00:00
debugger disable memory breakpoint before calling membp.trigger()
This commit is contained in:
@@ -461,7 +461,8 @@ class Debugger(object):
|
||||
self._pass_memory_breakpoint(bp, original_prot, fault_page)
|
||||
return DBG_CONTINUE
|
||||
|
||||
continue_flag = mem_bp.trigger(self, exception)
|
||||
with self.DisabledMemoryBreakpoint()
|
||||
continue_flag = mem_bp.trigger(self, exception)
|
||||
self._explicit_single_step[self.current_thread.tid] = self.current_thread.context.EEFlags.TF
|
||||
# If BP has not been removed in trigger, pas it
|
||||
if fault_page in cp_watch_page and mem_bp in cp_watch_page[fault_page].bps:
|
||||
@@ -716,6 +717,14 @@ class Debugger(object):
|
||||
target.virtual_protect(page_addr, PAGE_SIZE, protection, None)
|
||||
return
|
||||
|
||||
@contextmanager
|
||||
def DisabledMemoryBreakpoint(self, target=None):
|
||||
data = self.disable_all_memory_breakpoints(target)
|
||||
try:
|
||||
yield
|
||||
finally:
|
||||
self.restore_all_memory_breakpoints(data, target)
|
||||
|
||||
# Public callback
|
||||
def on_exception(self, exception):
|
||||
"""Called on exception event other that known breakpoint or requested single step. ``exception`` is one of the following type:
|
||||
|
||||
Reference in New Issue
Block a user