How Remote debugging works and does code needs to be compiled at local box?
I have java webapplication deployed on remote server. I want to do remote debugging from my local machine from eclipse. Both are of same version. My question does the code needs to be compiled at my local mchine too for remote debugging or its not required? As per my understanding code should be compiled at my local too. Just to have better understanding as per me this is how remote debugging works:-
when i put debugger on some source file at line 250 in eclipse, it will look for correspondong byte code in class file at local system and note that line number(say it is line number 200 in class file as it removes all comments and dead code). Also it will put kind of breakpoint at line 200 in class file on remote server. So when execution comes at line 200, debugger will stop but in eclipse for developer convenience it will stop at line 250 of source code(internally it must be doing internal calculation to determine the exact line in source code corresponding to byte code) . Please correct me if i am wrong?
One more how debugger determines what is the line number in source file corresponding to byte code in JVM. Does jvm have this data somewhere where it tracks the byte code line against the source code line? Thanks in advance.
Posted at http://stackoverflow.com/questions/10622448/how-remote-debugging-works-and-does-code-needs-to-be-compiled-at-local-box, but no replies .