From: "Raúl Huertas" <raulh39@ya.com>
To: GDB maillist <gdb@sourceware.org>
Subject: <incomplete type> in a C++ program compiled with gcc 4.0.1
Date: Fri, 10 Nov 2006 19:07:00 -0000 [thread overview]
Message-ID: <4554CDC5.5030309@ya.com> (raw)
Hi all!
This is my first post to this mail list, and I'm not sure if it is the
correct one. In case I'm wrong, can you please tell me wich mail list is
the correct one?
I have this C++ program:
------------------------------------------
/*
g++ -g -o tgdb tgdb.cc -lstdc++
*/
#include <sstream>
#include <iostream>
int main()
{
std::stringstream a_example("I want to see this in gdb!");
std::cout << a_example.str() << std::endl;
}
------------------------------------------
The program works as expected, but when I run it in GDB setting a
breakpoint in the "cout" line, I cannot print the content of "a_example".
Here is the output of gdb:
(gdb) p a_example
$1 = <incomplete type>
(gdb) what a_example
type = stringstream
(gdb) ptype a_example
type = struct
std::basic_stringstream<char,std::char_traits<char>,std::allocator<char> > {
<incomplete type>
}
My gcc is:
$ g++ -v
Using built-in specs.
Target: i586-mandriva-linux-gnu
Configured with: ../configure --prefix=/usr --libexecdir=/usr/lib
--with-slibdir=/lib --mandir=/usr/share/man --infodir=/usr/share/info
--enable-shared --enable-threads=posix --disable-checking
--enable-languages=c,c++,ada,f95,objc,java
--host=i586-mandriva-linux-gnu --with-system-zlib --enable-long-long
--enable-__cxa_atexit --enable-clocale=gnu
--disable-libunwind-exceptions --enable-java-awt=gtk
--with-java-home=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre
--enable-gtk-cairo --disable-libjava-multilib
Thread model: posix
gcc version 4.0.1 (4.0.1-5mdk for Mandriva Linux release 2006.0)
And my gdb is:
$ gdb -v
GNU gdb 6.3-5mdk (Mandriva Linux release 2006.0)
Copyright 2004 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 "i586-mandriva-linux-gnu".
As you can see, I have used "g++ -g -o tgdb tgdb.cc -lstdc++" to compile
the program.
Am I doing something wrong?
Why can't I see the contents of "a_example"?
Here (http://tinyurl.com/ynzagc) I have found a similar problem, but I
really don't understand the way it is resolved.
Any ideas will be much appreciated.
Thank you very much,
Raúl.
next reply other threads:[~2006-11-10 19:07 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-11-10 19:07 Raúl Huertas [this message]
2006-11-10 19:11 ` Daniel Jacobowitz
2006-11-10 19:24 ` Raúl Huertas
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4554CDC5.5030309@ya.com \
--to=raulh39@ya.com \
--cc=gdb@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox