* [patch, doc RFA] New command-line option -na.
@ 2010-12-11 0:47 Doug Evans
2010-12-11 8:16 ` Eli Zaretskii
2010-12-13 18:55 ` Jan Kratochvil
0 siblings, 2 replies; 10+ messages in thread
From: Doug Evans @ 2010-12-11 0:47 UTC (permalink / raw)
To: gdb-patches
Hi.
It is useful to be able to disable the auto-loading of scripts
provided by the program. E.g., because there's a bug in one,
or because you don't trust them.
The capability exists today with "maint set python auto-load on|off",
but that can't be used to disable scripts from a program provided on
the command line.
In order to use that, one has to start gdb without a program,
disable auto-loading, and *then* use the "file" command. Bleah.
This patch adds a new command-line option, -na, to disable auto-loading.
Since auto-loading is less of a maintenance issue,
and since there's no reason why this has to be python-specific,
I'm renaming "maint set python auto-load on|off" to
"set auto-load-scripts on|off".
I will check this in in two days if there are no objections.
[and pending doc RFA]
2010-12-10 Doug Evans <dje@google.com>
New command-line option -na, new command "set auto-load-scripts".
* NEWS: Mention them.
main.c (captured_main): Recognize -na.
(print_gdb_help): Print -na.
* top.c (auto_load_scripts): New global.
(init_main): New command "set auto-load-scripts on|off".
* top.h (auto_load_scripts): Declare.
* python/py-auto-load.c (gdbpy_auto_load): Delete.
(load_auto_scripts_for_objfile): Test auto_load_scripts instead of
gdbpy_auto_load.
(gdbpy_initialize_auto_load): Delete command
"maint set python auto-load on|off".
doc/
* gdb.texinfo (Mode Options): Document -na.
(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".
Index: NEWS
===================================================================
RCS file: /cvs/src/src/gdb/NEWS,v
retrieving revision 1.414
diff -u -p -r1.414 NEWS
--- NEWS 10 Dec 2010 20:33:44 -0000 1.414
+++ NEWS 11 Dec 2010 00:23:22 -0000
@@ -8,6 +8,11 @@
-data-directory DIR Specify DIR as the "data-directory".
This is mostly for testing purposes.
+-na Disable the loading of auto-loaded scripts.
+
+* The "maint set python auto-load on|off" command has been renamed to
+ "set auto-load-scripts on|off".
+
* GDB has a new command: "set directories".
It is like the "dir" command except that it replaces the
source path list instead of augmenting it.
Index: main.c
===================================================================
RCS file: /cvs/src/src/gdb/main.c,v
retrieving revision 1.88
diff -u -p -r1.88 main.c
--- main.c 7 Dec 2010 17:26:03 -0000 1.88
+++ main.c 11 Dec 2010 00:23:22 -0000
@@ -396,6 +396,7 @@ captured_main (void *data)
{"silent", no_argument, &quiet, 1},
{"nx", no_argument, &inhibit_gdbinit, 1},
{"n", no_argument, &inhibit_gdbinit, 1},
+ {"na", no_argument, &auto_load_scripts, 0},
{"batch-silent", no_argument, 0, 'B'},
{"batch", no_argument, &batch_flag, 1},
{"epoch", no_argument, &epoch_interface, 1},
@@ -985,6 +986,7 @@ Options:\n\n\
--nx Do not read "), stream);
fputs_unfiltered (gdbinit, stream);
fputs_unfiltered (_(" file.\n\
+ --na Do not auto-load scripts provided by the program.\n\
--quiet Do not print version number on startup.\n\
--readnow Fully read symbol files on first access.\n\
"), stream);
Index: top.c
===================================================================
RCS file: /cvs/src/src/gdb/top.c,v
retrieving revision 1.185
diff -u -p -r1.185 top.c
--- top.c 2 Nov 2010 16:48:41 -0000 1.185
+++ top.c 11 Dec 2010 00:23:22 -0000
@@ -88,6 +88,13 @@ char gdbinit[PATH_MAX + 1] = GDBINIT_FIL
int inhibit_gdbinit = 0;
+/* User-settable option to enable/disable auto-loading of scripts
+ provided by the program:
+ set auto-load-scripts on|off
+ If zero, then "auto-load" scripts are not loaded,
+ otherwise they are loaded. */
+int auto_load_scripts = 1;
+
/* If nonzero, and GDB has been configured to be able to use windows,
attempt to open them upon startup. */
@@ -1507,6 +1514,7 @@ show_exec_done_display_p (struct ui_file
Notification of completion for asynchronous execution commands is %s.\n"),
value);
}
+
static void
init_main (void)
{
@@ -1639,6 +1647,15 @@ When set, GDB uses the specified path to
NULL, NULL,
&setlist,
&showlist);
+
+ add_setshow_boolean_cmd ("auto-load-scripts", class_support,
+ &auto_load_scripts, _("\
+Enable or disable auto-loading of scripts when an object is opened."), _("\
+Show whether scripts will be auto-loaded when an object is opened."), _("\
+Enables or disables auto-loading of scripts when an object is opened."),
+ NULL, NULL,
+ &setlist,
+ &showlist);
}
void
Index: top.h
===================================================================
RCS file: /cvs/src/src/gdb/top.h,v
retrieving revision 1.22
diff -u -p -r1.22 top.h
--- top.h 7 Apr 2010 16:54:39 -0000 1.22
+++ top.h 11 Dec 2010 00:23:22 -0000
@@ -30,6 +30,7 @@ extern int in_user_command;
extern int caution;
extern char gdb_dirbuf[1024];
extern int inhibit_gdbinit;
+extern int auto_load_scripts;
extern int epoch_interface;
extern char gdbinit[];
Index: doc/gdb.texinfo
===================================================================
RCS file: /cvs/src/src/gdb/doc/gdb.texinfo,v
retrieving revision 1.779
diff -u -p -r1.779 gdb.texinfo
--- doc/gdb.texinfo 7 Dec 2010 17:26:03 -0000 1.779
+++ doc/gdb.texinfo 11 Dec 2010 00:23:23 -0000
@@ -1025,6 +1025,11 @@ Do not execute commands found in any ini
options and arguments have been processed. @xref{Command Files,,Command
Files}.
+@item -na
+@cindex @code{--na}
+Do not auto-load scripts provided by the program.
+@xref{Auto-loading}.
+
@item -quiet
@itemx -silent
@itemx -q
@@ -1263,6 +1268,12 @@ to the program you are debugging, in the
@value{GDBN}.
@item
+Loads any auto-loaded scripts provided by the program being debugged.
+@xref{Auto-loading}.
+This can be disabled with the @samp{-na} option.
+@xref{Mode Options, -na}.
+
+@item
Reads command files specified by the @samp{-x} option. @xref{Command
Files}, for more details about @value{GDBN} command files.
@@ -23114,15 +23125,18 @@ debugging commands and scripts.
Auto-loading can be enabled or disabled.
@table @code
-@kindex maint set python auto-load
-@item maint set python auto-load [yes|no]
-Enable or disable the Python auto-loading feature.
-
-@kindex maint show python auto-load
-@item maint show python auto-load
-Show whether Python auto-loading is enabled or disabled.
+@kindex set auto-load
+@item set auto-load [yes|no]
+Enable or disable the auto-loading of scripts.
+
+@kindex show auto-load
+@item show auto-load
+Show whether auto-loading is enabled or disabled.
@end table
+Auto-loading can also be disabled with the @samp{-na} command-line option.
+@xref{Mode Options, -na}.
+
When reading an auto-loaded file, @value{GDBN} sets the
@dfn{current objfile}. This is available via the @code{gdb.current_objfile}
function (@pxref{Objfiles In Python}). This can be useful for
Index: python/py-auto-load.c
===================================================================
RCS file: /cvs/src/src/gdb/python/py-auto-load.c,v
retrieving revision 1.5
diff -u -p -r1.5 py-auto-load.c
--- python/py-auto-load.c 22 Sep 2010 20:00:53 -0000 1.5
+++ python/py-auto-load.c 11 Dec 2010 00:23:23 -0000
@@ -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
@@ -81,12 +81,6 @@ struct loaded_script_entry
const char *full_path;
};
-/* 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;
-
/* Per-program-space data key. */
static const struct program_space_data *auto_load_pspace_data;
@@ -404,7 +398,7 @@ auto_load_new_objfile (struct objfile *o
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,15 +465,6 @@ 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."),
- NULL, NULL,
- &set_python_list,
- &show_python_list);
-
add_cmd ("section-scripts", class_maintenance, maintenance_print_section_scripts,
_("Print dump of auto-loaded section scripts matching REGEXP."),
&maintenanceprintlist);
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [patch, doc RFA] New command-line option -na.
2010-12-11 0:47 [patch, doc RFA] New command-line option -na Doug Evans
@ 2010-12-11 8:16 ` Eli Zaretskii
2010-12-15 1:40 ` Doug Evans
2010-12-13 18:55 ` Jan Kratochvil
1 sibling, 1 reply; 10+ messages in thread
From: Eli Zaretskii @ 2010-12-11 8:16 UTC (permalink / raw)
To: Doug Evans; +Cc: gdb-patches
> Date: Fri, 10 Dec 2010 16:47:34 -0800 (PST)
> From: dje@google.com (Doug Evans)
>
> This patch adds a new command-line option, -na, to disable auto-loading.
Thanks.
> --- NEWS 10 Dec 2010 20:33:44 -0000 1.414
> +++ NEWS 11 Dec 2010 00:23:22 -0000
> @@ -8,6 +8,11 @@
> -data-directory DIR Specify DIR as the "data-directory".
> This is mostly for testing purposes.
>
> +-na Disable the loading of auto-loaded scripts.
> +
> +* The "maint set python auto-load on|off" command has been renamed to
> + "set auto-load-scripts on|off".
> +
This part is okay.
> fputs_unfiltered (gdbinit, stream);
> fputs_unfiltered (_(" file.\n\
> + --na Do not auto-load scripts provided by the program.\n\
> --quiet Do not print version number on startup.\n\
> --readnow Fully read symbol files on first access.\n\
You used TABs, the other lines use spaces, so the options might not
align.
> +Enable or disable auto-loading of scripts when an object is opened."), _("\
The "object" part makes this doc strings less useful than it could be.
What "objects" are we talking about here? I think these are
executable program files and shared libraries, is that true? (Yes, I
know the original doc string used that, but it was an obscure maint
command back then.)
> +@item -na
> +@cindex @code{--na}
> +Do not auto-load scripts provided by the program.
Same here: "provided by the program" how? Yes, I know that the
cross-referenced node explains that in detail, but I would like us to
have here something that won't require every reader to go there in
order to understand. For example:
Do not auto-load scripts when programs or shared libraries are
loaded.
> +Loads any auto-loaded scripts provided by the program being debugged.
> +@xref{Auto-loading}.
In addition to the same rewording as above, this sounds inaccurate:
aren't these scripts loaded only as part of loading the debuggee's
executable file? If so, we should mention that here, because (AFAIU),
invoking GDB without any program as the argument won't trigger any
auto-loading.
> @table @code
> -@kindex maint set python auto-load
> -@item maint set python auto-load [yes|no]
> -Enable or disable the Python auto-loading feature.
> -
> -@kindex maint show python auto-load
> -@item maint show python auto-load
> -Show whether Python auto-loading is enabled or disabled.
> +@kindex set auto-load
> +@item set auto-load [yes|no]
> +Enable or disable the auto-loading of scripts.
> +
> +@kindex show auto-load
> +@item show auto-load
> +Show whether auto-loading is enabled or disabled.
> @end table
If we are going to leave this section inside the Python chapter, then
we should say "auto-load Python scripts" etc. elsewhere, because this
feature is limited to loading Python scripts, right?
Thanks.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [patch, doc RFA] New command-line option -na.
2010-12-11 0:47 [patch, doc RFA] New command-line option -na Doug Evans
2010-12-11 8:16 ` Eli Zaretskii
@ 2010-12-13 18:55 ` Jan Kratochvil
2010-12-13 19:28 ` Doug Evans
1 sibling, 1 reply; 10+ messages in thread
From: Jan Kratochvil @ 2010-12-13 18:55 UTC (permalink / raw)
To: Doug Evans; +Cc: gdb-patches
On Sat, 11 Dec 2010 01:47:34 +0100, Doug Evans wrote:
> The capability exists today with "maint set python auto-load on|off",
> but that can't be used to disable scripts from a program provided on
> the command line.
> In order to use that, one has to start gdb without a program,
> disable auto-loading, and *then* use the "file" command. Bleah.
I use the "file" trick commonly for example for:
gdb -ex 'set debug-file-directory /tmp/foo:/usr/lib/debug' -ex 'file /bin/date'
> I'm renaming "maint set python auto-load on|off" to
> "set auto-load-scripts on|off".
I would find this part as a sufficient one. Otherwise we should introduce
a command-line option also for "debug-file-directory" and probably others.
Do you find a common need for `-na'?
Regards,
Jan
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [patch, doc RFA] New command-line option -na.
2010-12-13 18:55 ` Jan Kratochvil
@ 2010-12-13 19:28 ` Doug Evans
2010-12-13 19:36 ` Doug Evans
0 siblings, 1 reply; 10+ messages in thread
From: Doug Evans @ 2010-12-13 19:28 UTC (permalink / raw)
To: Jan Kratochvil; +Cc: gdb-patches
On Mon, Dec 13, 2010 at 10:55 AM, Jan Kratochvil
<jan.kratochvil@redhat.com> wrote:
> On Sat, 11 Dec 2010 01:47:34 +0100, Doug Evans wrote:
>> The capability exists today with "maint set python auto-load on|off",
>> but that can't be used to disable scripts from a program provided on
>> the command line.
>> In order to use that, one has to start gdb without a program,
>> disable auto-loading, and *then* use the "file" command. Bleah.
>
> I use the "file" trick commonly for example for:
> gdb -ex 'set debug-file-directory /tmp/foo:/usr/lib/debug' -ex 'file /bin/date'
>
>
>> I'm renaming "maint set python auto-load on|off" to
>> "set auto-load-scripts on|off".
>
> I would find this part as a sufficient one. Otherwise we should introduce
> a command-line option also for "debug-file-directory" and probably others.
> Do you find a common need for `-na'?
The high order bit is the change to the option name.
I wonder if it'd be sufficiently useful to provide support for adding
new command-line options in python.
Then I could add -na in system.gdbinit.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [patch, doc RFA] New command-line option -na.
2010-12-13 19:28 ` Doug Evans
@ 2010-12-13 19:36 ` Doug Evans
0 siblings, 0 replies; 10+ messages in thread
From: Doug Evans @ 2010-12-13 19:36 UTC (permalink / raw)
To: Jan Kratochvil; +Cc: gdb-patches
On Mon, Dec 13, 2010 at 11:28 AM, Doug Evans <dje@google.com> wrote:
>>> I'm renaming "maint set python auto-load on|off" to
>>> "set auto-load-scripts on|off".
>>
>> I would find this part as a sufficient one. Otherwise we should introduce
>> a command-line option also for "debug-file-directory" and probably others.
>> Do you find a common need for `-na'?
>
> The high order bit is the change to the option name.
>
> I wonder if it'd be sufficiently useful to provide support for adding
> new command-line options in python.
> Then I could add -na in system.gdbinit.
... setting aside problems with -nx :-).
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [patch, doc RFA] New command-line option -na.
2010-12-11 8:16 ` Eli Zaretskii
@ 2010-12-15 1:40 ` Doug Evans
2010-12-15 6:05 ` Eli Zaretskii
0 siblings, 1 reply; 10+ messages in thread
From: Doug Evans @ 2010-12-15 1:40 UTC (permalink / raw)
To: Eli Zaretskii, Jan Kratochvil; +Cc: gdb-patches
[-- Attachment #1: Type: text/plain, Size: 2456 bytes --]
Note: I have removed -na.
On Sat, Dec 11, 2010 at 12:15 AM, Eli Zaretskii <eliz@gnu.org> wrote:
>> +Loads any auto-loaded scripts provided by the program being debugged.
>> +@xref{Auto-loading}.
>
> In addition to the same rewording as above, this sounds inaccurate:
> aren't these scripts loaded only as part of loading the debuggee's
> executable file? If so, we should mention that here, because (AFAIU),
> invoking GDB without any program as the argument won't trigger any
> auto-loading.
Reword per suggestion, but I kinda like the original wording.
The context here is startup, e.g. shared libraries aren't read at this point.
If you wish a different wording, can you provide one? Thanks.
>> @table @code
>> -@kindex maint set python auto-load
>> -@item maint set python auto-load [yes|no]
>> -Enable or disable the Python auto-loading feature.
>> -
>> -@kindex maint show python auto-load
>> -@item maint show python auto-load
>> -Show whether Python auto-loading is enabled or disabled.
>> +@kindex set auto-load
>> +@item set auto-load [yes|no]
>> +Enable or disable the auto-loading of scripts.
>> +
>> +@kindex show auto-load
>> +@item show auto-load
>> +Show whether auto-loading is enabled or disabled.
>> @end table
>
> If we are going to leave this section inside the Python chapter, then
> we should say "auto-load Python scripts" etc. elsewhere, because this
> feature is limited to loading Python scripts, right?
I like what it's in the patch.
There's no reason why one couldn't have non-python auto-loaded
scripts, and there's no reason at the moment for having a different
option to control them.
So I don't want "python" in the option name.
Having it the Python section of the manual is fine for now since
that's all we currently support.
Ok to check in?
2010-12-10 Doug Evans <dje@google.com>
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".
[-- Attachment #2: gdb-101214-auto-load-2.patch.txt --]
[-- Type: text/plain, Size: 5858 bytes --]
2010-12-10 Doug Evans <dje@google.com>
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".
Index: NEWS
===================================================================
RCS file: /cvs/src/src/gdb/NEWS,v
retrieving revision 1.414
diff -u -p -r1.414 NEWS
--- NEWS 10 Dec 2010 20:33:44 -0000 1.414
+++ NEWS 15 Dec 2010 01:29:46 -0000
@@ -8,6 +8,9 @@
-data-directory DIR Specify DIR as the "data-directory".
This is mostly for testing purposes.
+* The "maint set python auto-load on|off" command has been renamed to
+ "set auto-load-scripts on|off".
+
* GDB has a new command: "set directories".
It is like the "dir" command except that it replaces the
source path list instead of augmenting it.
Index: doc/gdb.texinfo
===================================================================
RCS file: /cvs/src/src/gdb/doc/gdb.texinfo,v
retrieving revision 1.779
diff -u -p -r1.779 gdb.texinfo
--- doc/gdb.texinfo 7 Dec 2010 17:26:03 -0000 1.779
+++ doc/gdb.texinfo 15 Dec 2010 01:29:47 -0000
@@ -1263,6 +1263,23 @@ to the program you are debugging, in the
@value{GDBN}.
@item
+Loads any auto-loaded scripts when programs or shared-libraries are loaded.
+@xref{Auto-loading}.
+
+If you wish to disable the auto-loading of scripts from a program
+specified on the command line, you must do something like the following:
+
+@smallexample
+$ gdb -ex "set auto-load-scripts off" -ex "file myprogram"
+@end smallexample
+
+The following does not work because the auto-loading is turned off too late:
+
+@smallexample
+$ gdb -ex "set auto-load-scripts off" myprogram
+@end smallexample
+
+@item
Reads command files specified by the @samp{-x} option. @xref{Command
Files}, for more details about @value{GDBN} command files.
@@ -23114,13 +23131,13 @@ debugging commands and scripts.
Auto-loading can be enabled or disabled.
@table @code
-@kindex maint set python auto-load
-@item maint set python auto-load [yes|no]
-Enable or disable the Python auto-loading feature.
-
-@kindex maint show python auto-load
-@item maint show python auto-load
-Show whether Python auto-loading is enabled or disabled.
+@kindex set auto-load-scripts
+@item set auto-load-scripts [yes|no]
+Enable or disable the auto-loading of scripts.
+
+@kindex show auto-load-scripts
+@item show auto-load-scripts
+Show whether auto-loading is enabled or disabled.
@end table
When reading an auto-loaded file, @value{GDBN} sets the
Index: python/py-auto-load.c
===================================================================
RCS file: /cvs/src/src/gdb/python/py-auto-load.c,v
retrieving revision 1.5
diff -u -p -r1.5 py-auto-load.c
--- python/py-auto-load.c 22 Sep 2010 20:00:53 -0000 1.5
+++ python/py-auto-load.c 15 Dec 2010 01:29:47 -0000
@@ -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 *o
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."),
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [patch, doc RFA] New command-line option -na.
2010-12-15 1:40 ` Doug Evans
@ 2010-12-15 6:05 ` Eli Zaretskii
2010-12-15 6:26 ` Doug Evans
0 siblings, 1 reply; 10+ messages in thread
From: Eli Zaretskii @ 2010-12-15 6:05 UTC (permalink / raw)
To: Doug Evans; +Cc: jan.kratochvil, gdb-patches
> X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED,
> T_DKIM_INVALID,T_RP_MATCHES_RCVD autolearn=ham version=3.3.1
> Date: Tue, 14 Dec 2010 17:40:10 -0800
> From: Doug Evans <dje@google.com>
> Cc: gdb-patches@sourceware.org
>
> >> +Loads any auto-loaded scripts provided by the program being debugged.
> >> +@xref{Auto-loading}.
> >
> > In addition to the same rewording as above, this sounds inaccurate:
> > aren't these scripts loaded only as part of loading the debuggee's
> > executable file? Â If so, we should mention that here, because (AFAIU),
> > invoking GDB without any program as the argument won't trigger any
> > auto-loading.
>
> Reword per suggestion, but I kinda like the original wording.
> The context here is startup, e.g. shared libraries aren't read at this point.
"Startup" is not well defined, from the user's POV. The manual uses
that term loosely as something vaguely understandable by everyone.
Wearing my user's hat, when I type "gdb core" or "gdb -p 1234",
everything GDB does before I get my first prompt is "startup". That
includes loading shared libraries (unless auto-solib-add is OFF),
AFAIK.
> If you wish a different wording, can you provide one? Thanks.
How about this one:
If the command line specified a program to debug, or a process to
attach to, or a core file, @value{GDBN} loads any auto-loaded
scripts provided for the program or for its loaded shared libraries.
@xref{Auto-Loading}.
> >> +@kindex set auto-load
> >> +@item set auto-load [yes|no]
> >> +Enable or disable the auto-loading of scripts.
> >> +
> >> +@kindex show auto-load
> >> +@item show auto-load
> >> +Show whether auto-loading is enabled or disabled.
> >> Â @end table
> >
> > If we are going to leave this section inside the Python chapter, then
> > we should say "auto-load Python scripts" etc. elsewhere, because this
> > feature is limited to loading Python scripts, right?
>
> I like what it's in the patch.
> There's no reason why one couldn't have non-python auto-loaded
> scripts, and there's no reason at the moment for having a different
> option to control them.
> So I don't want "python" in the option name.
> Having it the Python section of the manual is fine for now since
> that's all we currently support.
It's entirely unreasonable to have a command that is not limited to
Python in a Python specific section. We could either move it out or
say something like "Enable or disable auto-loading of Python scripts."
(Note that I didn't ask to have "python" in the option's name.)
Please choose one or the other; I can go with either one.
I'm also open to other suggestions, if you (or someone else) have
them.
Thanks.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [patch, doc RFA] New command-line option -na.
2010-12-15 6:05 ` Eli Zaretskii
@ 2010-12-15 6:26 ` Doug Evans
2010-12-15 6:58 ` Eli Zaretskii
0 siblings, 1 reply; 10+ messages in thread
From: Doug Evans @ 2010-12-15 6:26 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: jan.kratochvil, gdb-patches
On Tue, Dec 14, 2010 at 10:05 PM, Eli Zaretskii <eliz@gnu.org> wrote:
> "Startup" is not well defined, from the user's POV. The manual uses
> that term loosely as something vaguely understandable by everyone.
> Wearing my user's hat, when I type "gdb core" or "gdb -p 1234",
> everything GDB does before I get my first prompt is "startup". That
> includes loading shared libraries (unless auto-solib-add is OFF),
> AFAIK.
Actually, give it a try.
$ gdb hello
(gdb) info shared
No shared libraries loaded at this time.
(gdb)
>> If you wish a different wording, can you provide one? Thanks.
>
> How about this one:
>
> If the command line specified a program to debug, or a process to
> attach to, or a core file, @value{GDBN} loads any auto-loaded
> scripts provided for the program or for its loaded shared libraries.
> @xref{Auto-Loading}.
Works for me, but I'll take out "or for its loaded shared libraries". Ok?
>
>> >> +@kindex set auto-load
>> >> +@item set auto-load [yes|no]
>> >> +Enable or disable the auto-loading of scripts.
>> >> +
>> >> +@kindex show auto-load
>> >> +@item show auto-load
>> >> +Show whether auto-loading is enabled or disabled.
>> >> @end table
>> >
>> > If we are going to leave this section inside the Python chapter, then
>> > we should say "auto-load Python scripts" etc. elsewhere, because this
>> > feature is limited to loading Python scripts, right?
>>
>> I like what it's in the patch.
>> There's no reason why one couldn't have non-python auto-loaded
>> scripts, and there's no reason at the moment for having a different
>> option to control them.
>> So I don't want "python" in the option name.
>> Having it the Python section of the manual is fine for now since
>> that's all we currently support.
>
> It's entirely unreasonable to have a command that is not limited to
> Python in a Python specific section. We could either move it out or
> say something like "Enable or disable auto-loading of Python scripts."
> (Note that I didn't ask to have "python" in the option's name.)
> Please choose one or the other; I can go with either one.
>
> I'm also open to other suggestions, if you (or someone else) have
> them.
I disagree. The option is only applicable to Python scripts today, so
why not leave it where it is?
We can always move it later.
But I'll go with mentioning python in the command's text.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [patch, doc RFA] New command-line option -na.
2010-12-15 6:26 ` Doug Evans
@ 2010-12-15 6:58 ` Eli Zaretskii
2010-12-15 7:09 ` Doug Evans
0 siblings, 1 reply; 10+ messages in thread
From: Eli Zaretskii @ 2010-12-15 6:58 UTC (permalink / raw)
To: Doug Evans; +Cc: jan.kratochvil, gdb-patches
> Date: Tue, 14 Dec 2010 22:25:52 -0800
> From: Doug Evans <dje@google.com>
> Cc: jan.kratochvil@redhat.com, gdb-patches@sourceware.org
>
> On Tue, Dec 14, 2010 at 10:05 PM, Eli Zaretskii <eliz@gnu.org> wrote:
> > "Startup" is not well defined, from the user's POV. Â The manual uses
> > that term loosely as something vaguely understandable by everyone.
> > Wearing my user's hat, when I type "gdb core" or "gdb -p 1234",
> > everything GDB does before I get my first prompt is "startup". Â That
> > includes loading shared libraries (unless auto-solib-add is OFF),
> > AFAIK.
>
> Actually, give it a try.
>
> $ gdb hello
> (gdb) info shared
> No shared libraries loaded at this time.
> (gdb)
What about "gdb core" or "gdb -p PID"? These are the 2 use-cases I
mentioned that involve loading the shared libraries. I know that "gdb
hello" doesn't do that until you actually run the inferior.
> > Â If the command line specified a program to debug, or a process to
> > Â attach to, or a core file, @value{GDBN} loads any auto-loaded
> > Â scripts provided for the program or for its loaded shared libraries.
> > Â @xref{Auto-Loading}.
>
> Works for me, but I'll take out "or for its loaded shared libraries". Ok?
Let's not decide until we are done discussing the above two use-cases.
> The option is only applicable to Python scripts today, so
> why not leave it where it is?
> We can always move it later.
> But I'll go with mentioning python in the command's text.
That's fine with me, as I wrote.
Thanks.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [patch, doc RFA] New command-line option -na.
2010-12-15 6:58 ` Eli Zaretskii
@ 2010-12-15 7:09 ` Doug Evans
0 siblings, 0 replies; 10+ messages in thread
From: Doug Evans @ 2010-12-15 7:09 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: jan.kratochvil, gdb-patches
On Tue, Dec 14, 2010 at 10:58 PM, Eli Zaretskii <eliz@gnu.org> wrote:
> What about "gdb core" or "gdb -p PID"? These are the 2 use-cases I
> mentioned that involve loading the shared libraries. I know that "gdb
> hello" doesn't do that until you actually run the inferior.
Righto.
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2010-12-15 7:09 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-12-11 0:47 [patch, doc RFA] New command-line option -na Doug Evans
2010-12-11 8:16 ` Eli Zaretskii
2010-12-15 1:40 ` Doug Evans
2010-12-15 6:05 ` Eli Zaretskii
2010-12-15 6:26 ` Doug Evans
2010-12-15 6:58 ` Eli Zaretskii
2010-12-15 7:09 ` Doug Evans
2010-12-13 18:55 ` Jan Kratochvil
2010-12-13 19:28 ` Doug Evans
2010-12-13 19:36 ` Doug Evans
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox