From 73589123891e1c5ae9ee9c6e359a2a37133200de Mon Sep 17 00:00:00 2001 From: "Paul N. Hilfinger" Date: Mon, 4 Oct 2010 06:34:40 +0000 Subject: Replace wild_match with faster version and modify its interface. This new version of wild_match is comparable in speed to strcmp_iw, and has the same signature and same return value for equal names. gdb/ChangeLog: * ada-lang.c (wild_match): Reimplement. Change API to eliminate unused length argument, reverse arguments and make 0 the 'true' return value. (advance_wild_match): New auxiliary function for wild_match to improve readability. (ada_match_name, ada_add_block_symbols): Use new API for wild_match. * psymtab.c (ada_lookup_partial_symbol, map_ada_symtabs): Use new API for wild_match. * symfile.h (map_ada_symtabs): Modify declaration to use new API for wild_match. * dwarf2read.c (dw2_map_ada_symtabs): Ditto. --- gdb/psymtab.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'gdb/psymtab.c') diff --git a/gdb/psymtab.c b/gdb/psymtab.c index 4aec16e..eac3e1a 100644 --- a/gdb/psymtab.c +++ b/gdb/psymtab.c @@ -974,7 +974,7 @@ find_symbol_file_from_partial (struct objfile *objfile, const char *name) static struct partial_symbol * ada_lookup_partial_symbol (struct partial_symtab *pst, const char *name, int global, domain_enum namespace, int wild, - int (*wild_match) (const char *, int, const char *), + int (*wild_match) (const char *, const char *), int (*is_name_suffix) (const char *)) { struct partial_symbol **start; @@ -999,7 +999,7 @@ ada_lookup_partial_symbol (struct partial_symtab *pst, const char *name, if (symbol_matches_domain (SYMBOL_LANGUAGE (psym), SYMBOL_DOMAIN (psym), namespace) - && (*wild_match) (name, name_len, SYMBOL_LINKAGE_NAME (psym))) + && (*wild_match) (SYMBOL_LINKAGE_NAME (psym), name) == 0) return psym; } return NULL; @@ -1112,7 +1112,7 @@ ada_lookup_partial_symbol (struct partial_symtab *pst, const char *name, static void map_ada_symtabs (struct objfile *objfile, - int (*wild_match) (const char *, int, const char *), + int (*wild_match) (const char *, const char *), int (*is_name_suffix) (const char *), void (*callback) (struct objfile *, struct symtab *, void *), const char *name, int global, domain_enum namespace, int wild, -- cgit v1.1