public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: Jim Blandy <jimb@redhat.com>
To: Craig Jeffree <craig.jeffree@preston.net>
Cc: gdb@sources.redhat.com
Subject: Re: <incomplete type>
Date: Fri, 02 Sep 2005 00:22:00 -0000	[thread overview]
Message-ID: <m3k6i0uxp8.fsf@alligator.red-bean.com> (raw)
In-Reply-To: <1125618911.8327.53.camel@norman> (Craig Jeffree's message of "Fri, 02 Sep 2005 09:55:11 +1000")


Craig Jeffree <craig.jeffree@preston.net> writes:
> On Mon, 2005-08-29 at 11:31 -0700, Jim Blandy wrote:
>> The leftmost number in <angle brackets> is the nesting level of that
>> die; so if the entry for the die after the first one you listed starts
>> with <2>, then it's a child of the <1> die.  There should be
>> DW_TAG_member(?) dies.
>
> Ah, now I can see some sense in these dies.  Looking in the actual
> executable I can see this...
>
>  <1><c74a688>: Abbrev Number: 114 (DW_TAG_structure_type)
>      DW_AT_sibling     : <c74aadf>
>      DW_AT_name        : (indirect string, offset: 0x4ff824): Waypoint
>      DW_AT_byte_size   : 92
>      DW_AT_decl_file   : 60
>      DW_AT_decl_line   : 28
>      DW_AT_containing_type: <c74b7e1>
>  <2><c74a698>: Abbrev Number: 54 (DW_TAG_inheritance)
>      DW_AT_type        : <c74abb4>
>      DW_AT_data_member_location: 2 byte block: 23 0
> (DW_OP_plus_uconst: 0)
>      DW_AT_accessibility: 1     (public)
>  <2><c74a6a1>: Abbrev Number: 56 (DW_TAG_variable)
>      DW_AT_name        : (indirect string, offset: 0x837e8): typeName_
>      DW_AT_decl_file   : 1
>      DW_AT_decl_line   : 17
>      DW_AT_MIPS_linkage_name: (indirect string, offset: 0x8e402b):
> _ZN3Soi8Waypoint9typeName_E
>      DW_AT_type        : <c74b7af>
>      DW_AT_external    : 1
>      DW_AT_declaration : 1
>  <2><c74a6b2>: Abbrev Number: 47 (DW_TAG_member)
>      DW_AT_name        : (indirect string, offset: 0x7724ea): wpname_
>      DW_AT_decl_file   : 60
>      DW_AT_decl_line   : 84
>      DW_AT_type        : <c74b7b4>
>      DW_AT_data_member_location: 2 byte block: 23 4
> (DW_OP_plus_uconst: 4)
>      DW_AT_accessibility: 3     (private)
>  <2><c74a6c1>: Abbrev Number: 47 (DW_TAG_member)
>      DW_AT_name        : (indirect string, offset: 0x8e4084): wpll_
>      DW_AT_decl_file   : 60
>      DW_AT_decl_line   : 85
>      DW_AT_type        : <c748414>
>      DW_AT_data_member_location: 2 byte block: 23 4c
> (DW_OP_plus_uconst: 76)
>      DW_AT_accessibility: 3     (private)
>  <2><c74a6d0>: Abbrev Number: 48 (DW_TAG_subprogram)
> [It then trails off into a long list of methods and their arguments]
>
>
> So, it appears to list the members of Waypoint.  Is this enough info for
> gdb to not say incomplete type?  How can I figure out why gdb is missing
> this?  When I explicitly try to reference these members of a Waypoint
> object gdb says "There is no member named wpll_".

Well, we've at least established that 'wpll_' is mentioned in the
debug info.

If you run GDB on the executable alone, without starting it, what does
'ptype struct Soi::Waypoint' say?  (Running the program will load
shared libraries and possibly confuse the issue, but GDB should be
able to understand the info in the executable without running
anything.)

>> (I'm apparently wrong about the DW_AT_name being mangled.  Does the
>> DW_AT_containing_type attribute of the first die point at something
>> named "Soi"?)
>
> The containing type for 'Waypoint' points to a die that appears to
> describe Waypoint's base class.

That's odd.  The Dwarf 3 spec only mentions DW_AT_containing_type in
the context of dies describing pointer-to-member types.  So the
attribute wasn't what I guessed it was, but it also doesn't belong
there.

> I couldn't find any dies relating to the namespace 'Soi'.

I have trouble keeping track of how namespaces are supposed to work in
the GNU toolchain; it's changed over time.

As I understand it now, if the namespace information were present, it
would be a DW_TAG_namespace die, and the DW_TAG_structure_type die
would be one of its children.  Or, if the type were declared inside
the namespace but defined outside it, the definition die might not be
a child of a namespace die itself, but it would have a
DW_AT_specification attribute that pointed to another die that was.

But you're saying there's no "Soi" die at all, so that's all moot.

What does 'ptype struct Waypoint' say?  (Again, without running the
program.)

  reply	other threads:[~2005-09-02  0:22 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-26  2:06 Craig Jeffree
2005-08-26 19:04 ` Jim Blandy
2005-08-29  7:50   ` Craig Jeffree
2005-08-29 18:38     ` Jim Blandy
2005-09-01 23:55       ` Craig Jeffree
2005-09-02  0:22         ` Jim Blandy [this message]
2005-09-02  1:50           ` Craig Jeffree
2005-09-02 13:16             ` Daniel Jacobowitz
2005-09-05  7:34               ` Craig Jeffree
2005-09-05 14:00                 ` Daniel Jacobowitz
2005-09-06  7:15                   ` Craig Jeffree
2005-09-12  1:34                     ` Daniel Jacobowitz
2005-09-15  5:12                       ` Craig Jeffree
2005-09-19  7:44                         ` Craig Jeffree
2005-09-12  1:35           ` Daniel Jacobowitz
2005-09-02  2:05       ` Craig Jeffree
  -- strict thread matches above, loose matches on Subject: below --
2005-05-01 21:21 "Incomplete Type" lin q

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=m3k6i0uxp8.fsf@alligator.red-bean.com \
    --to=jimb@redhat.com \
    --cc=craig.jeffree@preston.net \
    --cc=gdb@sources.redhat.com \
    /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).