Running gdb version 5.3 on Suse Linux.
I am using g++ version 3.2.2
I am specifing compiler swithces -g and have also tried -ggdb for more
Lots of weird behavior when running gdb to check data. Here is a small
example of the problem that I am having.
I am unable to print the value of variable i in the code below.
When stepping into a block of code like this:
40 int matsize = strike_.size() * tau_.size();
41 for( int i = 0; i < (strike_.size() * tau_.size()); i++ )
43 cout << i << endl;
(gdb) where 1
#0 PAAParams (this=0xbffff110) at PAAParams.cpp:44
(More stack frames follow...)
(gdb) print i
No symbol "i" in current context.
(gdb) print strike_.size() * tau_.size()
$1 = 84
Note that I am on line 41 and still cannot print variable i inside the
for loop !!! I am expecting the value of i to be 0<= i <= 84.
The variable does get printed to cout with values upto 84 !
At the end of the loop, vector's size i.e. position_.size() == 84 !
which is correct. Therefore I do know that the code is being executed.
I also am not able to step into some parts of my code, also compiled
with the same debug switches.
Are there any more compile swithes that I should be setting ? I have
always used -g for generating debug and symbol tables.
What could be causing this problem ?