Search code examples
javaeclipsemultithreadingbreakpointsstep-into

java eclipse can't step through thread after breakpoint with multithreaded program


I have a program that has 4 worker threads operating on a method. If I place a breakpoint in the method each worker thread will pause on it but the step into and step over buttons (as well as play/pause/terminate) are disabled so I can't walk through the execution path.

I have tried using suspendVM rather than just suspending thread and just suspending one thread by using a conditional breakpoint referencing worker1 thread name but it makes no difference, the step in/over buttons are disabled

Anybody know how to get this to work? Its works fine when i'm running only a single main thread.


Solution

  • Well I got it working but don't ask me how, I think it has something to do with native methods. If my thread suspends while there is a key next to the method (in the call stack) I can't use step buttons, but if its three blue bars in call stack I can. It seems to be pot luck which one I get so I just restart the program until I get lucky.