🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gdb.bug
Article #268

Why gdb doesn't print out baseclasses in C++.

#268
From: Bryan Boreham
Date: Wed, 20 Sep 1989 12:53
33 lines
1682 bytes
I don't know whether or not this affects everybody, but for me, gdb
has always claimed not to know about baseclasses. It would say "Type
not defined in this context". 

My guess is that this is because class foo as a baseclass is
represented in the symbol table by a copy of the information on plain
vanilla class foo. Unfortunately, this copy is taken when foo is
masquerading as an undefined reference. 

I offer the following fix.

Bryan.

BTW: What is a "via_virtual" baseclass?


kewill% diff -c dbxread.c~ dbxread.c
*** dbxread.c~  Tue Jul 11 03:38:46 1989
--- dbxread.c   Wed Sep 20 13:35:12 1989
***************
*** 4231,4236 ****
--- 4231,4241 ----
          *pp += 1;             /* skip trailing ';' */
          baseclass_vec[i] = lookup_basetype_type (baseclass, offset, via_virtual, via_public);

+         /* We should be able to fix this up at the end.
+            Otherwise, it just gets left undefined forever. */
+         if (TYPE_FLAGS(baseclass_vec[i]) & TYPE_FLAG_STUB)
+           add_undefined_type (baseclass_vec[i]);
+
          /* Make this baseclass visible for structure-printing purposes.  */
          new = (struct nextfield *) alloca (sizeof (struct nextfield));
          new->next = list;
Technical Details
Message-ID: <8909201253.AA21603@edinburgh.kewill.uucp>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!ucsd!tut.cis.ohio-state.edu!UUNET.UU.NET!kewill!bryan

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!ucsd!tut.cis.ohio-state.edu!UUNET.UU.NET!kewill!bryan
From: kewill!bryan@UUNET.UU.NET (Bryan Boreham)
Newsgroups: gnu.gdb.bug
Subject: Why gdb doesn't print out baseclasses in C++.
Message-ID: <8909201253.AA21603@edinburgh.kewill.uucp>
Date: 20 Sep 89 12:53:49 GMT
Sender: daemon@tut.cis.ohio-state.edu
Distribution: gnu
Organization: GNUs Not Usenet
Lines: 33