public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug gdb/16999] New: HISTSIZE behavior should match Bash's
@ 2014-05-30  3:36 ezyang at mit dot edu
  2014-06-13 19:53 ` [Bug gdb/16999] " chrismatteri at gmail dot com
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: ezyang at mit dot edu @ 2014-05-30  3:36 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=16999

            Bug ID: 16999
           Summary: HISTSIZE behavior should match Bash's
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: gdb
          Assignee: unassigned at sourceware dot org
          Reporter: ezyang at mit dot edu

Currently, if a HISTSIZE is passed to gdb which atoi cannot parse, gdb decides
that the desired history size is zero. This is not so great; usually people
want their history size to be infinite and not zero, especially seeing as this
behavior is different from that of bash, which assumes /infinite/ history size
when the value of HISTSIZE is empty. Thus, there is an annoying situation where
'export HISTSIZE=INFINITE' causes Bash to keep infinite history, but gdb to
keep zero history! To make matters worse, the environment variable overrides
the setting in .gdbinit. Please consider setting history_size_setshow_var to
the maximum signed integer (since readline uses a signed int) when it is not
parseable.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug gdb/16999] HISTSIZE behavior should match Bash's
  2014-05-30  3:36 [Bug gdb/16999] New: HISTSIZE behavior should match Bash's ezyang at mit dot edu
@ 2014-06-13 19:53 ` chrismatteri at gmail dot com
  2014-07-11 11:05 ` jason.vas.dias at gmail dot com
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: chrismatteri at gmail dot com @ 2014-06-13 19:53 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=16999

Chris Matteri <chrismatteri at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |chrismatteri at gmail dot com

--- Comment #1 from Chris Matteri <chrismatteri at gmail dot com> ---
In bash version 4.3.18 (I don't know exactly when this feature was introduced)
negative values of HISTSIZE also result in unlimited history, while gdb sets
history_size_setshow_var to zero on negative HISTSIZE.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug gdb/16999] HISTSIZE behavior should match Bash's
  2014-05-30  3:36 [Bug gdb/16999] New: HISTSIZE behavior should match Bash's ezyang at mit dot edu
  2014-06-13 19:53 ` [Bug gdb/16999] " chrismatteri at gmail dot com
@ 2014-07-11 11:05 ` jason.vas.dias at gmail dot com
  2015-05-01 11:41 ` jason.vas.dias at gmail dot com
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: jason.vas.dias at gmail dot com @ 2014-07-11 11:05 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=16999

Jason Vas Dias <jason.vas.dias at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jason.vas.dias at gmail dot com

--- Comment #2 from Jason Vas Dias <jason.vas.dias at gmail dot com> ---
Created attachment 7695
  --> https://sourceware.org/bugzilla/attachment.cgi?id=7695&action=edit
Patch to make GDB honor HISTSIZE=-1 in the same way as bash (unlimited history
size).

patch was against gdb-7.2 ( the version in RHEL-6 I have to use) but
should be easily portable to latest version.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug gdb/16999] HISTSIZE behavior should match Bash's
  2014-05-30  3:36 [Bug gdb/16999] New: HISTSIZE behavior should match Bash's ezyang at mit dot edu
  2014-06-13 19:53 ` [Bug gdb/16999] " chrismatteri at gmail dot com
  2014-07-11 11:05 ` jason.vas.dias at gmail dot com
@ 2015-05-01 11:41 ` jason.vas.dias at gmail dot com
  2015-05-01 15:55 ` dje at google dot com
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: jason.vas.dias at gmail dot com @ 2015-05-01 11:41 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=16999

--- Comment #3 from Jason Vas Dias <jason.vas.dias at gmail dot com> ---
Created attachment 8293
  --> https://sourceware.org/bugzilla/attachment.cgi?id=8293&action=edit
Updated patch for gdb-7.9, which STILL does not honor HISTSIZE=-1 .

Here is a patch to make GDB 7.9 also honor the HISTSIZE=-1 setting, which
modern readline also honors.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug gdb/16999] HISTSIZE behavior should match Bash's
  2014-05-30  3:36 [Bug gdb/16999] New: HISTSIZE behavior should match Bash's ezyang at mit dot edu
                   ` (2 preceding siblings ...)
  2015-05-01 11:41 ` jason.vas.dias at gmail dot com
@ 2015-05-01 15:55 ` dje at google dot com
  2015-05-04  9:58 ` palves at redhat dot com
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: dje at google dot com @ 2015-05-01 15:55 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=16999

dje at google dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dje at google dot com

--- Comment #4 from dje at google dot com ---
*** Bug 17820 has been marked as a duplicate of this bug. ***

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug gdb/16999] HISTSIZE behavior should match Bash's
  2014-05-30  3:36 [Bug gdb/16999] New: HISTSIZE behavior should match Bash's ezyang at mit dot edu
                   ` (3 preceding siblings ...)
  2015-05-01 15:55 ` dje at google dot com
@ 2015-05-04  9:58 ` palves at redhat dot com
  2015-06-17 18:14 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: palves at redhat dot com @ 2015-05-04  9:58 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=16999

Pedro Alves <palves at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |palves at redhat dot com,
                   |                            |patrick at parcs dot ath.cx

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug gdb/16999] HISTSIZE behavior should match Bash's
  2014-05-30  3:36 [Bug gdb/16999] New: HISTSIZE behavior should match Bash's ezyang at mit dot edu
                   ` (4 preceding siblings ...)
  2015-05-04  9:58 ` palves at redhat dot com
@ 2015-06-17 18:14 ` cvs-commit at gcc dot gnu.org
  2015-06-17 18:14 ` cvs-commit at gcc dot gnu.org
  2015-06-17 18:30 ` patrick at parcs dot ath.cx
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2015-06-17 18:14 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=16999

--- Comment #6 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Patrick Palka <ppalka@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=bc460514b9db46a491c2c39cd118b02608742968

commit bc460514b9db46a491c2c39cd118b02608742968
Author: Patrick Palka <patrick@parcs.ath.cx>
Date:   Tue May 12 06:50:26 2015 -0400

    Tweak the handling of $GDBHISTSIZE edge cases [PR gdb/16999]

    When GDB reads a nonsensical value for the GDBHISTSIZE environment
    variable, i.e. one that is non-numeric or negative, GDB then sets its
    history size to 0.  This behavior is annoying and also inconsistent
    with the behavior of bash.

    This patch makes the behavior of invalid GDBHISTSIZE consistent with how
    bash handles HISTSIZE.  When we encounter a null or out-of-range
    GDBHISTSIZE (outside of [0, INT_MAX]) we now set the history size to
    unlimited instead of 0.  When we encounter a non-numeric GDBHISTSIZE we
    do nothing.

    gdb/ChangeLog:

        PR gdb/16999
        * NEWS: Mention new GDBHISTSIZE behavior.
        * top.c (init_history): For null or out-of-range GDBHISTSIZE,
        set history size to unlimited.  Ignore non-numeric GDBHISTSIZE.

    gdb/doc/ChangeLog:

        PR gdb/16999
        * gdb.texinfo (Command History): Mention new GDBHISTSIZE
        behavior.

    gdb/testsuite/ChangeLog:

        PR gdb/16999
        * gdb.base/gdbhistsize-history.exp: New test.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug gdb/16999] HISTSIZE behavior should match Bash's
  2014-05-30  3:36 [Bug gdb/16999] New: HISTSIZE behavior should match Bash's ezyang at mit dot edu
                   ` (5 preceding siblings ...)
  2015-06-17 18:14 ` cvs-commit at gcc dot gnu.org
@ 2015-06-17 18:14 ` cvs-commit at gcc dot gnu.org
  2015-06-17 18:30 ` patrick at parcs dot ath.cx
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2015-06-17 18:14 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=16999

--- Comment #5 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Patrick Palka <ppalka@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=b58c513b7932cfb9852d66e07282b9c2379197ed

commit b58c513b7932cfb9852d66e07282b9c2379197ed
Author: Patrick Palka <patrick@parcs.ath.cx>
Date:   Wed Jun 17 13:31:56 2015 -0400

    Read $GDBHISTSIZE instead of $HISTSIZE

    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: Mention that GDBHISTSIZE is read instead of HISTSIZE.
        * 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: Likewise.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug gdb/16999] HISTSIZE behavior should match Bash's
  2014-05-30  3:36 [Bug gdb/16999] New: HISTSIZE behavior should match Bash's ezyang at mit dot edu
                   ` (6 preceding siblings ...)
  2015-06-17 18:14 ` cvs-commit at gcc dot gnu.org
@ 2015-06-17 18:30 ` patrick at parcs dot ath.cx
  7 siblings, 0 replies; 9+ messages in thread
From: patrick at parcs dot ath.cx @ 2015-06-17 18:30 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=16999

patrick at parcs dot ath.cx changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #7 from patrick at parcs dot ath.cx ---
The next version of GDB will no longer read HISTSIZE at all because doing so
causes more problems than it solves.  Instead GDBHISTSIZE is read for the same
purpose.  And for good measure, the behavior of GDBHISTSIZE will match how bash
reads HISTSIZE, so setting GDBHISTSIZE to -1 will cause GDB's history size to
be unlimited.

Hope these changes are sensible.  Let us know if you disagree.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2015-06-17 18:30 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-30  3:36 [Bug gdb/16999] New: HISTSIZE behavior should match Bash's ezyang at mit dot edu
2014-06-13 19:53 ` [Bug gdb/16999] " chrismatteri at gmail dot com
2014-07-11 11:05 ` jason.vas.dias at gmail dot com
2015-05-01 11:41 ` jason.vas.dias at gmail dot com
2015-05-01 15:55 ` dje at google dot com
2015-05-04  9:58 ` palves at redhat dot com
2015-06-17 18:14 ` cvs-commit at gcc dot gnu.org
2015-06-17 18:14 ` cvs-commit at gcc dot gnu.org
2015-06-17 18:30 ` patrick at parcs dot ath.cx

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).