diff --git a/_pydevd_sys_monitoring/pydevd_sys_monitoring.py b/_pydevd_sys_monitoring/pydevd_sys_monitoring.py index c05be125..bc14e95a 100644 --- a/_pydevd_sys_monitoring/pydevd_sys_monitoring.py +++ b/_pydevd_sys_monitoring/pydevd_sys_monitoring.py @@ -730,7 +730,7 @@ def _return_event(code, instruction, retval): if info.suspend_type != PYTHON_SUSPEND: # Plugin stepping - if func_code_info.plugin_return_stepping and info.suspend_type != PYTHON_SUSPEND: + if func_code_info.plugin_return_stepping: _plugin_stepping(py_db, step_cmd, 'return', frame, thread_info) return @@ -915,7 +915,7 @@ def _stop_on_breakpoint(py_db, thread_info: ThreadInfo, stop_reason, bp, frame, def _plugin_stepping(py_db, step_cmd, event, frame, thread_info): - plugin_manager = py_db.plugins + plugin_manager = py_db.plugin # Step return makes no sense for plugins (I guess?!?), so, just handle as step into. if step_cmd in (CMD_STEP_INTO, CMD_STEP_INTO_MY_CODE, CMD_STEP_INTO_COROUTINE, CMD_SMART_STEP_INTO) or step_cmd in (CMD_STEP_RETURN, CMD_STEP_RETURN_MY_CODE): stop_info = {} @@ -1015,9 +1015,10 @@ def _line_event(code, line): if step_cmd == -1: return - # Plugin stepping - if func_code_info.plugin_line_stepping and info.suspend_type != PYTHON_SUSPEND: - _plugin_stepping(py_db, step_cmd, 'line', frame, thread_info) + if info.suspend_type != PYTHON_SUSPEND: + # Plugin stepping + if func_code_info.plugin_line_stepping: + _plugin_stepping(py_db, step_cmd, 'line', frame, thread_info) return # Python stepping now @@ -1141,6 +1142,7 @@ def _start_method_event(code, instruction_offset): if py_db.plugin: plugin_manager = py_db.plugin + # Check breaking on breakpoints in a 'call' info = thread_info.additional_info if func_code_info.plugin_call_breakpoint_found: result = plugin_manager.get_breakpoint(py_db, frame, 'call', info) @@ -1152,9 +1154,11 @@ def _start_method_event(code, instruction_offset): _stop_on_breakpoint(py_db, thread_info, stop_reason, bp, frame, new_frame, stop, stop_on_plugin_breakpoint, bp_type) return + # Check breaking on line stepping in a 'call' step_cmd = info.pydev_step_cmd if step_cmd != -1 and func_code_info.plugin_call_stepping and info.suspend_type != PYTHON_SUSPEND: _plugin_stepping(py_db, step_cmd, 'call', frame, thread_info) + return def _resume_method_event(code, instruction_offset): diff --git a/tests_python/test_debugger.py b/tests_python/test_debugger.py index 2b8a8bc4..fbfb7923 100644 --- a/tests_python/test_debugger.py +++ b/tests_python/test_debugger.py @@ -3647,10 +3647,10 @@ def test_frame_eval_limitations(case_setup, filename, break_at_lines): hit = writer.wait_for_breakpoint_hit() thread_id = hit.thread_id - if (IS_PY36_OR_GREATER and TEST_CYTHON) and not TODO_PY311: + if (IS_PY36_OR_GREATER and TEST_CYTHON) and not IS_PY311_OR_GREATER: assert hit.suspend_type == break_mode else: - # Before 3.6 frame eval is not available. + # Before 3.6 and after 3.11, frame eval is not available. assert hit.suspend_type == 'trace' writer.log.append('run thread')