vscode-java-debug icon indicating copy to clipboard operation
vscode-java-debug copied to clipboard

Pause All Threads on Hitting Breakpoint?

Open gcbartlett opened this issue 5 years ago • 6 comments

Is it possible to configure a breakpoint (or the debugger in general) to pause all threads when a breakpoint is hit?

I have a scenario where once one of my (worker) threads hits a breakpoint, the main thread continues creating more threads that also end up hitting the same breakpoint. I can manually pause my main thread when my breakpoint is reached, but it would be nice to be able to configure the breakpoint so that all threads are automatically paused. (This would probably need to be integrated with any new Continue All action being discussed elsewhere to make it easier to resume operation).

gcbartlett avatar Nov 25 '19 19:11 gcbartlett

If we support Continue All threads feature, do you think it will mitigate the pain point in your case?

testforstephen avatar Dec 05 '19 08:12 testforstephen

Adding Continue All Threads would be useful, but will only help in my scenario, if a breakpoint can trigger Pause All Threads.

gcbartlett avatar Dec 05 '19 18:12 gcbartlett

The request is to allow setting the suspend policy of the breakpoint.

  • SUSPEND_ALL: Suspend all threads when the event occurs.
  • SUSPEND_EVENT_THREAD: Suspend only the thread which generated the event when the event occurs.

testforstephen avatar Apr 28 '21 08:04 testforstephen

News?

aperrone avatar Sep 14 '23 13:09 aperrone

This is a significant omission. It makes debugging server processes with 100's of threads near impossible.

robaho avatar Sep 28 '23 23:09 robaho

Just started doing some multithreaded Java dev in VS Code and hit this as well. Going to have to debug in a different IDE until this gets fixed.

jdconley avatar Nov 08 '23 19:11 jdconley