* Bug? GDB can't display c++ c'tor local variable.
@ 2008-11-14 20:32 Koffee Lue
2008-11-14 20:41 ` Daniel Jacobowitz
0 siblings, 1 reply; 2+ messages in thread
From: Koffee Lue @ 2008-11-14 20:32 UTC (permalink / raw)
To: gdb
Hi,
I found that GDB can't display local variables in a c++ constructor.
Please see the testing code below. When I stepped into the c'tor, and
typed ''info lo'', gdb responded "No locals.", however `tmp' is a
local with type int.
I searched on the web and somebody said it's a bug of gcc rather than
gdb. But that's for gcc 3.x years ago. (see:
http://gcc.gnu.org/ml/gcc-bugs/2007-08/msg00727.html)
Any hint???
Thanks!
Here's my system:
----------------------------------
Distributor ID: Ubuntu
Description: Ubuntu 8.04.1
Release: 8.04
Codename: hardy
g++ (GCC) 4.2.4 (Ubuntu 4.2.4-1ubuntu3)
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
GNU gdb 6.8-debian
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "i486-linux-gnu".
----- testing code ------
1 #include <iostream>
2
3 using namespace std;
4
5 class A {
6 public:
7 int a;
8 A();
9 };
10
11 A::A()
12 {
13 int tmp = 5;
14 a = tmp;
15 cout << "a= "<<a<<endl;
16 cout << "tmp= "<<tmp<<endl;
17 }
18
19 int main()
20 {
21 A x;
22 return 0;
23 }
24
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-11-14 20:41 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-11-14 20:32 Bug? GDB can't display c++ c'tor local variable Koffee Lue
2008-11-14 20:41 ` Daniel Jacobowitz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox