(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.
+2011-04-04 Tom Tromey <tromey@redhat.com>
+
+ * 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.
+
2011-04-03 Joel Brobecker <brobecker@adacore.com>
GDB 7.3 branch created (branch timestamp: 2011-04-01 01:00 UTC)
#define BLOCKVECTOR_BLOCK(blocklist,n) (blocklist)->block[n]
#define BLOCKVECTOR_MAP(blocklist) ((blocklist)->map)
-/* Special block numbers */
-
-enum { GLOBAL_BLOCK = 0, STATIC_BLOCK = 1, FIRST_LOCAL_BLOCK = 2 };
-
extern struct symbol *block_linkage_function (const struct block *);
extern int block_inlined_p (const struct block *block);
extern void initialize_progspace (void);
extern void initialize_inferiors (void);
+/* Special block numbers */
+
+enum block_enum
+{
+ GLOBAL_BLOCK = 0,
+ STATIC_BLOCK = 1,
+ FIRST_LOCAL_BLOCK = 2
+};
+
#endif /* #ifndef DEFS_H */
static void
dw2_pre_expand_symtabs_matching (struct objfile *objfile,
- int kind, const char *name,
+ enum block_enum block_kind, const char *name,
domain_enum domain)
{
dw2_do_expand_symtabs_matching (objfile, name);
dw2_expand_symtabs_matching (struct objfile *objfile,
int (*file_matcher) (const char *, void *),
int (*name_matcher) (const char *, void *),
- domain_enum kind,
+ enum search_domain kind,
void *data)
{
int i;
static void
pre_expand_symtabs_matching_psymtabs (struct objfile *objfile,
- int kind, const char *name,
+ enum block_enum block_kind,
+ const char *name,
domain_enum domain)
{
/* Nothing. */
void *),
int (*name_matcher) (const char *,
void *),
- domain_enum kind,
+ enum search_domain kind,
void *data)
{
struct partial_symtab *ps;
doesn't make sense to implement both.) The arguments are as for
`lookup_symbol'. */
void (*pre_expand_symtabs_matching) (struct objfile *objfile,
- int kind, const char *name,
+ enum block_enum block_kind,
+ const char *name,
domain_enum domain);
/* Print statistics about any indices loaded for OBJFILE. The
void (*expand_symtabs_matching) (struct objfile *objfile,
int (*file_matcher) (const char *, void *),
int (*name_matcher) (const char *, void *),
- domain_enum kind,
+ enum search_domain kind,
void *data);
/* Return the symbol table from OBJFILE that contains PC and
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);
/* */
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;
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;
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)
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"};
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)
{
/* LABEL_DOMAIN may be used for names of labels (for gotos). */
- LABEL_DOMAIN,
+ LABEL_DOMAIN
+} domain_enum;
- /* Searching domains. These overlap with VAR_DOMAIN, providing
- some granularity with the search_symbols function. */
+/* Searching domains, used for `search_symbols'. */
+enum search_domain
+{
/* Everything in VAR_DOMAIN minus FUNCTIONS_DOMAIN and
TYPES_DOMAIN. */
VARIABLES_DOMAIN,
/* All defined types */
TYPES_DOMAIN
-}
-domain_enum;
+};
/* An address-class says where to find the value of a symbol. */
struct symbol_search *next;
};
-extern void search_symbols (char *, domain_enum, int, char **,
+extern void search_symbols (char *, enum search_domain, int, char **,
struct symbol_search **);
extern void free_search_symbols (struct symbol_search *);
extern struct cleanup *make_cleanup_free_search_symbols (struct symbol_search