Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / December 2006

Tip: Looking for answers? Try searching our database.

viewing local variables while debugging

Thread view: 
TrevorBoydSmith@gmail.com - 12 Dec 2006 15:55 GMT
While debugging, How would you make sure that you can view the local
('auto' qualified) variables in your debugger's variable window?

I know of a couple cases where the local variables aren't available for
debug viewing:
-It seems to only let you see the local variable when you are on the
original static main that the thread was started in (Or to be more
general, instead of the main... lets just say the original method that
spun up the new thread)
-as soon as you leave the static main and go to an object's constructor
you can't see the local variables (or so it seems i haven't tested
throughly)

Debugger: Eclipse 3.2

In eclipse, when you can not view the local variables in the debug
variable window there is a message that states "local variables
unavailable" next to the current stack for the thread you are on.
wesley.hall@gmail.com - 12 Dec 2006 16:43 GMT
> While debugging, How would you make sure that you can view the local
> ('auto' qualified) variables in your debugger's variable window?
[quoted text clipped - 14 lines]
> variable window there is a message that states "local variables
> unavailable" next to the current stack for the thread you are on.

Sounds like you are compiling without the debug information.

If you are compiling using javac then add a -g flag.

If you are compiling using ant then add debug="true" as an attribute to
your javac task call.

If you are using eclipse to compile then you are on your own. I avoid
Eclipse like the plague.
TrevorBoydSmith@gmail.com - 12 Dec 2006 18:38 GMT
Wesley,
Your instinct was correct.  The correct debugging flags were not in
place.  So when I did my debugging it did not have the debugging info
it needed to show the 'local variables' values.

The way I fixed it was to reset Eclipse.  Then when I ran debugging
again I could see all the local variables without a hitch.

For those of you interested in wondering how Eclipse handles debugging
I did some research before I thought about just resetting Eclipse to
fix it:
-when you do the common 'run java application' it compiles the program
with default settings for running a java application
-when you do the common 'debug java application' it compiles
differently and hands you off to the debugging tools associated with
the Eclipse Java Dev Tools.
-Probably, when i did 'debug java application' the settings did not
switch and so the eclipse debugging tools did not get all the symbolic
debugging info that was needed.

-Trevor

> > While debugging, How would you make sure that you can view the local
> > ('auto' qualified) variables in your debugger's variable window?
[quoted text clipped - 24 lines]
> If you are using eclipse to compile then you are on your own. I avoid
> Eclipse like the plague.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.