This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[commit] Minor optimization to symtab.c:search_symbols
- From: dje at google dot com (Doug Evans)
- To: gdb-patches at sourceware dot org
- Date: Wed, 23 May 2012 17:25:36 -0700 (PDT)
- Subject: [commit] Minor optimization to symtab.c:search_symbols
Hi.
I've committed this minor optimization to search_symbols.
This saves reading and storing the dwarf line header when we know we're
matching every file anyway.
Regression tested on amd64-linux.
2012-05-23 Doug Evans <dje@google.com>
* symtab.c (search_symbols): Pass NULL for file_matcher to
expand_symtabs_matching if there are no files to match.
Index: symtab.c
===================================================================
RCS file: /cvs/src/src/gdb/symtab.c,v
retrieving revision 1.304
diff -u -p -r1.304 symtab.c
--- symtab.c 18 May 2012 21:02:50 -0000 1.304
+++ symtab.c 24 May 2012 00:19:54 -0000
@@ -3426,7 +3426,9 @@ search_symbols (char *regexp, enum searc
{
if (objfile->sf)
objfile->sf->qf->expand_symtabs_matching (objfile,
- search_symbols_file_matches,
+ (nfiles == 0
+ ? NULL
+ : search_symbols_file_matches),
search_symbols_name_matches,
kind,
&datum);