Skip to content

Commit

Permalink
wip2
Browse files Browse the repository at this point in the history
  • Loading branch information
fabioz committed Nov 27, 2023
1 parent 2a9ca23 commit f1acd85
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
14 changes: 9 additions & 5 deletions _pydevd_sys_monitoring/pydevd_sys_monitoring.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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 = {}
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand All @@ -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):
Expand Down
4 changes: 2 additions & 2 deletions tests_python/test_debugger.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down

0 comments on commit f1acd85

Please sign in to comment.