This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: Question regarding missing local variables in gdb
- To: chastain at cygnus dot com, gdb at sources dot redhat dot com
- Subject: Re: Question regarding missing local variables in gdb
- From: Donna S Womble <dsw at mbay dot net>
- Date: Wed, 30 May 2001 15:08:00 -0700
- CC: dsw at mbay dot net
Here is all the verbatim input/output that you requested. I am running
from a tcsh (prompt = /home/dsw/test % ). The actual code is attached.
/home/dsw/test % g++ -g -O0 -o test_gdb1 test_gdb1.cpp
/home/dsw/test % gdb -nw test_gdb1
GNU gdb 5.0
Copyright 2000 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you
are
welcome to change it and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for
details.
This GDB was configured as "i686-pc-linux-gnu"...
(gdb) break 11
Breakpoint 1 at 0x804872c: file test_gdb1.cpp, line 11.
(gdb) run
Starting program: /home/dsw/test/test_gdb1
Breakpoint 1, main () at test_gdb1.cpp:11
11 cout << i << "\t" << j << "\t" << goo << "\t" << hoo
<< endl;
(gdb) info locals
No locals.
(gdb) quit
The program is running. Exit anyway? (y or n) y
/home/dsw/test %
/home/dsw/test % g++ -v
Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/2.96/specs
gcc version 2.96 20000731 (Red Hat Linux 7.0)
/home/dsw/test %
/home/dsw/test % gdb -v
GNU gdb 5.0
Copyright 2000 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you
are
welcome to change it and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for
details.
This GDB was configured as "i686-pc-linux-gnu".
/home/dsw/test %
#include <iostream>
int main()
{
for (int i(0); i < 10; i++)
{
double foo(100.);
for (int j(10); j < 20; j++)
{
double goo(i*1000.);
double hoo(j*500.);
cout << i << "\t" << j << "\t" << goo << "\t" << hoo << endl;
}
}
return 0;
}