e3c8b47
2005-01-21  Jeff Johnston  <jjohnstn@redhat.com>
e3c8b47
e3c8b47
	* linespec.c (collect_methods): Don't do special processing for
e3c8b47
	destructors as this will be handled in find_methods.
e3c8b47
	(find_methods): Fix ctor check to also check for dtor.
e3c8b47
e3c8b47
2007-10-14  Jan Kratochvil  <jan.kratochvil@redhat.com>
e3c8b47
e3c8b47
	Port to GDB-6.7.
e3c8b47
e3c8b47
Index: gdb-6.7/gdb/linespec.c
e3c8b47
===================================================================
e3c8b47
--- gdb-6.7.orig/gdb/linespec.c	2007-10-13 05:26:33.000000000 +0200
e3c8b47
+++ gdb-6.7/gdb/linespec.c	2007-10-14 23:31:03.000000000 +0200
e3c8b47
@@ -398,12 +398,14 @@ add_matching_methods (int method_counter
e3c8b47
 
e3c8b47
       /* Check for special case of looking for member that
e3c8b47
 	 doesn't have a mangled name provided.  This will happen
e3c8b47
-	 when we have in-charge and not-in-charge constructors.
e3c8b47
+	 when we have in-charge and not-in-charge ctors/dtors.
e3c8b47
 	 Since we don't have a mangled name to work with, if we
e3c8b47
-	 look for the symbol, we can only find the class itself.
e3c8b47
+	 look for the symbol, we can at best find the class itself.
e3c8b47
 	 We can find the information we need in the minimal symbol
e3c8b47
 	 table which has the full member name information we need.  */
e3c8b47
-      if (strlen (phys_name) <= strlen (class_name))
e3c8b47
+     if (strlen (phys_name) <= strlen (class_name)
e3c8b47
+         || (strlen (phys_name) == strlen (class_name) + 1
e3c8b47
+             && phys_name[0] == '~'))
e3c8b47
 	return add_minsym_members (class_name, phys_name, msym_arr);
e3c8b47
 
e3c8b47
       /* Destructor is handled by caller, don't add it to
e3c8b47
@@ -1731,6 +1733,11 @@ collect_methods (char *copy, struct type
e3c8b47
 {
e3c8b47
   int i1 = 0;	/*  Counter for the symbol array.  */
e3c8b47
 
e3c8b47
+#if 0
e3c8b47
+  /* Ignore this special method for getting destructors because
e3c8b47
+     find_methods is more robust and can handle multiple
e3c8b47
+     destructors which is the case when gcc generates a not-in-charge
e3c8b47
+     vs an in-charge destructor.  */
e3c8b47
   if (destructor_name_p (copy, t))
e3c8b47
     {
e3c8b47
       /* Destructors are a special case.  */
e3c8b47
@@ -1749,6 +1756,7 @@ collect_methods (char *copy, struct type
e3c8b47
 	}
e3c8b47
     }
e3c8b47
   else
e3c8b47
+#endif
e3c8b47
     i1 = find_methods (t, copy, SYMBOL_LANGUAGE (sym_class), sym_arr, msym_arr);
e3c8b47
 
e3c8b47
   return i1;