aboutsummaryrefslogtreecommitdiff
path: root/gdb/symtab.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2011-04-04 14:10:12 +0000
committerTom Tromey <tromey@redhat.com>2011-04-04 14:10:12 +0000
commit8903c50da7496b9e04c3db262ec7020a206cab79 (patch)
tree95114b313de18eed3a6913afa8fb17f88b761c29 /gdb/symtab.c
parent1e99536ae5e3e54a10f35e8c915d3bd6c44140bd (diff)
downloadgdb-8903c50da7496b9e04c3db262ec7020a206cab79.zip
gdb-8903c50da7496b9e04c3db262ec7020a206cab79.tar.gz
gdb-8903c50da7496b9e04c3db262ec7020a206cab79.tar.bz2
* symtab.h (domain_enum): Split in two...
(enum search_domain): New. (search_symbols): Update. * symtab.c (print_symbol_info, symtab_symbol_info): Remove redundant declarations. (search_symbols): Change 'kind' argument to search_domain. Update. (print_symbol_info): Likewise. (symtab_symbol_info): Likewise. * symfile.h (struct quick_symbol_functions) <pre_expand_symtabs_matching>: Change type of 'kind' argument. <expand_symtabs_matching>: Likewise. * psymtab.c (pre_expand_symtabs_matching_psymtabs): Update. (expand_symtabs_matching_via_partial): Update. * dwarf2read.c (dw2_pre_expand_symtabs_matching): Update. (dw2_expand_symtabs_for_function): Update. * block.h: Moved anonymous enum... * defs.h (enum block_enum): ... here. Now named.
Diffstat (limited to 'gdb/symtab.c')
-rw-r--r--gdb/symtab.c26
1 files changed, 10 insertions, 16 deletions
diff --git a/gdb/symtab.c b/gdb/symtab.c
index 8aa692d..96b0773 100644
--- a/gdb/symtab.c
+++ b/gdb/symtab.c
@@ -110,13 +110,8 @@ struct symbol *lookup_symbol_aux_quick (struct objfile *objfile,
const char *name,
const domain_enum domain);
-static void print_symbol_info (domain_enum,
- struct symtab *, struct symbol *, int, char *);
-
static void print_msymbol_info (struct minimal_symbol *);
-static void symtab_symbol_info (char *, domain_enum, int);
-
void _initialize_symtab (void);
/* */
@@ -2986,7 +2981,8 @@ search_symbols_name_matches (const char *symname, void *user_data)
separately alphabetized. */
void
-search_symbols (char *regexp, domain_enum kind, int nfiles, char *files[],
+search_symbols (char *regexp, enum search_domain kind,
+ int nfiles, char *files[],
struct symbol_search **matches)
{
struct symtab *s;
@@ -3017,13 +3013,10 @@ search_symbols (char *regexp, domain_enum kind, int nfiles, char *files[],
struct cleanup *old_chain = NULL;
struct search_symbols_data datum;
- if (kind < VARIABLES_DOMAIN)
- error (_("must search on specific domain"));
-
- ourtype = types[(int) (kind - VARIABLES_DOMAIN)];
- ourtype2 = types2[(int) (kind - VARIABLES_DOMAIN)];
- ourtype3 = types3[(int) (kind - VARIABLES_DOMAIN)];
- ourtype4 = types4[(int) (kind - VARIABLES_DOMAIN)];
+ ourtype = types[kind];
+ ourtype2 = types2[kind];
+ ourtype3 = types3[kind];
+ ourtype4 = types4[kind];
sr = *matches = NULL;
tail = NULL;
@@ -3257,7 +3250,8 @@ search_symbols (char *regexp, domain_enum kind, int nfiles, char *files[],
regarding the match to gdb_stdout. */
static void
-print_symbol_info (domain_enum kind, struct symtab *s, struct symbol *sym,
+print_symbol_info (enum search_domain kind,
+ struct symtab *s, struct symbol *sym,
int block, char *last)
{
if (last == NULL || filename_cmp (last, s->filename) != 0)
@@ -3314,7 +3308,7 @@ print_msymbol_info (struct minimal_symbol *msymbol)
matches. */
static void
-symtab_symbol_info (char *regexp, domain_enum kind, int from_tty)
+symtab_symbol_info (char *regexp, enum search_domain kind, int from_tty)
{
static const char * const classnames[] =
{"variable", "function", "type", "method"};
@@ -3331,7 +3325,7 @@ symtab_symbol_info (char *regexp, domain_enum kind, int from_tty)
printf_filtered (regexp
? "All %ss matching regular expression \"%s\":\n"
: "All defined %ss:\n",
- classnames[(int) (kind - VARIABLES_DOMAIN)], regexp);
+ classnames[kind], regexp);
for (p = symbols; p != NULL; p = p->next)
{