/* GDB routines for manipulating objfiles.
- Copyright (C) 1992-2016 Free Software Foundation, Inc.
+ Copyright (C) 1992-2017 Free Software Foundation, Inc.
Contributed by Cygnus Support, using pieces from other GDB modules.
{
storage
= ((struct objfile_per_bfd_storage *)
- bfd_zalloc (abfd, sizeof (struct objfile_per_bfd_storage)));
+ bfd_alloc (abfd, sizeof (struct objfile_per_bfd_storage)));
set_bfd_data (abfd, objfiles_bfd_data, storage);
}
else
- storage = OBSTACK_ZALLOC (&objfile->objfile_obstack,
- struct objfile_per_bfd_storage);
+ {
+ storage = (objfile_per_bfd_storage *)
+ obstack_alloc (&objfile->objfile_obstack,
+ sizeof (objfile_per_bfd_storage));
+ }
+
+ /* objfile_per_bfd_storage is not trivially constructible, must
+ call the ctor manually. */
+ storage = new (storage) objfile_per_bfd_storage ();
/* Look up the gdbarch associated with the BFD. */
if (abfd != NULL)
bcache_xfree (storage->macro_cache);
if (storage->demangled_names_hash)
htab_delete (storage->demangled_names_hash);
- obstack_free (&storage->storage_obstack, 0);
+ storage->~objfile_per_bfd_storage ();
}
/* A wrapper for free_objfile_per_bfd_storage that can be passed as a
simply copied through to the new objfile flags member. */
struct objfile *
-allocate_objfile (bfd *abfd, const char *name, int flags)
+allocate_objfile (bfd *abfd, const char *name, objfile_flags flags)
{
struct objfile *objfile;
char *expanded_name;
/* Return non-zero if PC is in a section called NAME. */
int
-pc_in_section (CORE_ADDR pc, char *name)
+pc_in_section (CORE_ADDR pc, const char *name)
{
struct obj_section *s;
int retval = 0;