Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Feature Request: Option to disable debugging for specific threads #1816

Closed
Qasemt opened this issue Jan 25, 2025 · 3 comments
Closed

Feature Request: Option to disable debugging for specific threads #1816

Qasemt opened this issue Jan 25, 2025 · 3 comments
Assignees

Comments

@Qasemt
Copy link

Qasemt commented Jan 25, 2025

Feature Request: Option to disable debugging for specific threads

Description

Currently, debugpy does not provide an option to disable debugging for specific threads. This becomes challenging in multi-threaded applications where certain threads need to run without interruptions caused by breakpoints or debugging overhead.

Proposed Solution

Introduce an API or configuration option (e.g., disable_debug_for_thread(thread_id) or a similar mechanism) to exclude specific threads from being debugged.

Use Case

In a multi-threaded application, developers might want to focus debugging only on specific threads while allowing others to execute uninterrupted. This feature would improve debugging efficiency in complex scenarios.

Additional Notes

  • A similar feature exists in some other debugging tools, and it greatly enhances usability in multi-threaded applications.
  • If possible, allow thread-specific logging as an additional option.
 
import threading
import sys

def thread_function():
    # Simulate disabling debugging for this thread
    sys.settrace(None)  # This disables debugging for the current thread

    # Simulate work
    for i in range(5):
        print(f"Thread running iteration {i}")
        import time
        time.sleep(1)

@eleanorjboyd
Copy link
Member

Hi! This would be required on the debugpy level and not something we can just implement on the surface, sending it there. Thanks!

@eleanorjboyd eleanorjboyd transferred this issue from microsoft/vscode-python-debugger Jan 27, 2025
@github-actions github-actions bot added the needs repro Issue has not been reproduced yet label Jan 27, 2025
@rchiodo
Copy link
Contributor

rchiodo commented Jan 27, 2025

I think this might be possible, but it can get very complicated. See this issue here for some of why:
#1475

@rchiodo
Copy link
Contributor

rchiodo commented Jan 27, 2025

Converting to a discussion item for up votes

@microsoft microsoft locked and limited conversation to collaborators Jan 27, 2025
@rchiodo rchiodo converted this issue into discussion #1817 Jan 27, 2025
@judej judej removed the needs repro Issue has not been reproduced yet label Feb 18, 2025

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants