public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug gdb/15294] New: list with unlimited listsize broken
@ 2013-03-21 18:06 palves at redhat dot com
  2013-03-21 18:22 ` [Bug gdb/15294] " palves at redhat dot com
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: palves at redhat dot com @ 2013-03-21 18:06 UTC (permalink / raw)
  To: gdb-prs

http://sourceware.org/bugzilla/show_bug.cgi?id=15294

             Bug #: 15294
           Summary: list with unlimited listsize broken
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: gdb
        AssignedTo: unassigned@sourceware.org
        ReportedBy: palves@redhat.com
    Classification: Unclassified


(gdb) set listsize -1
(gdb) show listsize 
Number of source lines gdb will list by default is unlimited.
(gdb) list 1
(gdb) list 1
(gdb) list 1
(gdb) set listsize 10
(gdb) list 1
1       /* Main function for CLI gdb.  
2          Copyright (C) 2002-2013 Free Software Foundation, Inc.
3
4          This file is part of GDB.
5
6          This program is free software; you can redistribute it and/or modify
7          it under the terms of the GNU General Public License as published by
8          the Free Software Foundation; either version 3 of the License, or
9          (at your option) any later version.
10

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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

* [Bug gdb/15294] list with unlimited listsize broken
  2013-03-21 18:06 [Bug gdb/15294] New: list with unlimited listsize broken palves at redhat dot com
@ 2013-03-21 18:22 ` palves at redhat dot com
  2013-03-28 11:50 ` cvs-commit at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: palves at redhat dot com @ 2013-03-21 18:22 UTC (permalink / raw)
  To: gdb-prs

http://sourceware.org/bugzilla/show_bug.cgi?id=15294

Pedro Alves <palves at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
         AssignedTo|unassigned at sourceware    |palves at redhat dot com
                   |dot org                     |

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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

* [Bug gdb/15294] list with unlimited listsize broken
  2013-03-21 18:06 [Bug gdb/15294] New: list with unlimited listsize broken palves at redhat dot com
  2013-03-21 18:22 ` [Bug gdb/15294] " palves at redhat dot com
@ 2013-03-28 11:50 ` cvs-commit at gcc dot gnu.org
  2013-03-28 11:57 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2013-03-28 11:50 UTC (permalink / raw)
  To: gdb-prs

http://sourceware.org/bugzilla/show_bug.cgi?id=15294

--- Comment #1 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> 2013-03-28 11:50:01 UTC ---
CVSROOT:    /cvs/src
Module name:    src
Branch:     gdb_7_6-branch
Changes by:    palves@sourceware.org    2013-03-28 11:50:00

Modified files:
    gdb            : ChangeLog source.c 
    gdb/doc        : ChangeLog gdb.texinfo 
    gdb/testsuite  : ChangeLog 
    gdb/testsuite/gdb.base: list.exp 

Log message:
    Fix PR gdb/15294: list with unlimited listsize broken

    Currently, "set listsize -1" is supposed to mean "unlimited" source
    lines, but, alas, it doesn't actually work:

    (gdb) set listsize -1
    (gdb) show listsize
    Number of source lines gdb will list by default is unlimited.
    (gdb) list 1
    (gdb) list 1
    (gdb) list 1
    (gdb) set listsize 10
    (gdb) list 1
    1       /* Main function for CLI gdb.
    2          Copyright (C) 2002-2013 Free Software Foundation, Inc.
    3
    4          This file is part of GDB.
    5
    6          This program is free software; you can redistribute it and/or
modify
    7          it under the terms of the GNU General Public License as
published by
    8          the Free Software Foundation; either version 3 of the License,
or
    9          (at your option) any later version.
    10

    Before this patch:

    http://sourceware.org/ml/gdb-patches/2012-08/msg00367.html

    was applied, the "set listsize" command was a var_integer command, and
    "unlimited" was set with 0.  Internally, var_integer maps 0 to INT_MAX

    case var_integer:
    {
    ...
    if (val == 0 && c->var_type == var_integer)
    val = INT_MAX;

    The change in that patch to zuinteger_unlimited command, meant that -1
    is left as -1 in the command's control variable (lines_to_list), and
    the code in source.c isn't expecting that -- it only expects positive
    numbers.

    I previously suggested fixing the code and keeping the new behavior,
    but I found that "set listsize 0" is currently used in the wild, and
    we do have a bunch of other commands where "0" means unlimited, so I'm
    thinking that changing this command alone in isolation is not a good
    idea.

    So I now strongly prefer reverting back the behavior in 7.6 to the
    same behavior the command has had since 2006 (0==unlimited, -1=error).
    Before that, set listsize -1 would be accepted as unlimited as well.

    After 7.6 is out, in mainline, we can get back to reconsidering
    changing this command's behavior, if there's a real need for being
    able to suppress output.  For now, let's play it safe.

    The "list line 1 with unlimited listsize" test in list.exp was
    originally written years and years ago expecting 0 to mean "no
    output", but GDB never actually worked that way, even when the tests
    were written, so the tests had been xfailed then.  This patch now
    adjusts the test to the new behavior, so that the test actually
    passes, and the xfail is removed.

    gdb/
    2013-03-28  Pedro Alves  <palves@redhat.com>

    PR gdb/15294

    * source.c (_initialize_source): Change back "set listsize" to an
    integer command.

    gdb/testsuite/
    2013-03-28  Pedro Alves  <palves@redhat.com>

    PR gdb/15294

    * gdb.base/list.exp (set_listsize): Adjust to accept $arg == 0 to
    mean unlimited instead of $arg < 0.
    (test_listsize): Remove "listsize of 0 suppresses output" test.
    Test that "set listsize 0" ends up with an unlimited listsize.

    gdb/doc/
    2013-03-28  Pedro Alves  <palves@redhat.com>

    PR gdb/15294

    * gdb.texinfo (List) <set listsize>: Adjust to document that
    listsize 0 means no limit, and remove mention of -1.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/ChangeLog.diff?cvsroot=src&only_with_tag=gdb_7_6-branch&r1=1.15260.2.17&r2=1.15260.2.18
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/source.c.diff?cvsroot=src&only_with_tag=gdb_7_6-branch&r1=1.153.2.2&r2=1.153.2.3
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/doc/ChangeLog.diff?cvsroot=src&only_with_tag=gdb_7_6-branch&r1=1.1423&r2=1.1423.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/doc/gdb.texinfo.diff?cvsroot=src&only_with_tag=gdb_7_6-branch&r1=1.1060&r2=1.1060.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/ChangeLog.diff?cvsroot=src&only_with_tag=gdb_7_6-branch&r1=1.3580.2.9&r2=1.3580.2.10
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/gdb.base/list.exp.diff?cvsroot=src&only_with_tag=gdb_7_6-branch&r1=1.34.2.3&r2=1.34.2.4

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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

* [Bug gdb/15294] list with unlimited listsize broken
  2013-03-21 18:06 [Bug gdb/15294] New: list with unlimited listsize broken palves at redhat dot com
  2013-03-21 18:22 ` [Bug gdb/15294] " palves at redhat dot com
  2013-03-28 11:50 ` cvs-commit at gcc dot gnu.org
@ 2013-03-28 11:57 ` cvs-commit at gcc dot gnu.org
  2013-03-28 12:02 ` palves at redhat dot com
  2013-03-28 16:23 ` palves at redhat dot com
  4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2013-03-28 11:57 UTC (permalink / raw)
  To: gdb-prs

http://sourceware.org/bugzilla/show_bug.cgi?id=15294

--- Comment #2 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> 2013-03-28 11:57:48 UTC ---
CVSROOT:    /cvs/src
Module name:    src
Changes by:    palves@sourceware.org    2013-03-28 11:57:47

Modified files:
    gdb            : ChangeLog source.c 
    gdb/doc        : ChangeLog gdb.texinfo 
    gdb/testsuite  : ChangeLog 
    gdb/testsuite/gdb.base: list.exp 

Log message:
    Fix PR gdb/15294: list with unlimited listsize broken

    Currently, "set listsize -1" is supposed to mean "unlimited" source
    lines, but, alas, it doesn't actually work:

    (gdb) set listsize -1
    (gdb) show listsize
    Number of source lines gdb will list by default is unlimited.
    (gdb) list 1
    (gdb) list 1
    (gdb) list 1
    (gdb) set listsize 10
    (gdb) list 1
    1       /* Main function for CLI gdb.
    2          Copyright (C) 2002-2013 Free Software Foundation, Inc.
    3
    4          This file is part of GDB.
    5
    6          This program is free software; you can redistribute it and/or
modify
    7          it under the terms of the GNU General Public License as
published by
    8          the Free Software Foundation; either version 3 of the License,
or
    9          (at your option) any later version.
    10

    Before this patch:

    http://sourceware.org/ml/gdb-patches/2012-08/msg00367.html

    was applied, the "set listsize" command was a var_integer command, and
    "unlimited" was set with 0.  Internally, var_integer maps 0 to INT_MAX

    case var_integer:
    {
    ...
    if (val == 0 && c->var_type == var_integer)
    val = INT_MAX;

    The change in that patch to zuinteger_unlimited command, meant that -1
    is left as -1 in the command's control variable (lines_to_list), and
    the code in source.c isn't expecting that -- it only expects positive
    numbers.

    I previously suggested fixing the code and keeping the new behavior,
    but I found that "set listsize 0" is currently used in the wild, and
    we do have a bunch of other commands where "0" means unlimited, so I'm
    thinking that changing this command alone in isolation is not a good
    idea.

    So I now strongly prefer reverting back the behavior in 7.6 to the
    same behavior the command has had since 2006 (0==unlimited, -1=error).
    Before that, set listsize -1 would be accepted as unlimited as well.

    After 7.6 is out, in mainline, we can get back to reconsidering
    changing this command's behavior, if there's a real need for being
    able to suppress output.  For now, let's play it safe.

    The "list line 1 with unlimited listsize" test in list.exp was
    originally written years and years ago expecting 0 to mean "no
    output", but GDB never actually worked that way, even when the tests
    were written, so the tests had been xfailed then.  This patch now
    adjusts the test to the new behavior, so that the test actually
    passes, and the xfail is removed.

    gdb/
    2013-03-28  Pedro Alves  <palves@redhat.com>

    PR gdb/15294

    * source.c (_initialize_source): Change back "set listsize" to an
    integer command.

    gdb/testsuite/
    2013-03-28  Pedro Alves  <palves@redhat.com>

    PR gdb/15294

    * gdb.base/list.exp (set_listsize): Adjust to accept $arg == 0 to
    mean unlimited instead of $arg < 0.
    (test_listsize): Remove "listsize of 0 suppresses output" test.
    Test that "set listsize 0" ends up with an unlimited listsize.

    gdb/doc/
    2013-03-28  Pedro Alves  <palves@redhat.com>

    PR gdb/15294

    * gdb.texinfo (List) <set listsize>: Adjust to document that
    listsize 0 means no limit, and remove mention of -1.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/ChangeLog.diff?cvsroot=src&r1=1.15327&r2=1.15328
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/source.c.diff?cvsroot=src&r1=1.155&r2=1.156
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/doc/ChangeLog.diff?cvsroot=src&r1=1.1427&r2=1.1428
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/doc/gdb.texinfo.diff?cvsroot=src&r1=1.1064&r2=1.1065
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/ChangeLog.diff?cvsroot=src&r1=1.3604&r2=1.3605
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/gdb.base/list.exp.diff?cvsroot=src&r1=1.38&r2=1.39

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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

* [Bug gdb/15294] list with unlimited listsize broken
  2013-03-21 18:06 [Bug gdb/15294] New: list with unlimited listsize broken palves at redhat dot com
                   ` (2 preceding siblings ...)
  2013-03-28 11:57 ` cvs-commit at gcc dot gnu.org
@ 2013-03-28 12:02 ` palves at redhat dot com
  2013-03-28 16:23 ` palves at redhat dot com
  4 siblings, 0 replies; 6+ messages in thread
From: palves at redhat dot com @ 2013-03-28 12:02 UTC (permalink / raw)
  To: gdb-prs

http://sourceware.org/bugzilla/show_bug.cgi?id=15294

Pedro Alves <palves at redhat dot com> changed:

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

--- Comment #3 from Pedro Alves <palves at redhat dot com> 2013-03-28 12:02:28 UTC ---
Patch checked in.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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

* [Bug gdb/15294] list with unlimited listsize broken
  2013-03-21 18:06 [Bug gdb/15294] New: list with unlimited listsize broken palves at redhat dot com
                   ` (3 preceding siblings ...)
  2013-03-28 12:02 ` palves at redhat dot com
@ 2013-03-28 16:23 ` palves at redhat dot com
  4 siblings, 0 replies; 6+ messages in thread
From: palves at redhat dot com @ 2013-03-28 16:23 UTC (permalink / raw)
  To: gdb-prs

http://sourceware.org/bugzilla/show_bug.cgi?id=15294

Pedro Alves <palves at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |7.6

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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

end of thread, other threads:[~2013-03-28 16:23 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-21 18:06 [Bug gdb/15294] New: list with unlimited listsize broken palves at redhat dot com
2013-03-21 18:22 ` [Bug gdb/15294] " palves at redhat dot com
2013-03-28 11:50 ` cvs-commit at gcc dot gnu.org
2013-03-28 11:57 ` cvs-commit at gcc dot gnu.org
2013-03-28 12:02 ` palves at redhat dot com
2013-03-28 16:23 ` palves at redhat dot com

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).