[05/14] gdb: make `program_space::free_all_objfiles` use `this`

Message ID 20240711195307.1544451-6-simon.marchi@polymtl.ca
State New
Headers
Series Some random program space cleanups |

Checks

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

Commit Message

Simon Marchi July 11, 2024, 7:52 p.m. UTC
  Use `this` instead of `current_program_space`.  Presumably, the method
wants to check the solibs of "this" program space, not the current
global program space (although they are likely always the same at the
moment).

Change-Id: Iaf0534f36bfd47c04c53ed0657da332bdb8fb906
---
 gdb/progspace.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Patch

diff --git a/gdb/progspace.c b/gdb/progspace.c
index 224b61e0d7f8..28198c1e8a43 100644
--- a/gdb/progspace.c
+++ b/gdb/progspace.c
@@ -128,7 +128,7 @@  void
 program_space::free_all_objfiles ()
 {
   /* Any objfile reference would become stale.  */
-  for (const solib &so : current_program_space->solibs ())
+  for (const solib &so : this->solibs ())
     gdb_assert (so.objfile == NULL);
 
   while (!objfiles_list.empty ())