From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6215 invoked by alias); 16 Jun 2012 21:14:36 -0000 Received: (qmail 6202 invoked by uid 22791); 16 Jun 2012 21:14:35 -0000 X-SWARE-Spam-Status: No, hits=-4.1 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,RCVD_IN_DNSWL_NONE,RCVD_IN_HOSTKARMA_NO,SPF_SOFTFAIL X-Spam-Check-By: sourceware.org Received: from mtaout22.012.net.il (HELO mtaout22.012.net.il) (80.179.55.172) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 16 Jun 2012 21:14:12 +0000 Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0M5Q00I00AWUPA00@a-mtaout22.012.net.il> for gdb-patches@sourceware.org; Sun, 17 Jun 2012 00:14:11 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.210.75]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0M5Q00IZ1AZMHX30@a-mtaout22.012.net.il>; Sun, 17 Jun 2012 00:14:11 +0300 (IDT) Date: Sat, 16 Jun 2012 21:14:00 -0000 From: Eli Zaretskii Subject: Re: [patch] -iex and -ix: Execute them _after_ gdbinits In-reply-to: <20120616201312.GA7000@host2.jankratochvil.net> To: Jan Kratochvil Cc: gdb-patches@sourceware.org Reply-to: Eli Zaretskii Message-id: <83sjdvdkns.fsf@gnu.org> References: <20120616195417.GA6368@host2.jankratochvil.net> <83txybdnue.fsf@gnu.org> <20120616201312.GA7000@host2.jankratochvil.net> 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/msg00552.txt.bz2 > Date: Sat, 16 Jun 2012 22:13:12 +0200 > From: Jan Kratochvil > Cc: gdb-patches@sourceware.org > > > > 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 My concern is about what happens before ~/.gdbinit is loaded, so nothing that happens after that can resolve that. > If you are in directory ~ then the .gdbinit file is considered to be > ~/.gdbinit (and not inferior .gdbinit). > > Does it answer your question? No, see above. > > > 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. It doesn't have to be better. It has the advantage of being there first. It's the new behavior that must have a significant advantage to justify an incompatible change of behavior. > > > 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. But setting auto-load is not the only thing I can do with -iex. I can have any number of commands there which have nothing to do with safe-path and stuff. We are removing a potentially useful feature for reasons that were not justified well enough. Are there any reasons beyond the auto-load issue? If not, I submit the reasons are not grave enough for the change, certainly not in a minor release. And I don't see why we should pay so much attention to what Fedora does in its GDB distribution. For example, I always build my own GDB, on any platform I work, and I don't see why I should be punished because Fedora does something.