How to stop other threads stealing focus when debugging in Eclipse?

后端 未结 5 728
小蘑菇
小蘑菇 2020-12-17 10:44

I\'m debugging a server process running in Eclipse 3.4.1. There are 20 threads or so, waking up at various interval after sleeping.

I set a breakpoint in one metho

相关标签:
5条回答
  • 2020-12-17 10:52

    Not sure if this will work (haven't got an Eclipse install to hand to confirm), but there's a debug option that you could try.

    Under Run/Debug in the Preferences, there's an option called (something like) Activate debug view when a breakpoint is hit. If you uncheck that option Eclipse won't jump the focus to the debug view. It might also stop individual threads stealing the focus.

    0 讨论(0)
  • 2020-12-17 10:54

    You could suspend the entire Java VM not only the executing thread to get rid of the focus problems.

    Select a breakpoint in the breakpoints view and choose "Suspend VM" instead of "Suspend Thread". Under Preferences->Java->Debug you can make "Suspend VM" the default option.

    0 讨论(0)
  • 2020-12-17 11:03

    I have had the same problem when debugging Play!Framework 2 applications. What seems to have finally solved it is to uncheck Java -> Monitors in the debug perspective/thread view panel context menu.

    0 讨论(0)
  • 2020-12-17 11:05

    If the above does not help you can always disable all your breakpoints once you are debugging where you want to be.

    In the Breakpoints view: Ctrl-A, Right click -> Disable

    0 讨论(0)
  • 2020-12-17 11:05

    Could you use the option to stop all threads at the breakpoint?

    0 讨论(0)
提交回复
热议问题