Note: I've also sent this bug the bug-gdb mailing list. Reverting to the version of GDB in RH5.2 solves the problem. GDB can't seem to resolve calls to member functions of template classes in a "print" command. This used to work, but now gives the error message: Cannot resolve method ... to any overloaded instance GDB version: 4.18 Compiler: egcs 1.1.2 or gcc 2.95.1 Example: #include <stream.h> template<class foo> class bar { public: foo i; void show() { cout << i; } }; main(){ bar<int> q; q.show(); /* included just to instantiate member */ } Compile thus: g++ -g gdbbug.cc -o gdbbug Debug thus: gdb gdbbug b main r p q.show() Gdb response: Cannot resolve method bar<int>::show to any overloaded instance This was run under Red Hat 6.1. At the very least, the error message makes no sense, since a function with no arguments cannot be overloaded.
I was able to reproduce this problem with gdb-4.18-6 which is what is in Rawhide.
Seems to be fixed in Debian distribution; see Bug#43955 Debian Bugs database.
jim, can you please check that bug out?
See: http://sourceware.cygnus.com/ml/gdb/2000-q1/msg00330.html http://sourceware.cygnus.com/ml/gdb/2000-q1/msg00333.html Note that Debian bug #43955 does not contain a fix as far as I could see.
I believe this is fixed by Dan Berlin's checkin of 2000-03-10 to valops.c (I know Dan Berlin has a fix and I think that is the one). So try GDB from CVS (http://sourceware.cygnus.com/gdb/) or wait for us to get around to putting that GDB into Rawhide (I'd recommend the former but I may be biased :-)).
I have been able to cure this problem by setting "over-load-resolution" off. The bug may be as little as a mixed up condition test. For example, under gud on an i386, RedHat 6.1 system: (gdb) set overload-resolution off (gdb) p _cons.const_types() $1 = (KrInheritanceHierarchy *) 0x8127a88 (gdb) set overload-resolution on (gdb) p _cons.const_types() Cannot resolve method KrManualCons::const_types to any overloaded instance
GDB 5.0 is now in Rawhide, and fixes this problem.