constructor breakpoints

Doug Evans
2008-03-28T00:05:21Z

Having recently tripped over this (not being able to set breakpoints
on constructors), and having read as much of the sordid history of
this as I can find, I wonder what the current thinking is on how to
fix this. Has there been any progress?

bash$ ./gdb -nx testsuite/gdb.cp/overload
(gdb) b foo::foo
[0] cancel
[1] all
?HERE
?HERE
?HERE
>

The ?HERE's are because symbol lookup finds the class, not the
constructor. Being able to specifically ask for the constructor seems
like a reasonable way to go. This could be done by encoding the
request in the name (looking up c::c), or specifying the class of
object to lookup (e.g. LOC_BLOCK), or rearranging the symbol table
such that one can lookup the class, and then from that lookup (or
iterate) over members that match certain parameters. [I'm just
throwing out a range of possibilities.]