gdb: use objfile->pspace in auto-load.c
authorSimon Marchi <simon.marchi@efficios.com>
Wed, 4 Oct 2023 02:20:19 +0000 (22:20 -0400)
committerSimon Marchi <simon.marchi@efficios.com>
Thu, 5 Oct 2023 17:20:50 +0000 (13:20 -0400)
Use objfile->pspace instead of current_program_space in two spots.

Change-Id: Idf94fad486252d1250380f295e71b0fe76dce76c
Approved-By: Tom Tromey <tom@tromey.com>
gdb/auto-load.c

index 5267cb4e64d791a366f26a94ed03ef3e646948f1..c6744ca2555418d229f5764204455a15466a69e7 100644 (file)
@@ -788,7 +788,7 @@ auto_load_objfile_script_1 (struct objfile *objfile, const char *realname,
       /* Add this script to the hash table too so
         "info auto-load ${lang}-scripts" can print it.  */
       pspace_info
-       = get_auto_load_pspace_data_for_loading (current_program_space);
+       = get_auto_load_pspace_data_for_loading (objfile->pspace);
       maybe_add_script_file (pspace_info, is_safe, debugfile, debugfile,
                             language);
 
@@ -1052,12 +1052,10 @@ static void
 source_section_scripts (struct objfile *objfile, const char *section_name,
                        const char *start, const char *end)
 {
-  const char *p;
-  struct auto_load_pspace_info *pspace_info;
-
-  pspace_info = get_auto_load_pspace_data_for_loading (current_program_space);
+  auto_load_pspace_info *pspace_info
+    = get_auto_load_pspace_data_for_loading (objfile->pspace);
 
-  for (p = start; p < end; ++p)
+  for (const char *p = start; p < end; ++p)
     {
       const char *entry;
       const struct extension_language_defn *language;