>Submitter-Id: net >Originator: Thomas Richter >Organization: TU-Berlin >Confidential: no >Synopsis: g++-3.2 does not generate proper debugging information for >sub-classes with virtual members >Severity: serious >Priority: medium >Category: c++ >Class: sw-bug >Release: 3.2.1 20020924 (Debian prerelease) (Debian testing/unstable) >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.