aboutsummaryrefslogtreecommitdiff
path: root/gdb/psymtab.c
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2018-11-23 11:58:27 -0700
committerTom Tromey <tom@tromey.com>2019-01-09 18:28:14 -0700
commit99d89cdea6c296bdd94ce532350d139d3900ff78 (patch)
treeb7f8d547f554f4925fec808d4e6cfd048b09c254 /gdb/psymtab.c
parent217083254a26b9e1dc42c43f573054740988c2cf (diff)
downloadgdb-99d89cdea6c296bdd94ce532350d139d3900ff78.zip
gdb-99d89cdea6c296bdd94ce532350d139d3900ff78.tar.gz
gdb-99d89cdea6c296bdd94ce532350d139d3900ff78.tar.bz2
Remove ALL_PSPACE_OBJFILES
This removes the ALL_PSPACE_OBJFILES macro in favor of ranged for loops. gdb/ChangeLog 2019-01-09 Tom Tromey <tom@tromey.com> * probe.c (parse_probes_in_pspace): Use all_objfiles. * guile/scm-progspace.c (gdbscm_progspace_objfiles): Use all_objfiles. * objfiles.h (ALL_PSPACE_OBJFILES): Remove. * symmisc.c (print_symbol_bcache_statistics) (print_objfile_statistics, maintenance_print_objfiles) (maintenance_info_symtabs, maintenance_check_symtabs) (maintenance_expand_symtabs, maintenance_info_line_tables): Use all_objfiles. * source.c (forget_cached_source_info): Use all_objfiles. * symfile-debug.c (set_debug_symfile): Use all_objfiles. * elfread.c (elf_gnu_ifunc_resolve_by_cache) (elf_gnu_ifunc_resolve_by_got): Use all_objfiles. * objfiles.c (update_section_map): Use all_objfiles. (shared_objfile_contains_address_p): Likewise. * psymtab.c (maintenance_info_psymtabs): Use all_objfiles. * python/py-progspace.c (pspy_get_objfiles): Use all_objfiles.
Diffstat (limited to 'gdb/psymtab.c')
-rw-r--r--gdb/psymtab.c190
1 files changed, 98 insertions, 92 deletions
diff --git a/gdb/psymtab.c b/gdb/psymtab.c
index f14aae6..804558e 100644
--- a/gdb/psymtab.c
+++ b/gdb/psymtab.c
@@ -2031,106 +2031,112 @@ static void
maintenance_info_psymtabs (const char *regexp, int from_tty)
{
struct program_space *pspace;
- struct objfile *objfile;
if (regexp)
re_comp (regexp);
ALL_PSPACES (pspace)
- ALL_PSPACE_OBJFILES (pspace, objfile)
- {
- struct gdbarch *gdbarch = get_objfile_arch (objfile);
- struct partial_symtab *psymtab;
-
- /* We don't want to print anything for this objfile until we
- actually find a symtab whose name matches. */
- int printed_objfile_start = 0;
-
- ALL_OBJFILE_PSYMTABS_REQUIRED (objfile, psymtab)
- {
- QUIT;
-
- if (! regexp
- || re_exec (psymtab->filename))
- {
- if (! printed_objfile_start)
- {
- printf_filtered ("{ objfile %s ", objfile_name (objfile));
- wrap_here (" ");
- printf_filtered ("((struct objfile *) %s)\n",
- host_address_to_string (objfile));
- printed_objfile_start = 1;
- }
-
- printf_filtered (" { psymtab %s ", psymtab->filename);
- wrap_here (" ");
- printf_filtered ("((struct partial_symtab *) %s)\n",
- host_address_to_string (psymtab));
-
- printf_filtered (" readin %s\n",
- psymtab->readin ? "yes" : "no");
- printf_filtered (" fullname %s\n",
- psymtab->fullname
- ? psymtab->fullname : "(null)");
- printf_filtered (" text addresses ");
- fputs_filtered (paddress (gdbarch, psymtab->text_low (objfile)),
- gdb_stdout);
- printf_filtered (" -- ");
- fputs_filtered (paddress (gdbarch, psymtab->text_high (objfile)),
- gdb_stdout);
- printf_filtered ("\n");
- printf_filtered (" psymtabs_addrmap_supported %s\n",
- (psymtab->psymtabs_addrmap_supported
- ? "yes" : "no"));
- printf_filtered (" globals ");
- if (psymtab->n_global_syms)
- {
- auto p = &objfile->global_psymbols[psymtab->globals_offset];
-
- printf_filtered ("(* (struct partial_symbol **) %s @ %d)\n",
- host_address_to_string (p),
- psymtab->n_global_syms);
- }
- else
- printf_filtered ("(none)\n");
- printf_filtered (" statics ");
- if (psymtab->n_static_syms)
- {
- auto p = &objfile->static_psymbols[psymtab->statics_offset];
-
- printf_filtered ("(* (struct partial_symbol **) %s @ %d)\n",
- host_address_to_string (p),
- psymtab->n_static_syms);
- }
- else
- printf_filtered ("(none)\n");
- printf_filtered (" dependencies ");
- if (psymtab->number_of_dependencies)
- {
- int i;
+ for (objfile *objfile : all_objfiles (pspace))
+ {
+ struct gdbarch *gdbarch = get_objfile_arch (objfile);
+ struct partial_symtab *psymtab;
- printf_filtered ("{\n");
- for (i = 0; i < psymtab->number_of_dependencies; i++)
- {
- struct partial_symtab *dep = psymtab->dependencies[i];
+ /* We don't want to print anything for this objfile until we
+ actually find a symtab whose name matches. */
+ int printed_objfile_start = 0;
- /* Note the string concatenation there --- no comma. */
- printf_filtered (" psymtab %s "
- "((struct partial_symtab *) %s)\n",
- dep->filename,
- host_address_to_string (dep));
- }
- printf_filtered (" }\n");
- }
- else
- printf_filtered ("(none)\n");
- printf_filtered (" }\n");
- }
- }
+ ALL_OBJFILE_PSYMTABS_REQUIRED (objfile, psymtab)
+ {
+ QUIT;
+
+ if (! regexp
+ || re_exec (psymtab->filename))
+ {
+ if (! printed_objfile_start)
+ {
+ printf_filtered ("{ objfile %s ", objfile_name (objfile));
+ wrap_here (" ");
+ printf_filtered ("((struct objfile *) %s)\n",
+ host_address_to_string (objfile));
+ printed_objfile_start = 1;
+ }
+
+ printf_filtered (" { psymtab %s ", psymtab->filename);
+ wrap_here (" ");
+ printf_filtered ("((struct partial_symtab *) %s)\n",
+ host_address_to_string (psymtab));
+
+ printf_filtered (" readin %s\n",
+ psymtab->readin ? "yes" : "no");
+ printf_filtered (" fullname %s\n",
+ psymtab->fullname
+ ? psymtab->fullname : "(null)");
+ printf_filtered (" text addresses ");
+ fputs_filtered (paddress (gdbarch,
+ psymtab->text_low (objfile)),
+ gdb_stdout);
+ printf_filtered (" -- ");
+ fputs_filtered (paddress (gdbarch,
+ psymtab->text_high (objfile)),
+ gdb_stdout);
+ printf_filtered ("\n");
+ printf_filtered (" psymtabs_addrmap_supported %s\n",
+ (psymtab->psymtabs_addrmap_supported
+ ? "yes" : "no"));
+ printf_filtered (" globals ");
+ if (psymtab->n_global_syms)
+ {
+ auto p
+ = &objfile->global_psymbols[psymtab->globals_offset];
+
+ printf_filtered
+ ("(* (struct partial_symbol **) %s @ %d)\n",
+ host_address_to_string (p),
+ psymtab->n_global_syms);
+ }
+ else
+ printf_filtered ("(none)\n");
+ printf_filtered (" statics ");
+ if (psymtab->n_static_syms)
+ {
+ auto p
+ = &objfile->static_psymbols[psymtab->statics_offset];
+
+ printf_filtered
+ ("(* (struct partial_symbol **) %s @ %d)\n",
+ host_address_to_string (p),
+ psymtab->n_static_syms);
+ }
+ else
+ printf_filtered ("(none)\n");
+ printf_filtered (" dependencies ");
+ if (psymtab->number_of_dependencies)
+ {
+ int i;
+
+ printf_filtered ("{\n");
+ for (i = 0; i < psymtab->number_of_dependencies; i++)
+ {
+ struct partial_symtab *dep = psymtab->dependencies[i];
+
+ /* Note the string concatenation there --- no
+ comma. */
+ printf_filtered (" psymtab %s "
+ "((struct partial_symtab *) %s)\n",
+ dep->filename,
+ host_address_to_string (dep));
+ }
+ printf_filtered (" }\n");
+ }
+ else
+ printf_filtered ("(none)\n");
+ printf_filtered (" }\n");
+ }
+ }
- if (printed_objfile_start)
- printf_filtered ("}\n");
- }
+ if (printed_objfile_start)
+ printf_filtered ("}\n");
+ }
}
/* Check consistency of currently expanded psymtabs vs symtabs. */