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