[patch#2 3/6] set auto-load local-gdbinit warn-and-*
Doug Evans
dje@google.com
Thu Mar 29 20:58:00 GMT 2012
On Thu, Mar 29, 2012 at 2:12 AM, Jan Kratochvil
<jan.kratochvil@redhat.com> wrote:
> Hi,
>
> it does not change any default behavior (that's done in [patch 6/6]) but it
> gives an option to warn on .gdbinit files (which become deprecated).
Deprecating .gdbinit files requires a NEWS entry.
[But maybe that's in a later patch.]
And are we *really* sure we want to deprecate them?
I don't read every thread (and forget half I do read :-() so I may
have missed a high level decision.
> --- a/gdb/NEWS
> +++ b/gdb/NEWS
> @@ -141,7 +141,7 @@ set auto-load python-scripts on|off
> show auto-load python-scripts
> Control auto-loading of Python script files.
>
> -set auto-load local-gdbinit on|off
> +set auto-load local-gdbinit on|off|warn-and-on|warn-and-off
> show auto-load local-gdbinit
> Control loading of init file (.gdbinit) from current directory.
>
While I realize you might be trying to avoid adding another option,
combining warn on/off with auto-load on/off is a bit odd. Is it
possible to look at this differently and have the warning apply to
more than just local-gdbinit (thus being a more useful option and thus
being less of a pain to add)?
E.g., a warning for using deprecated features or some such.
[Or maybe we want a warning for each such feature, dunno.]
> + struct stat statbuf;
> +
> + if (fstat (fd, &statbuf) == 0
> + && memcmp (&statbuf, &local_gdbinit_stat,
> + sizeof (statbuf)) == 0)
> + local_gdbinit = NULL;
This assumes absence of padding.
More information about the Gdb-patches
mailing list