Eclipse debugging begins with what is called an agent.
The JVM, which runs subordinate ".class" sources, has a function that allows you to insert external libraries (written in Java or C ++) into the JVM at run time. These external libraries are called agents, and they have the ability to modify the contents of .class files. These agents have access to JVM functionality that is not available from regular Java code running inside the JVM, and they can be used to create interesting things, such as injecting and modifying source code, profiling, etc. Some tools, such as JRebel (used for hot-swapping code) use this functionality to achieve their magic.
And to pass Lib Lib to the JVM, you do this with start arguments, using
agentlib:libname[=options]
We actually passed the Lib agent named jdwp to the JVM working with Tomcat. Jdwp is a specific JVM, an optional implementation of JDWP (Java Debug Wire Protocol), which is used to determine the relationship between the debugger and the running JVM. Its implementation, if present, is provided as a native JVM library like jdwp.so or jdwp.dll
And what is he doing? Simply put, the jdwp agent we pass in mainly serves as a communication function between the JVM instance that launches the application and the debugger (which can be located either remotely or locally). Since this is an agent library, it has the ability to intercept running code, create a bridge between the JVM and the debugger, and use the functionality of the debugger applied to the JVM. Since in the JVM architecture the debugging functionality is not found in the JVM itself, but is distracted by external tools (which are called debuggers), these tools can either be located on the local machine where the JVM is debugged, or it can be started from am by the external machine. It is this unrelated modular architecture that allows us to have a JVM running on a remote machine and using JDWP, to have a remote debugger that can communicate with it.
Thus, the Eclipse debugger works shorter.
Pritam Banerjee Jan 12 '16 at 19:33 2016-01-12 19:33
source share