Weird values for local variables in static functions during debugging... [message #841396] |
Wed, 11 April 2012 08:44 |
|
Hi, all:
Environment: Ubuntu 11.10
Eclipse:
Version: Indigo Service Release 2
Build id: 20120216-1857
I was just about to debug into a static function, which seems to be prohibited from doing so under Eclipse.
In my case, my testing function is as simple as
public static int fun() {
int left1 = left;
System.out.println(left1);
int right1 = right;
System.out.println(right1);
....
}
Quote:System.out.println is able to print out those 2 integer values. However, unfortunately, when I tried to watch Quote:left1, right1 , either in the view of Quote:Variables or Quote:Expressions , I got weird numbers different from my expectation. Well, I was expecting to see the values Quote:left1==left, right1==right . But, they r of different values. Why is it so? Does it have something to do with the static functions? I don't think so because every main function is defined as static. Any other reasons? Can anybody help to explain it a bit please?
Best Regards
Pei
[Updated on: Wed, 11 April 2012 08:50] Report message to a moderator
|
|
|
|
Powered by
FUDForum. Page generated in 0.02723 seconds