Peng Yu wrote: Redirected to gcc-help. > I have the following code. I try to print the variable temp in the > constructor of A. But gdb can not do that. The error message is shown > blow the C++ code. > > According to the people from gdb mailing list, it is because that the > compiler (g++) does not generate information for such variable in the > debugging mode. Is it a bug of g++. BTW, I'm using g++ of the > following version It's not a bug as such, since we've never guaranteed to generate complete debug information. Perhaps this should be considered an enhancement request, rather than a bug. If you go to http://gcc.gnu.org/bugzilla/ and type the search terms "c++ debug info" you'll find several related bug reports. Andrew.