This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Command flags for debugging template code
- From: Stephen Torri <storri at torri dot org>
- To: GCC List <gcc-help at gcc dot gnu dot org>
- Date: Mon, 26 Mar 2007 20:17:27 -0500
- Subject: Command flags for debugging template code
I have a C++ project that uses the boost graph library. Now the reason I
am emailing here is that I was wondering for general C++ code that uses
templates what flags should I use to enable gdb to stop in a template
function? For example if I had a header file that had:
class Fruit {
public:
template <typename Basket>
void print_Contents ( Basket* container_ptr )
{
std::cout << container_ptr->dump() << std::endl;
}
};
Assuming that I had a class that supported the function dump() I could
then use this function. Well as I understand it the definition in the
header for the function dump() will be inlined anywhere it is used in
the code. Is that correct?
If it is then unless I keep careful management of print_Contents I may
not know its called. In the boost graph library there are a lot of ways
certain functions are used but require a indepth understanding of which
are called explicitly or implicitly. I would like such that if I used
flags X, Y and Z with the g++ compiler I can call gdb to stop in
function print_Contents. Do I make sense?
Stephen