1
votes

I'm debugging a multi-threaded Java application in IntelliJ. I want to suspend all threads on some breakpoint and resume only selected thread while I step-over the code. I can suspend all threads on a breakpoint, but when I step-over the code from one thread, others are also running. Is it possible to do so?

Thanks in advance for the help!

1
Hmm, if you set a breakpoint, then all threads should still stop there. Does that not work? - markspace
All threads are suspending when a thread reaches the breakpoint. But, when I step-over and analyze the code, the rest of the threads are also resuming. - Karthik Chennupati
OK, that's a bit odd, but I can see how it might happen. In my debugger (not Intelij unfortunately) there's a separate window that I can manually suspend and resume threads (and inspect their call stack). Can you do that on your system? Alternately, when debugging, can you launch only one thread? - markspace
I can see a window summarizing all the threads. ibb.co/x3VBwWR - Karthik Chennupati
You can try to set up the following breakpoint settings and select the necessary thread via the debug tool window. - Egor Klepikov

1 Answers

2
votes

There's a setting exactly for this here: Preferences | Build, Execution, Deployment | Debugger | Stepping - Resume only the current thread