自动将调试器附加到Eclipse中的新Java子进程 [英] automatically attach a debugger to a new Java sub-process in Eclipse

查看:160
本文介绍了自动将调试器附加到Eclipse中的新Java子进程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用ProcessBuilder等来生成一个新的JVM的Java进程。调试时,是否可以让Eclipse将调试器附加到新的子进程?更好的是,有没有任何插件会在通知新的子进程时自动执行?



我被告知(虽然没有看到)VisualAge曾经能够做到这一点 - 当您尝试创建新的JVM时,会注意到,而是创建一个调试模式并附加到它。 Nifty。

解决方案

提供通常的JVM标志,以指示您要调试进程(依赖供应商),具有特定端口,并且有一个Eclipse调试启动配置来使用该端口。



较新的日食可以做相反的技巧,调试器在端口上等待新的JVM附加准备。这可能是你要找的?


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 create 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?

这篇关于自动将调试器附加到Eclipse中的新Java子进程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆