From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 33449 invoked by alias); 17 Oct 2019 07:00:40 -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 33362 invoked by uid 89); 17 Oct 2019 07:00:40 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-16.1 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,SPF_PASS autolearn=ham version=3.3.1 spammy=H*r:4.82, H*r:142, H*r:sk:fencepo, H*r:470 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; Thu, 17 Oct 2019 07:00:38 +0000 Received: from fencepost.gnu.org ([2001:470:142:3::e]:59894) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1iKzlz-0007AD-HK; Thu, 17 Oct 2019 03:00:35 -0400 Received: from [176.228.60.248] (port=1136 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1iKzly-0006AF-MT; Thu, 17 Oct 2019 03:00:35 -0400 Date: Thu, 17 Oct 2019 07:00:00 -0000 Message-Id: <83ftjrdfge.fsf@gnu.org> From: Eli Zaretskii To: cbiesinger@google.com CC: gdb-patches@sourceware.org, tdevries@suse.de, simon.marchi@polymtl.ca In-reply-to: <20191016221835.354DA20AF6@gnutoolchain-gerrit.osci.io> Subject: Re: [review] Load system gdbinit files from a directory References: <20191016221835.354DA20AF6@gnutoolchain-gerrit.osci.io> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-IsSubscribed: yes X-SW-Source: 2019-10/txt/msg00550.txt.bz2 > Date: Wed, 16 Oct 2019 18:18:34 -0400 > From: "Christian Biesinger (Code Review)" > Cc: Tom de Vries , Simon Marchi > > gdb/ChangeLog: > > 2019-08-20 Christian Biesinger > > * NEWS: Mention new --with-system-gdbinit-dir option. > * config.in: Regenerate. > * configure: Regenerate. > * configure.ac: Add new option --with-system-gdbinit-dir. > * extension.c (get_ext_lang_of_file): Return extension_language_gdb > for a ".gdb" suffix. > * main.c (get_init_files): Change system_gdbinit argument to > a vector and return the files in SYSTEM_GDBINIT_DIR in > addition to SYSTEM_GDBINIT. > (captured_main_1): Update. > (print_gdb_help): Update. > * top.c (print_gdb_configuration): Also print the value of > SYSTEM_GDBINIT_DIR. > > gdb/doc/ChangeLog: > > 2019-08-25 Christian Biesinger > > * Makefile.in: Also set SYSTEM_GDBINIT_DIR for the info manual > generation. > * gdb.texinfo (many sections): Document new --with-system-gdbinit-dir > option. I think I already approved the changes to the documentation, didn't I? > diff --git a/gdb/NEWS b/gdb/NEWS > index 25e67e4..7613598 100644 > --- a/gdb/NEWS > +++ b/gdb/NEWS > @@ -46,6 +46,12 @@ > The 'outer_function::' prefix is only needed if 'inner_function' is > not visible in the current scope. > > +* In addition to the system-wide gdbinit file, if configured with > + --with-system-gdbinit-dir, GDB will now also load files in that directory > + as system gdbinit files, unless the -nx or -n flag is provided. Files > + with extensions .gdb, .py and .scm are supported as long as GDB was > + compiled with support for that language. OK for this part. > +@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 in alphabetical order immediately after > +system.gdbinit (if enabled) when @value{GDBN} starts, before command line > +options have been processed. Files need to have a recognized scripting > +language extension (@code{.py}/@code{.scm}) or be named with a @code{.gdb} File-name extensions should have the @file markup. > @@ -1315,8 +1325,11 @@ > @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. The files need to be named with a @code{.gdb} > +extension to be interpreted as @value{GDBN} commands, or they can be written > +in a supported scripting language with an appropriate file extension. Likewise here, and elsewhere in the patch. Thanks.