*BSD News Article 30511


Return to BSD News archive

Xref: sserve gnu.gcc.help:8088 gnu.g++.help:5445 comp.os.386bsd.questions:10312
Path: sserve!newshost.anu.edu.au!munnari.oz.au!constellation!mimbres.cs.unm.edu!ees1a0.engr.ccny.cuny.edu!rpi!usc!howland.reston.ans.net!europa.eng.gtefsd.com!uhog.mit.edu!grapevine.lcs.mit.edu!usenet.coe.montana.edu!pcnot4me
From: pcnot4me@cs.montana.edu (Craig Pratt)
Newsgroups: gnu.gcc.help,gnu.g++.help,comp.os.386bsd.questions
Subject: Re: GDB "incomplete type" messages (solved)
Date: 12 May 1994 02:57:19 GMT
Organization: Dept of Computer Science, Montana State University, Bozeman, MT
Lines: 38
Message-ID: <2qs5uf$2uj@pdq.coe.montana.edu>
References: <2qprbh$2ni@pdq.coe.montana.edu>
Reply-To: pcnot4me@cs.montana.edu (Craig Pratt)
NNTP-Posting-Host: fubar.cs.montana.edu
Keywords: gcc g++ gdb struct

Thanks for those who replied.  It turns out this is a bug in g++.  I 
presume it's a problem with the way it's storing the debug type info.  
The workaround is simple - see below.

In article <2qprbh$2ni@pdq.coe.montana.edu>,
  Craig Pratt <pcnot4me@cs.montana.edu> wrote:
>We're having a problem with either gdb 4.11 or gcc 2.4.5 under FreeBSD 
>1.1.0 Beta that may qualify as a "bug."
>
>A structure in the program is declared as:
>
> typedef struct {
>   id_name type_name;
>   int typeOf;      // type (via the #defines in typclass.h)
>   int flags;       // weird things (forward, private)
>   int ssPosition;  // position of this type in the Static Scope Table
>   void *element;   // pointer to some type class
> } AdacsType;
...
>or enter a "ptype AdacsType" gdb prints:
>
> type = struct AdacsType {
>     <incomplete type>
> }

But, if the above struct is declared as:

  typedef struct AnyUniqueStructNameHere {
    ...
  } AdacsType;

it will then be visible in gdb.  This bug is limited to g++.  Either of 
the above structs works fine in gcc.
-- 
 Craig Pratt                                       Craig.Pratt@cs.montana.edu
 Montana State University, Bozeman MT            gcp1070@msu.oscs.montana.edu
 "Think for yourself and feel the walls...
                                 become sand beneath your feet." - Queensrych