How does remote debugging work? Do I need to compile code in a local field?

I have a Java web application deployed to a remote server. I want to perform remote debugging from my local machine from Eclipse. They have the same version. Do I need to compile code for my local mchine for remote debugging, or is this not required? I understand that the code must be compiled by my local tool.

What follows is, as I believe, remote debugging works. Please correct me if I am wrong.

When I put the debugger in some source file on line 250 in Eclipse, it will look for the corresponding bytecode in the class file and mark that point (say, this is line 200 in the class file, since it removes all comments and dead code). It will also place a breakpoint on line 200 in the class file on the remote server. When execution reaches line 200, the debugger will stop, but in Eclipse, for the convenience of the developer, it will stop at line 250 of the source code. (He must do an internal calculation to determine the exact string in the source code that corresponds to the bytecode.)

+3
source share
1 answer

Eclipse debugging begins with what is called Agents .

JVM, .class , , ( Java ++) JVM, . , .class, . JVM, Java-, JVM, , , .. ( , JRebel .)

Lib JVM, ,

 agentlib:libname[=options] format.

Lib jdwp JVM, Tomcat. jdwp JVM, JDWP (Java Debug Wire Protocol), JVM. , , JVM jdwp.so, jdwp.dll

?
, jdwp, , JVM, , ( , ). , , JVM , JVM.
JVM JVM, ( ), , JVM . JVM, JDWP, .

+1

All Articles