aboutsummaryrefslogtreecommitdiff
path: root/gdb/auto-load.c
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@efficios.com>2023-10-03 22:20:20 -0400
committerSimon Marchi <simon.marchi@efficios.com>2023-10-05 13:20:50 -0400
commit74ce4f8ecf8b9b3a41821eec73b8952447e84eef (patch)
treec0bd340806067f5844aae70f522109e2e292306a /gdb/auto-load.c
parenteb0558dee5e249ca6270f2b4875988f2dc2fbb15 (diff)
downloadgdb-74ce4f8ecf8b9b3a41821eec73b8952447e84eef.zip
gdb-74ce4f8ecf8b9b3a41821eec73b8952447e84eef.tar.gz
gdb-74ce4f8ecf8b9b3a41821eec73b8952447e84eef.tar.bz2
gdb: add program_space parameters to some auto-load functions
Make the current_program_space references bubble up a bit. Change-Id: Id047a48cc8d8a45504cdbb5960bafe3e7735d652 Approved-By: Tom Tromey <tom@tromey.com>
Diffstat (limited to 'gdb/auto-load.c')
-rw-r--r--gdb/auto-load.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/gdb/auto-load.c b/gdb/auto-load.c
index c6744ca..37a44cc 100644
--- a/gdb/auto-load.c
+++ b/gdb/auto-load.c
@@ -706,12 +706,9 @@ maybe_add_script_text (struct auto_load_pspace_info *pspace_info,
/* Clear the table of loaded section scripts. */
static void
-clear_section_scripts (void)
+clear_section_scripts (program_space *pspace)
{
- struct program_space *pspace = current_program_space;
- struct auto_load_pspace_info *info;
-
- info = auto_load_pspace_data.get (pspace);
+ auto_load_pspace_info *info = auto_load_pspace_data.get (pspace);
if (info != NULL && info->loaded_script_files != NULL)
auto_load_pspace_data.clear (pspace);
}
@@ -1175,7 +1172,7 @@ auto_load_new_objfile (struct objfile *objfile)
if (!objfile)
{
/* OBJFILE is NULL when loading a new "main" symbol-file. */
- clear_section_scripts ();
+ clear_section_scripts (current_program_space);
return;
}
@@ -1262,15 +1259,14 @@ print_scripts (const std::vector<loaded_script *> &scripts)
PATTERN. FROM_TTY is the usual GDB boolean for user interactivity. */
void
-auto_load_info_scripts (const char *pattern, int from_tty,
- const struct extension_language_defn *language)
+auto_load_info_scripts (program_space *pspace, const char *pattern,
+ int from_tty, const extension_language_defn *language)
{
struct ui_out *uiout = current_uiout;
- struct auto_load_pspace_info *pspace_info;
dont_repeat ();
- pspace_info = get_auto_load_pspace_data (current_program_space);
+ auto_load_pspace_info *pspace_info = get_auto_load_pspace_data (pspace);
if (pattern && *pattern)
{
@@ -1347,7 +1343,8 @@ auto_load_info_scripts (const char *pattern, int from_tty,
static void
info_auto_load_gdb_scripts (const char *pattern, int from_tty)
{
- auto_load_info_scripts (pattern, from_tty, &extension_language_gdb);
+ auto_load_info_scripts (current_program_space, pattern, from_tty,
+ &extension_language_gdb);
}
/* Implement 'info auto-load local-gdbinit'. */