This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Constructor names in the symbol table
- From: Jim Blandy <jimb at redhat dot com>
- To: Daniel Jacobowitz <drow at false dot org>, david dot carlton at sun dot com
- Cc: gdb at sources dot redhat dot com
- Date: 17 Sep 2004 15:03:50 -0500
- Subject: Constructor names in the symbol table
Hey you C++ guys (and anyone else who's interested):
I've noticed that constructors get entered into the full symbol table
under their unprefixed name. That is, the following code:
struct S
{
int x;
S(int);
};
S::S (int _x)
{
x = _x * 2;
}
int
main ()
{
S s(3);
}
as compiled by GCC 3.4 produces a LOC_TYPEDEF entry for S, and then
two LOC_BLOCK symbols for the in-charge and not-in-charge
constructors, whose names are S.
When I do something like set a breakpoint on S::S(int), I don't get a
match from the full symbol table; instead, I get a match on the
demangled names in the minimal symbol table.
Is this the way it's supposed to work? I would have expected
something in dwarf2read to have consulted processing_current_prefix
and produced a qualified name for the full symbol.