Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Weird values for local variables in static functions during debugging...(Eclipse defects?)
icon5.gif  Weird values for local variables in static functions during debugging... [message #841396] Wed, 11 April 2012 04:44 Go to next message
JIA Pei is currently offline JIA Pei
Messages: 49
Registered: September 2009
Member

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


Welcome to Vision Open
http://www.visionopen.com

[Updated on: Wed, 11 April 2012 04:50]

Report message to a moderator

Re: Weird values for local variables in static functions during debugging... [message #842042 is a reply to message #841396] Wed, 11 April 2012 20:38 Go to previous message
JIA Pei is currently offline JIA Pei
Messages: 49
Registered: September 2009
Member


Have no idea why it was so, but now, every weird thing is gone. I just re-construct the whole project. Seriously have no idea why for the first 8 packages, the testing is of no problem while for the last package, the testing is so problematic...

Best Regards
Pei


Welcome to Vision Open
http://www.visionopen.com
Previous Topic:eclipse does not generate .class files
Next Topic:what's the difference between public DOM AST and internal AST
Goto Forum:
  


Current Time: Fri Aug 22 21:45:36 EDT 2014

Powered by FUDForum. Page generated in 0.01601 seconds