Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] gdb printing false information
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
Lonely-Star
Tux's lil' helper
Tux's lil' helper


Joined: 12 Jul 2003
Posts: 82

PostPosted: Wed Apr 27, 2005 4:58 pm    Post subject: [SOLVED] gdb printing false information Reply with quote

Hi everybody,
I sometimes have the problem, that gdb is printing false information about value of some variables.
In example:
I have the variable
float f;
Now, in gdb I do "display f" and on every "next", it prints tells me, that the value of f is about 3356.2.
But then I step over the following code:

if(f>1.0f)
printf("Big f\n");

and the programm does not go into the "printf("Big f\n");" command and also does not print "Big f" on the console.

Does anybody have a Idea what could be the reason for this strange behavior?
Back to top
View user's profile Send private message
Lonely-Star
Tux's lil' helper
Tux's lil' helper


Joined: 12 Jul 2003
Posts: 82

PostPosted: Wed Apr 27, 2005 10:25 pm    Post subject: Reply with quote

It was the -O2 optimation flag.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum