This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 1/2] Read $GDBHISTSIZE instead of $HISTSIZE
- From: Patrick Palka <patrick at parcs dot ath dot cx>
- To: Eli Zaretskii <eliz at gnu dot org>
- Cc: "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>
- Date: Thu, 4 Jun 2015 11:30:18 -0400
- Subject: Re: [PATCH 1/2] Read $GDBHISTSIZE instead of $HISTSIZE
- Authentication-results: sourceware.org; auth=none
- References: <1432293831-23599-1-git-send-email-patrick at parcs dot ath dot cx> <83vbfk4wxi dot fsf at gnu dot org>
On Fri, May 22, 2015 at 8:30 AM, Eli Zaretskii <eliz@gnu.org> wrote:
>> From: Patrick Palka <patrick@parcs.ath.cx>
>> Cc: Patrick Palka <patrick@parcs.ath.cx>
>> Date: Fri, 22 May 2015 07:23:50 -0400
>>
>> 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.
>
> Thanks.
>
> I think we should explain in the manual why we don't use HISTSIZE.
> And I wonder why we cannot use HISTSIZE if neither GDBHISTSIZE nor
> .gdbinit specify the size, but you probably already discussed that.
Hmm, reading HISTSIZE as a last resort would reduce the inter-version
breakage a little, at least for users who today rely solely on
HISTSIZE (not ~/.gdbinit) to set their history size. This can be
done, I guess.
>
> Otherwise, the documentation part is OK.