]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Change clear_program_space_solib_cache to method on program_space
authorTom Tromey <tom@tromey.com>
Thu, 29 Oct 2020 21:04:33 +0000 (15:04 -0600)
committerTom Tromey <tom@tromey.com>
Thu, 29 Oct 2020 21:04:38 +0000 (15:04 -0600)
This changes clear_program_space_solib_cache to be a method on
program_space.  Also, it removes a call to this function from the
program_space destructor, as that is not necessary.

gdb/ChangeLog
2020-10-29  Tom Tromey  <tom@tromey.com>

* progspace.c (program_space::~program_space): Don't call
clear_program_space_solib_cache.
(program_space::clear_solib_cache): Rename from
clear_solib_cache.
* solib.c (handle_solib_event): Update.
* progspace.h (struct program_space) <clear_solib_cache>: New
method.
(clear_program_space_solib_cache): Don't declare.

gdb/ChangeLog
gdb/progspace.c
gdb/progspace.h
gdb/solib.c

index c074b4fdbf3254f1f86109ad8a7853707fa3022f..979319425701b4fc1dc0c8fdc2122cf95948cba3 100644 (file)
@@ -1,3 +1,14 @@
+2020-10-29  Tom Tromey  <tom@tromey.com>
+
+       * progspace.c (program_space::~program_space): Don't call
+       clear_program_space_solib_cache.
+       (program_space::clear_solib_cache): Rename from
+       clear_solib_cache.
+       * solib.c (handle_solib_event): Update.
+       * progspace.h (struct program_space) <clear_solib_cache>: New
+       method.
+       (clear_program_space_solib_cache): Don't declare.
+
 2020-10-29  Tom Tromey  <tom@tromey.com>
 
        * windows-tdep.c (windows_solib_create_inferior_hook): Update.
index 52482ca8f6453e1527507634f4a1274a617dfaf4..84baaeab292160f684b4d6e910fabc5f902b48d0 100644 (file)
@@ -154,7 +154,6 @@ program_space::~program_space ()
   clear_symtab_users (SYMFILE_DEFER_BP_RESET);
   if (!gdbarch_has_shared_address_space (target_gdbarch ()))
     free_address_space (this->aspace);
-  clear_program_space_solib_cache (this);
     /* Discard any data modules have associated with the PSPACE.  */
   program_space_free_data (this);
 }
@@ -448,10 +447,10 @@ update_address_spaces (void)
 /* See progspace.h.  */
 
 void
-clear_program_space_solib_cache (struct program_space *pspace)
+program_space::clear_solib_cache ()
 {
-  pspace->added_solibs.clear ();
-  pspace->deleted_solibs.clear ();
+  added_solibs.clear ();
+  deleted_solibs.clear ();
 }
 
 \f
index e719cee57d094df040b63d826894f3a49439509d..22805d74f37ca1618834da6e165686088afd167b 100644 (file)
@@ -288,6 +288,11 @@ struct program_space
     ebfd = std::move (abfd);
   }
 
+  /* Reset saved solib data at the start of an solib event.  This lets
+     us properly collect the data when calling solib_add, so it can then
+     later be printed.  */
+  void clear_solib_cache ();
+
   /* Unique ID number.  */
   int num = 0;
 
@@ -435,11 +440,6 @@ extern int address_space_num (struct address_space *aspace);
    mappings.  */
 extern void update_address_spaces (void);
 
-/* Reset saved solib data at the start of an solib event.  This lets
-   us properly collect the data when calling solib_add, so it can then
-   later be printed.  */
-extern void clear_program_space_solib_cache (struct program_space *);
-
 /* Keep a registry of per-pspace data-pointers required by other GDB
    modules.  */
 
index 9df4eca888a20f64021943362adf710aee06736f..baa1801635b7cbbdd99a96dff92f4955b474d5f0 100644 (file)
@@ -1252,7 +1252,7 @@ handle_solib_event (void)
   if (ops->handle_event != NULL)
     ops->handle_event ();
 
-  clear_program_space_solib_cache (current_inferior ()->pspace);
+  current_inferior ()->pspace->clear_solib_cache ();
 
   /* Check for any newly added shared libraries if we're supposed to
      be adding them automatically.  Switch terminal for any messages