From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23986 invoked by alias); 27 Feb 2003 18:14:30 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 23979 invoked from network); 27 Feb 2003 18:14:28 -0000 Received: from unknown (HELO tomts10-srv.bellnexxia.net) (209.226.175.54) by 172.16.49.205 with SMTP; 27 Feb 2003 18:14:28 -0000 Received: from sympatico.ca ([65.94.70.23]) by tomts10-srv.bellnexxia.net (InterMail vM.5.01.04.19 201-253-122-122-119-20020516) with ESMTP id <20030227181428.HXIR26691.tomts10-srv.bellnexxia.net@sympatico.ca> for ; Thu, 27 Feb 2003 13:14:28 -0500 Message-ID: <3E5FA6BF.8080405@sympatico.ca> Date: Thu, 27 Feb 2003 18:14:00 -0000 From: jacques User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20030113 X-Accept-Language: en-us, en MIME-Version: 1.0 To: gdb@sources.redhat.com CC: gdb@sources.redhat.com Subject: Re: Problems outputting a string References: <3E5E3F0D.1080308@redhat.com> <3E5FA468.8090008@sympatico.ca> In-Reply-To: <3E5FA468.8090008@sympatico.ca> X-Enigmail-Version: 0.71.0.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=GB2312 Content-Transfer-Encoding: 8bit X-SW-Source: 2003-02/txt/msg00587.txt.bz2 woops, had the gdb output paste wrong, here it is(everything else was correct): bash-2.05b$ gdb tetete.o GNU gdb 5.3 Copyright 2002 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) b 7 Breakpoint 1 at 0x80486ad: file /home/palomer/tetete.cpp, line 7. (gdb) r Starting program: /home/palomer/tetete.o Breakpoint 1, foo() () at /home/palomer/tetete.cpp:7 7 return ret; (gdb) p ret $1 = {static npos = 4294967295, _M_dataplus = {> = {}, _M_p = 0xbffff7a0 "T\233\004\ba"+$@?¡Ây"?\035\205\004\bT_\022@a"+$@?¡Ây"?d\n\023@\ 001"}, static _S_empty_rep_storage = {0, 0, 0, 0}} (gdb) p ret.c_str() Program received signal SIGSEGV, Segmentation fault. 0x400acf3c in std::char_traits::assign(char&, char const&) () from /usr/lib/gcc-lib/i686-pc-linux-gnu/3.2.1/libstdc++.so.5 The program being debugged was signaled while in a function called from GDB. GDB remains in the frame where the signal was received. To change this behavior use "set unwindonsignal on" Evaluation of the expression containing the function (std::string::c_str() const ) will be abandoned. (gdb) --Jacques