gdb: don't call so_list::clear in free_so
authorSimon Marchi <simon.marchi@efficios.com>
Tue, 10 Oct 2023 16:28:03 +0000 (16:28 +0000)
committerSimon Marchi <simon.marchi@efficios.com>
Thu, 19 Oct 2023 14:57:51 +0000 (10:57 -0400)
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
Approved-By: Pedro Alves <pedro@palves.net>
Reviewed-By: Reviewed-By: Lancelot Six <lancelot.six@amd.com>
gdb/solib.c

index b0ae9347f024c243c3857ba7391a458179c6a050..4594587a13413e96020b76a44913c7d378d9cc77 100644 (file)
@@ -664,7 +664,6 @@ lm_info::~lm_info () = default;
 void
 free_so (so_list &so)
 {
-  so.clear ();
   delete &so;
 }