aboutsummaryrefslogtreecommitdiff
path: root/gdb/python
diff options
context:
space:
mode:
authorDoug Evans <dje@google.com>2010-12-15 17:28:00 +0000
committerDoug Evans <dje@google.com>2010-12-15 17:28:00 +0000
commita86caf66bb66054f86ef6bed3c5fa6d68444734b (patch)
treedacd30dd4676b811dab258da5a799f596b3ee7c2 /gdb/python
parent2fbb4320cae80e68bd80064cac06588f33546e6f (diff)
downloadgdb-a86caf66bb66054f86ef6bed3c5fa6d68444734b.zip
gdb-a86caf66bb66054f86ef6bed3c5fa6d68444734b.tar.gz
gdb-a86caf66bb66054f86ef6bed3c5fa6d68444734b.tar.bz2
Rename "maint set python auto-load" to "set auto-load-scripts".
* NEWS: Mention it. * python/py-auto-load.c (auto_load_scripts): Renamed from gdbpy_auto_load. (load_auto_scripts_for_objfile): Update. (gdbpy_initialize_auto_load): Rename "maint set python auto-load" to "set auto-load-scripts". doc/ * gdb.texinfo (Startup): Document auto-loading of scripts during startup. (Auto-loading): Delete "maint set python auto-load on|off". Add "set auto-load-scripts on|off".
Diffstat (limited to 'gdb/python')
-rw-r--r--gdb/python/py-auto-load.c32
1 files changed, 19 insertions, 13 deletions
diff --git a/gdb/python/py-auto-load.c b/gdb/python/py-auto-load.c
index 538e06d..ae5dc74 100644
--- a/gdb/python/py-auto-load.c
+++ b/gdb/python/py-auto-load.c
@@ -34,7 +34,7 @@
This is true if we should auto-load python code when an objfile is opened,
false otherwise.
- Both gdbpy_auto_load && gdbpy_global_auto_load must be true to enable
+ Both auto_load_scripts && gdbpy_global_auto_load must be true to enable
auto-loading.
This flag exists to facilitate deferring auto-loading during start-up
@@ -82,10 +82,15 @@ struct loaded_script_entry
};
/* User-settable option to enable/disable auto-loading:
- maint set python auto-load on|off
- This is true if we should auto-load python code when an objfile is opened,
- false otherwise. */
-static int gdbpy_auto_load = 1;
+ set auto-load-scripts on|off
+ This is true if we should auto-load associated scripts when an objfile
+ is opened, false otherwise.
+ At the moment, this only affects python scripts, but there's no reason
+ one couldn't also have other kinds of auto-loaded scripts, and there's
+ no reason to have them each controlled by a separate flag.
+ So we elide "python" from the name here and in the option.
+ The fact that it lives here is just an implementation detail. */
+static int auto_load_scripts = 1;
/* Per-program-space data key. */
static const struct program_space_data *auto_load_pspace_data;
@@ -404,7 +409,7 @@ auto_load_new_objfile (struct objfile *objfile)
void
load_auto_scripts_for_objfile (struct objfile *objfile)
{
- if (gdbpy_auto_load && gdbpy_global_auto_load)
+ if (auto_load_scripts && gdbpy_global_auto_load)
{
auto_load_objfile_script (objfile, GDBPY_AUTO_FILE_NAME);
auto_load_section_scripts (objfile, GDBPY_AUTO_SECTION_NAME);
@@ -471,14 +476,15 @@ gdbpy_initialize_auto_load (void)
observer_attach_new_objfile (auto_load_new_objfile);
- add_setshow_boolean_cmd ("auto-load", class_maintenance,
- &gdbpy_auto_load, _("\
-Enable or disable auto-loading of Python code when an object is opened."), _("\
-Show whether Python code will be auto-loaded when an object is opened."), _("\
-Enables or disables auto-loading of Python code when an object is opened."),
+ add_setshow_boolean_cmd ("auto-load-scripts", class_support,
+ &auto_load_scripts, _("\
+Set the debugger's behaviour regarding auto-loaded scripts."), _("\
+Show the debugger's behaviour regarding auto-loaded scripts."), _("\
+If enabled, auto-loaded scripts are loaded when the debugger reads\n\
+an executable or shared library."),
NULL, NULL,
- &set_python_list,
- &show_python_list);
+ &setlist,
+ &showlist);
add_cmd ("section-scripts", class_maintenance, maintenance_print_section_scripts,
_("Print dump of auto-loaded section scripts matching REGEXP."),