mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-29 08:24:05 +08:00
Remove ALL_OBJFILES and ALL_FILETABS
This removes the ALL_OBJFILES and ALL_FILETABS macros, replacing them with ranged for loops. gdb/ChangeLog 2019-01-09 Tom Tromey <tom@tromey.com> * symtab.c (find_line_symtab, info_sources_command) (make_source_files_completion_list): Use objfile_compunits. * source.c (select_source_symtab): Use objfile_compunits. * objfiles.h (struct objfile): Update comment. (ALL_OBJFILES): Remove. (ALL_FILETABS): Remove. * mi/mi-cmd-file.c (mi_cmd_file_list_exec_source_files): Use objfile_compunits.
This commit is contained in:
24
gdb/source.c
24
gdb/source.c
@ -238,8 +238,6 @@ clear_current_source_symtab_and_line (void)
|
||||
void
|
||||
select_source_symtab (struct symtab *s)
|
||||
{
|
||||
struct objfile *ofp;
|
||||
|
||||
if (s)
|
||||
{
|
||||
current_source_symtab = s;
|
||||
@ -271,16 +269,22 @@ select_source_symtab (struct symtab *s)
|
||||
|
||||
current_source_line = 1;
|
||||
|
||||
ALL_FILETABS (ofp, cu, symtab)
|
||||
for (objfile *ofp : all_objfiles (current_program_space))
|
||||
{
|
||||
const char *name = symtab->filename;
|
||||
int len = strlen (name);
|
||||
|
||||
if (!(len > 2 && (strcmp (&name[len - 2], ".h") == 0
|
||||
|| strcmp (name, "<<C++-namespaces>>") == 0)))
|
||||
for (compunit_symtab *cu : objfile_compunits (ofp))
|
||||
{
|
||||
current_source_pspace = current_program_space;
|
||||
current_source_symtab = symtab;
|
||||
for (symtab *symtab : compunit_filetabs (cu))
|
||||
{
|
||||
const char *name = symtab->filename;
|
||||
int len = strlen (name);
|
||||
|
||||
if (!(len > 2 && (strcmp (&name[len - 2], ".h") == 0
|
||||
|| strcmp (name, "<<C++-namespaces>>") == 0)))
|
||||
{
|
||||
current_source_pspace = current_program_space;
|
||||
current_source_symtab = symtab;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user