Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <drow@mvista.com>
To: jacques <jacqueslenormand@sympatico.ca>
Cc: gdb@sources.redhat.com
Subject: Re: Problems outputting a string
Date: Thu, 27 Feb 2003 19:27:00 -0000	[thread overview]
Message-ID: <20030227192725.GA9709@nevyn.them.org> (raw)
In-Reply-To: <3E5FA6BF.8080405@sympatico.ca>

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 = {<allocator<char>> = {<No data fields>},
> _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><bdba>: 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


      reply	other threads:[~2003-02-27 19:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <F84byfA34cnFqUob5MF00027426@hotmail.com>
2003-02-27 16:36 ` a question about gdb and simulator Andrew Cagney
2003-02-27 18:04   ` Problems outputting a string jacques
2003-02-27 18:14     ` jacques
2003-02-27 19:27       ` Daniel Jacobowitz [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030227192725.GA9709@nevyn.them.org \
    --to=drow@mvista.com \
    --cc=gdb@sources.redhat.com \
    --cc=jacqueslenormand@sympatico.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox