@@ -361,7 +361,10 @@ def _handle_message(
361
361
# response or the event, since the DAP does not specify an order in which they are sent. May need revisiting
362
362
# if there turns out to be some odd ordering issues, e.g. if we can receive messages in the order
363
363
# ["response: continued", "event: stopped", "event: continued"].
364
- if message ["command" ] == "continue" and message ["success" ] == True :
364
+ if (
365
+ message ["command" ] in ["continue" , "stepIn" , "next" , "stepOut" ]
366
+ and message ["success" ] == True
367
+ ):
365
368
debugger_state .is_running = True
366
369
# Reset all state that is invalidated upon program continue.
367
370
debugger_state .stopped_reason = None
@@ -677,21 +680,34 @@ def launch(self, cmdline):
677
680
def _post_step_hook (self ):
678
681
"""Hook to be executed after completing a step request."""
679
682
680
- def step_in (self ):
683
+ def _step (self , step_request_string ):
681
684
self ._flush_breakpoints ()
682
685
step_req_id = self .send_message (
683
- self .make_request ("stepIn" , {"threadId" : self ._debugger_state .thread })
686
+ self .make_request (
687
+ step_request_string , {"threadId" : self ._debugger_state .thread }
688
+ )
684
689
)
685
690
response = self ._await_response (step_req_id )
686
691
if not response ["success" ]:
687
- raise DebuggerException ("failed to step" )
692
+ raise DebuggerException (
693
+ f"failed to perform debugger action: '{ step_request_string } '"
694
+ )
688
695
# If we've "stepped" to a breakpoint, then continue to hit the breakpoint properly.
689
696
# NB: This is an issue that only seems relevant to LLDB, but is also harmless outside of LLDB; if it turns out
690
697
# to cause issues for other debuggers, we can move it to a post-step hook.
691
698
while self ._debugger_state .is_running :
692
699
time .sleep (0.001 )
693
700
self ._post_step_hook ()
694
701
702
+ def step_in (self ):
703
+ self ._step ("stepIn" )
704
+
705
+ def step_next (self ):
706
+ self ._step ("next" )
707
+
708
+ def step_out (self ):
709
+ self ._step ("stepOut" )
710
+
695
711
def go (self ) -> ReturnCode :
696
712
self ._flush_breakpoints ()
697
713
continue_req_id = self .send_message (
0 commit comments