This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: <incomplete type>


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]



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]