开发者

automatically attach a debugger to a new Java sub-process in Eclipse

开发者 https://www.devze.com 2023-01-18 15:15 出处:网络
I hava a Java process that spawns a new JVM using ProcessBuilder etc. While debugging this, is it possible to have Eclipse attach a debugger to the new sub-process? Even better, is there any plugin th

I hava a Java process that spawns a new JVM using ProcessBuilder etc. While debugging this, is it possible to have Eclipse attach a debugger to the new sub-process? Even better, is there any plugin that will do this automatically when it notices the new child process?

I'm told (though haven't seen) that VisualAge used to be able to do this - it would notice when you tried to c开发者_JS百科reate a new JVM, and instead create a debug-mode one and attach to it. Nifty.


Provide the usual JVM flags to indicate that you want to debug the process (vendor dependant), with a specific port, and have an Eclipse debug launch configuration to use that port.

Newer Eclipses can do the reverse trick, where the debugger waits on the port for the new JVM to attach when ready. That might be what you are looking for?

0

精彩评论

暂无评论...
验证码 换一张
取 消