From: Simon Marchi Date: Wed, 4 Oct 2023 02:20:19 +0000 (-0400) Subject: gdb: use objfile->pspace in auto-load.c X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=eb0558dee5e249ca6270f2b4875988f2dc2fbb15;p=binutils-gdb.git 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 --- 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;