From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2733 invoked by alias); 27 Feb 2003 19:27:29 -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 2724 invoked from network); 27 Feb 2003 19:27:29 -0000 Received: from unknown (HELO crack.them.org) (65.125.64.184) by 172.16.49.205 with SMTP; 27 Feb 2003 19:27:29 -0000 Received: from nevyn.them.org ([66.93.61.169] ident=mail) by crack.them.org with asmtp (Exim 3.12 #1 (Debian)) id 18oVa1-0004Hh-00; Thu, 27 Feb 2003 15:28:37 -0600 Received: from drow by nevyn.them.org with local (Exim 3.36 #1 (Debian)) id 18oTgj-0002aI-00; Thu, 27 Feb 2003 14:27:25 -0500 Date: Thu, 27 Feb 2003 19:27:00 -0000 From: Daniel Jacobowitz To: jacques Cc: gdb@sources.redhat.com Subject: Re: Problems outputting a string Message-ID: <20030227192725.GA9709@nevyn.them.org> Mail-Followup-To: jacques , gdb@sources.redhat.com References: <3E5E3F0D.1080308@redhat.com> <3E5FA468.8090008@sympatico.ca> <3E5FA6BF.8080405@sympatico.ca> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <3E5FA6BF.8080405@sympatico.ca> User-Agent: Mutt/1.5.1i X-SW-Source: 2003-02/txt/msg00591.txt.bz2 On Fri, Feb 28, 2003 at 01:13:19PM -0500, jacques wrote: > 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}} The short version: If you get a CVS snapshot of GDB (see http://sources.redhat.com/gdb/ for how to get one) this will be fixed. The long version, for the curious: The debug info for ret says: <2>: Abbrev Number: 107 (DW_TAG_variable) DW_AT_name : ret DW_AT_decl_file : 1 DW_AT_decl_line : 5 DW_AT_type : <7759> DW_AT_location : 3 byte block: 91 8 6 (DW_OP_fbreg: 8; DW_OP_deref; ) Note the DW_OP_deref at the end. decode_locdesc et al. support arguments which are frame-base relative and passed by reference, but not variables which are stored by reference. Oops. However, LOC_COMPUTED handles this perfectly gracefully. It would make a great test-case; I'll add it later. -- Daniel Jacobowitz MontaVista Software Debian GNU/Linux Developer