gdb/gdb-6.3-dtorfix-20050121.patch

49 lines
2.0 KiB
Diff

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