I have two monitors and it would be handy to be able to have two eclipse windows, one each running the debugger against a different thread of the same jvm.
Right now I have to keep going to the debug view and clicking on the other thread to switch to it's context. Having both contexts on the screen at the same time would make things a lot easier.
Is there a way to do this in eclipse?
Start debug session. When the breakpoint in run is hit, you can go to another breakpoint, enable that breakpoint if it was disabled. Then right click on the breakpoint -> go to Filters, now you can select the thread you want the breakpoint to be remain enabled for and you can uncheck the rest of the threads.
Parallel processing using many threads can greatly improve program performance, but it may also make debugging more difficult because you're tracking many threads. Multithreading can introduce new types of potential bugs.
Put breakpoints in both projects and launch them in debug mode. Switch to "Debug" perspective and find "Debug" view there. You will see a list of active debug sessions with their respective call stacks. You can click on every debug step of every debug session and Eclipse will open that step in code editor.
Is it possible to debug multiple threads in eclipse in different windows?
Well I just tried it and it sort of works. You don't need multiple monitors to try it.
run()
methods.This works but even though there are 2 Debug tabs, they are joined somewhat. When I step forward in the Thread-1 debug window, the focus changes to Thread-1 -- even in the other Thread-2 window.
Edit:
Actually I played with it a bit more and it seems to work pretty well. If I switch to the other window debugging Thread-2 and step, it expands the Thread-2 stack trace in the Thread-1 window but doesn't actually seem to change the highlight. I can go back to the Thread-1 window and step forward easily in Thread-1.
I don't know of any way to create two separate debug windows that are not fully connected. Web searches come up empty as well.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With