+2017-10-20 Tom Tromey <tom@tromey.com>
+
+ * gdb_bfd.c (struct gdb_bfd_data) <included_bfds>: Now a
+ std::vector.
+ (gdb_bfd_record_inclusion): Update.
+ (bfdp): Remove typedef.
+
2017-10-20 Tom Tromey <tom@tromey.com>
* gdb_bfd.c (gdb_bfd_ref): Use new.
#include "gdb/fileio.h"
#include "inferior.h"
-typedef bfd *bfdp;
-DEF_VEC_P (bfdp);
-
/* An object of this type is stored in the section's user data when
mapping a section. */
~gdb_bfd_data ()
{
- int ix;
- bfd *included_bfd;
-
- for (ix = 0;
- VEC_iterate (bfdp, included_bfds, ix, included_bfd);
- ++ix)
- gdb_bfd_unref (included_bfd);
- VEC_free (bfdp, included_bfds);
}
/* The reference count. */
bfd *archive_bfd = nullptr;
/* Table of all the bfds this bfd has included. */
- VEC (bfdp) *included_bfds = nullptr;
+ std::vector<gdb_bfd_ref_ptr> included_bfds;
/* The registry. */
REGISTRY_FIELDS = {};
{
struct gdb_bfd_data *gdata;
- gdb_bfd_ref (includee);
gdata = (struct gdb_bfd_data *) bfd_usrdata (includer);
- VEC_safe_push (bfdp, gdata->included_bfds, includee);
+ gdata->included_bfds.push_back (new_bfd_ref (includee));
}
/* See gdb_bfd.h. */