Debugging an SWT application causes all GTK application to freeze

无人久伴 提交于 2019-12-05 01:00:37

问题


I have an SWT application which I debug via remote debugging in eclipse. If I set a breakpoint inside an event handler of the SWT app my hole desktop freezes. I can still switch to a text console via Strg+Alt+Fx. If I kill the SWT app from the console everything continues to work.

Since this only happens when the breakpoint is inside an event handler I highly suspect SWT to block in the event loop causing everything to freeze. My guess is, that there is some magic parameter for SWT to "seperate" the applications, so I can debug properly, but I'm unable to find it.


回答1:


It's a known problem with a native widget having the X Pointer grab and not releasing it. The most common workaround is to run your inner eclipse on another display. I use Xvnc because I encounter this problem all the time, but other examples are XNest.

I've seen people try an use -Dsun.awt.disablegrab=true. I don't know if that works or not.

See https://bugs.eclipse.org/bugs/show_bug.cgi?id=20006 for a lengthy discussion of the problem and what people have tried.

PW




回答2:


I've repeatedly had this problem using Linux mint 11 with JRE 1.6.0.xx, although just using standard Swing components and using local debugging. When hitting a breakpoint in an event handler x11 seems to freeze completely and I need to drop to a shell to kill the java process.

Setting -Dsun.awt.disablegrab=true solves the problem for me.

I just set the VM arguments for the debug configuration, I guess for remote debugging you'd need to make sure that the remote application was started up with this VM option on the command line (or however it's started) rather than in the IDE debug config or starting Eclipse with this option.



来源:https://stackoverflow.com/questions/6178642/debugging-an-swt-application-causes-all-gtk-application-to-freeze

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!