Bug 9032 - gdb 6.3 can't resolve overloaded functions
Summary: gdb 6.3 can't resolve overloaded functions
Status: RESOLVED DUPLICATE of bug 8166
Alias: None
Product: gdb
Classification: Unclassified
Component: c++ (show other bugs)
Version: 3.50
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-04-25 16:38 UTC by rrh
Modified: 2010-03-13 00:45 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments
gdb.cc (193 bytes, application/octet-stream)
, rrh
Details

Note You need to log in before you can comment on or make changes to this bug.
Description rrh 2005-04-25 16:38:01 UTC
[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;
}
Comment 1 Keith Seitz 2010-03-13 00:45:40 UTC

*** This bug has been marked as a duplicate of 8166 ***