data = ada_inferior_data.get (inf);
if (data == NULL)
- data = ada_inferior_data.emplace (inf);
+ data = &ada_inferior_data.emplace (inf);
return data;
}
{
cache_entry_set *data = ada_pspace_data_handle.get (pspace);
if (data == nullptr)
- data = ada_pspace_data_handle.emplace (pspace);
+ data = &ada_pspace_data_handle.emplace (pspace);
return *data;
}
data = ada_tasks_pspace_data_handle.get (pspace);
if (data == NULL)
- data = ada_tasks_pspace_data_handle.emplace (pspace);
+ data = &ada_tasks_pspace_data_handle.emplace (pspace);
return data;
}
data = ada_tasks_inferior_data_handle.get (inf);
if (data == NULL)
- data = ada_tasks_inferior_data_handle.emplace (inf);
+ data = &ada_tasks_inferior_data_handle.emplace (inf);
return data;
}
data = aix_thread_variables_handle.get (inf);
if (data == NULL)
- data = aix_thread_variables_handle.emplace (inf);
+ data = &aix_thread_variables_handle.emplace (inf);
return data;
}
amd_dbgapi_inferior_info *info = amd_dbgapi_inferior_data.get (inferior);
if (info == nullptr)
- info = amd_dbgapi_inferior_data.emplace (inferior, inferior);
+ info = &amd_dbgapi_inferior_data.emplace (inferior, inferior);
return *info;
}
}
/* Allocate exception table data structure. */
- data = arm_exidx_data_key.emplace (objfile->obfd.get ());
+ data = &arm_exidx_data_key.emplace (objfile->obfd.get ());
data->section_maps.resize (objfile->obfd->section_count);
/* Fill in exception table. */
data = arm_bfd_data_key.get (objfile->obfd.get ());
if (data == NULL)
- data = arm_bfd_data_key.emplace (objfile->obfd.get (),
- objfile->obfd->section_count);
+ data = &arm_bfd_data_key.emplace (objfile->obfd.get (),
+ objfile->obfd->section_count);
arm_mapping_symbol_vec &map
= data->section_maps[bfd_asymbol_section (sym)->index];
info = auto_load_pspace_data.get (pspace);
if (info == NULL)
- info = auto_load_pspace_data.emplace (pspace);
+ info = &auto_load_pspace_data.emplace (pspace);
return info;
}
if (info == nullptr)
{
- info = auxv_inferior_data.emplace (inf);
+ info = &auxv_inferior_data.emplace (inf);
info->data = target_read_auxv_raw (inf->top_target ());
}
inf_data = catch_syscall_inferior_data.get (inf);
if (inf_data == NULL)
- inf_data = catch_syscall_inferior_data.emplace (inf);
+ inf_data = &catch_syscall_inferior_data.emplace (inf);
return inf_data;
}
bp_objfile_data = breakpoint_objfile_key.get (objfile);
if (bp_objfile_data == NULL)
- bp_objfile_data = breakpoint_objfile_key.emplace (objfile);
+ bp_objfile_data = &breakpoint_objfile_key.emplace (objfile);
return bp_objfile_data;
}
{
struct bsd_uthread_ops *ops = bsd_uthread_data.get (gdbarch);
if (ops == nullptr)
- ops = bsd_uthread_data.emplace (gdbarch);
+ ops = &bsd_uthread_data.emplace (gdbarch);
return ops;
}
gdbarch *arch = this->m_per_objfile->objfile->arch ();
dwarf_gdbarch_types *types = dwarf_arch_cookie.get (arch);
if (types == nullptr)
- types = dwarf_arch_cookie.emplace (arch);
+ types = &dwarf_arch_cookie.emplace (arch);
int ndx;
if (this->m_addr_size == 2)
{
dwarf2_frame_ops *result = dwarf2_frame_data.get (gdbarch);
if (result == nullptr)
- result = dwarf2_frame_data.emplace (gdbarch);
+ result = &dwarf2_frame_data.emplace (gdbarch);
return result;
}
just_created = true;
}
- per_objfile = dwarf2_objfile_data_key.emplace (objfile, objfile, per_bfd);
+ per_objfile
+ = &dwarf2_objfile_data_key.emplace (objfile, objfile, per_bfd);
}
/* Virtual sections are created from DWP files. It's not clear those
if (probes_per_bfd == NULL)
{
- probes_per_bfd = probe_key.emplace (objfile->obfd.get ());
+ probes_per_bfd = &probe_key.emplace (objfile->obfd.get ());
/* Here we try to gather information about all types of probes from the
objfile. */
{
struct fbsd_gdbarch_data *result = fbsd_gdbarch_data_handle.get (gdbarch);
if (result == nullptr)
- result = fbsd_gdbarch_data_handle.emplace (gdbarch);
+ result = &fbsd_gdbarch_data_handle.emplace (gdbarch);
return result;
}
data = fbsd_pspace_data_handle.get (pspace);
if (data == NULL)
- data = fbsd_pspace_data_handle.emplace (pspace);
+ data = &fbsd_pspace_data_handle.emplace (pspace);
return data;
}
{
struct frame_base_table *table = frame_base_data.get (gdbarch);
if (table == nullptr)
- table = frame_base_data.emplace (gdbarch);
+ table = &frame_base_data.emplace (gdbarch);
return table;
}
{
std::vector<const frame_unwind *> *table = frame_unwind_data.get (gdbarch);
if (table == nullptr)
- table = frame_unwind_data.emplace (gdbarch,
- standard_unwinders.begin (),
- standard_unwinders.end ());
+ table = &frame_unwind_data.emplace (gdbarch,
+ standard_unwinders.begin (),
+ standard_unwinders.end ());
return *table;
}
data = bfd_inferior_data_key.get (inf);
if (data == nullptr)
- data = bfd_inferior_data_key.emplace (inf);
+ data = &bfd_inferior_data_key.emplace (inf);
return data;
}
fixed_point_type_storage *storage
= fixed_point_objfile_key.get (type->objfile_owner ());
if (storage == nullptr)
- storage = fixed_point_objfile_key.emplace (type->objfile_owner ());
+ storage = &fixed_point_objfile_key.emplace (type->objfile_owner ());
info = up.get ();
storage->push_back (std::move (up));
}
is no call to scm_gc_unprotect_object for it. */
scm_gc_protect_object (arch_scm);
- data = arch_object_data.emplace (gdbarch);
+ data = &arch_object_data.emplace (gdbarch);
data->arch_scm = arch_scm;
}
struct syscm_gdbarch_data *data = syscm_gdbarch_data_key.get (gdbarch);
if (data == nullptr)
{
- data = syscm_gdbarch_data_key.emplace (gdbarch);
+ data = &syscm_gdbarch_data_key.emplace (gdbarch);
data->htab
= gdbscm_create_eqable_gsmob_ptr_map (syscm_hash_symbol_smob,
syscm_eq_symbol_smob);
/* Keep a pointer to the unwind information. */
obj_private = hppa_objfile_priv_data.get (objfile);
if (obj_private == NULL)
- obj_private = hppa_objfile_priv_data.emplace (objfile);
+ obj_private = &hppa_objfile_priv_data.emplace (objfile);
obj_private->unwind_info = ui;
}
{
struct libunwind_descr *result = libunwind_descr_handle.get (gdbarch);
if (result == nullptr)
- result = libunwind_descr_handle.emplace (gdbarch);
+ result = &libunwind_descr_handle.emplace (gdbarch);
return result;
}
info = inflow_inferior_data.get (inf);
if (info == NULL)
- info = inflow_inferior_data.emplace (inf);
+ info = &inflow_inferior_data.emplace (inf);
return info;
}
{
struct jit_gdbarch_data_type *data = jit_gdbarch_data.get (gdbarch);
if (data == nullptr)
- data = jit_gdbarch_data.emplace (gdbarch);
+ data = &jit_gdbarch_data.emplace (gdbarch);
if (!data->unwinder_registered)
{
data = checkpoint_inferior_data_key.get (inf);
if (data == nullptr)
- data = checkpoint_inferior_data_key.emplace (inf);
+ data = &checkpoint_inferior_data_key.emplace (inf);
return data;
}
{
struct linux_gdbarch_data *result = linux_gdbarch_data_handle.get (gdbarch);
if (result == nullptr)
- result = linux_gdbarch_data_handle.emplace (gdbarch);
+ result = &linux_gdbarch_data_handle.emplace (gdbarch);
return result;
}
linux_info *info = linux_inferior_data.get (inf);
if (info == nullptr)
- info = linux_inferior_data.emplace (inf);
+ info = &linux_inferior_data.emplace (inf);
return info;
}
{
struct nbsd_gdbarch_data *result = nbsd_gdbarch_data_handle.get (gdbarch);
if (result == nullptr)
- result = nbsd_gdbarch_data_handle.emplace (gdbarch);
+ result = &nbsd_gdbarch_data_handle.emplace (gdbarch);
return result;
}
}
if (objc_csym == NULL)
- objc_csym = objc_objfile_data.emplace (&objfile, objfile_csym);
+ objc_csym = &objc_objfile_data.emplace (&objfile, objfile_csym);
else
/* Count of ObjC methods in this objfile should be constant. */
gdb_assert (*objc_csym == objfile_csym);
info = objfiles_pspace_data.get (pspace);
if (info == NULL)
- info = objfiles_pspace_data.emplace (pspace);
+ info = &objfiles_pspace_data.emplace (pspace);
return info;
}
{
gdbpy_register_type *vecp = gdbpy_register_object_data.get (gdbarch);
if (vecp == nullptr)
- vecp = gdbpy_register_object_data.emplace (gdbarch);
+ vecp = &gdbpy_register_object_data.emplace (gdbarch);
gdbpy_register_type &vec = *vecp;
/* Ensure that we have enough entries in the vector. */
{
struct pyuw_gdbarch_data_type *data = pyuw_gdbarch_data.get (newarch);
if (data == nullptr)
- data= pyuw_gdbarch_data.emplace (newarch);
+ data = &pyuw_gdbarch_data.emplace (newarch);
if (!data->unwinder_registered)
{
{
struct reggroups *groups = reggroups_data.get (gdbarch);
if (groups == nullptr)
- groups = reggroups_data.emplace (gdbarch);
+ groups = ®groups_data.emplace (gdbarch);
return groups;
}
available. It emplaces a new instance of the associated data
type and attaches it to OBJ using this key. The arguments, if
any, are forwarded to the constructor. */
- template<typename Dummy = DATA *, typename... Args>
+ template<typename Dummy = DATA &, typename... Args>
typename std::enable_if<std::is_same<Deleter,
std::default_delete<DATA>>::value,
Dummy>::type
{
DATA *result = new DATA (std::forward<Args> (args)...);
set (obj, result);
- return result;
+ return *result;
}
/* Clear the data attached to OBJ that is associated with this KEY.
if (sim_data == NULL)
{
- sim_data = sim_inferior_data_key.emplace (inf, sim_desc);
+ sim_data = &sim_inferior_data_key.emplace (inf, sim_desc);
}
else if (sim_desc)
{
{
remote_per_progspace *info = remote_pspace_data.get (pspace);
if (info == nullptr)
- info = remote_pspace_data.emplace (pspace);
+ info = &remote_pspace_data.emplace (pspace);
gdb_assert (info != nullptr);
return *info;
}
struct remote_g_packet_data *data
= remote_g_packet_data_handle.get (gdbarch);
if (data == nullptr)
- data = remote_g_packet_data_handle.emplace (gdbarch);
+ data = &remote_g_packet_data_handle.emplace (gdbarch);
return data;
}
ppc_inferior_data *per_inf = ppc_inferior_data_key.get (inf);
if (per_inf == nullptr)
- per_inf = ppc_inferior_data_key.emplace (inf);
+ per_inf = &ppc_inferior_data_key.emplace (inf);
return per_inf;
}
data = solib_aix_inferior_data_handle.get (inf);
if (data == NULL)
- data = solib_aix_inferior_data_handle.emplace (inf);
+ data = &solib_aix_inferior_data_handle.emplace (inf);
return data;
}
if (info != nullptr)
return info;
- return solib_darwin_pspace_data.emplace (pspace);
+ return &solib_darwin_pspace_data.emplace (pspace);
}
/* Return non-zero if the version in dyld_all_image is known. */
if (info != nullptr)
return info;
- return solib_dsbt_pspace_data.emplace (pspace);
+ return &solib_dsbt_pspace_data.emplace (pspace);
}
solib_info *info = rocm_solib_data.get (inf);
if (info == nullptr)
- info = rocm_solib_data.emplace (inf, inf);
+ info = &rocm_solib_data.emplace (inf, inf);
return info;
}
struct svr4_info *info = solib_svr4_pspace_data.get (pspace);
if (info == NULL)
- info = solib_svr4_pspace_data.emplace (pspace);
+ info = &solib_svr4_pspace_data.emplace (pspace);
return info;
}
current_source_location *loc
= current_source_key.get (pspace);
if (loc == nullptr)
- loc = current_source_key.emplace (pspace);
+ loc = ¤t_source_key.emplace (pspace);
return loc;
}
{
struct svr4_tls_gdbarch_data *result = svr4_tls_gdbarch_data_handle.get (gdbarch);
if (result == nullptr)
- result = svr4_tls_gdbarch_data_handle.emplace (gdbarch);
+ result = &svr4_tls_gdbarch_data_handle.emplace (gdbarch);
return result;
}
if (cache == NULL)
{
- cache = symbol_cache_key.emplace (pspace);
+ cache = &symbol_cache_key.emplace (pspace);
resize_symbol_cache (cache, symbol_cache_size);
}
gdb returned "main" as the name even if no function named
"main" was defined the program; and this approach lets us
keep compatibility. */
- info = main_progspace_key.emplace (pspace);
+ info = &main_progspace_key.emplace (pspace);
}
return info;
{
tdesc_arch_data *result = tdesc_data.get (gdbarch);
if (result == nullptr)
- result = tdesc_data.emplace (gdbarch);
+ result = &tdesc_data.emplace (gdbarch);
return result;
}
{
windows_gdbarch_data *result = windows_gdbarch_data_handle.get (gdbarch);
if (result == nullptr)
- result = windows_gdbarch_data_handle.emplace (gdbarch);
+ result = &windows_gdbarch_data_handle.emplace (gdbarch);
return result;
}