From 19ef5c713c0116f2e15fea28168614d7894b613a Mon Sep 17 00:00:00 2001 From: Keith Seitz Date: Tue, 16 Jun 2009 18:39:41 +0000 Subject: * linespec.c (collect_methods): Delete. (add_matching_methods): Reove destructor special case. (find_method): Call find_methods directly instead of collect_methods. * valops.c (value_struct_elt): Remove destructor special cases. (check_field): Likewise. (value_struct_elt_for_reference): Likewise. (destructor_name_p): Remove misleading comment about dtors being "special cases". * gdbtypes.h (get_destructor_fn_field): Remove. No longer needed. * gdbtypes.c (get_destructor_fn_field): Likewise. --- gdb/linespec.c | 46 +++++----------------------------------------- 1 file changed, 5 insertions(+), 41 deletions(-) (limited to 'gdb/linespec.c') diff --git a/gdb/linespec.c b/gdb/linespec.c index 3d0ceed..9c10156 100644 --- a/gdb/linespec.c +++ b/gdb/linespec.c @@ -76,10 +76,6 @@ static struct symtabs_and_lines find_method (int funfirstline, struct type *t, struct symbol *sym_class); -static int collect_methods (char *copy, struct type *t, - struct symbol *sym_class, - struct symbol **sym_arr); - static NORETURN void cplusplus_error (const char *name, const char *fmt, ...) ATTR_NORETURN ATTR_FORMAT (printf, 2, 3); @@ -306,11 +302,6 @@ add_matching_methods (int method_counter, struct type *t, else phys_name = TYPE_FN_FIELD_PHYSNAME (f, field_counter); - /* Destructor is handled by caller, don't add it to - the list. */ - if (is_destructor_name (phys_name) != 0) - continue; - sym_arr[i1] = lookup_symbol_in_language (phys_name, NULL, VAR_DOMAIN, language, @@ -849,6 +840,10 @@ decode_line_1 (char **argptr, int funfirstline, struct symtab *default_symtab, p = skip_quoted (*argptr); } + /* Keep any template parameters */ + if (*p == '<') + p = find_template_name_end (p); + copy = (char *) alloca (p - *argptr + 1); memcpy (copy, *argptr, p - *argptr); copy[p - *argptr] = '\0'; @@ -1441,7 +1436,7 @@ find_method (int funfirstline, char ***canonical, char *saved_arg, /* Find all methods with a matching name, and put them in sym_arr. */ - i1 = collect_methods (copy, t, sym_class, sym_arr); + i1 = find_methods (t, copy, SYMBOL_LANGUAGE (sym_class), sym_arr); if (i1 == 1) { @@ -1492,37 +1487,6 @@ find_method (int funfirstline, char ***canonical, char *saved_arg, } } -/* Find all methods named COPY in the class whose type is T, and put - them in SYM_ARR. Return the number of methods found. */ - -static int -collect_methods (char *copy, struct type *t, - struct symbol *sym_class, struct symbol **sym_arr) -{ - int i1 = 0; /* Counter for the symbol array. */ - - if (destructor_name_p (copy, t)) - { - /* Destructors are a special case. */ - int m_index, f_index; - - if (get_destructor_fn_field (t, &m_index, &f_index)) - { - struct fn_field *f = TYPE_FN_FIELDLIST1 (t, m_index); - - sym_arr[i1] = - lookup_symbol (TYPE_FN_FIELD_PHYSNAME (f, f_index), - NULL, VAR_DOMAIN, (int *) NULL); - if (sym_arr[i1]) - i1++; - } - } - else - i1 = find_methods (t, copy, SYMBOL_LANGUAGE (sym_class), sym_arr); - - return i1; -} - /* Return the symtab associated to the filename given by the substring -- cgit v1.1