PDA

View Full Version : gdb acting weird



Sockerdrickan
July 9th, 2009, 08:27 AM
p is supposed to print the value of a variable right?


const unsigned int rolf=500;
(gdb) p rolf
$1 = 4198984
:mad:

TheStatsMan
July 9th, 2009, 11:34 AM
Have you turned compiler optimisations off?

dwhitney67
July 9th, 2009, 12:49 PM
p is supposed to print the value of a variable right?


const unsigned int rolf=500;
(gdb) p rolf
$1 = 4198984
:mad:

From your output above, it would seem to me that the statement has not been executed yet. Perform a "next" or a "step", then print the value of rolf.