[22/24] gdb: don't call so_list::clear in free_so

Message ID 20231010204213.111285-23-simon.marchi@efficios.com
State New
Series C++ification of struct so_list |


Context Check Description
linaro-tcwg-bot/tcwg_gdb_check--master-arm success Testing passed
linaro-tcwg-bot/tcwg_gdb_build--master-arm success Testing passed
linaro-tcwg-bot/tcwg_gdb_check--master-aarch64 success Testing passed
linaro-tcwg-bot/tcwg_gdb_build--master-aarch64 success Testing passed

Commit Message

Simon Marchi Oct. 10, 2023, 8:40 p.m. UTC
  I think this `so.clear ()` call is not useful.

 - so_list::clear deletes some things that now get automatically deleted
   when the so_list gets deleted right after in free_so.
 - so_list::clear resets some scalar fields of so_list, which we don't
   really care about since the so_list gets deleted right after.
 - so_list::clear calls target_so_ops::clear_so, of which there is a
   single implementation, svr4_clear_so.  That implementation just
   resets a field in lm_info_svr4, which we don't care about, as it will
   get deleted when the so_list gets deleted right after.

Change-Id: Ie4d72f2a04a4129e55c460bb5c69bc0af0d12b32
 gdb/solib.c | 1 -
 1 file changed, 1 deletion(-)


diff --git a/gdb/solib.c b/gdb/solib.c
index 9c10340ff583..2e4881798339 100644
--- a/gdb/solib.c
+++ b/gdb/solib.c
@@ -664,7 +664,6 @@  lm_info::~lm_info () = default;
 free_so (so_list &so)
-  so.clear ();
   delete &so;