@@ -114,6 +114,7 @@ class Gdb:
114114 TARGET_STOP_REASON_BP = 3
115115 TARGET_STOP_REASON_WP = 4
116116 TARGET_STOP_REASON_STEPPED = 5
117+ TARGET_STOP_REASON_FN_FINISHED = 6
117118
118119 @staticmethod
119120 def get_logger ():
@@ -139,6 +140,8 @@ def _on_notify(self, rec):
139140 self ._target_stop_reason = self .TARGET_STOP_REASON_WP
140141 elif rec ['payload' ]['reason' ] == 'end-stepping-range' :
141142 self ._target_stop_reason = self .TARGET_STOP_REASON_STEPPED
143+ elif rec ['payload' ]['reason' ] == 'function-finished' :
144+ self ._target_stop_reason = self .TARGET_STOP_REASON_FN_FINISHED
142145 elif rec ['payload' ]['reason' ] == 'signal-received' :
143146 if rec ['payload' ]['signal-name' ] == 'SIGINT' :
144147 self ._target_stop_reason = self .TARGET_STOP_REASON_SIGINT
@@ -261,7 +264,19 @@ def exec_next(self):
261264 # -exec-next [--reverse]
262265 res ,_ = self ._mi_cmd_run ('-exec-next' )
263266 if res != 'running' :
264- raise DebuggerError ('Failed to step program!' )
267+ raise DebuggerError ('Failed to step over!' )
268+
269+ def exec_step (self ):
270+ # -exec-step [--reverse]
271+ res ,_ = self ._mi_cmd_run ('-exec-step' )
272+ if res != 'running' :
273+ raise DebuggerError ('Failed to step in!' )
274+
275+ def exec_finish (self ):
276+ # -exec-finish [--reverse]
277+ res ,_ = self ._mi_cmd_run ('-exec-finish' )
278+ if res != 'running' :
279+ raise DebuggerError ('Failed to step out!' )
265280
266281 def data_eval_expr (self , expr ):
267282 # -data-evaluate-expression expr
0 commit comments