}
/* Add it to the list. */
- auto &new_solib = sos.emplace_back (*this);
- new_solib.original_name = so_name;
- new_solib.name = so_name;
- new_solib.lm_info = std::make_unique<lm_info_aix> (info);
+ sos.emplace_back (std::make_unique<lm_info_aix> (info), so_name, so_name,
+ *this);
}
return sos;
struct lm_info_darwin final : public lm_info
{
+ explicit lm_info_darwin (CORE_ADDR lm_addr)
+ : lm_addr (lm_addr)
+ {}
+
/* The target location of lm. */
- CORE_ADDR lm_addr = 0;
+ CORE_ADDR lm_addr;
};
/* Lookup the value for a specific symbol. */
break;
/* Create and fill the new struct solib element. */
- auto &newobj = sos.emplace_back (*this);
-
- auto li = std::make_unique<lm_info_darwin> ();
-
- newobj.name = file_path.get ();
- newobj.original_name = newobj.name;
- li->lm_addr = load_addr;
-
- newobj.lm_info = std::move (li);
+ sos.emplace_back (std::make_unique<lm_info_darwin> (load_addr),
+ file_path.get (), file_path.get (), *this);
}
return sos;
struct lm_info_dsbt final : public lm_info
{
+ explicit lm_info_dsbt (int_elf32_dsbt_loadmap *map)
+ : map (map)
+ {}
+
+ DISABLE_COPY_AND_ASSIGN (lm_info_dsbt);
+
~lm_info_dsbt ()
{
xfree (this->map);
}
/* The loadmap, digested into an easier to use form. */
- int_elf32_dsbt_loadmap *map = NULL;
+ int_elf32_dsbt_loadmap *map;
};
/* Per pspace dsbt specific data. */
break;
}
- auto &sop = sos.emplace_back (*this);
- auto li = std::make_unique<lm_info_dsbt> ();
- li->map = loadmap;
/* Fetch the name. */
addr = extract_unsigned_integer (lm_buf.l_name,
sizeof (lm_buf.l_name),
if (solib_dsbt_debug)
gdb_printf (gdb_stdlog, "current_sos: name = %s\n",
name_buf.get ());
-
- sop.name = name_buf.get ();
- sop.original_name = sop.name;
}
- sop.lm_info = std::move (li);
+ sos.emplace_back (std::make_unique<lm_info_dsbt> (loadmap),
+ name_buf != nullptr ? name_buf.get () : "",
+ name_buf != nullptr ? name_buf.get () : "",
+ *this);
}
else
{
ldm = info->exec_loadmap;
delete info->main_executable_lm_info;
- info->main_executable_lm_info = new lm_info_dsbt;
- info->main_executable_lm_info->map = ldm;
+ info->main_executable_lm_info = new lm_info_dsbt (ldm);
objfile *objf = current_program_space->symfile_object_file;
section_offsets new_offsets (objf->section_offsets.size ());
struct lm_info_frv final : public lm_info
{
+ lm_info_frv (int_elf32_fdpic_loadmap *map, CORE_ADDR got_value,
+ CORE_ADDR lm_addr)
+ : map (map), got_value (got_value), lm_addr (lm_addr)
+ {}
+
+ DISABLE_COPY_AND_ASSIGN (lm_info_frv);
+
~lm_info_frv ()
{
xfree (this->map);
}
/* The loadmap, digested into an easier to use form. */
- int_elf32_fdpic_loadmap *map = NULL;
+ int_elf32_fdpic_loadmap *map;
/* The GOT address for this link map entry. */
- CORE_ADDR got_value = 0;
+ CORE_ADDR got_value;
/* The link map address, needed for frv_fetch_objfile_link_map(). */
- CORE_ADDR lm_addr = 0;
+ CORE_ADDR lm_addr;
/* Cached dynamic symbol table and dynamic relocs initialized and
used only by find_canonical_descriptor_in_load_object().
break;
}
- auto &sop = sos.emplace_back (*this);
- auto li = std::make_unique<lm_info_frv> ();
- li->map = loadmap;
- li->got_value = got_addr;
- li->lm_addr = lm_addr;
- sop.lm_info = std::move (li);
-
/* Fetch the name. */
addr = extract_unsigned_integer (lm_buf.l_name,
sizeof (lm_buf.l_name),
if (name_buf == nullptr)
warning (_("Can't read pathname for link map entry."));
- else
- {
- sop.name = name_buf.get ();
- sop.original_name = sop.name;
- }
+
+ sos.emplace_back (std::make_unique<lm_info_frv> (loadmap, got_addr,
+ lm_addr),
+ name_buf != nullptr ? name_buf.get () : "",
+ name_buf != nullptr ? name_buf.get () : "",
+ *this);
}
else
{
error (_("Unable to load the executable's loadmap."));
delete main_executable_lm_info;
- main_executable_lm_info = new lm_info_frv;
- main_executable_lm_info->map = ldm;
+ main_executable_lm_info = new lm_info_frv (ldm, 0, 0);
objfile *objf = current_program_space->symfile_object_file;
section_offsets new_offsets (objf->section_offsets.size ());
owning_intrusive_list<solib> dst;
for (const rocm_so &so : sos)
- {
- auto &newobj = dst.emplace_back (*this);
-
- newobj.lm_info = std::make_unique<lm_info_svr4> (*so.lm_info);
- newobj.name = so.name;
- newobj.original_name = so.unique_name;
- }
+ dst.emplace_back (std::make_unique<lm_info_svr4> (*so.lm_info),
+ so.unique_name, so.name, *this);
return dst;
}
owning_intrusive_list<solib> dst;
for (const svr4_so &so : sos)
- {
- auto &newobj = dst.emplace_back (*this);
-
- newobj.name = so.name;
- newobj.original_name = so.name;
- newobj.lm_info = std::make_unique<lm_info_svr4> (*so.lm_info);
- }
+ dst.emplace_back (std::make_unique<lm_info_svr4> (*so.lm_info), so.name,
+ so.name, *this);
return dst;
}
li->l_addr_p = 1;
owning_intrusive_list<solib> sos;
- auto &newobj = sos.emplace_back (*this);
-
- newobj.lm_info = std::move (li);
- newobj.name = info->debug_loader_name;
- newobj.original_name = newobj.name;
+ sos.emplace_back (std::move (li), info->debug_loader_name,
+ info->debug_loader_name, *this);
return sos;
}
/* Build a struct solib for each entry on the list. */
for (auto &library : library_list)
- {
- auto &new_solib = sos.emplace_back (*this);
-
- /* We don't need a copy of the name in INFO anymore. */
- new_solib.name = std::move (library.name);
- new_solib.original_name = new_solib.name;
- new_solib.lm_info = std::move (library.info);
- }
+ sos.emplace_back (std::move (library.info), library.name, library.name,
+ *this);
return sos;
}
/* Constructor
OPS is the solib_ops implementation providing this solib. */
- explicit solib (const solib_ops &ops) : m_ops (&ops) {}
+ explicit solib (lm_info_up lm_info, std::string original_name,
+ std::string name, const solib_ops &ops)
+ : lm_info (std::move (lm_info)),
+ original_name (std::move (original_name)),
+ name (std::move (name)),
+ m_ops (&ops)
+ {}
/* Return the solib_ops implementation providing this solib. */
const solib_ops &ops () const