Skip to main content


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 08:44 Go to next message
JIA Pei is currently offline JIA PeiFriend
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

[Updated on: Wed, 11 April 2012 08: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] Thu, 12 April 2012 00:38 Go to previous message
JIA Pei is currently offline JIA PeiFriend
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
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 Apr 26 16:59:07 GMT 2024

Powered by FUDForum. Page generated in 0.02723 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top