/* Darwin support for GDB, the GNU debugger.
- Copyright (C) 2008-2012 Free Software Foundation, Inc.
+ Copyright (C) 2008-2013 Free Software Foundation, Inc.
Contributed by AdaCore.
#include "vec.h"
#include "psympriv.h"
#include "complaints.h"
+#include "gdb_bfd.h"
#include <string.h>
/* If non-zero displays debugging message. */
-static int mach_o_debug_level = 0;
+static unsigned int mach_o_debug_level = 0;
/* Dwarf debugging information are never in the final executable. They stay
in object files and the executable contains the list of object files read
macho_symfile_init (struct objfile *objfile)
{
objfile->flags |= OBJF_REORDERED;
- init_entry_point_info (objfile);
}
/* Add a new OSO to the vector of OSO to load. */
asymbol **symp;
struct bfd_hash_table table;
int nbr_sections;
+ struct cleanup *cleanup;
/* Per section flag to mark which section have been rebased. */
unsigned char *sections_rebased;
/* We need to clear SYMFILE_MAINLINE to avoid interractive question
from symfile.c:symbol_file_add_with_addrs_or_offsets. */
+ cleanup = make_cleanup_bfd_unref (abfd);
symbol_file_add_from_bfd
(abfd, symfile_flags & ~(SYMFILE_MAINLINE | SYMFILE_VERBOSE), NULL,
main_objfile->flags & (OBJF_REORDERED | OBJF_SHARED
| OBJF_READNOW | OBJF_USERLOADED),
main_objfile);
+ do_cleanups (cleanup);
}
/* Read symbols from the vector of oso files. */
}
/* Open the archive and check the format. */
- archive_bfd = gdb_bfd_openr (archive_name, gnutarget);
+ archive_bfd = gdb_bfd_open (archive_name, gnutarget, -1);
if (archive_bfd == NULL)
{
warning (_("Could not open OSO archive file \"%s\""),
{
bfd *abfd;
- abfd = gdb_bfd_openr (oso->name, gnutarget);
+ abfd = gdb_bfd_open (oso->name, gnutarget, -1);
if (!abfd)
warning (_("`%s': can't open to read symbols: %s."), oso->name,
bfd_errmsg (bfd_get_error ()));
int ix;
oso_el *oso;
struct bfd_section *asect, *dsect;
+ struct cleanup *cleanup;
if (mach_o_debug_level > 0)
printf_unfiltered (_("dsym file found\n"));
}
/* Add the dsym file as a separate file. */
+ cleanup = make_cleanup_bfd_unref (dsym_bfd);
symbol_file_add_separate (dsym_bfd, symfile_flags, objfile);
+ do_cleanups (cleanup);
/* Don't try to read dwarf2 from main file or shared libraries. */
return;
{
add_symtab_fns (&macho_sym_fns);
- add_setshow_zinteger_cmd ("mach-o", class_obscure,
- &mach_o_debug_level,
- _("Set if printing Mach-O symbols processing."),
- _("Show if printing Mach-O symbols processing."),
- NULL, NULL, NULL,
- &setdebuglist, &showdebuglist);
+ add_setshow_zuinteger_cmd ("mach-o", class_obscure,
+ &mach_o_debug_level,
+ _("Set if printing Mach-O symbols processing."),
+ _("Show if printing Mach-O symbols processing."),
+ NULL, NULL, NULL,
+ &setdebuglist, &showdebuglist);
}