Re: Force generation of an uncalled method?

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

 



stepleton@xxxxxxxxx wrote:

> The problem is that I can't get g++ to generate code for this method
> unless I actually call it in somewhere the code (in which case everything
> works as intended). I've tried the "used" attribute in the declaration,
> and optimization is already off. Is there any way to force this method to
> be compiled?

I think you will need to explicitly instantiate a copy of the debug
method for each type that you expect to want to use from gdb, because
normally g++ only instantiates implicitly.  You might find this page
helpful:
<http://gcc.gnu.org/onlinedocs/gcc/Template-Instantiation.html>.

Brian

[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