c++/9366: g++-3.2 does not generate proper debugging information for sub-classes with virtual members

Thomas Richter thor@math.TU-Berlin.DE
Sun Jan 19 16:19:00 GMT 2003


>Number:         9366
>Category:       c++
>Synopsis:       g++-3.2 does not generate proper debugging information for sub-classes with virtual members
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Jan 19 15:36:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     Thomas Richter
>Release:        3.2.1 20020924 (Debian prerelease) (Debian testing/unstable)
>Organization:
TU-Berlin
>Environment:
System: Linux skywise 2.4.18 #25 Sam Dez 14 12:49:23 CET 2002 i686 unknown
Architecture: i686

	
host: i386-pc-linux-gnu
build: i386-pc-linux-gnu
target: i386-pc-linux-gnu
configured with: /mnt/data/gcc-3.1/gcc-3.2-3.2.1ds2/src/configure -v --enable-languages=c,c++,java,f77,proto,objc,ada --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-gxx-include-dir=/usr/include/c++/3.2 --enable-shared --with-system-zlib --enable-nls --without-included-gettext --enable-java-gc=boehm --enable-objc-gc i386-linux
>Description:
Save the following code as "foo.cpp":
/* snip */

struct Menu {
  class ButtonGadget {
  public:
    virtual bool HitTest(void);
  };
};

bool Menu::ButtonGadget::HitTest(void)
{
  return false;
}

int main(int argc,char **argv)
{
  return 0;
}

/* snip */

With the instructions given below, gdb (GNU gdb 5.2.1) will not be able
to find the method "Menu::ButtonGadget::HitTest". This might also be a
gdb problem.

>How-To-Repeat:
Save the above code, then compile it with
$ g++-3.2 -O0 -ggdb foo.cpp
The result will be an "a.out" file. Run gdb as follows:
$ gdb a.out
Then try to set a breakpoint at "Menu::ButtonGadget::HitTest".
This command will result in:
GNU gdb 5.2.1
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i686-pc-linux-gnu"...
(gdb) list
6       };
7
8       bool Menu::ButtonGadget::HitTest(void)
9       {
10        return false;
11      }
12
13      int main(int argc,char **argv)
14      {
15        return 0;
(gdb) break Menu::ButtonGadget::HitTest
the class Menu does not have any method named ButtonGadget
Hint: try 'Menu::ButtonGadget::HitTest<TAB> or 'Menu::ButtonGadget::HitTest<ESC-?>
(Note leading single quote.)
(gdb) 
>Fix:
No known fix available.
>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the Gcc-bugs mailing list