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

On Thu, 2005-09-01 at 17:20 -0700, Jim Blandy wrote:
> 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.)

  (gdb) ptype struct Soi::Waypoint
  No struct type named Soi.
[That's right, Soi's a namespace, but why doesn't it recongnise
Soi::Waypoint as a struct?]

  (gdb) ptype Soi::Waypoint
  type = namespace Soi::Waypoint
[Waypoint isn't a namespace though, its a class!]

  (gdb) ptype Soi
  type = namespace Soi

  (gdb) ptype struct Waypoint
  Internal: global symbol `Waypoint' found in SoiWaypoint.C psymtab but
not in symtab.
  Waypoint may be an inlined function, or may be a template function
  (if a template, try specifying an instantiation: Waypoint<type>).
[Waypoint isn't a template, it is a fairly normal class]

  (gdb) ptype Soi::Waypoint::wpll_
  type = class AdmLatLong { [long class decl] } ( Soi::Waypoint::&)

  (gdb) ptype Soi::Waypoint::wpname_
  type = char ( Soi::Waypoint::&)[72]


> 
> >> (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.

I should have also mentioned that the containing type points to the base
class at the top of the hierarchy, not the class mentioned in Waypoint's
declaration, but instead the class mentioned in that class's
declaration.

> 
> 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.

What about dwarf 2?  I'm using gcc 3.2.3 and it's doco seems to refer to
dwarf 2 rather than 3?  What versions does GDB work with?  Should I be
able to expect GDB 6.3 to work with 3.2.3 as well as it does with 3.4.x?

> > 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.

Maybe not.  Looking in the commands I've quoted at the top of this post
GDB does understand that Soi is a namespace, but readelf doesn't list
anything that describes this namespace.
> 
> What does 'ptype struct Waypoint' say?  (Again, without running the
> program.)

  (gdb) ptype struct Waypoint
  Internal: global symbol `Waypoint' found in SoiWaypoint.C psymtab but
not in symtab.
  Waypoint may be an inlined function, or may be a template function
  (if a template, try specifying an instantiation: Waypoint<type>).
[Waypoint isn't a template, it is a fairly normal class]


  reply	other threads:[~2005-09-02  1:50 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
2005-09-02  1:50           ` Craig Jeffree [this message]
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=1125625791.8327.76.camel@norman \
    --to=craig.jeffree@preston.net \
    --cc=gdb@sources.redhat.com \
    --cc=jimb@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).