自动将调试器附加到 Eclipse 中的新 Java 子进程

发布于 2024-09-25 18:12:52 字数 204 浏览 0 评论 0原文

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

我被告知(虽然还没见过)VisualAge 曾经能够做到这一点 - 当您尝试创建一个新的 JVM 时它会注意到,而是创建一个调试模式的 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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

︶ ̄淡然 2024-10-02 18:12:52

提供常用的 JVM 标志来指示您想要使用特定端口调试进程(取决于供应商),并拥有 Eclipse 调试启动配置来使用该端口。

较新的 Eclipse 可以执行相反的操作,即调试器在端口上等待新 JVM 在准备就绪时附加。这可能就是您正在寻找的?

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?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文