* 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.
This commit is contained in:
parent
1e99536ae5
commit
8903c50da7
8 changed files with 55 additions and 32 deletions
|
@ -1,3 +1,24 @@
|
|||
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)
|
||||
|
|
|
@ -129,10 +129,6 @@ struct blockvector
|
|||
#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);
|
||||
|
|
|
@ -1256,4 +1256,13 @@ void dummy_obstack_deallocate (void *object, void *data);
|
|||
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 */
|
||||
|
|
|
@ -2426,7 +2426,7 @@ dw2_do_expand_symtabs_matching (struct objfile *objfile, const char *name)
|
|||
|
||||
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);
|
||||
|
@ -2572,7 +2572,7 @@ static void
|
|||
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;
|
||||
|
|
|
@ -588,7 +588,8 @@ match_partial_symbol (struct partial_symtab *pst, int global,
|
|||
|
||||
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. */
|
||||
|
@ -1244,7 +1245,7 @@ expand_symtabs_matching_via_partial (struct objfile *objfile,
|
|||
void *),
|
||||
int (*name_matcher) (const char *,
|
||||
void *),
|
||||
domain_enum kind,
|
||||
enum search_domain kind,
|
||||
void *data)
|
||||
{
|
||||
struct partial_symtab *ps;
|
||||
|
|
|
@ -182,7 +182,8 @@ struct quick_symbol_functions
|
|||
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
|
||||
|
@ -265,7 +266,7 @@ struct quick_symbol_functions
|
|||
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
|
||||
|
|
26
gdb/symtab.c
26
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)
|
||||
{
|
||||
|
|
13
gdb/symtab.h
13
gdb/symtab.h
|
@ -395,11 +395,13 @@ typedef enum domain_enum_tag
|
|||
|
||||
/* 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,
|
||||
|
@ -409,8 +411,7 @@ typedef enum domain_enum_tag
|
|||
|
||||
/* All defined types */
|
||||
TYPES_DOMAIN
|
||||
}
|
||||
domain_enum;
|
||||
};
|
||||
|
||||
/* An address-class says where to find the value of a symbol. */
|
||||
|
||||
|
@ -1263,7 +1264,7 @@ struct symbol_search
|
|||
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
|
||||
|
|
Loading…
Reference in a new issue