Command flags for debugging template code

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux