From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 119292 invoked by alias); 26 Aug 2019 07:22:59 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 119275 invoked by uid 89); 26 Aug 2019 07:22:59 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-6.1 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_1,SPF_PASS autolearn=ham version=3.3.1 spammy=lacks X-HELO: eggs.gnu.org Received: from eggs.gnu.org (HELO eggs.gnu.org) (209.51.188.92) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 26 Aug 2019 07:22:57 +0000 Received: from fencepost.gnu.org ([2001:470:142:3::e]:35425) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1i29L5-0005kh-Ca; Mon, 26 Aug 2019 03:22:55 -0400 Received: from [176.228.60.248] (port=2346 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1i29L4-0001CV-OT; Mon, 26 Aug 2019 03:22:55 -0400 Date: Mon, 26 Aug 2019 07:22:00 -0000 Message-Id: <831rx8gzlc.fsf@gnu.org> From: Eli Zaretskii To: Christian Biesinger CC: gdb-patches@sourceware.org In-reply-to: <20190826003310.86830-1-cbiesinger@google.com> (gdb-patches@sourceware.org) Subject: Re: [PATCH 3/3 v2] Load system gdbinit files from a directory References: <20190826003310.86830-1-cbiesinger@google.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-IsSubscribed: yes X-SW-Source: 2019-08/txt/msg00585.txt.bz2 > Date: Sun, 25 Aug 2019 19:33:10 -0500 > From: "Christian Biesinger via gdb-patches" > Cc: Christian Biesinger > > Adds a configure option --with-system-gdbinit-dir to specify a directory > in which to look for gdbinit files. All files in this directory are > loaded on startup (subject to -n/-nx as usual). I think this option's value should be displayed by "show configuration" and by "gdb --config". > +* If configured with --with-system-gdbinit-dir, GDB will now also load I think "also" here might be confusing, because it lacks context. I think we should say explicitly "in addition to the system-wide gdbinit file" instead. > + all files in that directory as system gdbinit files, unless the -nx > + or -n flag is provided. These files can be written in any supported Two spaces between sentences (here and elsewhere throughout the patch). > +@item @file{system.gdbinit.d} > +This is the system-wide init directory. > +Its location is specified with the @code{--with-system-gdbinit-dir} > +configure option (@pxref{System-wide configuration}). > +Files in this directory are loaded immediately after system.gdbinit (if > +enabled) when @value{GDBN} starts, before command line options have been > +processed. I'm not sure I understand: _all_ files in that directory will be loaded, regardless of how they are named? If so, I think we should say that explicitly. We should probably also say that the order the files are loaded is arbitrary. Also, we should say something about that directory including subdirectories, because I think the reader might wonder about that. > @cindex init file > Reads the system-wide @dfn{init file} (if @option{--with-system-gdbinit} was > used when building @value{GDBN}; @pxref{System-wide configuration, > - ,System-wide configuration and settings}) and executes all the commands in > -that file. > + ,System-wide configuration and settings}) and the files in the system-wide > +gdbinit directory (if @option{--with-system-gdbinit-dir} was used) and executes > +all the commands in those files. If scripting languages are enabled, the files > +can be written in any of the supported languages as long as the extension matches > +the language. Is the order of reading as described, i.e. the file first, then the files in the directory? Btw, how does this option interact with auto-load safe-path? Would GDB refuse to load init files from this directory if it considers them "unsafe"? > +@item --with-system-gdbinit-dir=@var{directory} > +Configure @value{GDBN} to automatically load init files from a > +system-wide directory. @var{directory} should be an absolute path. ^^^^^^^^^^^^^ "absolute file name". The Gnu Coding Standards frown on using "path" for anything that is not PATH-style lists of directories. > +@ifset SYSTEM_GDBINIT > +@value{SYSTEM_GDBINIT_DIR}/* > +@end ifset @ifset SYSTEM_GDBINIT or @ifset SYSTEM_GDBINIT_DIR? Thanks.