@@ -422,8 +422,9 @@ def _setup_breakpoint_MEMBP(self, bp, target):
422422 return True
423423
424424 def _restore_breakpoint_MEMBP (self , bp , target ):
425- (page_addr , page_prot ) = bp ._reput_page
426- return target .virtual_protect (page_addr , PAGE_SIZE , page_prot , None )
425+ for (page_addr , page_prot ) in bp ._reput_pages :
426+ target .virtual_protect (page_addr , PAGE_SIZE , page_prot , None )
427+ bp ._reput_pages .clear ()
427428
428429
429430 def _remove_breakpoint_MEMBP (self , bp , target ):
@@ -542,7 +543,7 @@ def _pass_memory_breakpoint(self, bp, page_protect, fault_page):
542543 ctx = thread .context
543544 ctx .EEFlags .TF = 1
544545 thread .set_context (ctx )
545- bp ._reput_page = ( fault_page , page_prot .value )
546+ bp ._reput_pages . append (( fault_page , page_prot .value ) )
546547 self ._breakpoint_to_reput [cp .pid ].add (bp )
547548
548549 # debug event handlers
@@ -665,6 +666,7 @@ def _handle_exception_access_violation(self, exception, excp_addr):
665666 fault_type = exception .ExceptionRecord .ExceptionInformation [0 ]
666667 fault_addr = exception .ExceptionRecord .ExceptionInformation [1 ]
667668 pc_addr = self .current_thread .context .pc
669+ dbgprint ("Handling access_violation at pc={0:#x} addr={1:#x}" .format (pc_addr , fault_addr ), "DBG" )
668670 if fault_addr == pc_addr :
669671 fault_type = EXEC
670672 event = EVENT_STR [fault_type ]
0 commit comments