diff options
author | Keith Seitz <keiths@redhat.com> | 2009-06-16 18:39:41 +0000 |
---|---|---|
committer | Keith Seitz <keiths@redhat.com> | 2009-06-16 18:39:41 +0000 |
commit | 19ef5c713c0116f2e15fea28168614d7894b613a (patch) | |
tree | cf913c08263d2b8aa2a3389dc7f9c2220f70389d /gdb/linespec.c | |
parent | a42616899b4f89a1bc1177c8edb27e890af40a82 (diff) | |
download | gdb-19ef5c713c0116f2e15fea28168614d7894b613a.zip gdb-19ef5c713c0116f2e15fea28168614d7894b613a.tar.gz gdb-19ef5c713c0116f2e15fea28168614d7894b613a.tar.bz2 |
* 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.
Diffstat (limited to 'gdb/linespec.c')
-rw-r--r-- | gdb/linespec.c | 46 |
1 files changed, 5 insertions, 41 deletions
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 |