From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31820 invoked by alias); 16 Jun 2012 20:13:52 -0000 Received: (qmail 31812 invoked by uid 22791); 16 Jun 2012 20:13:51 -0000 X-SWARE-Spam-Status: No, hits=-6.2 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 16 Jun 2012 20:13:38 +0000 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q5GKDYX4012394 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sat, 16 Jun 2012 16:13:35 -0400 Received: from host2.jankratochvil.net (ovpn-116-33.ams2.redhat.com [10.36.116.33]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q5GKDL3G013331 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Sat, 16 Jun 2012 16:13:27 -0400 Date: Sat, 16 Jun 2012 20:13:00 -0000 From: Jan Kratochvil To: Eli Zaretskii Cc: gdb-patches@sourceware.org Subject: Re: [patch] -iex and -ix: Execute them _after_ gdbinits Message-ID: <20120616201312.GA7000@host2.jankratochvil.net> References: <20120616195417.GA6368@host2.jankratochvil.net> <83txybdnue.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <83txybdnue.fsf@gnu.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes 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 X-SW-Source: 2012-06/txt/msg00551.txt.bz2 On Sat, 16 Jun 2012 22:05:29 +0200, Eli Zaretskii wrote: > > Date: Sat, 16 Jun 2012 21:54:17 +0200 > > From: Jan Kratochvil > > > > Before 7.5 gets branched/released I would like to yet change behavior of this > > new feature. The current order is: > > 1. -iex and -ix > > 2. /etc/gdbinit, ~/.gdbinit > > 2. inferior load > > 3. -ex and -x etc. > > > > I would like to swap 1 <-> 2: > > 1. /etc/gdbinit, ~/.gdbinit > > 2. -iex and -ix > > 2. inferior load > > 3. -ex and -x etc. > > That would make it impossible to run a command before loading > .gdbinit, right? There is additionally: 4. load .gdbinit from the inferior's directory If you are in directory ~ then the .gdbinit file is considered to be ~/.gdbinit (and not inferior .gdbinit). Does it answer your question? Do you see any problem with the new behavior. > > In practice I found I need to override 'set auto-load safe-path ...' pre-set > > by ~/.gdbinit for specific GDB runs by -iex. There is no other way to do it. > > We could invent some other way of doing that, but without taking away > what users can do now. I have not found a use case where the current behavior is better. > > Contrary to it I cannot imagine why one would want to get -iex commands > > overriden by /etc/gdbinit and ~/.gdbinit. > > Not overriden by, _executed_before_. I also agree with "executed before" but in practice it means that if distro for example (Fedora does not) puts into /etc/gdbinit: set auto-load safe-path /opt:/distro-dir:/bin Then there is no chance to use -iex 'set auto-load safe-path ...' currently. (One can use add-auto-load-safe-path everywhere which would work, but then still one cannot remove/reset directories.) Thanks, Jan