/* Darwin support for GDB, the GNU debugger.
- Copyright (C) 2008-2019 Free Software Foundation, Inc.
+ Copyright (C) 2008-2020 Free Software Foundation, Inc.
Contributed by AdaCore.
#include "gdbcore.h"
#include "mach-o.h"
#include "aout/stab_gnu.h"
-#include "psympriv.h"
#include "complaints.h"
#include "gdb_bfd.h"
#include <string>
{
if (mach_o_debug_level > 4)
{
- struct gdbarch *arch = get_objfile_arch (main_objfile);
+ struct gdbarch *arch = main_objfile->arch ();
printf_unfiltered
(_("Adding symbol %s (addr: %s)\n"),
sym->name, paddress (arch, sym->value));
if (mach_o_debug_level > 3)
{
- struct gdbarch *arch = get_objfile_arch (main_objfile);
+ struct gdbarch *arch = main_objfile->arch ();
printf_unfiltered
(_("resolve sect %s with %s (set to %s)\n"),
sec->name, sym->name,
/* Open the archive and check the format. */
gdb_bfd_ref_ptr archive_bfd (gdb_bfd_open (archive_name.c_str (),
- gnutarget, -1));
+ gnutarget));
if (archive_bfd == NULL)
{
warning (_("Could not open OSO archive file \"%s\""),
}
else
{
- gdb_bfd_ref_ptr abfd (gdb_bfd_open (oso->name, gnutarget, -1));
+ gdb_bfd_ref_ptr abfd (gdb_bfd_open (oso->name, gnutarget));
if (abfd == NULL)
warning (_("`%s': can't open to read symbols: %s."), oso->name,
bfd_errmsg (bfd_get_error ()));
struct obj_section *osect;
/* Allocate section_offsets. */
- objfile->num_sections = bfd_count_sections (objfile->obfd);
- objfile->section_offsets = (struct section_offsets *)
- obstack_alloc (&objfile->objfile_obstack,
- SIZEOF_N_SECTION_OFFSETS (objfile->num_sections));
- memset (objfile->section_offsets, 0,
- SIZEOF_N_SECTION_OFFSETS (objfile->num_sections));
+ objfile->section_offsets.assign (bfd_count_sections (objfile->obfd), 0);
/* This code is run when we first add the objfile with
symfile_add_with_addrs_or_offsets, when "addrs" not "offsets" are
&psym_functions
};
+void _initialize_machoread ();
void
-_initialize_machoread (void)
+_initialize_machoread ()
{
add_symtab_fns (bfd_target_mach_o_flavour, &macho_sym_fns);