> c++ -O2 lib.cpp -c This line is causing the problem. Try c++ -g -O2 lib.cpp -c and you should get better results. GDB cannot display the proper line number for modules compiled without -g. GDB also does not step into functions compiled without -g and executes a `next' (step over) instead, which explains why you end up back in `main' after a step into `problem'. > Hi! > > I think i found a very strange problem/bug: > > (using > -gdb version 4.16, 418 and to 5.0 configured for 'i586-pc-linux-gnu' and > solaris > - gcc version 2.95.2 19991024 (release) > ) > > i wonder if it is an bug of gdb or gcc. (Or maybe it isn't a bug???) > > Here's an example: (The very important part is in Class.h) > use the following commands on the files enclosed at the end of this mail: > > c++ -O2 lib.cpp -c > c++ -g -c cctest.cpp > c++ -o ttt cctest.o lib.o > > Execute binary 'ttt'. The output looks like this: > | 0x80485e0 > | 0x8048660 > | this is function no_problem > | this is function problem > > > > now start gdb ('gdb ttt') > use the 'info line *' command on both of the addresses. The output looks > like > this: > > | (gdb) info line * 0x80485e0 > | Line 6 of "cctest.cpp" starts at address 0x80485e0 <no_problem__Fv> > | and ends at 0x80485e6 <no_problem__Fv+6>. > > > > Everything's fine with this information > > | (gdb) info line * 0x8048660 > | Line 23 of "cctest.cpp" starts at address 0x8048652 <main+66> > | and ends at 0x80486c0 <__tf4Test>. > > > > Oops: There is wrong line,file and symbol name information for the second > address. > try to step into the function 'problem'. > > without the keyword 'virtual' or/and without the function body of > Test::cctest() everything's fine! What's wrong? > > Best regards > Henning Moll -- Peter Schauer [EMAIL PROTECTED] _______________________________________________ Bug-gdb mailing list [EMAIL PROTECTED] http://mail.gnu.org/mailman/listinfo/bug-gdb