to the main executable, not a shared library. */
for (ix = 1; ix < library_list->size (); ix++)
{
- struct so_list *new_solib = XCNEW (struct so_list);
+ so_list *new_solib = new so_list;
std::string so_name;
lm_info_aix &info = (*library_list)[ix];
break;
/* Create and fill the new so_list element. */
- gdb::unique_xmalloc_ptr<struct so_list> newobj (XCNEW (struct so_list));
+ so_list *newobj = new so_list;
lm_info_darwin *li = new lm_info_darwin;
newobj->lm_info = li;
li->lm_addr = load_addr;
if (head == NULL)
- head = newobj.get ();
+ head = newobj;
else
- tail->next = newobj.get ();
- tail = newobj.release ();
+ tail->next = newobj;
+
+ tail = newobj;
}
return head;
if (dsbt_index != 0)
{
struct int_elf32_dsbt_loadmap *loadmap;
- struct so_list *sop;
CORE_ADDR addr;
loadmap = fetch_loadmap (map_addr);
break;
}
- sop = XCNEW (struct so_list);
+ so_list *sop = new so_list;
lm_info_dsbt *li = new lm_info_dsbt;
sop->lm_info = li;
li->map = loadmap;
if (got_addr != mgot)
{
struct int_elf32_fdpic_loadmap *loadmap;
- struct so_list *sop;
CORE_ADDR addr;
/* Fetch the load map address. */
break;
}
- sop = XCNEW (struct so_list);
+ so_list *sop = new so_list;
lm_info_frv *li = new lm_info_frv;
sop->lm_info = li;
li->map = loadmap;
while (src != nullptr)
{
- struct so_list *newobj;
-
- newobj = XNEW (struct so_list);
+ so_list *newobj = new so_list;
memcpy (newobj, src, sizeof (struct so_list));
lm_info_svr4 *src_li = (lm_info_svr4 *) src->lm_info;
if (status != AMD_DBGAPI_STATUS_SUCCESS)
continue;
- struct so_list *so = XCNEW (struct so_list);
+ so_list *so = new so_list;
lm_info_svr4 *li = new lm_info_svr4;
li->l_addr = l_addr;
so->lm_info = li;
while (src != NULL)
{
- struct so_list *newobj;
-
- newobj = XNEW (struct so_list);
+ so_list *newobj = new so_list;
memcpy (newobj, src, sizeof (struct so_list));
lm_info_svr4 *src_li = (lm_info_svr4 *) src->lm_info;
= (ULONGEST *) xml_find_attribute (attributes, "l_addr")->value.get ();
ULONGEST *l_ldp
= (ULONGEST *) xml_find_attribute (attributes, "l_ld")->value.get ();
- struct so_list *new_elem;
- new_elem = XCNEW (struct so_list);
+ so_list *new_elem = new so_list;
lm_info_svr4 *li = new lm_info_svr4;
new_elem->lm_info = li;
li->lm_addr = *lmp;
static struct so_list *
svr4_default_sos (svr4_info *info)
{
- struct so_list *newobj;
-
if (!info->debug_loader_offset_p)
return NULL;
- newobj = XCNEW (struct so_list);
+ so_list *newobj = new so_list;
lm_info_svr4 *li = new lm_info_svr4;
newobj->lm_info = li;
for (; lm != 0; prev_lm = lm, lm = next_lm)
{
- so_list_up newobj (XCNEW (struct so_list));
+ so_list_up newobj (new so_list);
lm_info_svr4 *li = lm_info_read (lm).release ();
newobj->lm_info = li;
static struct so_list *
solib_target_current_sos (void)
{
- struct so_list *new_solib, *start = NULL, *last = NULL;
+ so_list *start = NULL, *last = NULL;
/* Fetch the list of shared libraries. */
gdb::optional<gdb::char_vector> library_document
/* Build a struct so_list for each entry on the list. */
for (auto &&info : library_list)
{
- new_solib = XCNEW (struct so_list);
+ so_list *new_solib = new so_list;
strncpy (new_solib->so_name, info->name.c_str (),
SO_NAME_MAX_PATH_SIZE - 1);
new_solib->so_name[SO_NAME_MAX_PATH_SIZE - 1] = '\0';
clear_so (so);
ops->free_so (so);
- xfree (&so);
+ delete &so;
}
dynamic linker's tables in the inferior, and are initialized by
current_sos. */
- struct so_list *next; /* next structure in linked list */
+ struct so_list *next = nullptr; /* next structure in linked list */
/* A pointer to target specific link map information. Often this
will be a copy of struct link_map from the user process, but
it need not be; it can be any collection of data needed to
traverse the dynamic linker's data structures. */
- lm_info_base *lm_info;
+ lm_info_base *lm_info = nullptr;
/* Shared object file name, exactly as it appears in the
inferior's link map. This may be a relative path, or something
which needs to be looked up in LD_LIBRARY_PATH, etc. We use it
to tell which entries in the inferior's dynamic linker's link
map we've already loaded. */
- char so_original_name[SO_NAME_MAX_PATH_SIZE];
+ char so_original_name[SO_NAME_MAX_PATH_SIZE] {};
/* Shared object file name, expanded to something GDB can open. */
- char so_name[SO_NAME_MAX_PATH_SIZE];
+ char so_name[SO_NAME_MAX_PATH_SIZE] {};
/* The following fields of the structure are built from
information gathered from the shared object file itself, and
current_sos must initialize these fields to 0. */
- bfd *abfd;
- char symbols_loaded; /* flag: symbols read in yet? */
+ bfd *abfd = nullptr;
+ char symbols_loaded = 0; /* flag: symbols read in yet? */
/* objfile with symbols for a loaded library. Target memory is read from
ABFD. OBJFILE may be NULL either before symbols have been loaded, if
the file cannot be found or after the command "nosharedlibrary". */
- struct objfile *objfile;
+ struct objfile *objfile = nullptr;
- target_section_table *sections;
+ target_section_table *sections = nullptr;
/* Record the range of addresses belonging to this shared library.
There may not be just one (e.g. if two segments are relocated
the MI command "-file-list-shared-libraries". The latter has a format
that supports outputting multiple segments once the related code
supports them. */
- CORE_ADDR addr_low, addr_high;
+ CORE_ADDR addr_low = 0, addr_high = 0;
};
struct target_so_ops