2e2750b
2005-01-21  Jeff Johnston  <jjohnstn@redhat.com>
2e2750b
2e2750b
	* linespec.c (collect_methods): Don't do special processing for
2e2750b
	destructors as this will be handled in find_methods.
2e2750b
	(find_methods): Fix ctor check to also check for dtor.
2e2750b
9231e41
Index: gdb-6.5/gdb/linespec.c
9231e41
===================================================================
9231e41
--- gdb-6.5.orig/gdb/linespec.c	2006-07-07 01:04:56.000000000 -0300
9231e41
+++ gdb-6.5/gdb/linespec.c	2006-07-07 02:05:35.000000000 -0300
9231e41
@@ -377,12 +377,14 @@ add_matching_methods (int method_counter
2e2750b
 
2e2750b
       /* Check for special case of looking for member that
2e2750b
 	 doesn't have a mangled name provided.  This will happen
2e2750b
-	 when we have in-charge and not-in-charge constructors.
2e2750b
+	 when we have in-charge and not-in-charge ctors/dtors.
2e2750b
 	 Since we don't have a mangled name to work with, if we
2e2750b
-	 look for the symbol, we can only find the class itself.
2e2750b
+	 look for the symbol, we can at best find the class itself.
9231e41
 	 We can find the information we need in the minimal symbol
2e2750b
 	 table which has the full member name information we need.  */
2e2750b
-      if (strlen (phys_name) <= strlen (class_name))
9231e41
+     if (strlen (phys_name) <= strlen (class_name)
9231e41
+         || (strlen (phys_name) == strlen (class_name) + 1
9231e41
+             && phys_name[0] == '~'))
2e2750b
 	return add_minsym_members (class_name, phys_name, msym_arr);
2e2750b
 		
2e2750b
       /* Destructor is handled by caller, don't add it to
9231e41
@@ -1709,6 +1711,11 @@ collect_methods (char *copy, struct type
2e2750b
 {
2e2750b
   int i1 = 0;	/*  Counter for the symbol array.  */
2e2750b
 
2e2750b
+#if 0
2e2750b
+  /* Ignore this special method for getting destructors because
2e2750b
+     find_methods is more robust and can handle multiple
2e2750b
+     destructors which is the case when gcc generates a not-in-charge
2e2750b
+     vs an in-charge destructor.  */
2e2750b
   if (destructor_name_p (copy, t))
2e2750b
     {
2e2750b
       /* Destructors are a special case.  */
9231e41
@@ -1727,6 +1734,7 @@ collect_methods (char *copy, struct type
2e2750b
 	}
2e2750b
     }
2e2750b
   else
2e2750b
+#endif
2e2750b
     i1 = find_methods (t, copy, sym_arr, msym_arr);
2e2750b
 
2e2750b
   return i1;