I am using Eclipse 2.1 on a Solaris platform to debug a WebShere 5.02 appliation running on the same machine. I am using the Remote Debugging feature of Eclipse. I have the "Java Developer's Guide to Eclipse" Book written by Shavor, Anjou, Fairbrother, Kehn, Kellerman and mcCarthy. I am following the process described in this book to do the remote debugging.
Here is what I am running into: The debugger attaches to the running program and suspends execution fine. I can put the break-points and see the "flow" of the program logic correctly. Only problem is: the local variables do not display in the variables window. I cannot evaluate them or display them using the Context sensitive menus either. It seems like some sort of setting problem. Is there is a switch of some sort that needs to be enabled to observe the local variable values?
Somthing very interesting happening here since my last post. The debugger displays the local variables/parameter values for those methods which are declared either private or protected. It does not display the local variables/parameters for those methods which are declared public. The class member variables are always shown however. This must be some sort of setting that I am missing. Any ideas anyone?
Any insights anyone might have will be greatly appreciated.
I am a little bit disappointed here since no one responded. I was hoping that one of the famed authors of the aforementioned book which I bought will be kind enough to shed some light on it, apparently not.
Anyway, I have discovered the solution to this problem researching on my own. I did a google search on "local variables unavailable" and it linked me into the following site: www.myeclipseide.com I searched their knowledgebase and found very useful information pertaining to the problem discussed above.
The gist of it is that our "Ant" build was not compiling with the debug symbolic information and therefore, the local variables were not being displayed. Eclipse, on the other hand, compiles with debug symbols by default. As soon as I copied over the Eclipse compiled class files on to the Ant compiled class files and restarted the Websphere server, it started showing the full debug information.
Moral of the story, make sure that you check the Ant build file. In version 1.5.x, Ant will or will not insert debug information in the compiled class file depending on whether you use the debug="true" or debug="on" flag in the "javac" task. In our build, we need to use debug="on" instead of debug="true". When in doubt, copy Eclipse compiled class files over the ant compiled files, things should work.
Bharat, That's interesting. When I had a problem with ant disabling the debug fields, I got an error when I tried to run about there not being any line numbers. It's good to know that shows up in different ways. Thanks for posting the solution.