@@ -59,6 +59,25 @@ def get_smart_step_into_variant_from_frame_offset(*args, **kwargs):
5959_get_ident = threading .get_ident
6060_thread_active = threading ._active # noqa
6161
62+
63+ # IFDEF CYTHON
64+ # cython_inline_constant: CMD_THREAD_SUSPEND = 105
65+ # cython_inline_constant: CMD_STEP_INTO = 107
66+ # cython_inline_constant: CMD_STEP_OVER = 108
67+ # cython_inline_constant: CMD_STEP_INTO_MY_CODE = 144
68+ # cython_inline_constant: CMD_STEP_INTO_COROUTINE = 206
69+ # cython_inline_constant: CMD_SMART_STEP_INTO = 128
70+ # cython_inline_constant: can_skip: bool = True
71+ # cython_inline_constant: CMD_STEP_RETURN = 109
72+ # cython_inline_constant: CMD_STEP_OVER_MY_CODE = 159
73+ # cython_inline_constant: CMD_STEP_RETURN_MY_CODE = 160
74+ # cython_inline_constant: CMD_SET_BREAK = 111
75+ # cython_inline_constant: CMD_SET_FUNCTION_BREAK = 208
76+ # cython_inline_constant: STATE_RUN = 1
77+ # cython_inline_constant: STATE_SUSPEND = 2
78+ # ELSE
79+ # Note: those are now inlined on cython.
80+ CMD_THREAD_SUSPEND : int = 105
6281CMD_STEP_INTO : int = 107
6382CMD_STEP_OVER : int = 108
6483CMD_STEP_INTO_MY_CODE : int = 144
@@ -72,6 +91,8 @@ def get_smart_step_into_variant_from_frame_offset(*args, **kwargs):
7291CMD_SET_FUNCTION_BREAK : int = 208
7392STATE_RUN : int = 1
7493STATE_SUSPEND : int = 2
94+ # ENDIF
95+
7596
7697IGNORE_EXCEPTION_TAG = re .compile ("[^#]*#.*@IgnoreException" )
7798DEBUG_START = ("pydevd.py" , "run" )
@@ -809,7 +830,7 @@ def _enable_code_tracing(py_db, additional_info, func_code_info: FuncCodeInfo, c
809830def _enable_step_tracing (py_db , code , step_cmd , info , frame ):
810831# ENDIF
811832# fmt: on
812- if step_cmd in (CMD_STEP_INTO , CMD_STEP_INTO_MY_CODE , CMD_STEP_INTO_COROUTINE , CMD_SMART_STEP_INTO ):
833+ if step_cmd in (CMD_STEP_INTO , CMD_STEP_INTO_MY_CODE , CMD_STEP_INTO_COROUTINE , CMD_SMART_STEP_INTO , CMD_THREAD_SUSPEND ):
813834 # Stepping (must have line/return tracing enabled).
814835 _enable_line_tracing (code )
815836 _enable_return_tracing (code )
@@ -1088,7 +1109,7 @@ def _return_event(code, instruction, retval):
10881109
10891110 # Python line stepping
10901111 stop_frame = info .pydev_step_stop
1091- if step_cmd in (CMD_STEP_INTO , CMD_STEP_INTO_MY_CODE , CMD_STEP_INTO_COROUTINE ):
1112+ if step_cmd in (CMD_STEP_INTO , CMD_STEP_INTO_MY_CODE , CMD_STEP_INTO_COROUTINE , CMD_THREAD_SUSPEND ):
10921113 force_check_project_scope = step_cmd == CMD_STEP_INTO_MY_CODE
10931114 if frame .f_back is not None and not info .pydev_use_scoped_step_frame :
10941115 back_func_code_info = _get_func_code_info (frame .f_back .f_code , frame .f_back )
@@ -1581,6 +1602,11 @@ def _internal_line_event(func_code_info, frame, line):
15811602 _do_wait_suspend (py_db , thread_info , frame , "line" , None )
15821603 return
15831604
1605+ elif step_cmd == CMD_THREAD_SUSPEND :
1606+ py_db .set_suspend (thread_info .thread , step_cmd , original_step_cmd = info .pydev_original_step_cmd )
1607+ _do_wait_suspend (py_db , thread_info , frame , "line" , None )
1608+ return
1609+
15841610 elif step_cmd == CMD_SMART_STEP_INTO :
15851611 stop = False
15861612 back = frame .f_back
0 commit comments