8

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!

6
  • Hmm, if you set a breakpoint, then all threads should still stop there. Does that not work? Commented May 23, 2020 at 3:37
  • 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. Commented May 23, 2020 at 3:39
  • 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? Commented May 23, 2020 at 3:42
  • I can see a window summarizing all the threads. ibb.co/x3VBwWR Commented May 23, 2020 at 3:48
  • 1
    You can try to set up the following breakpoint settings and select the necessary thread via the debug tool window. Commented May 27, 2020 at 13:53

1 Answer 1

9

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

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks! It's exactly what I wanted.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.