diff options
Diffstat (limited to 'gdb/solib-aix.c')
-rw-r--r-- | gdb/solib-aix.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/gdb/solib-aix.c b/gdb/solib-aix.c index 1c319c2..926f1ed 100644 --- a/gdb/solib-aix.c +++ b/gdb/solib-aix.c @@ -444,7 +444,7 @@ solib_aix_solib_create_inferior_hook (int from_tty) /* Implement the "current_sos" solib_ops method. */ -static intrusive_list<solib> +static owning_intrusive_list<solib> solib_aix_current_sos () { std::optional<std::vector<lm_info_aix>> &library_list @@ -452,14 +452,13 @@ solib_aix_current_sos () if (!library_list.has_value ()) return {}; - intrusive_list<solib> sos; + owning_intrusive_list<solib> sos; /* Build a struct solib for each entry on the list. We skip the first entry, since this is the entry corresponding to the main executable, not a shared library. */ for (int ix = 1; ix < library_list->size (); ix++) { - solib *new_solib = new solib; std::string so_name; lm_info_aix &info = (*library_list)[ix]; @@ -481,12 +480,11 @@ solib_aix_current_sos () info.member_name.c_str ()); } - new_solib->so_original_name = so_name; - new_solib->so_name = so_name; - new_solib->lm_info = std::make_unique<lm_info_aix> (info); - /* Add it to the list. */ - sos.push_back (*new_solib); + auto &new_solib = sos.emplace_back (); + new_solib.so_original_name = so_name; + new_solib.so_name = so_name; + new_solib.lm_info = std::make_unique<lm_info_aix> (info); } return sos; |