/* Generic symbol file reading for the GNU debugger, GDB.
- Copyright (C) 1990-2021 Free Software Foundation, Inc.
+ Copyright (C) 1990-2022 Free Software Foundation, Inc.
Contributed by Cygnus Support, using pieces from other GDB modules.
#include "regcache.h"
#include "filenames.h" /* for DOSish file names */
#include "gdb-stabs.h"
-#include "gdb_obstack.h"
+#include "gdbsupport/gdb_obstack.h"
#include "completer.h"
#include "bcache.h"
#include "hashtab.h"
#include "gdbsupport/selftest.h"
#include "cli/cli-style.h"
#include "gdbsupport/forward-scope-exit.h"
+#include "gdbsupport/buildargv.h"
#include <sys/types.h>
#include <fcntl.h>
statements because hex_string returns a local static
string. */
- printf_unfiltered (_("add symbol table from file \"%s\""),
- filename.get ());
+ printf_filtered (_("add symbol table from file \"%s\""),
+ filename.get ());
section_addr_info section_addrs;
std::vector<sect_opt>::const_iterator it = sect_opts.begin ();
if (!seen_addr)
const char *sec = it->name;
if (section_addrs.empty ())
- printf_unfiltered (_(" at\n"));
+ printf_filtered (_(" at\n"));
addr = parse_and_eval_address (val);
/* Here we store the section offsets in the order they were
so we can't determine what section names are valid. */
}
if (seen_offset)
- printf_unfiltered (_("%s offset by %s\n"),
- (section_addrs.empty ()
- ? _(" with all sections")
- : _("with other sections")),
- paddress (gdbarch, offset));
+ printf_filtered (_("%s offset by %s\n"),
+ (section_addrs.empty ()
+ ? _(" with all sections")
+ : _("with other sections")),
+ paddress (gdbarch, offset));
else if (section_addrs.empty ())
- printf_unfiltered ("\n");
+ printf_filtered ("\n");
if (from_tty && (!query ("%s", "")))
error (_("Not confirmed."));
if (!objfile_has_symbols (objfile))
{
- wrap_here ("");
+ gdb_stdout->wrap_here (0);
printf_filtered (_("(no debugging symbols found)\n"));
- wrap_here ("");
+ gdb_stdout->wrap_here (0);
}
/* We're done reading the symbol file; finish off complaints. */
struct symtab *
allocate_symtab (struct compunit_symtab *cust, const char *filename)
{
- struct objfile *objfile = cust->objfile;
+ struct objfile *objfile = cust->objfile ();
struct symtab *symtab
= OBSTACK_ZALLOC (&objfile->objfile_obstack, struct symtab);
symtab->filename = objfile->intern (filename);
symtab->fullname = NULL;
- symtab->language = deduce_language_from_filename (filename);
+ symtab->set_language (deduce_language_from_filename (filename));
/* This can be very verbose with lots of headers.
Only print at higher debug levels. */
}
/* Add it to CUST's list of symtabs. */
- if (cust->filetabs == NULL)
- {
- cust->filetabs = symtab;
- cust->last_filetab = symtab;
- }
- else
- {
- cust->last_filetab->next = symtab;
- cust->last_filetab = symtab;
- }
+ cust->add_filetab (symtab);
/* Backlink to the containing compunit symtab. */
- symtab->compunit_symtab = cust;
+ symtab->set_compunit (cust);
return symtab;
}
struct compunit_symtab);
const char *saved_name;
- cu->objfile = objfile;
+ cu->set_objfile (objfile);
/* The name we record here is only for display/debugging purposes.
Just save the basename to avoid path issues (too long for display,
saved_name = lbasename (name);
cu->name = obstack_strdup (&objfile->objfile_obstack, saved_name);
- COMPUNIT_DEBUGFORMAT (cu) = "unknown";
+ cu->set_debugformat ("unknown");
if (symtab_create_debug)
{
void
add_compunit_symtab_to_objfile (struct compunit_symtab *cu)
{
- cu->next = cu->objfile->compunit_symtabs;
- cu->objfile->compunit_symtabs = cu;
+ cu->next = cu->objfile ()->compunit_symtabs;
+ cu->objfile ()->compunit_symtabs = cu;
}
\f
name = bfd_section_name (osect->the_bfd_section);
printf_filtered ("Section %s, loaded at ", name);
- fputs_filtered (paddress (gdbarch, lma), gdb_stdout);
+ puts_filtered (paddress (gdbarch, lma));
puts_filtered (" - ");
- fputs_filtered (paddress (gdbarch, lma + size), gdb_stdout);
+ puts_filtered (paddress (gdbarch, lma + size));
printf_filtered (", mapped at ");
- fputs_filtered (paddress (gdbarch, vma), gdb_stdout);
+ puts_filtered (paddress (gdbarch, vma));
puts_filtered (" - ");
- fputs_filtered (paddress (gdbarch, vma + size), gdb_stdout);
+ puts_filtered (paddress (gdbarch, vma + size));
puts_filtered ("\n");
nmapped++;
sec2))
{
if (info_verbose)
- printf_unfiltered (_("Note: section %s unmapped by overlap\n"),
- bfd_section_name (sec2->the_bfd_section));
+ printf_filtered (_("Note: section %s unmapped by overlap\n"),
+ bfd_section_name (sec2->the_bfd_section));
sec2->ovly_mapped = 0; /* sec2 overlaps sec: unmap sec2. */
}
return;
overlay_debugging = ovly_auto;
enable_overlay_breakpoints ();
if (info_verbose)
- printf_unfiltered (_("Automatic overlay debugging enabled."));
+ printf_filtered (_("Automatic overlay debugging enabled."));
}
/* Function: overlay_manual_command
overlay_debugging = ovly_on;
disable_overlay_breakpoints ();
if (info_verbose)
- printf_unfiltered (_("Overlay debugging enabled."));
+ printf_filtered (_("Overlay debugging enabled."));
}
/* Function: overlay_off_command
overlay_debugging = ovly_off;
disable_overlay_breakpoints ();
if (info_verbose)
- printf_unfiltered (_("Overlay debugging disabled."));
+ printf_filtered (_("Overlay debugging disabled."));
}
static void