mirror of
https://github.com/darlinghq/darling-gdb.git
synced 2025-02-10 03:02:30 +00:00
psymtab cleanup patch 2/3
This patch adds two typedefs: expand_symtabs_file_matcher_ftype expand_symtabs_symbol_matcher_ftype It also renames the NAME_MATCHER argument in expand_symtabs_matching. The function is named expand_symtabs_matching and it takes a name_matcher argument. Name of what? The symtab? A symbol? I made it SYMBOL_MATCHER to make it clearer. * symfile.h (expand_symtabs_file_matcher_ftype): New typedef. (expand_symtabs_symbol_matcher_ftype): New typedef. (quick_symbol_functions.expand_symtabs_matching): Update to use. expand_symtabs_file_matcher_ftype, expand_symtabs_symbol_matcher_ftype. * symfile.c (expand_partial_symbol_names): Update to use expand_symtabs_symbol_matcher_ftype. * dwarf2read.c (dw2_expand_symtabs_matching): Update to use expand_symtabs_file_matcher_ftype, expand_symtabs_symbol_matcher_ftype. Arg name_matcher renamed to symbol_matcher. * psymtab.c (recursively_search_psymtabs): Update to use expand_symtabs_symbol_matcher_ftype. Arg name_matcher renamed to sym_matcher. (expand_symtabs_matching_via_partial): Update to use expand_symtabs_file_matcher_ftype, expand_symtabs_symbol_matcher_ftype. Arg name_matcher renamed to symbol_matcher.
This commit is contained in:
parent
540c2971fa
commit
206f2a5777
@ -1,3 +1,21 @@
|
|||||||
|
2014-01-14 Doug Evans <dje@google.com>
|
||||||
|
|
||||||
|
* symfile.h (expand_symtabs_file_matcher_ftype): New typedef.
|
||||||
|
(expand_symtabs_symbol_matcher_ftype): New typedef.
|
||||||
|
(quick_symbol_functions.expand_symtabs_matching): Update to use.
|
||||||
|
expand_symtabs_file_matcher_ftype, expand_symtabs_symbol_matcher_ftype.
|
||||||
|
* symfile.c (expand_partial_symbol_names): Update to use
|
||||||
|
expand_symtabs_symbol_matcher_ftype.
|
||||||
|
* dwarf2read.c (dw2_expand_symtabs_matching): Update to use
|
||||||
|
expand_symtabs_file_matcher_ftype, expand_symtabs_symbol_matcher_ftype.
|
||||||
|
Arg name_matcher renamed to symbol_matcher.
|
||||||
|
* psymtab.c (recursively_search_psymtabs): Update to use
|
||||||
|
expand_symtabs_symbol_matcher_ftype. Arg name_matcher renamed to
|
||||||
|
sym_matcher.
|
||||||
|
(expand_symtabs_matching_via_partial): Update to use
|
||||||
|
expand_symtabs_file_matcher_ftype, expand_symtabs_symbol_matcher_ftype.
|
||||||
|
Arg name_matcher renamed to symbol_matcher.
|
||||||
|
|
||||||
2014-01-14 Doug Evans <dje@google.com>
|
2014-01-14 Doug Evans <dje@google.com>
|
||||||
|
|
||||||
* psymtab.c (expand_partial_symbol_names): Delete, moved to symfile.c.
|
* psymtab.c (expand_partial_symbol_names): Delete, moved to symfile.c.
|
||||||
|
@ -3771,8 +3771,8 @@ dw2_map_matching_symbols (struct objfile *objfile,
|
|||||||
static void
|
static void
|
||||||
dw2_expand_symtabs_matching
|
dw2_expand_symtabs_matching
|
||||||
(struct objfile *objfile,
|
(struct objfile *objfile,
|
||||||
int (*file_matcher) (const char *, void *, int basenames),
|
expand_symtabs_file_matcher_ftype *file_matcher,
|
||||||
int (*name_matcher) (const char *, void *),
|
expand_symtabs_symbol_matcher_ftype *symbol_matcher,
|
||||||
enum search_domain kind,
|
enum search_domain kind,
|
||||||
void *data)
|
void *data)
|
||||||
{
|
{
|
||||||
@ -3876,7 +3876,7 @@ dw2_expand_symtabs_matching
|
|||||||
|
|
||||||
name = index->constant_pool + MAYBE_SWAP (index->symbol_table[idx]);
|
name = index->constant_pool + MAYBE_SWAP (index->symbol_table[idx]);
|
||||||
|
|
||||||
if (! (*name_matcher) (name, data))
|
if (! (*symbol_matcher) (name, data))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
/* The name was matched, now expand corresponding CUs that were
|
/* The name was matched, now expand corresponding CUs that were
|
||||||
|
@ -1281,7 +1281,7 @@ static int
|
|||||||
recursively_search_psymtabs (struct partial_symtab *ps,
|
recursively_search_psymtabs (struct partial_symtab *ps,
|
||||||
struct objfile *objfile,
|
struct objfile *objfile,
|
||||||
enum search_domain kind,
|
enum search_domain kind,
|
||||||
int (*name_matcher) (const char *, void *),
|
expand_symtabs_symbol_matcher_ftype *sym_matcher,
|
||||||
void *data)
|
void *data)
|
||||||
{
|
{
|
||||||
struct partial_symbol **psym;
|
struct partial_symbol **psym;
|
||||||
@ -1304,7 +1304,7 @@ recursively_search_psymtabs (struct partial_symtab *ps,
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
r = recursively_search_psymtabs (ps->dependencies[i],
|
r = recursively_search_psymtabs (ps->dependencies[i],
|
||||||
objfile, kind, name_matcher, data);
|
objfile, kind, sym_matcher, data);
|
||||||
if (r != 0)
|
if (r != 0)
|
||||||
{
|
{
|
||||||
ps->searched_flag = PST_SEARCHED_AND_FOUND;
|
ps->searched_flag = PST_SEARCHED_AND_FOUND;
|
||||||
@ -1346,7 +1346,7 @@ recursively_search_psymtabs (struct partial_symtab *ps,
|
|||||||
&& PSYMBOL_CLASS (*psym) == LOC_BLOCK)
|
&& PSYMBOL_CLASS (*psym) == LOC_BLOCK)
|
||||||
|| (kind == TYPES_DOMAIN
|
|| (kind == TYPES_DOMAIN
|
||||||
&& PSYMBOL_CLASS (*psym) == LOC_TYPEDEF))
|
&& PSYMBOL_CLASS (*psym) == LOC_TYPEDEF))
|
||||||
&& (*name_matcher) (SYMBOL_SEARCH_NAME (*psym), data))
|
&& (*sym_matcher) (SYMBOL_SEARCH_NAME (*psym), data))
|
||||||
{
|
{
|
||||||
/* Found a match, so notify our caller. */
|
/* Found a match, so notify our caller. */
|
||||||
result = PST_SEARCHED_AND_FOUND;
|
result = PST_SEARCHED_AND_FOUND;
|
||||||
@ -1363,8 +1363,8 @@ recursively_search_psymtabs (struct partial_symtab *ps,
|
|||||||
static void
|
static void
|
||||||
expand_symtabs_matching_via_partial
|
expand_symtabs_matching_via_partial
|
||||||
(struct objfile *objfile,
|
(struct objfile *objfile,
|
||||||
int (*file_matcher) (const char *, void *, int basenames),
|
expand_symtabs_file_matcher_ftype *file_matcher,
|
||||||
int (*name_matcher) (const char *, void *),
|
expand_symtabs_symbol_matcher_ftype *symbol_matcher,
|
||||||
enum search_domain kind,
|
enum search_domain kind,
|
||||||
void *data)
|
void *data)
|
||||||
{
|
{
|
||||||
@ -1406,7 +1406,7 @@ expand_symtabs_matching_via_partial
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (recursively_search_psymtabs (ps, objfile, kind, name_matcher, data))
|
if (recursively_search_psymtabs (ps, objfile, kind, symbol_matcher, data))
|
||||||
psymtab_to_symtab (objfile, ps);
|
psymtab_to_symtab (objfile, ps);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3843,7 +3843,7 @@ symfile_free_objfile (struct objfile *objfile)
|
|||||||
See quick_symbol_functions.expand_symtabs_matching for details. */
|
See quick_symbol_functions.expand_symtabs_matching for details. */
|
||||||
|
|
||||||
void
|
void
|
||||||
expand_partial_symbol_names (int (*fun) (const char *, void *),
|
expand_partial_symbol_names (expand_symtabs_symbol_matcher_ftype *fun,
|
||||||
void *data)
|
void *data)
|
||||||
{
|
{
|
||||||
struct objfile *objfile;
|
struct objfile *objfile;
|
||||||
|
@ -125,6 +125,18 @@ struct symfile_segment_data
|
|||||||
typedef void (symbol_filename_ftype) (const char *filename,
|
typedef void (symbol_filename_ftype) (const char *filename,
|
||||||
const char *fullname, void *data);
|
const char *fullname, void *data);
|
||||||
|
|
||||||
|
/* Callback for quick_symbol_functions->expand_symtabs_matching
|
||||||
|
to match a file name. */
|
||||||
|
|
||||||
|
typedef int (expand_symtabs_file_matcher_ftype) (const char *filename,
|
||||||
|
void *data, int basenames);
|
||||||
|
|
||||||
|
/* Callback for quick_symbol_functions->expand_symtabs_matching
|
||||||
|
to match a symbol name. */
|
||||||
|
|
||||||
|
typedef int (expand_symtabs_symbol_matcher_ftype) (const char *name,
|
||||||
|
void *data);
|
||||||
|
|
||||||
/* The "quick" symbol functions exist so that symbol readers can
|
/* The "quick" symbol functions exist so that symbol readers can
|
||||||
avoiding an initial read of all the symbols. For example, symbol
|
avoiding an initial read of all the symbols. For example, symbol
|
||||||
readers might choose to use the "partial symbol table" utilities,
|
readers might choose to use the "partial symbol table" utilities,
|
||||||
@ -256,11 +268,11 @@ struct quick_symbol_functions
|
|||||||
|
|
||||||
Otherwise, if KIND does not match this symbol is skipped.
|
Otherwise, if KIND does not match this symbol is skipped.
|
||||||
|
|
||||||
If even KIND matches, then NAME_MATCHER is called for each symbol
|
If even KIND matches, then SYMBOL_MATCHER is called for each symbol
|
||||||
defined in the file. The symbol "search" name and DATA are passed
|
defined in the file. The symbol "search" name and DATA are passed
|
||||||
to NAME_MATCHER.
|
to SYMBOL_MATCHER.
|
||||||
|
|
||||||
If NAME_MATCHER returns zero, then this symbol is skipped.
|
If SYMBOL_MATCHER returns zero, then this symbol is skipped.
|
||||||
|
|
||||||
Otherwise, this symbol's symbol table is expanded.
|
Otherwise, this symbol's symbol table is expanded.
|
||||||
|
|
||||||
@ -268,8 +280,8 @@ struct quick_symbol_functions
|
|||||||
functions. */
|
functions. */
|
||||||
void (*expand_symtabs_matching)
|
void (*expand_symtabs_matching)
|
||||||
(struct objfile *objfile,
|
(struct objfile *objfile,
|
||||||
int (*file_matcher) (const char *, void *, int basenames),
|
expand_symtabs_file_matcher_ftype *file_matcher,
|
||||||
int (*name_matcher) (const char *, void *),
|
expand_symtabs_symbol_matcher_ftype *symbol_matcher,
|
||||||
enum search_domain kind,
|
enum search_domain kind,
|
||||||
void *data);
|
void *data);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user