This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
constructor breakpoints
- From: "Doug Evans" <dje at google dot com>
- To: gdb <gdb at sourceware dot org>
- Date: Thu, 27 Mar 2008 17:04:57 -0700
- Subject: constructor breakpoints
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.]