Strange behavior in gdb 5.3 on suse linux
From: Sunil Matta (smatta_at_acm.org)
Date: 09/30/04
- Previous message: Doug Laidlaw: "Re: Software to create an E-book?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 29 Sep 2004 16:58:24 -0700
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
debugging information.
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:
(gdb) list
40 int matsize = strike_.size() * tau_.size();
41 for( int i = 0; i < (strike_.size() * tau_.size()); i++ )
42 {
43 cout << i << endl;
44 position_.push_back(100);
45 }
(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 ?
Sunil
- Previous message: Doug Laidlaw: "Re: Software to create an E-book?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|