Re: [PATCH 2/7] gdb: use get_standard_config_dir when looking for .gdbinit

Andrew Burgess
2020-11-02T10:20:27Z

* Eli Zaretskii <eliz@gnu.org> [2020-10-08 09:52:14 +0300]:

> > From: Andrew Burgess <andrew.burgess@embecosm.com>
> > Date: Wed, 7 Oct 2020 21:05:06 +0100
> > Cc: Tom Tromey <tom@tromey.com>
> >
> > This commit effectively changes the default location of the .gdbinit
> > file, while maintaining backward compatibility.
> >
> > For non Apple hosts the .gdbinit file will now be looked for in the
> > following locations:
> >
> > $XDG_CONFIG_HOME/gdb/gdbinit
> > $HOME/.config/gdb/gdbinit
> > $HOME/.gdbinit
> >
> > On Apple hosts the search order is instead:
> >
> > $HOME/Library/Preferences/gdb/gdbinit
> > $HOME/.gdbinit
>
> Thanks.
>
> I still wonder why we treat Apple specially here.
>
> > +Do not execute commands found in any initialization file
>
> "files"
>
> Also, I think this should say "in any startup or initialization
> files", as startup file loading is also prevented, right?
>
> > +(@pxref{Initialization Files}).
>
> There should be a cross-reference to where startup files are described
> as well.

Eli,

Thanks for the review.

I'm going to push the first 3 patches in this series as they have had
positive feedback, and can be considered separate from the other 4
patches.

As these first 3 don't introduce startup files (they were just setup
for that) then I'll not make the startup file related changes you
suggest here, instead I'll make these changes in the later patches as
I rebase them.

The other fixes you have suggested I have of course made.

Thanks,
Andrew

>
> > +As the system wide and home directory initialization files are
> > +@value{GDBN} will check the current directory for a file called
> > +@file{./.gdbinit}. It is loaded last, after command line options
> ^^^^^^^^^^
> The "./" part is redundant here.