Java远程调试,技术上是怎么做的? [英] Java remote debugging, how does it work technically?
问题描述
我真的很喜欢 JVM 的远程调试功能.但我想知道它在内部是如何工作的.
I really like the remote debugging facilities of the JVM. But I wonder how it works internally.
我的假设:它是通过 JVM 功能完成的,其中正在运行的进程从附加的远程调试器(如 IDE)下载/使用源代码它知道当前堆栈跟踪的行,然后可以跳转到相应的 IDE 断点.然后通过套接字或共享内存(远程调试器的设置)完成堆栈跟踪和应用程序状态自省的通信.
My assumption: It is done through a JVM feature where the running process is downloading/using the source-code from the attached remote-debugger (like IDE) It knows the line of the current stack-trace and then can jump to the respective IDE breakpoint. The communication of stack-trace and introspection of the application state is then done either through sockets or shared-memory (setting of remote debugger).
有任何有趣的链接/资源吗?
Has anybody interesting links/resources on that?
推荐答案
JVM 的调试功能通过 Java 平台调试器架构 (JPDA).
The debugging features of the JVM are provided via the Java Platform Debugger Architecture (JPDA).
JPDA 本身由以下部分组成:
The JPDA itself is composed of the following:
- Java 虚拟机工具接口 (JVM TI) - 供工具使用的本机编程接口.此接口允许进行状态检查并有助于控制被调试对象内的执行流程.
- Java 调试线协议 (JDWP) - 用于定义调试器和被调试对象进程之间的通信.
- Java 调试接口 (JDI) - 此接口允许工具开发人员编写远程调试器应用程序.
The diagram listed in the JPDA architecture structure is a good starting point. Additional places to look for would be the guides listed in the JPDA page.
这篇关于Java远程调试,技术上是怎么做的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!