From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 82413 invoked by alias); 12 Sep 2019 22:12:35 -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 82404 invoked by uid 89); 12 Sep 2019 22:12:35 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-20.8 required=5.0 tests=AWL,BAYES_00,ENV_AND_HDR_SPF_MATCH,GIT_PATCH_1,RCVD_IN_DNSWL_NONE,SPF_PASS,USER_IN_DEF_SPF_WL autolearn=ham version=3.3.1 spammy=Standards X-HELO: mail-ot1-f67.google.com Received: from mail-ot1-f67.google.com (HELO mail-ot1-f67.google.com) (209.85.210.67) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 12 Sep 2019 22:12:33 +0000 Received: by mail-ot1-f67.google.com with SMTP id g19so27583239otg.13 for ; Thu, 12 Sep 2019 15:12:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=IUoTdyMKXIXdQbm0zGu/t3hqfihU/HeD4zDHsWPOXVM=; b=uAvU1AZBx0WIrGlIwVAPnBHitYPyXS3mKapchLhz6fs2tmmIe1D47iAN11OFsx8j/Y LumPYDJik1PBmREpHrNifkwzVCWCPsf9O/BERBcAPds+bTqtsfRc59i2Q15Jnh5SI//P jFOlPPZIymWC0ghQzee2OXQyeQg7EpsWfFSa0YapYTJmcUEPwK9XVCcrTXwsDojUb7wc qom/P5fv+AUstmjy1tFUnxPujzGQ7cD7TjfQIWX0l6q5h1gaTdOz4odKyJgfaEQJU2bz 2rJNUMxyO/Yz275wdP9r4+hwxZiIwciCieYbSPVxr5KYidCqHwcEk5QW2s6c2kfjsOv6 YBPw== MIME-Version: 1.0 References: <20190826003310.86830-1-cbiesinger@google.com> <831rx8gzlc.fsf@gnu.org> In-Reply-To: <831rx8gzlc.fsf@gnu.org> From: "Christian Biesinger via gdb-patches" Reply-To: Christian Biesinger Date: Thu, 12 Sep 2019 22:12:00 -0000 Message-ID: Subject: Re: [PATCH 3/3 v2] Load system gdbinit files from a directory To: Eli Zaretskii Cc: gdb-patches Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes X-SW-Source: 2019-09/txt/msg00227.txt.bz2 Thanks for the review! On Mon, Aug 26, 2019 at 2:22 AM Eli Zaretskii wrote: > > > 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". Done. > > +* 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. Done. > > + 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). I think I fixed all occurrences. (searching gdb.texinfo for "\. [^ ]" found a lot of existing places that do it wrong :( ) > > +@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. I changed it now so that only .gdb/.py/.scm is loaded, and documented that. > We should probably also say that the order the > files are loaded is arbitrary. They're actually alphabetically sorted; added a note in the documentation about that. > Also, we should say something about > that directory including subdirectories, because I think the reader > might wonder about that. Done. > > @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? Yes. > 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"? No, that is not consulted for these files (if it were, the system gdbinit file or ~/.gdbinit would not work in the common case, because the auto-load path is $debugdir:$datadir/auto-load) > > +@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. Changed to "absolute directory name"; I didn't want to use "file name" for a directory. (looks like a number of other occurrences in gdb.texinfo should be changed too...) > > +@ifset SYSTEM_GDBINIT > > +@value{SYSTEM_GDBINIT_DIR}/* > > +@end ifset > > @ifset SYSTEM_GDBINIT or @ifset SYSTEM_GDBINIT_DIR? Thanks, fixed. Will send a new patch in a second. Christian