Bump GDB's version number to 15.0.91.DATE-git.
[binutils-gdb.git] / gdb / guile / scm-auto-load.c
blob57550fa9239c1bb07c8535a4a7a7d3c9a136d518
1 /* GDB routines for supporting auto-loaded Guile scripts.
3 Copyright (C) 2010-2024 Free Software Foundation, Inc.
5 This file is part of GDB.
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 3 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program. If not, see <http://www.gnu.org/licenses/>. */
20 #include "top.h"
21 #include "objfiles.h"
22 #include "cli/cli-cmds.h"
23 #include "auto-load.h"
24 #include "guile.h"
25 #include "guile-internal.h"
27 /* User-settable option to enable/disable auto-loading of Guile scripts:
28 set auto-load guile-scripts on|off
29 This is true if we should auto-load associated Guile scripts when an
30 objfile is opened, false otherwise. */
31 static bool auto_load_guile_scripts = true;
33 /* "show" command for the auto_load_guile_scripts configuration variable. */
35 static void
36 show_auto_load_guile_scripts (struct ui_file *file, int from_tty,
37 struct cmd_list_element *c, const char *value)
39 gdb_printf (file, _("Auto-loading of Guile scripts is %s.\n"), value);
42 /* See guile-internal.h. */
44 bool
45 gdbscm_auto_load_enabled (const struct extension_language_defn *extlang)
47 return auto_load_guile_scripts;
50 /* Wrapper for "info auto-load guile-scripts". */
52 static void
53 info_auto_load_guile_scripts (const char *pattern, int from_tty)
55 auto_load_info_scripts (current_program_space, pattern, from_tty,
56 &extension_language_guile);
59 void
60 gdbscm_initialize_auto_load (void)
62 add_setshow_boolean_cmd ("guile-scripts", class_support,
63 &auto_load_guile_scripts, _("\
64 Set the debugger's behaviour regarding auto-loaded Guile scripts."), _("\
65 Show the debugger's behaviour regarding auto-loaded Guile scripts."), _("\
66 If enabled, auto-loaded Guile scripts are loaded when the debugger reads\n\
67 an executable or shared library.\n\
68 This options has security implications for untrusted inferiors."),
69 NULL, show_auto_load_guile_scripts,
70 auto_load_set_cmdlist_get (),
71 auto_load_show_cmdlist_get ());
73 add_cmd ("guile-scripts", class_info, info_auto_load_guile_scripts,
74 _("Print the list of automatically loaded Guile scripts.\n\
75 Usage: info auto-load guile-scripts [REGEXP]"),
76 auto_load_info_cmdlist_get ());