From eb0558dee5e249ca6270f2b4875988f2dc2fbb15 Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Tue, 3 Oct 2023 22:20:19 -0400 Subject: [PATCH] gdb: use objfile->pspace in auto-load.c Use objfile->pspace instead of current_program_space in two spots. Change-Id: Idf94fad486252d1250380f295e71b0fe76dce76c Approved-By: Tom Tromey --- gdb/auto-load.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/gdb/auto-load.c b/gdb/auto-load.c index 5267cb4e64d..c6744ca2555 100644 --- a/gdb/auto-load.c +++ b/gdb/auto-load.c @@ -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; -- 2.30.2