From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10101 invoked by alias); 6 Dec 2002 04:15:43 -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 10094 invoked from network); 6 Dec 2002 04:15:42 -0000 Received: from unknown (HELO crack.them.org) (65.125.64.184) by sources.redhat.com with SMTP; 6 Dec 2002 04:15:42 -0000 Received: from nevyn.them.org ([66.93.61.169] ident=mail) by crack.them.org with asmtp (Exim 3.12 #1 (Debian)) id 18KBmE-0000FP-00; Fri, 06 Dec 2002 00:15:54 -0600 Received: from drow by nevyn.them.org with local (Exim 3.36 #1 (Debian)) id 18K9uO-0000dv-00; Thu, 05 Dec 2002 23:16:12 -0500 Date: Thu, 05 Dec 2002 20:15:00 -0000 From: Daniel Jacobowitz To: Murad Nayal Cc: gdb@sources.redhat.com Subject: Re: help: gdb and c++ strings Message-ID: <20021206041612.GA2453@nevyn.them.org> Mail-Followup-To: Murad Nayal , gdb@sources.redhat.com References: <3DF02150.AACFAEB7@columbia.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3DF02150.AACFAEB7@columbia.edu> User-Agent: Mutt/1.5.1i X-SW-Source: 2002-12/txt/msg00112.txt.bz2 On Thu, Dec 05, 2002 at 11:02:24PM -0500, Murad Nayal wrote: > > > Hello, > > I am wondering if anyone here can help me with this. I am porting code > to linux and trying to use gdb to do the debugging. unfortunately this > is complicated by the fact that gdb does not print c++ string variables. > > p s > $1 = ( > const basic_string,std::allocator > > &) @0xbffff3d0: {static npos = Cannot access memory at address 0x8f4b974 > > I have come upon an older post to bug-gdb list that mentions this > problem > http://sources.redhat.com/ml/bug-gdb/2000-09/msg00012.html > > in response Daniel Berlin suggested that this problem might be related > to the stabs format and that using dwarf-2 format (i.e. g++ -gdwarf-2) > would solve it. however it was mentioned back then that for large > programs this problem persists even when compiling with the -gdwarf-2 > flag. this is where I am at right now. I have recompiled gdb from > sources (5.2.1) and recompiled most of the libraries I am using > (including the objects I am trying to debug) using the -gdwarf-2 flag. I > am on a pentium 3 platform using g++ 3.2.1, also compiled from sources. > I am not sure what to try next. can you help? You need to get a newer snapshot of GDB. This bug was fixed only a couple of weeks ago, IIRC. -- Daniel Jacobowitz MontaVista Software Debian GNU/Linux Developer