This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
gnu-win32 B19: gdb and template
- To: egcs at cygnus dot com
- Subject: gnu-win32 B19: gdb and template
- From: Xiaomao Xiao <xiao at cmold dot com>
- Date: Fri, 9 Oct 1998 17:30:41 -0400 (EDT)
- Reply-To: xiao at cmold dot com
Hi there:
I recently tried to debug a c++ program with templates on my Windows NT box
installed with gnu-win32 B19. I found that I cannot step into the
implementation of a template. I prepared a simple example here to show what I
mean. Any advice is appreciated.
==================================
#include <stream.h>
template <class T>
void Print(const T & a)
{
cout << a << endl;
}
void Print1(const float & a)
{
cout << a << endl;
}
void Print1(const double & a)
{
cout << a << endl;
}
main()
{
Print(0.5);
Print(0.4f);
Print1(0.5);
Print1(0.4f);
}
==================================
I used this command to compile the program: gcc -gstabs+ test.cpp -lstdc++.
When I tried to debug the program with gdb (4.16-B19), I could not step into the
template function Print(). However I can step into function Print1().
What should I do to solve this problem? Thanks!
--
Xiaomao
=================================================================
Xiaomao (Mark) Xiao E-Mail: xiao@cmold.com
C-MOLD TEL: (607) 257-4949 x 699
31 Dutch Mill Road FAX: (607) 257-6355
Ithaca, NY 14850 URL: http://www.cmold.com
=================================================================