From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 81025 invoked by alias); 17 Jun 2015 18:19:36 -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 81012 invoked by uid 89); 17 Jun 2015 18:19:35 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_LOW autolearn=no version=3.3.2 X-HELO: mail-oi0-f52.google.com Received: from mail-oi0-f52.google.com (HELO mail-oi0-f52.google.com) (209.85.218.52) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Wed, 17 Jun 2015 18:19:34 +0000 Received: by oiyy130 with SMTP id y130so23384166oiy.0 for ; Wed, 17 Jun 2015 11:19:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=jZBcx2hb4/IteL6epJwMlrYP5NNuVwCNfCGZmJnv9DY=; b=BrihJHUgT1jqSD0lxJpKXGOE8TUT79EYHAVM7umRg9lVTITC+GFKaprTdPLdYQmGPI nUHflZIuBh6qEOPb/qAL1VmiMSurUxbqUc91kTIsLUyF3j+HKgclbQ60vcGzim7cUSd5 WQtfkQRG9gRvv4PK5Y28FOlUVR0Ccl9UZ5D6ulctgsM4yxCooeOiqVqy5iLsHp113J/x lVfXvP5QWerEsL7NGwUoQV53KLqtN1nYRdycz8MlDCEF6u+lvyZf4rVjulnA5BW+2IV9 C3qQLbfp3RWnFQDOClvjMtx9qEtfKxIxpwt2c8ejgurRYWqTVHvKDSkdDKvdTnM92lCj 3h4g== X-Gm-Message-State: ALoCoQlSo942AqPtVYgNIuXyjtYP/w2QQX4ezlnjxobLawQlhWGB9R49iEf1xSx43WNhvUryyCkO X-Received: by 10.182.153.197 with SMTP id vi5mr5722027obb.28.1434565172653; Wed, 17 Jun 2015 11:19:32 -0700 (PDT) MIME-Version: 1.0 Received: by 10.182.96.167 with HTTP; Wed, 17 Jun 2015 11:19:12 -0700 (PDT) In-Reply-To: <1432293831-23599-1-git-send-email-patrick@parcs.ath.cx> References: <1432293831-23599-1-git-send-email-patrick@parcs.ath.cx> From: Patrick Palka Date: Wed, 17 Jun 2015 18:19:00 -0000 Message-ID: Subject: Re: [PATCH 1/2] Read $GDBHISTSIZE instead of $HISTSIZE To: "gdb-patches@sourceware.org" Cc: Patrick Palka Content-Type: text/plain; charset=UTF-8 X-SW-Source: 2015-06/txt/msg00372.txt.bz2 On Fri, May 22, 2015 at 7:23 AM, Patrick Palka wrote: > The HISTSIZE environment variable is generally expected to be read by > shells, not by applications. Some distros for example globally export > HISTSIZE in /etc/profile -- with the intention that it only affects > shells -- and by doing so it renders useless GDB's own mechanism for > setting the history size via .gdbinit. Also, annoyances may arise when > HISTSIZE is not interpreted the same way by the shell and by GDB, e.g. > PR gdb/16999. That can always be fixed on a shell-by-shell basis but it > may be impossible to be consistent with the behavior of all shells at > once. Finally it just makes sense to not confound shell environment > variables with application environment variables. > > gdb/ChangeLog: > > * NEWS: Add entry. > * top.c (init_history): Read from GDBHISTSIZE instead of > HISTSIZE. > (init_main): Refer to GDBHISTSIZE instead of HISTSIZE. > > gdb/doc/ChangeLog: > > * gdb.texinfo (Command History): Replace occurrences of HISTSIZE > with GDBHISTSIZE. > > gdb/testsuite/ChangeLog: > > * gdb.base/gdbinit-history.exp: Replace occurrences of HISTSIZE > with GDBHISTSIZE. > * gdb.base/readline.exp: Likewis. Committed this change (without the part that explains in the manual why we don't use HISTSIZE). Eli, what do you think about the following addendum to the manual? diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo index 9889b69..c1b11f4 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -22644,6 +22644,15 @@ to 256 if this variable is not set. Non-numeric values of @env{GDBHISTSIZE} are ignored. If @var{size} is @code{unlimited} or if @env{GDBHISTSIZE} is a negative number, the number of commands @value{GDBN} keeps in the history list is unlimited. + +Note: In @value{GDBN} version 7.8 and earlier, the @env{HISTSIZE} environment +variable was read instead of the @env{GDBHISTSIZE} environment variable. +However, reading @env{HISTSIZE} was problematic since this environment variable +is usually set with the intention to be read only by the user's shell, and +differences in interpretation of this environment variable may exist between +@value{GDBN} and the prevailing shell. So since @value{GDBN} version 7.9 the +dedicated @env{GDBHISTSIZE} environment variable is instead read for the same +purpose. @end table History expansion assigns special meaning to the character @kbd{!}.