From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8098 invoked by alias); 21 Jan 2006 21:46:34 -0000 Received: (qmail 8090 invoked by uid 22791); 21 Jan 2006 21:46:33 -0000 X-Spam-Check-By: sourceware.org Received: from nevyn.them.org (HELO nevyn.them.org) (66.93.172.17) by sourceware.org (qpsmtpd/0.31.1) with ESMTP; Sat, 21 Jan 2006 21:46:31 +0000 Received: from drow by nevyn.them.org with local (Exim 4.54) id 1F0QZ3-0001xa-MS; Sat, 21 Jan 2006 16:46:29 -0500 Date: Sun, 22 Jan 2006 19:18:00 -0000 From: Daniel Jacobowitz To: "yinglcs2@yahoo.com" Cc: gdb@sourceware.org Subject: Re: Debugging a C++ problem in GDB on linux Message-ID: <20060121214629.GA7495@nevyn.them.org> Mail-Followup-To: "yinglcs2@yahoo.com" , gdb@sourceware.org References: <20060121203559.41933.qmail@web35715.mail.mud.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20060121203559.41933.qmail@web35715.mail.mud.yahoo.com> User-Agent: Mutt/1.5.8i 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-01/txt/msg00205.txt.bz2 On Sat, Jan 21, 2006 at 12:35:59PM -0800, yinglcs2@yahoo.com wrote: > Hi > > I am trying to debug a C++ program in GDB on linux. > I want to dump out the content of the "this" object, > Here is what I get: > (gdb) print *this > $2 = {path = } > > My question is why I don't see the content of 'path'? > It said > ''. > > In the code, path is: > ostringstream path; > > When I try to do this: at GDB prompt 'print > this->path.str()' , I get > this error: > > (gdb) print this->path.str() > Couldn't find method ostringstream::str This is often a consequence of having no debug information for the C++ standard library. However, there's always a chance it's a bug in GDB; can you post a complete testcase? -- Daniel Jacobowitz CodeSourcery