GDB (xrefs)
scm-auto-load.c
Go to the documentation of this file.
1 /* GDB routines for supporting auto-loaded Guile scripts.
2 
3  Copyright (C) 2010-2015 Free Software Foundation, Inc.
4 
5  This file is part of GDB.
6 
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.
11 
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.
16 
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/>. */
19 
20 #include "defs.h"
21 #include "top.h"
22 #include "gdbcmd.h"
23 #include "objfiles.h"
24 #include "cli/cli-cmds.h"
25 #include "auto-load.h"
26 #include "guile.h"
27 #include "guile-internal.h"
28 
29 /* User-settable option to enable/disable auto-loading of Guile scripts:
30  set auto-load guile-scripts on|off
31  This is true if we should auto-load associated Guile scripts when an
32  objfile is opened, false otherwise. */
33 static int auto_load_guile_scripts = 1;
34 
35 /* "show" command for the auto_load_guile_scripts configuration variable. */
36 
37 static void
38 show_auto_load_guile_scripts (struct ui_file *file, int from_tty,
39  struct cmd_list_element *c, const char *value)
40 {
41  fprintf_filtered (file, _("Auto-loading of Guile scripts is %s.\n"), value);
42 }
43 
44 /* Return non-zero if auto-loading Guile scripts is enabled.
45  This is the extension_language_script_ops.auto_load_enabled "method". */
46 
47 int
49 {
51 }
52 
53 /* Wrapper for "info auto-load guile-scripts". */
54 
55 static void
56 info_auto_load_guile_scripts (char *pattern, int from_tty)
57 {
59 }
60 
61 void
63 {
64  add_setshow_boolean_cmd ("guile-scripts", class_support,
66 Set the debugger's behaviour regarding auto-loaded Guile scripts."), _("\
67 Show the debugger's behaviour regarding auto-loaded Guile scripts."), _("\
68 If enabled, auto-loaded Guile scripts are loaded when the debugger reads\n\
69 an executable or shared library.\n\
70 This options has security implications for untrusted inferiors."),
74 
76  _("Print the list of automatically loaded Guile scripts.\n\
77 Usage: info auto-load guile-scripts [REGEXP]"),
79 }
struct cmd_list_element ** auto_load_set_cmdlist_get(void)
Definition: auto-load.c:1507
#define _(String)
Definition: gdb_locale.h:40
EXPORTED_CONST struct extension_language_defn extension_language_guile
Definition: guile.c:80
void fprintf_filtered(struct ui_file *stream, const char *format,...)
Definition: utils.c:2351
static void info_auto_load_guile_scripts(char *pattern, int from_tty)
Definition: scm-auto-load.c:56
struct cmd_list_element * add_cmd(const char *name, enum command_class theclass, cmd_cfunc_ftype *fun, const char *doc, struct cmd_list_element **list)
Definition: cli-decode.c:192
int gdbscm_auto_load_enabled(const struct extension_language_defn *extlang)
Definition: scm-auto-load.c:48
static void show_auto_load_guile_scripts(struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
Definition: scm-auto-load.c:38
void gdbscm_initialize_auto_load(void)
Definition: scm-auto-load.c:62
Definition: value.c:172
void auto_load_info_scripts(char *pattern, int from_tty, const struct extension_language_defn *language)
Definition: auto-load.c:1323
struct cmd_list_element ** auto_load_show_cmdlist_get(void)
Definition: auto-load.c:1534
static int auto_load_guile_scripts
Definition: scm-auto-load.c:33
void add_setshow_boolean_cmd(const char *name, enum command_class theclass, int *var, const char *set_doc, const char *show_doc, const char *help_doc, cmd_sfunc_ftype *set_func, show_value_ftype *show_func, struct cmd_list_element **set_list, struct cmd_list_element **show_list)
Definition: cli-decode.c:541
struct cmd_list_element ** auto_load_info_cmdlist_get(void)
Definition: auto-load.c:1585