Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't change already suspended threads in subsequent suspend calls #296

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions _pydevd_bundle/pydevd_thread_lifecycle.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,10 @@ def pydevd_find_thread_by_id(thread_id):
return None


def mark_thread_suspended(thread, stop_reason: int, original_step_cmd: int = -1):
def mark_thread_suspended(thread, stop_reason: int, original_step_cmd: int = -1, skip_unless_run_state: bool = False):
info = set_additional_thread_info(thread)
if skip_unless_run_state and info.pydev_state != STATE_RUN:
return info
info.suspend_type = PYTHON_SUSPEND
if original_step_cmd != -1:
stop_reason = original_step_cmd
Expand Down Expand Up @@ -91,7 +93,9 @@ def suspend_all_threads(py_db, except_thread):
else:
if t is except_thread:
continue
info = mark_thread_suspended(t, CMD_THREAD_SUSPEND)
info = mark_thread_suspended(t, CMD_THREAD_SUSPEND, py_db.multi_threads_single_notification)
if info.pydev_state != STATE_SUSPEND:
continue
frame = info.get_topmost_frame(t)

# Reset the tracing as in this case as it could've set scopes to be untraced.
Expand Down
Loading