[Converted from Gnats 1927] gdb version 6 gets confused when breakpoints are put onto overloaded c++ functions. The breakpoint query interaction says that the breakpoint is ?HERE; the pc gets mapped to pc 0. Attempting to list an overloaded c++ function results in a gdb segfault. All versions of gdb 6 I had available on suse linux have this problem. gdb 5.3 doesn't seem to have this problem. gdb 6 on solaris also has this problem. This problem happens when I compile the debuggee/victim program with with either "gcc -g" or "gcc -ggdb" Release: GNU gdb 6.3.50.20050423 Environment: Linux steel10 2.4.20-64GB-SMP #1 SMP Mon Mar 17 17:56:03 UTC 2003 i686 unknown unknown GNU/Linux debuggee version (victim program): gcc version 3.3.5 This GDB was configured as "i686-pc-linux-gnu". How-To-Repeat: Compile the attached file. Run under gdb. Put a breakpoint on: b InstSelection::InstSelection There are 2 functions with this overload, which is expected (one exlicitly given, the other default constructor). Observe: [0] cancel [1] all ?HERE ?HERE 1 Note: breakpoint -1 (disabled) also set at pc 0x0. Breakpoint 1 at 0x0 Note: breakpoints -1 (disabled) and 1 also set at pc 0x0. Breakpoint 2 at 0x0 then, do list InstSelection::InstSelection observe same output, and then selection [1], and get a segfault. Here's the debugged program (victim): #include <stdio.h> class InstSelection { public: InstSelection(double d) { } public: virtual ~InstSelection(void); void dump(void); }; InstSelection::~InstSelection(void) { } void InstSelection::dump(void) { printf("InstSelection::dump here\n"); } int main(void) { InstSelection *is = new InstSelection(17.0); is->dump(); delete is; is = 0; return 0; }
*** This bug has been marked as a duplicate of 8166 ***