gdb/python/py-auto-load.c - gdb
Global variables defined
Functions defined
Source code
- #include "defs.h"
- #include "top.h"
- #include "gdbcmd.h"
- #include "objfiles.h"
- #include "python.h"
- #include "auto-load.h"
- #include "python-internal.h"
- static int auto_load_python_scripts = 1;
- static void
- show_auto_load_python_scripts (struct ui_file *file, int from_tty,
- struct cmd_list_element *c, const char *value)
- {
- fprintf_filtered (file, _("Auto-loading of Python scripts is %s.\n"), value);
- }
- int
- gdbpy_auto_load_enabled (const struct extension_language_defn *extlang)
- {
- return auto_load_python_scripts;
- }
- static void
- info_auto_load_python_scripts (char *pattern, int from_tty)
- {
- auto_load_info_scripts (pattern, from_tty, &extension_language_python);
- }
- int
- gdbpy_initialize_auto_load (void)
- {
- struct cmd_list_element *cmd;
- const char *cmd_name;
- add_setshow_boolean_cmd ("python-scripts", class_support,
- &auto_load_python_scripts, _("\
- Set the debugger's behaviour regarding auto-loaded Python scripts."), _("\
- Show the debugger's behaviour regarding auto-loaded Python scripts."), _("\
- If enabled, auto-loaded Python scripts are loaded when the debugger reads\n\
- an executable or shared library.\n\
- This options has security implications for untrusted inferiors."),
- NULL, show_auto_load_python_scripts,
- auto_load_set_cmdlist_get (),
- auto_load_show_cmdlist_get ());
- add_setshow_boolean_cmd ("auto-load-scripts", class_support,
- &auto_load_python_scripts, _("\
- Set the debugger's behaviour regarding auto-loaded Python scripts, "
- "deprecated."),
- _("\
- Show the debugger's behaviour regarding auto-loaded Python scripts, "
- "deprecated."),
- NULL, NULL, show_auto_load_python_scripts,
- &setlist, &showlist);
- cmd_name = "auto-load-scripts";
- cmd = lookup_cmd (&cmd_name, setlist, "", -1, 1);
- deprecate_cmd (cmd, "set auto-load python-scripts");
-
- cmd_name = "auto-load-scripts";
- cmd = lookup_cmd (&cmd_name, showlist, "", -1, 1);
- deprecate_cmd (cmd, "show auto-load python-scripts");
- add_cmd ("python-scripts", class_info, info_auto_load_python_scripts,
- _("Print the list of automatically loaded Python scripts.\n\
- Usage: info auto-load python-scripts [REGEXP]"),
- auto_load_info_cmdlist_get ());
- cmd = add_info ("auto-load-scripts", info_auto_load_python_scripts, _("\
- Print the list of automatically loaded Python scripts, deprecated."));
- deprecate_cmd (cmd, "info auto-load python-scripts");
- return 0;
- }