From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6999 invoked by alias); 10 Nov 2006 19:07:10 -0000 Received: (qmail 6835 invoked by uid 22791); 10 Nov 2006 19:07:06 -0000 X-Spam-Check-By: sourceware.org Received: from smtp04.ya.com (HELO smtpauth.ya.com) (62.151.11.162) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 10 Nov 2006 19:06:48 +0000 Received: from [88.11.124.120] (helo=[192.168.1.2]) by smtpauth.ya.com with asmtp id 1Gibi8-0005e5-00 for gdb@sourceware.org; Fri, 10 Nov 2006 20:06:44 +0100 Message-ID: <4554CDC5.5030309@ya.com> Date: Fri, 10 Nov 2006 19:07:00 -0000 From: =?ISO-8859-1?Q?Ra=FAl_Huertas?= User-Agent: Thunderbird 1.5.0.7 (X11/20060921) MIME-Version: 1.0 To: GDB maillist Subject: in a C++ program compiled with gcc 4.0.1 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2006-11/txt/msg00058.txt.bz2 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 #include 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 = (gdb) what a_example type = stringstream (gdb) ptype a_example type = struct std::basic_stringstream,std::allocator > { } 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.