Remove ALL_OBJFILE_COMPUNITS
This removes ALL_OBJFILE_COMPUNITS, replacing its uses with ranged for loops. Because ALL_COMPUNITS is also updated, in some places a declaration must be deleted to avoid shadowing. gdb/ChangeLog 2019-01-09 Tom Tromey <tom@tromey.com> * source.c (select_source_symtab) (forget_cached_source_info_for_objfile): Remove declaration. * mi/mi-cmd-file.c (mi_cmd_file_list_exec_source_files): Remove declaration. * maint.c (count_symtabs_and_blocks): Remove declaration. * cp-support.c (add_symbol_overload_list_qualified): Remove declaration. * coffread.c (coff_symtab_read): Remove declaration. * symtab.c (lookup_symbol_in_objfile_symtabs) (basic_lookup_transparent_type_1): Use objfile_compunits. (lookup_objfile_from_block, find_pc_sect_compunit_symtab) (info_sources_command, search_symbols) (default_collect_symbol_completion_matches_break_on) (make_source_files_completion_list): Remove declaration. * ada-lang.c (add_nonlocal_symbols): Use objfile_compunits. (ada_collect_symbol_completion_matches) (ada_add_global_exceptions): Remove declaration. * linespec.c (iterate_over_all_matching_symtabs): Use objfile_compunits. * objfiles.h (ALL_OBJFILE_COMPUNITS): Remove. (class objfile_compunits): New. (ALL_COMPUNITS): Use objfile_compunits. * symmisc.c (print_objfile_statistics, maintenance_info_symtabs) (maintenance_check_symtabs, maintenance_info_line_tables): Use objfile_compunits. * objfiles.c (objfile_relocate1): Use objfile_compunits.
This commit is contained in:
parent
5325b9bf1e
commit
592553c469
12 changed files with 82 additions and 73 deletions
|
@ -1,3 +1,32 @@
|
||||||
|
2019-01-09 Tom Tromey <tom@tromey.com>
|
||||||
|
|
||||||
|
* source.c (select_source_symtab)
|
||||||
|
(forget_cached_source_info_for_objfile): Remove declaration.
|
||||||
|
* mi/mi-cmd-file.c (mi_cmd_file_list_exec_source_files): Remove
|
||||||
|
declaration.
|
||||||
|
* maint.c (count_symtabs_and_blocks): Remove declaration.
|
||||||
|
* cp-support.c (add_symbol_overload_list_qualified): Remove
|
||||||
|
declaration.
|
||||||
|
* coffread.c (coff_symtab_read): Remove declaration.
|
||||||
|
* symtab.c (lookup_symbol_in_objfile_symtabs)
|
||||||
|
(basic_lookup_transparent_type_1): Use objfile_compunits.
|
||||||
|
(lookup_objfile_from_block, find_pc_sect_compunit_symtab)
|
||||||
|
(info_sources_command, search_symbols)
|
||||||
|
(default_collect_symbol_completion_matches_break_on)
|
||||||
|
(make_source_files_completion_list): Remove declaration.
|
||||||
|
* ada-lang.c (add_nonlocal_symbols): Use objfile_compunits.
|
||||||
|
(ada_collect_symbol_completion_matches)
|
||||||
|
(ada_add_global_exceptions): Remove declaration.
|
||||||
|
* linespec.c (iterate_over_all_matching_symtabs): Use
|
||||||
|
objfile_compunits.
|
||||||
|
* objfiles.h (ALL_OBJFILE_COMPUNITS): Remove.
|
||||||
|
(class objfile_compunits): New.
|
||||||
|
(ALL_COMPUNITS): Use objfile_compunits.
|
||||||
|
* symmisc.c (print_objfile_statistics, maintenance_info_symtabs)
|
||||||
|
(maintenance_check_symtabs, maintenance_info_line_tables): Use
|
||||||
|
objfile_compunits.
|
||||||
|
* objfiles.c (objfile_relocate1): Use objfile_compunits.
|
||||||
|
|
||||||
2019-01-09 Tom Tromey <tom@tromey.com>
|
2019-01-09 Tom Tromey <tom@tromey.com>
|
||||||
|
|
||||||
* symtab.c (search_symbols)
|
* symtab.c (search_symbols)
|
||||||
|
|
|
@ -5605,7 +5605,6 @@ add_nonlocal_symbols (struct obstack *obstackp,
|
||||||
const lookup_name_info &lookup_name,
|
const lookup_name_info &lookup_name,
|
||||||
domain_enum domain, int global)
|
domain_enum domain, int global)
|
||||||
{
|
{
|
||||||
struct compunit_symtab *cu;
|
|
||||||
struct match_data data;
|
struct match_data data;
|
||||||
|
|
||||||
memset (&data, 0, sizeof data);
|
memset (&data, 0, sizeof data);
|
||||||
|
@ -5630,7 +5629,7 @@ add_nonlocal_symbols (struct obstack *obstackp,
|
||||||
symbol_name_match_type::FULL,
|
symbol_name_match_type::FULL,
|
||||||
compare_names);
|
compare_names);
|
||||||
|
|
||||||
ALL_OBJFILE_COMPUNITS (objfile, cu)
|
for (compunit_symtab *cu : objfile_compunits (objfile))
|
||||||
{
|
{
|
||||||
const struct block *global_block
|
const struct block *global_block
|
||||||
= BLOCKVECTOR_BLOCK (COMPUNIT_BLOCKVECTOR (cu), GLOBAL_BLOCK);
|
= BLOCKVECTOR_BLOCK (COMPUNIT_BLOCKVECTOR (cu), GLOBAL_BLOCK);
|
||||||
|
@ -6391,7 +6390,6 @@ ada_collect_symbol_completion_matches (completion_tracker &tracker,
|
||||||
enum type_code code)
|
enum type_code code)
|
||||||
{
|
{
|
||||||
struct symbol *sym;
|
struct symbol *sym;
|
||||||
struct compunit_symtab *s;
|
|
||||||
const struct block *b, *surrounding_static_block = 0;
|
const struct block *b, *surrounding_static_block = 0;
|
||||||
struct block_iterator iter;
|
struct block_iterator iter;
|
||||||
|
|
||||||
|
@ -13551,7 +13549,6 @@ ada_add_global_exceptions (compiled_regex *preg,
|
||||||
std::vector<ada_exc_info> *exceptions)
|
std::vector<ada_exc_info> *exceptions)
|
||||||
{
|
{
|
||||||
struct objfile *objfile;
|
struct objfile *objfile;
|
||||||
struct compunit_symtab *s;
|
|
||||||
|
|
||||||
/* In Ada, the symbol "search name" is a linkage name, whereas the
|
/* In Ada, the symbol "search name" is a linkage name, whereas the
|
||||||
regular expression used to do the matching refers to the natural
|
regular expression used to do the matching refers to the natural
|
||||||
|
|
|
@ -1203,7 +1203,6 @@ coff_symtab_read (minimal_symbol_reader &reader,
|
||||||
/* Patch up any opaque types (references to types that are not defined
|
/* Patch up any opaque types (references to types that are not defined
|
||||||
in the file where they are referenced, e.g. "struct foo *bar"). */
|
in the file where they are referenced, e.g. "struct foo *bar"). */
|
||||||
{
|
{
|
||||||
struct compunit_symtab *cu;
|
|
||||||
struct symtab *s;
|
struct symtab *s;
|
||||||
|
|
||||||
ALL_OBJFILE_FILETABS (objfile, cu, s)
|
ALL_OBJFILE_FILETABS (objfile, cu, s)
|
||||||
|
|
|
@ -1373,7 +1373,6 @@ static void
|
||||||
add_symbol_overload_list_qualified (const char *func_name,
|
add_symbol_overload_list_qualified (const char *func_name,
|
||||||
std::vector<symbol *> *overload_list)
|
std::vector<symbol *> *overload_list)
|
||||||
{
|
{
|
||||||
struct compunit_symtab *cust;
|
|
||||||
const struct block *b, *surrounding_static_block = 0;
|
const struct block *b, *surrounding_static_block = 0;
|
||||||
|
|
||||||
/* Look through the partial symtabs for all symbols which begin by
|
/* Look through the partial symtabs for all symbols which begin by
|
||||||
|
|
|
@ -1143,8 +1143,6 @@ iterate_over_all_matching_symtabs
|
||||||
|
|
||||||
for (objfile *objfile : all_objfiles (current_program_space))
|
for (objfile *objfile : all_objfiles (current_program_space))
|
||||||
{
|
{
|
||||||
struct compunit_symtab *cu;
|
|
||||||
|
|
||||||
if (objfile->sf)
|
if (objfile->sf)
|
||||||
objfile->sf->qf->expand_symtabs_matching (objfile,
|
objfile->sf->qf->expand_symtabs_matching (objfile,
|
||||||
NULL,
|
NULL,
|
||||||
|
@ -1152,7 +1150,7 @@ iterate_over_all_matching_symtabs
|
||||||
NULL, NULL,
|
NULL, NULL,
|
||||||
search_domain);
|
search_domain);
|
||||||
|
|
||||||
ALL_OBJFILE_COMPUNITS (objfile, cu)
|
for (compunit_symtab *cu : objfile_compunits (objfile))
|
||||||
{
|
{
|
||||||
struct symtab *symtab = COMPUNIT_FILETABS (cu);
|
struct symtab *symtab = COMPUNIT_FILETABS (cu);
|
||||||
|
|
||||||
|
|
|
@ -763,7 +763,6 @@ count_symtabs_and_blocks (int *nr_symtabs_ptr, int *nr_compunit_symtabs_ptr,
|
||||||
int *nr_blocks_ptr)
|
int *nr_blocks_ptr)
|
||||||
{
|
{
|
||||||
struct objfile *o;
|
struct objfile *o;
|
||||||
struct compunit_symtab *cu;
|
|
||||||
struct symtab *s;
|
struct symtab *s;
|
||||||
int nr_symtabs = 0;
|
int nr_symtabs = 0;
|
||||||
int nr_compunit_symtabs = 0;
|
int nr_compunit_symtabs = 0;
|
||||||
|
|
|
@ -84,7 +84,6 @@ void
|
||||||
mi_cmd_file_list_exec_source_files (const char *command, char **argv, int argc)
|
mi_cmd_file_list_exec_source_files (const char *command, char **argv, int argc)
|
||||||
{
|
{
|
||||||
struct ui_out *uiout = current_uiout;
|
struct ui_out *uiout = current_uiout;
|
||||||
struct compunit_symtab *cu;
|
|
||||||
struct symtab *s;
|
struct symtab *s;
|
||||||
struct objfile *objfile;
|
struct objfile *objfile;
|
||||||
|
|
||||||
|
|
|
@ -788,7 +788,6 @@ objfile_relocate1 (struct objfile *objfile,
|
||||||
|
|
||||||
/* OK, get all the symtabs. */
|
/* OK, get all the symtabs. */
|
||||||
{
|
{
|
||||||
struct compunit_symtab *cust;
|
|
||||||
struct symtab *s;
|
struct symtab *s;
|
||||||
|
|
||||||
ALL_OBJFILE_FILETABS (objfile, cust, s)
|
ALL_OBJFILE_FILETABS (objfile, cust, s)
|
||||||
|
@ -806,41 +805,42 @@ objfile_relocate1 (struct objfile *objfile,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ALL_OBJFILE_COMPUNITS (objfile, cust)
|
for (compunit_symtab *cust : objfile_compunits (objfile))
|
||||||
{
|
{
|
||||||
const struct blockvector *bv = COMPUNIT_BLOCKVECTOR (cust);
|
const struct blockvector *bv = COMPUNIT_BLOCKVECTOR (cust);
|
||||||
int block_line_section = COMPUNIT_BLOCK_LINE_SECTION (cust);
|
int block_line_section = COMPUNIT_BLOCK_LINE_SECTION (cust);
|
||||||
|
|
||||||
if (BLOCKVECTOR_MAP (bv))
|
if (BLOCKVECTOR_MAP (bv))
|
||||||
addrmap_relocate (BLOCKVECTOR_MAP (bv),
|
addrmap_relocate (BLOCKVECTOR_MAP (bv),
|
||||||
ANOFFSET (delta, block_line_section));
|
ANOFFSET (delta, block_line_section));
|
||||||
|
|
||||||
for (int i = 0; i < BLOCKVECTOR_NBLOCKS (bv); ++i)
|
for (int i = 0; i < BLOCKVECTOR_NBLOCKS (bv); ++i)
|
||||||
{
|
{
|
||||||
struct block *b;
|
struct block *b;
|
||||||
struct symbol *sym;
|
struct symbol *sym;
|
||||||
struct dict_iterator iter;
|
struct dict_iterator iter;
|
||||||
|
|
||||||
b = BLOCKVECTOR_BLOCK (bv, i);
|
b = BLOCKVECTOR_BLOCK (bv, i);
|
||||||
BLOCK_START (b) += ANOFFSET (delta, block_line_section);
|
BLOCK_START (b) += ANOFFSET (delta, block_line_section);
|
||||||
BLOCK_END (b) += ANOFFSET (delta, block_line_section);
|
BLOCK_END (b) += ANOFFSET (delta, block_line_section);
|
||||||
|
|
||||||
if (BLOCK_RANGES (b) != nullptr)
|
if (BLOCK_RANGES (b) != nullptr)
|
||||||
for (int j = 0; j < BLOCK_NRANGES (b); j++)
|
for (int j = 0; j < BLOCK_NRANGES (b); j++)
|
||||||
|
{
|
||||||
|
BLOCK_RANGE_START (b, j)
|
||||||
|
+= ANOFFSET (delta, block_line_section);
|
||||||
|
BLOCK_RANGE_END (b, j) += ANOFFSET (delta,
|
||||||
|
block_line_section);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* We only want to iterate over the local symbols, not any
|
||||||
|
symbols in included symtabs. */
|
||||||
|
ALL_DICT_SYMBOLS (BLOCK_DICT (b), iter, sym)
|
||||||
{
|
{
|
||||||
BLOCK_RANGE_START (b, j)
|
relocate_one_symbol (sym, objfile, delta);
|
||||||
+= ANOFFSET (delta, block_line_section);
|
|
||||||
BLOCK_RANGE_END (b, j) += ANOFFSET (delta, block_line_section);
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
/* We only want to iterate over the local symbols, not any
|
}
|
||||||
symbols in included symtabs. */
|
|
||||||
ALL_DICT_SYMBOLS (BLOCK_DICT (b), iter, sym)
|
|
||||||
{
|
|
||||||
relocate_one_symbol (sym, objfile, delta);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* This stores relocated addresses and so must be cleared. This
|
/* This stores relocated addresses and so must be cleared. This
|
||||||
|
|
|
@ -615,13 +615,21 @@ public:
|
||||||
/* Traverse all symtabs in one objfile. */
|
/* Traverse all symtabs in one objfile. */
|
||||||
|
|
||||||
#define ALL_OBJFILE_FILETABS(objfile, cu, s) \
|
#define ALL_OBJFILE_FILETABS(objfile, cu, s) \
|
||||||
ALL_OBJFILE_COMPUNITS (objfile, cu) \
|
for (compunit_symtab *cu : objfile_compunits (objfile)) \
|
||||||
ALL_COMPUNIT_FILETABS (cu, s)
|
ALL_COMPUNIT_FILETABS (cu, s)
|
||||||
|
|
||||||
/* Traverse all compunits in one objfile. */
|
/* A range adapter that makes it possible to iterate over all
|
||||||
|
compunits in one objfile. */
|
||||||
|
|
||||||
#define ALL_OBJFILE_COMPUNITS(objfile, cu) \
|
class objfile_compunits : public next_adapter<struct compunit_symtab>
|
||||||
for ((cu) = (objfile) -> compunit_symtabs; (cu) != NULL; (cu) = (cu) -> next)
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
explicit objfile_compunits (struct objfile *objfile)
|
||||||
|
: next_adapter<struct compunit_symtab> (objfile->compunit_symtabs)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
/* A range adapter that makes it possible to iterate over all
|
/* A range adapter that makes it possible to iterate over all
|
||||||
minimal symbols of an objfile. */
|
minimal symbols of an objfile. */
|
||||||
|
@ -714,7 +722,7 @@ private:
|
||||||
|
|
||||||
#define ALL_COMPUNITS(objfile, cu) \
|
#define ALL_COMPUNITS(objfile, cu) \
|
||||||
ALL_OBJFILES (objfile) \
|
ALL_OBJFILES (objfile) \
|
||||||
ALL_OBJFILE_COMPUNITS (objfile, cu)
|
for (compunit_symtab *cu : objfile_compunits (objfile))
|
||||||
|
|
||||||
#define ALL_OBJFILE_OSECTIONS(objfile, osect) \
|
#define ALL_OBJFILE_OSECTIONS(objfile, osect) \
|
||||||
for (osect = objfile->sections; osect < objfile->sections_end; osect++) \
|
for (osect = objfile->sections; osect < objfile->sections_end; osect++) \
|
||||||
|
|
|
@ -239,7 +239,6 @@ void
|
||||||
select_source_symtab (struct symtab *s)
|
select_source_symtab (struct symtab *s)
|
||||||
{
|
{
|
||||||
struct objfile *ofp;
|
struct objfile *ofp;
|
||||||
struct compunit_symtab *cu;
|
|
||||||
|
|
||||||
if (s)
|
if (s)
|
||||||
{
|
{
|
||||||
|
@ -350,7 +349,6 @@ show_directories_command (struct ui_file *file, int from_tty,
|
||||||
void
|
void
|
||||||
forget_cached_source_info_for_objfile (struct objfile *objfile)
|
forget_cached_source_info_for_objfile (struct objfile *objfile)
|
||||||
{
|
{
|
||||||
struct compunit_symtab *cu;
|
|
||||||
struct symtab *s;
|
struct symtab *s;
|
||||||
|
|
||||||
ALL_OBJFILE_FILETABS (objfile, cu, s)
|
ALL_OBJFILE_FILETABS (objfile, cu, s)
|
||||||
|
|
|
@ -82,7 +82,6 @@ void
|
||||||
print_objfile_statistics (void)
|
print_objfile_statistics (void)
|
||||||
{
|
{
|
||||||
struct program_space *pspace;
|
struct program_space *pspace;
|
||||||
struct compunit_symtab *cu;
|
|
||||||
struct symtab *s;
|
struct symtab *s;
|
||||||
int i, linetables, blockvectors;
|
int i, linetables, blockvectors;
|
||||||
|
|
||||||
|
@ -108,15 +107,15 @@ print_objfile_statistics (void)
|
||||||
OBJSTAT (objfile, n_types));
|
OBJSTAT (objfile, n_types));
|
||||||
if (objfile->sf)
|
if (objfile->sf)
|
||||||
objfile->sf->qf->print_stats (objfile);
|
objfile->sf->qf->print_stats (objfile);
|
||||||
i = linetables = blockvectors = 0;
|
i = linetables = 0;
|
||||||
ALL_OBJFILE_FILETABS (objfile, cu, s)
|
ALL_OBJFILE_FILETABS (objfile, cu, s)
|
||||||
{
|
{
|
||||||
i++;
|
i++;
|
||||||
if (SYMTAB_LINETABLE (s) != NULL)
|
if (SYMTAB_LINETABLE (s) != NULL)
|
||||||
linetables++;
|
linetables++;
|
||||||
}
|
}
|
||||||
ALL_OBJFILE_COMPUNITS (objfile, cu)
|
blockvectors = std::distance (objfile_compunits (objfile).begin (),
|
||||||
blockvectors++;
|
objfile_compunits (objfile).end ());
|
||||||
printf_filtered (_(" Number of symbol tables: %d\n"), i);
|
printf_filtered (_(" Number of symbol tables: %d\n"), i);
|
||||||
printf_filtered (_(" Number of symbol tables with line tables: %d\n"),
|
printf_filtered (_(" Number of symbol tables with line tables: %d\n"),
|
||||||
linetables);
|
linetables);
|
||||||
|
@ -145,7 +144,6 @@ print_objfile_statistics (void)
|
||||||
static void
|
static void
|
||||||
dump_objfile (struct objfile *objfile)
|
dump_objfile (struct objfile *objfile)
|
||||||
{
|
{
|
||||||
struct compunit_symtab *cust;
|
|
||||||
struct symtab *symtab;
|
struct symtab *symtab;
|
||||||
|
|
||||||
printf_filtered ("\nObject file %s: ", objfile_name (objfile));
|
printf_filtered ("\nObject file %s: ", objfile_name (objfile));
|
||||||
|
@ -469,7 +467,6 @@ maintenance_print_symbols (const char *args, int from_tty)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
struct compunit_symtab *cu;
|
|
||||||
struct symtab *s;
|
struct symtab *s;
|
||||||
int found = 0;
|
int found = 0;
|
||||||
|
|
||||||
|
@ -775,14 +772,13 @@ maintenance_info_symtabs (const char *regexp, int from_tty)
|
||||||
ALL_PSPACES (pspace)
|
ALL_PSPACES (pspace)
|
||||||
for (objfile *objfile : all_objfiles (pspace))
|
for (objfile *objfile : all_objfiles (pspace))
|
||||||
{
|
{
|
||||||
struct compunit_symtab *cust;
|
|
||||||
struct symtab *symtab;
|
struct symtab *symtab;
|
||||||
|
|
||||||
/* We don't want to print anything for this objfile until we
|
/* We don't want to print anything for this objfile until we
|
||||||
actually find a symtab whose name matches. */
|
actually find a symtab whose name matches. */
|
||||||
int printed_objfile_start = 0;
|
int printed_objfile_start = 0;
|
||||||
|
|
||||||
ALL_OBJFILE_COMPUNITS (objfile, cust)
|
for (compunit_symtab *cust : objfile_compunits (objfile))
|
||||||
{
|
{
|
||||||
int printed_compunit_symtab_start = 0;
|
int printed_compunit_symtab_start = 0;
|
||||||
|
|
||||||
|
@ -863,13 +859,11 @@ maintenance_check_symtabs (const char *ignore, int from_tty)
|
||||||
ALL_PSPACES (pspace)
|
ALL_PSPACES (pspace)
|
||||||
for (objfile *objfile : all_objfiles (pspace))
|
for (objfile *objfile : all_objfiles (pspace))
|
||||||
{
|
{
|
||||||
struct compunit_symtab *cust;
|
|
||||||
|
|
||||||
/* We don't want to print anything for this objfile until we
|
/* We don't want to print anything for this objfile until we
|
||||||
actually find something worth printing. */
|
actually find something worth printing. */
|
||||||
int printed_objfile_start = 0;
|
int printed_objfile_start = 0;
|
||||||
|
|
||||||
ALL_OBJFILE_COMPUNITS (objfile, cust)
|
for (compunit_symtab *cust : objfile_compunits (objfile))
|
||||||
{
|
{
|
||||||
int found_something = 0;
|
int found_something = 0;
|
||||||
struct symtab *symtab = compunit_primary_filetab (cust);
|
struct symtab *symtab = compunit_primary_filetab (cust);
|
||||||
|
@ -1032,10 +1026,9 @@ maintenance_info_line_tables (const char *regexp, int from_tty)
|
||||||
ALL_PSPACES (pspace)
|
ALL_PSPACES (pspace)
|
||||||
for (objfile *objfile : all_objfiles (pspace))
|
for (objfile *objfile : all_objfiles (pspace))
|
||||||
{
|
{
|
||||||
struct compunit_symtab *cust;
|
|
||||||
struct symtab *symtab;
|
struct symtab *symtab;
|
||||||
|
|
||||||
ALL_OBJFILE_COMPUNITS (objfile, cust)
|
for (compunit_symtab *cust : objfile_compunits (objfile))
|
||||||
{
|
{
|
||||||
ALL_COMPUNIT_FILETABS (cust, symtab)
|
ALL_COMPUNIT_FILETABS (cust, symtab)
|
||||||
{
|
{
|
||||||
|
|
14
gdb/symtab.c
14
gdb/symtab.c
|
@ -2167,7 +2167,6 @@ struct objfile *
|
||||||
lookup_objfile_from_block (const struct block *block)
|
lookup_objfile_from_block (const struct block *block)
|
||||||
{
|
{
|
||||||
struct objfile *obj;
|
struct objfile *obj;
|
||||||
struct compunit_symtab *cust;
|
|
||||||
|
|
||||||
if (block == NULL)
|
if (block == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -2255,8 +2254,6 @@ static struct block_symbol
|
||||||
lookup_symbol_in_objfile_symtabs (struct objfile *objfile, int block_index,
|
lookup_symbol_in_objfile_symtabs (struct objfile *objfile, int block_index,
|
||||||
const char *name, const domain_enum domain)
|
const char *name, const domain_enum domain)
|
||||||
{
|
{
|
||||||
struct compunit_symtab *cust;
|
|
||||||
|
|
||||||
gdb_assert (block_index == GLOBAL_BLOCK || block_index == STATIC_BLOCK);
|
gdb_assert (block_index == GLOBAL_BLOCK || block_index == STATIC_BLOCK);
|
||||||
|
|
||||||
if (symbol_lookup_debug > 1)
|
if (symbol_lookup_debug > 1)
|
||||||
|
@ -2269,7 +2266,7 @@ lookup_symbol_in_objfile_symtabs (struct objfile *objfile, int block_index,
|
||||||
name, domain_name (domain));
|
name, domain_name (domain));
|
||||||
}
|
}
|
||||||
|
|
||||||
ALL_OBJFILE_COMPUNITS (objfile, cust)
|
for (compunit_symtab *cust : objfile_compunits (objfile))
|
||||||
{
|
{
|
||||||
const struct blockvector *bv;
|
const struct blockvector *bv;
|
||||||
const struct block *block;
|
const struct block *block;
|
||||||
|
@ -2763,12 +2760,11 @@ static struct type *
|
||||||
basic_lookup_transparent_type_1 (struct objfile *objfile, int block_index,
|
basic_lookup_transparent_type_1 (struct objfile *objfile, int block_index,
|
||||||
const char *name)
|
const char *name)
|
||||||
{
|
{
|
||||||
const struct compunit_symtab *cust;
|
|
||||||
const struct blockvector *bv;
|
const struct blockvector *bv;
|
||||||
const struct block *block;
|
const struct block *block;
|
||||||
const struct symbol *sym;
|
const struct symbol *sym;
|
||||||
|
|
||||||
ALL_OBJFILE_COMPUNITS (objfile, cust)
|
for (compunit_symtab *cust : objfile_compunits (objfile))
|
||||||
{
|
{
|
||||||
bv = COMPUNIT_BLOCKVECTOR (cust);
|
bv = COMPUNIT_BLOCKVECTOR (cust);
|
||||||
block = BLOCKVECTOR_BLOCK (bv, block_index);
|
block = BLOCKVECTOR_BLOCK (bv, block_index);
|
||||||
|
@ -2874,7 +2870,6 @@ iterate_over_symbols (const struct block *block,
|
||||||
struct compunit_symtab *
|
struct compunit_symtab *
|
||||||
find_pc_sect_compunit_symtab (CORE_ADDR pc, struct obj_section *section)
|
find_pc_sect_compunit_symtab (CORE_ADDR pc, struct obj_section *section)
|
||||||
{
|
{
|
||||||
struct compunit_symtab *cust;
|
|
||||||
struct compunit_symtab *best_cust = NULL;
|
struct compunit_symtab *best_cust = NULL;
|
||||||
struct objfile *obj_file;
|
struct objfile *obj_file;
|
||||||
CORE_ADDR distance = 0;
|
CORE_ADDR distance = 0;
|
||||||
|
@ -3349,7 +3344,6 @@ find_line_symtab (struct symtab *symtab, int line,
|
||||||
BEST_INDEX and BEST_LINETABLE identify the item for it. */
|
BEST_INDEX and BEST_LINETABLE identify the item for it. */
|
||||||
int best;
|
int best;
|
||||||
|
|
||||||
struct compunit_symtab *cu;
|
|
||||||
struct symtab *s;
|
struct symtab *s;
|
||||||
|
|
||||||
if (best_index >= 0)
|
if (best_index >= 0)
|
||||||
|
@ -4185,7 +4179,6 @@ output_partial_symbol_filename (const char *filename, const char *fullname,
|
||||||
static void
|
static void
|
||||||
info_sources_command (const char *ignore, int from_tty)
|
info_sources_command (const char *ignore, int from_tty)
|
||||||
{
|
{
|
||||||
struct compunit_symtab *cu;
|
|
||||||
struct symtab *s;
|
struct symtab *s;
|
||||||
struct objfile *objfile;
|
struct objfile *objfile;
|
||||||
struct output_source_filename_data data;
|
struct output_source_filename_data data;
|
||||||
|
@ -4338,7 +4331,6 @@ search_symbols (const char *regexp, enum search_domain kind,
|
||||||
const char *t_regexp,
|
const char *t_regexp,
|
||||||
int nfiles, const char *files[])
|
int nfiles, const char *files[])
|
||||||
{
|
{
|
||||||
struct compunit_symtab *cust;
|
|
||||||
const struct blockvector *bv;
|
const struct blockvector *bv;
|
||||||
struct block *b;
|
struct block *b;
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
@ -5202,7 +5194,6 @@ default_collect_symbol_completion_matches_break_on
|
||||||
won't be that many. */
|
won't be that many. */
|
||||||
|
|
||||||
struct symbol *sym;
|
struct symbol *sym;
|
||||||
struct compunit_symtab *cust;
|
|
||||||
const struct block *b;
|
const struct block *b;
|
||||||
const struct block *surrounding_static_block, *surrounding_global_block;
|
const struct block *surrounding_static_block, *surrounding_global_block;
|
||||||
struct block_iterator iter;
|
struct block_iterator iter;
|
||||||
|
@ -5588,7 +5579,6 @@ maybe_add_partial_symtab_filename (const char *filename, const char *fullname,
|
||||||
completion_list
|
completion_list
|
||||||
make_source_files_completion_list (const char *text, const char *word)
|
make_source_files_completion_list (const char *text, const char *word)
|
||||||
{
|
{
|
||||||
struct compunit_symtab *cu;
|
|
||||||
struct symtab *s;
|
struct symtab *s;
|
||||||
struct objfile *objfile;
|
struct objfile *objfile;
|
||||||
size_t text_len = strlen (text);
|
size_t text_len = strlen (text);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue