From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15298 invoked by alias); 1 Apr 2013 12:29:54 -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 15252 invoked by uid 89); 1 Apr 2013 12:29:45 -0000 X-Spam-SWARE-Status: No, score=-7.5 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.1 Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Mon, 01 Apr 2013 12:29:39 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r31CTaF6011579 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 1 Apr 2013 08:29:36 -0400 Received: from host2.jankratochvil.net (ovpn-116-23.ams2.redhat.com [10.36.116.23]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r31CTVbK025192 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Mon, 1 Apr 2013 08:29:33 -0400 Date: Mon, 01 Apr 2013 12:41:00 -0000 From: Jan Kratochvil To: Pedro Alves Cc: mbilal , gdb-patches@sourceware.org, tromey@redhat.com Subject: Re: Fwd: [PATCH] Fix for PR gdb/15224 should "set history save on" by default Message-ID: <20130401122930.GA14029@host2.jankratochvil.net> References: <51558CB4.8010003@codesourcery.com> <51558EC5.2030806@codesourcery.com> <20130329141514.GA16671@host2.jankratochvil.net> <5159707E.9090209@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5159707E.9090209@redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes X-SW-Source: 2013-04/txt/msg00006.txt.bz2 On Mon, 01 Apr 2013 13:33:18 +0200, Pedro Alves wrote: > The commands issued in MI sessions aren't added to the history, as when the top > level interpreter is MI, GDB doesn't use readline/history (look for add_history). That's better than what I assumed. This would mean 'set history save off' in GDB testsuite could be sufficient. > It could be argued that commands executed through "-interpreter-exec console" > should make it to the history. Then we'd have the problem that cli > commands that frontends issue because there are no MI alternatives would > appear on the history. But, we already have a solution for that -- the > "server" command/prefix > (http://sourceware.org/gdb/onlinedocs/gdb/Server-Prefix.html#Server-Prefix). There is also needed backward compatibility with existing frontends. The default for -i=mi could be made "set history save off" and new frontends which properly recognize user commands vs. "server" commands could use during initialization: -interpreter-exec console "set history save on" > > I was thinking to just bind the default WRITE_HISTORY_P to > > whether ~/.gdbinit is being read or not. > > The history's filename is also tweakable with the GDBHISTFILE > environment variable (there's HISTSIZE too; 'GDBHISTFILE= gdb' effectively > disables history load/save). Doesn't feel quite right to tie this to .gdbinit. It matters how are the existing environments set up. And by default neither HISTSIZE nor GDBHISTFILE environment variables are set. Binding it to ~/.gdbinit is really ugly but I did not have a better idea compatible with existing GDB scripts/frontends/testsuites. > One possible counter argument to flipping this on would that since history > files are saved to the current directory by default, this has potential for > littering users' directories with (hidden) .gdb_history files without the > users noticing. We should at least make that fact explicit in NEWS and > perhaps make it prominent in the manual. I see there should be also changed the default to: set history filename ~/.gdb_history Otherwise it is a similar pain to ./.gdbinit, it is also non-standard to any other normal application which use history files in $HOME, I do not find using ./.gdb_history by default as acceptable. Jan