This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[PATCH] Fix a template constructors bug for gcc3/stabs
- From: Daniel Jacobowitz <drow at mvista dot com>
- To: gdb-patches at sources dot redhat dot com,Peter Schauer <Peter dot Schauer at Regent dot E-Technik dot TU-Muenchen dot DE>
- Date: Sat, 11 May 2002 18:45:35 -0400
- Subject: [PATCH] Fix a template constructors bug for gcc3/stabs
Peter sent this to me some time ago, and I dropped it on the floor...
it's quite correct. The code which was specially checking for
__base_ctor/__complete_dtor/etc. did not handle templates properly;
it expected the constructor to be named 'Template<type>::Template<type>'
instead of 'Template<type>::Template'.
Committed, since this is a C++-only function.
--
Daniel Jacobowitz Carnegie Mellon University
MontaVista Software Debian GNU/Linux Developer
2002-05-11 Daniel Jacobowitz <drow@mvista.com>
From Peter Schauer <Peter.Schauer@Regent.E-Technik.TU-Muenchen.DE>:
* linespec.c (find_methods): Handle GCC 3.x template constructors.
Index: linespec.c
===================================================================
RCS file: /cvs/src/src/gdb/linespec.c,v
retrieving revision 1.20
diff -u -p -r1.20 linespec.c
--- linespec.c 10 May 2002 20:05:27 -0000 1.20
+++ linespec.c 11 May 2002 22:41:43 -0000
@@ -130,6 +130,7 @@ find_methods (struct type *t, char *name
(struct symtab **) NULL)))
{
int method_counter;
+ int name_len = strlen (name);
CHECK_TYPEDEF (t);
@@ -202,7 +203,9 @@ find_methods (struct type *t, char *name
*/
}
}
- else if (strcmp_iw (class_name, name) == 0)
+ else if (strncmp (class_name, name, name_len) == 0
+ && (class_name[name_len] == '\0'
+ || class_name[name_len] == '<'))
{
/* For GCC 3.x and stabs, constructors and destructors have names
like __base_ctor and __complete_dtor. Check the physname for now