value);
}
-/* If non-zero, gdb will notify the user when it is loading symbols
- from a file. This is almost always what users will want to have happen;
- but for programs with lots of dynamically linked libraries, the output
- can be more noise than signal. */
-
-int print_symbol_loading = 1;
-
/* If non-zero, shared library symbols will be added automatically
when the inferior is created, new libraries are loaded, or when
attaching to the inferior. This is almost always what users will
if (symfile_objfile != NULL)
{
free_objfile (symfile_objfile);
- symfile_objfile = NULL;
+ gdb_assert (symfile_objfile == NULL);
}
/* Currently we keep symbols from the add-symbol-file command.
deprecated_pre_add_symbol_hook (name);
else
{
- if (print_symbol_loading)
- {
- printf_unfiltered (_("Reading symbols from %s..."), name);
- wrap_here ("");
- gdb_flush (gdb_stdout);
- }
+ printf_unfiltered (_("Reading symbols from %s..."), name);
+ wrap_here ("");
+ gdb_flush (gdb_stdout);
}
}
syms_from_objfile (objfile, addrs, offsets, num_offsets,
if ((flags & OBJF_READNOW) || readnow_symbol_files)
{
- if ((from_tty || info_verbose) && print_symbol_loading)
+ if (from_tty || info_verbose)
{
printf_unfiltered (_("expanding to full symbols..."));
wrap_here ("");
xfree (debugfile);
}
- if (!have_partial_symbols () && !have_full_symbols ()
- && print_symbol_loading)
+ if ((from_tty || info_verbose)
+ && !objfile_has_partial_symbols (objfile)
+ && !objfile_has_full_symbols (objfile))
{
wrap_here ("");
- printf_unfiltered (_("(no debugging symbols found)"));
- if (from_tty || info_verbose)
- printf_unfiltered ("...");
- else
- printf_unfiltered ("\n");
+ printf_unfiltered (_("(no debugging symbols found)..."));
wrap_here ("");
}
if (deprecated_post_add_symbol_hook)
deprecated_post_add_symbol_hook ();
else
- {
- if (print_symbol_loading)
- printf_unfiltered (_("done.\n"));
- }
+ printf_unfiltered (_("done.\n"));
}
/* We print some messages regardless of whether 'from_tty ||
descriptors as well. */
no_shared_libraries (NULL, from_tty);
- symfile_objfile = NULL;
+ gdb_assert (symfile_objfile == NULL);
if (from_tty)
printf_unfiltered (_("No symbol file now.\n"));
}
objfile->obfd = bfd_openr (obfd_filename, gnutarget);
if (objfile->obfd == NULL)
error (_("Can't open %s to read symbols."), objfile->name);
+ else
+ objfile->obfd = gdb_bfd_ref (objfile->obfd);
/* bfd_openr sets cacheable to true, which is what we want. */
if (!bfd_check_format (objfile->obfd, bfd_object))
error (_("Can't read symbols from %s: %s."), objfile->name,
zero is OK since dbxread.c also does what it needs to do if
objfile->global_psymbols.size is 0. */
(*objfile->sf->sym_read) (objfile, 0);
- if (!have_partial_symbols () && !have_full_symbols ())
+ if (!objfile_has_partial_symbols (objfile)
+ && !objfile_has_full_symbols (objfile))
{
wrap_here ("");
printf_unfiltered (_("(no debugging symbols found)\n"));
if (reread_one)
{
+ /* Notify objfiles that we've modified objfile sections. */
+ objfiles_changed ();
+
clear_symtab_users ();
/* At least one objfile has changed, so we can consider that
the executable we're debugging has changed too. */
observer_notify_executable_changed ();
-
- /* Notify objfiles that we've modified objfile sections. */
- objfiles_changed ();
}
}
NULL,
show_debug_file_directory,
&setlist, &showlist);
-
- add_setshow_boolean_cmd ("symbol-loading", no_class,
- &print_symbol_loading, _("\
-Set printing of symbol loading messages."), _("\
-Show printing of symbol loading messages."), NULL,
- NULL,
- NULL,
- &setprintlist, &showprintlist);
}