[gnu.gdb.bug] Why gdb doesn't print out baseclasses in C++.

bryan@UUNET.UU.NET (Bryan Boreham) (09/20/89)

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;