@@ -1047,6 +1047,31 @@ def run_to(self, address) -> bool:
10471047
10481048 return dbgcore .BNDebuggerRunTo (self .handle , addr_list , len (address ))
10491049
1050+ def run_to_reverse (self , address ) -> bool :
1051+ """
1052+ Resume the target in reverse, and wait for it to break at the given address(es).
1053+
1054+ The address parameter can be either an integer, or a list of integers.
1055+
1056+ Internally, the debugger places breakpoints on these addresses, resumes the target in reverse, and waits for the target
1057+ to break. Then the debugger removes the added breakpoints.
1058+
1059+ The call is asynchronous and returns before the target stops.
1060+
1061+ :return: whether the operation is successfully requested
1062+ """
1063+ if isinstance (address , int ):
1064+ address = [address ]
1065+
1066+ if not isinstance (address , list ):
1067+ raise NotImplementedError
1068+
1069+ addr_list = (ctypes .c_uint64 * len (address ))()
1070+ for i in range (len (address )):
1071+ addr_list [i ] = address [i ]
1072+
1073+ return dbgcore .BNDebuggerRunToReverse (self .handle , addr_list , len (address ))
1074+
10501075 def go_and_wait (self ) -> DebugStopReason :
10511076 """
10521077 Resume the target.
@@ -1200,6 +1225,31 @@ def run_to_and_wait(self, address) -> DebugStopReason:
12001225
12011226 return DebugStopReason (dbgcore .BNDebuggerRunToAndWait (self .handle , addr_list , len (address )))
12021227
1228+ def run_to_reverse_and_wait (self , address ) -> DebugStopReason :
1229+ """
1230+ Resume the target in reverse, and wait for it to break at the given address(es).
1231+
1232+ The address parameter can be either an integer, or a list of integers.
1233+
1234+ Internally, the debugger places breakpoints on these addresses, resumes the target in reverse, and waits for the target
1235+ to break. Then the debugger removes the added breakpoints.
1236+
1237+ The call is blocking and only returns when the target stops.
1238+
1239+ :return: the reason for the stop
1240+ """
1241+ if isinstance (address , int ):
1242+ address = [address ]
1243+
1244+ if not isinstance (address , list ):
1245+ raise NotImplementedError
1246+
1247+ addr_list = (ctypes .c_uint64 * len (address ))()
1248+ for i in range (len (address )):
1249+ addr_list [i ] = address [i ]
1250+
1251+ return DebugStopReason (dbgcore .BNDebuggerRunToReverseAndWait (self .handle , addr_list , len (address )))
1252+
12031253 def pause_and_wait (self ) -> None :
12041254 """
12051255 Pause a running target.
0 commit comments