Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
fabioz committed Nov 18, 2023
1 parent 7bcd609 commit f4609ab
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 7 deletions.
6 changes: 3 additions & 3 deletions _pydevd_sys_monitoring/pydevd_sys_monitoring.py
Original file line number Diff line number Diff line change
Expand Up @@ -434,14 +434,14 @@ def disable_code_tracing(code):


def enable_code_tracing(thread, code, frame):
DEBUG = False # 'my_code.py' in code.co_filename or 'other.py' in code.co_filename
DEBUG = False # 'my_code.py' in code.co_filename or 'other.py' in code.co_filename
if DEBUG:
print('==== enable code tracing', code.co_filename[-30:], code.co_name)
return _enable_code_tracing(thread, code, frame, False)


def _enable_code_tracing(thread, code, frame, warn_on_filtered_out):
DEBUG = False # 'my_code.py' in code.co_filename or 'other.py' in code.co_filename
DEBUG = False # 'my_code.py' in code.co_filename or 'other.py' in code.co_filename

py_db: object = GlobalDebuggerHolder.global_dbg
if py_db is None or py_db.pydb_disposed:
Expand Down Expand Up @@ -747,7 +747,7 @@ def _return_event(code, instruction, retval):
if py_db.show_return_values:
if (
(info.pydev_step_cmd in (CMD_STEP_OVER, CMD_STEP_OVER_MY_CODE, CMD_SMART_STEP_INTO) and (_is_same_frame(info, stop_frame, frame.f_back))) or
(info.pydev_step_cmd in (CMD_STEP_RETURN, CMD_STEP_RETURN_MY_CODE) and (info, _is_same_frame(stop_frame, frame))) or
(info.pydev_step_cmd in (CMD_STEP_RETURN, CMD_STEP_RETURN_MY_CODE) and (info, _is_same_frame(info, stop_frame, frame))) or
(info.pydev_step_cmd in (CMD_STEP_INTO, CMD_STEP_INTO_COROUTINE)) or
(
info.pydev_step_cmd == CMD_STEP_INTO_MY_CODE
Expand Down
2 changes: 1 addition & 1 deletion pydevd.py
Original file line number Diff line number Diff line change
Expand Up @@ -3022,11 +3022,11 @@ def _locked_settrace(

# Suspend as the last thing after all tracing is in place.
if suspend:
additional_info.pydev_original_step_cmd = CMD_SET_BREAK
if stop_at_frame is not None:
# If the step was set we have to go to run state and
# set the proper frame for it to stop.
additional_info.pydev_state = STATE_RUN
additional_info.pydev_original_step_cmd = CMD_STEP_OVER
additional_info.pydev_step_cmd = CMD_STEP_OVER
additional_info.pydev_step_stop = stop_at_frame
additional_info.suspend_type = PYTHON_SUSPEND
Expand Down
2 changes: 1 addition & 1 deletion tests_python/debugger_unittest.py
Original file line number Diff line number Diff line change
Expand Up @@ -1021,7 +1021,7 @@ def _get_stack_as_hit(self, msg, file=None, line=None, name=None):
if not isinstance(name, (list, tuple, set)):
assert name == hit_name
else:
assert hit_name in name
assert hit_name in name, 'Hit: %s not in %s' % (hit_name, name)

self.log.append('End(1): wait_for_breakpoint_hit: %s' % (msg.original_xml,))

Expand Down
11 changes: 9 additions & 2 deletions tests_python/test_debugger.py
Original file line number Diff line number Diff line change
Expand Up @@ -4219,9 +4219,12 @@ def test_asyncio_step_over_end_of_function(case_setup, target_filename):
hit = writer.wait_for_breakpoint_hit()

writer.write_step_over(hit.thread_id)
names = ('sleep', 'wait_task_rescheduled')
if USE_SYS_MONITORING:
names = ('main',)
hit = writer.wait_for_breakpoint_hit(
reason=REASON_STEP_OVER,
name=('sleep', 'wait_task_rescheduled'),
name=names,
)
writer.write_run_thread(hit.thread_id)
writer.finished_ok = True
Expand Down Expand Up @@ -4251,9 +4254,13 @@ def test_asyncio_step_in(case_setup, target_filename):
)

writer.write_step_in(hit.thread_id)
names = ('sleep', 'wait_task_rescheduled')
if USE_SYS_MONITORING:
names = ('main',)

hit = writer.wait_for_breakpoint_hit(
reason=REASON_STEP_INTO,
name=('sleep', 'wait_task_rescheduled'),
name=names,
)

writer.write_run_thread(hit.thread_id)
Expand Down

0 comments on commit f4609ab

Please sign in to comment.