Re: [PATCH 0/7] Adding startup files to GDB

Andrew Burgess
2020-10-28T15:29:41Z

* Tom Tromey <tom@tromey.com> [2020-10-22 13:02:07 -0600]:

> Andrew> Patch #4 adds the startup file support. Compared to Tom's original work:
> Andrew> (a) there's no auto saving of startup options,
>
> Andrew> (b) there's command line flag support for passing startup options
> Andrew> to GDB.
>
> Andrew> (c) there's support for a home directory and current working
> Andrew> directory startup file (only because this is basically free
> Andrew> given the restructuring of the code).
>
> Andrew> Patch #5 adds back the auto-save feature from Tom's series, however, I
> Andrew> have this off by default. I (personally) dislike the auto-save
> Andrew> feature, though I can see why some users might want it. I hope the
> Andrew> proposal I have here is might be a good middle ground.
>
> Could you say why you dislike it?

Sure. I just have a general dislike of tools that auto-write config
files. I prefer to be able to modify these files myself.

I guess the counter position is that a user should never be touching
these files by hand, they should be considered more of an internal
cache.

Another area where auto-saving might cause problems might be if a user
runs multiple versions of GDB (e.g. a desktop version, and several
different versions built to debug different remote targets), if these
versions have different sets of features that they auto-save then a
user will end up "loosing" settings in some cases I think.
>
> The reason I did it the way I did is that I thought it was strange to
> have a command like "set startup-blah-blah off" that would be useless to
> use in a running gdb. It seemed to me that the name & intended use of
> the command implied auto-saving.

Understood.

>
> Regardless of the choice here, I don't think it makes sense to have
> another option to control whether the first options are auto-saved.
> This is "feature to enable a feature" territory for me.

I don't really understand what "feature to enable a feature" means.
Does this mean you don't see any way that having a flag to control
auto-saving could be acceptable? What if it was just simple that I
proposed here, say 'set auto-save-startup-options on|off', which could
then be placed in to the startup file to disable auto-save?

Thanks,
Andrew