Dear bug-gdb,

I've had problems with gdb 4.18 when debugging C++ code
compiled by gcc 2.95.2.  A lot of things ahve gone wrong,
enough to make me wonder whether gdb is unhappy with the
fact that I'm using an SMP Linux kernel.  In any case, 
I've made a small testcase to show one of the problems
I've encountered.  gdb 4.18 can't find a member function 
in a class, something gdb 4.15.1 is able to do.

I've reproduced a shell session below, with commands that
identify the versions and configurations of gcc and gdb, 
list the testcase source code, and show gdb 4.18 giving
the message 
   Cannot resolve method Cell::Dump to any overloaded instance
whereas gdb 4.15 has no problem.

Thanks for your help.

Tom Ace
[EMAIL PROTECTED]




cartman : 250 > more gbug.cc
#include <stdio.h>

class Cell {
public:
    int        X;
    void       Dump();
};

void Cell::Dump()
{
    printf("X = %d\n",X);
}

int main(int argc,char **argv)
{
    Cell       C;

    C.X = 19;
    C.Dump();
}

cartman : 251 > gcc -g -v gbug.cc
Reading specs from /usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/specs
gcc version 2.95.2 19991024 (release)
 /usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/cpp -lang-c++ -v -D__GNUC__=2 
-D__GNUG__=2 -D__GNUC_MINOR__=95 -D__cplusplus -D__ELF__ -Dunix -D__i386__ -Dlinux 
-D__ELF__ -D__unix__ -D__i386__ -D__linux__ -D__unix -D__linux -Asystem(posix) 
-D__EXCEPTIONS -g -Acpu(i386) -Amachine(i386) -Di386 -D__i386 -D__i386__ -Di686 
-Dpentiumpro -D__i686 -D__i686__ -D__pentiumpro -D__pentiumpro__ gbug.cc 
/tmp/ccuc1Og6.ii
GNU CPP version 2.95.2 19991024 (release) (i386 Linux/ELF)
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/../../../../include/g++-3
 /usr/local/include
 /usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/../../../../i686-pc-linux-gnu/include
 /usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/include
 /usr/include
End of search list.
The following default directories have been omitted from the search path:
End of omitted list.
 /usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/cc1plus /tmp/ccuc1Og6.ii -quiet 
-dumpbase gbug.cc -g -version -o /tmp/ccozb3O1.s
GNU C++ version 2.95.2 19991024 (release) (i686-pc-linux-gnu) compiled by GNU C 
version 2.7.2.3.
 as -V -Qy -o /tmp/ccWAI9l0.o /tmp/ccozb3O1.s
GNU assembler version 2.9.5 (i386-linux) using BFD version 2.9.5.0.46
 /usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/collect2 -m elf_i386 -dynamic-linker 
/lib/ld-linux.so.2 /usr/lib/crt1.o /usr/lib/crti.o 
/usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/crtbegin.o 
-L/usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.95.2 -L/usr/local/lib /tmp/ccWAI9l0.o 
-lgcc -lc -lgcc /usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/crtend.o 
/usr/lib/crtn.o
cartman : 252 > gdb a.out
GNU gdb 4.18
Copyright 1998 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) b 19
Breakpoint 1 at 0x8048425: file gbug.cc, line 19.
(gdb) run

Breakpoint 1, main (argc=1, argv=0xbffffc74) at gbug.cc:19
19          C.Dump();
(gdb) p C.Dump()
Cannot resolve method Cell::Dump to any overloaded instance
(gdb) n
X = 19
20      }
(gdb) quit
cartman : 253 > ~/gdb-4.15.1 a.out
GDB is free software and you are welcome to 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.
GDB 4.15.1 (i486-linux), Copyright 1995 Free Software Foundation, Inc...
(gdb) b 19
Breakpoint 1 at 0x8048425: file gbug.cc, line 19.
(gdb) run

Breakpoint 1, main (argc=1, argv=0xbffffcd4) at gbug.cc:19
19          C.Dump();
(gdb) p C.Dump()
X = 19
$1 = void
(gdb) quit
cartman : 254 > more /proc/version
Linux version 2.3.99-pre9 (root@cartman) (gcc version 2.95.2 20000313 (Debian GN
U/Linux)) #1 SMP Fri Jun 16 12:17:24 PDT 2000

Reply via email to