From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5819 invoked by alias); 2 Sep 2005 01:50:24 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 5809 invoked by uid 22791); 2 Sep 2005 01:50:16 -0000 Received: from chfw.preston.net (HELO universe.preston.net) (202.14.89.130) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Fri, 02 Sep 2005 01:50:16 +0000 Received: from norman (norman.preston.net [202.14.10.82]) by universe.preston.net (8.11.6/8.11.6) with ESMTP id j821nq416427; Fri, 2 Sep 2005 11:49:56 +1000 Subject: Re: From: Craig Jeffree To: Jim Blandy Cc: gdb@sources.redhat.com In-Reply-To: References: <1125021866.10500.71.camel@norman> <1125301769.10500.124.camel@norman> <1125618911.8327.53.camel@norman> Content-Type: text/plain Date: Fri, 02 Sep 2005 01:50:00 -0000 Message-Id: <1125625791.8327.76.camel@norman> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-SW-Source: 2005-09/txt/msg00007.txt.bz2 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). [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). [Waypoint isn't a template, it is a fairly normal class]