public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "tromey at redhat dot com" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug c++/9607] print displays wrong value of char-pointer in a class, delivered as function parameter
Date: Wed, 20 May 2009 22:58:00 -0000	[thread overview]
Message-ID: <20090520225856.9455.qmail@sourceware.org> (raw)
In-Reply-To: <20080818193801.9607.cmayer@xp8.de>


------- Additional Comments From tromey at redhat dot com  2009-05-20 22:58 -------
I can use a trick to see the string:

(gdb) p ((char **) &param)[1]
$2 = 0x8048936 "TestValue"

gdb appears to be printing the "zeroth slot" of the object rather than the first.
This in turns appears to be a debug info problem, afaict:

 <1><33f4>: Abbrev Number: 79 (DW_TAG_class_type)
    <33f5>   DW_AT_name        : (indirect string, offset: 0x19b8): myclass     
    <33f9>   DW_AT_byte_size   : 4      
    <33fa>   DW_AT_decl_file   : 29     
    <33fb>   DW_AT_decl_line   : 9      
    <33fc>   DW_AT_sibling     : <0x343e>       
 <2><3400>: Abbrev Number: 80 (DW_TAG_member)
    <3401>   DW_AT_name        : str    
    <3405>   DW_AT_decl_file   : 29     
    <3406>   DW_AT_decl_line   : 11     
    <3407>   DW_AT_type        : <0xaef>        
    <340b>   DW_AT_data_member_location: 2 byte block: 23 0    
(DW_OP_plus_uconst: 0)


It seems to me that the data member location should not be 0.
However, I am not certain; I'll have to do more reading.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tromey at redhat dot com


http://sourceware.org/bugzilla/show_bug.cgi?id=9607

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


       reply	other threads:[~2009-05-20 22:58 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20080818193801.9607.cmayer@xp8.de>
2009-05-20 22:58 ` tromey at redhat dot com [this message]
2009-05-21 19:03 ` tromey at redhat dot com
     [not found] <bug-9607-4717@http.sourceware.org/bugzilla/>
2010-10-11 22:14 ` tromey at redhat dot com

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=20090520225856.9455.qmail@sourceware.org \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=gdb-prs@sourceware.org \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).