@@ -114,6 +114,7 @@ class Gdb:
114
114
TARGET_STOP_REASON_BP = 3
115
115
TARGET_STOP_REASON_WP = 4
116
116
TARGET_STOP_REASON_STEPPED = 5
117
+ TARGET_STOP_REASON_FN_FINISHED = 6
117
118
118
119
@staticmethod
119
120
def get_logger ():
@@ -139,6 +140,8 @@ def _on_notify(self, rec):
139
140
self ._target_stop_reason = self .TARGET_STOP_REASON_WP
140
141
elif rec ['payload' ]['reason' ] == 'end-stepping-range' :
141
142
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
142
145
elif rec ['payload' ]['reason' ] == 'signal-received' :
143
146
if rec ['payload' ]['signal-name' ] == 'SIGINT' :
144
147
self ._target_stop_reason = self .TARGET_STOP_REASON_SIGINT
@@ -261,7 +264,19 @@ def exec_next(self):
261
264
# -exec-next [--reverse]
262
265
res ,_ = self ._mi_cmd_run ('-exec-next' )
263
266
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!' )
265
280
266
281
def data_eval_expr (self , expr ):
267
282
# -data-evaluate-expression expr
0 commit comments