From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4543 invoked by alias); 17 Jan 2012 20:49:35 -0000 Received: (qmail 4531 invoked by uid 22791); 17 Jan 2012 20:49:31 -0000 X-SWARE-Spam-Status: No, hits=-3.0 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_LOW,TW_BJ,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail-vw0-f41.google.com (HELO mail-vw0-f41.google.com) (209.85.212.41) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 17 Jan 2012 20:49:18 +0000 Received: by vbbfa15 with SMTP id fa15so2399022vbb.0 for ; Tue, 17 Jan 2012 12:49:18 -0800 (PST) Received: by 10.52.155.196 with SMTP id vy4mr3403106vdb.12.1326833358043; Tue, 17 Jan 2012 12:49:18 -0800 (PST) MIME-Version: 1.0 Received: by 10.52.155.196 with SMTP id vy4mr3403093vdb.12.1326833357957; Tue, 17 Jan 2012 12:49:17 -0800 (PST) Received: by 10.220.229.1 with HTTP; Tue, 17 Jan 2012 12:49:17 -0800 (PST) In-Reply-To: <20120117203507.GA19670@host2.jankratochvil.net> References: <20120117095552.GA6141@host2.jankratochvil.net> <20120117162621.GA3883@host2.jankratochvil.net> <837h0q5i4u.fsf@gnu.org> <20120117175957.GA9415@host2.jankratochvil.net> <20120117203507.GA19670@host2.jankratochvil.net> Date: Tue, 17 Jan 2012 20:54:00 -0000 Message-ID: Subject: Re: [patch] New set auto-load-local-gdbinit + disable it by default From: Doug Evans To: Jan Kratochvil Cc: Tom Tromey , Eli Zaretskii , gdb-patches@sourceware.org X-System-Of-Record: true Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 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-01/txt/msg00648.txt.bz2 On Tue, Jan 17, 2012 at 12:35 PM, Jan Kratochvil wrote: > On Tue, 17 Jan 2012 21:28:29 +0100, Tom Tromey wrote: >> I think gdb has touted this -- rightly -- as a feature. =A0And, if >> anything, I think we've gone even more in this direction in recent >> years, what with pretty-printers and Python auto-loading. =A0Furthermore, >> I think this is a good trend in general; applications are getting more >> complex, and this provides an important way to adapt the debugger to >> them. > > In such case the `canned sequences of commands' should be bound to the bi= nary, > not to the directory. =A0One (me) runs GDB for so many different executab= lse > while staying in src/gdb/ . Or in binutils, for example, there are lots of different binaries, though they share a lot in common. For reference sake, we already have -gdb.py, which is looked for when the objfile is loaded. echo "print 'Hi there.'" > gdb-gdb.py && gdb -nx gdb One could have objdump-gdb.py and readelf-gdb.py, and then if I change binaries mid-session, the new one will get loaded, which can't happen with .gdbinit. [And to what extent vestiges of the old one get discarded depends on what was done. I can imagine wanting to be able to keep more state per-main-objfile. I could be simultaneously debugging gdb and readelf, and not want to see (top-gdb) (or (^gdb) or whatever) when I switch to readelf. :-)