Java远程调试,它在技术上如何工作? [英] Java remote debugging, how does it work technically?

查看:124
本文介绍了Java远程调试,它在技术上如何工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我真的很喜欢JVM的远程调试工具。但是我想知道它是如何在内部工作的。



我的假设是通过一个JVM功能完成的,其中正在运行的进程正在下载/使用附件远程的源代码,调试器(如IDE)它知道当前堆栈跟踪的行,然后可以跳转到相应的IDE断点。然后通过套接字或共享内存(远程调试器的设置)完成应用程序状态的堆栈跟踪和内省的通信。



有任何人有兴趣的链接/资源

解决方案

JVM的调试功能是通过 Java Platform Debugger Architecture(JPDA)



JPDA本身由以下组成:




  • Java虚拟机工具接口(JVM TI) - 用于工具使用的本机编程接口。此接口允许状态检查,并有助于控制调试程序中的执行流程。

  • Java调试线协议(JDWP) - 用于定义调试器和调试器进程之间的通信。 / li>
  • Java调试接口(JDI) - 此接口允许工具开发人员编写远程调试器应用程序。



JPDA架构结构是一个很好的起点。要查找的其他地方将是 JPDA页面中列出的指南


I really like the remote debugging facilities of the JVM. But I wonder how it works internally.

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?

解决方案

The debugging features of the JVM are provided via the Java Platform Debugger Architecture (JPDA).

The JPDA itself is composed of the following:

  • Java Virtual Machine Tool Interface (JVM TI) - the native programming interface for tools to use. This interface allows for state inspection and helps in controlling the flow of execution within the debuggee.
  • Java Debug Wire Protocol (JDWP) - used to define the communication between the debugger and debuggee processes.
  • Java Debug Interface (JDI) - this interface allows tool developers to write remote debugger applications.

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屋!

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