From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23629 invoked by alias); 9 Sep 2012 03:24:06 -0000 Received: (qmail 23616 invoked by uid 22791); 9 Sep 2012 03:24:05 -0000 X-SWARE-Spam-Status: No, hits=-4.4 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL X-Spam-Check-By: sourceware.org Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 09 Sep 2012 03:23:44 +0000 Received: from svr-orw-fem-01.mgc.mentorg.com ([147.34.98.93]) by relay1.mentorg.com with esmtp id 1TAY7c-0006j2-6V from Yao_Qi@mentor.com for gdb-patches@sourceware.org; Sat, 08 Sep 2012 20:23:44 -0700 Received: from SVR-ORW-FEM-04.mgc.mentorg.com ([147.34.97.41]) by svr-orw-fem-01.mgc.mentorg.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Sat, 8 Sep 2012 20:23:44 -0700 Received: from qiyao.dyndns.org.dyndns.org (147.34.91.1) by svr-orw-fem-04.mgc.mentorg.com (147.34.97.41) with Microsoft SMTP Server id 14.1.289.1; Sat, 8 Sep 2012 20:23:42 -0700 From: Yao Qi To: Subject: [PATCH 2/2] Update doc and test of 'set listsize'. Date: Sun, 09 Sep 2012 03:24:00 -0000 Message-ID: <1347160965-24089-3-git-send-email-yao@codesourcery.com> In-Reply-To: <1347160965-24089-1-git-send-email-yao@codesourcery.com> References: <1347160965-24089-1-git-send-email-yao@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain X-IsSubscribed: yes 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 X-SW-Source: 2012-09/txt/msg00091.txt.bz2 Hi, This patch is to update the doc and test of 'set listsize'. The original version of doc was reviewed by Eli, http://sourceware.org/ml/gdb-patches/2012-08/msg00370.html but I switch the meaning of '0' and '-1' of 'set listsize', because we need two special states of 'listsize', 'unlimited' and 'suppress printing'. In existing 'enum var_types', only 0 means unlimited (in var_uintger and var_integer') so it may be good to change 'set listsize' to conform this, and let '-1' means suppress printing accordingly. gdb/doc: 2012-09-09 Yao Qi * gdb.texinfo (List): Describe the meaning of 0 and -1 in 'set listsize'. gdb/testsuite: 2012-09-09 Yao Qi * gdb.base/list.exp (set_listsize): Set arg to "unlimited" when it is 0. (test_listsize): Adjust test for the different meaning of '0' and '-1' in listsize. Remove 'setup_xfail'. Adjust the expected last line in of source in test. --- gdb/doc/gdb.texinfo | 2 ++ gdb/testsuite/gdb.base/list.exp | 13 ++++++------- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo index 2d49e13..1bb2e5e 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -6706,6 +6706,8 @@ the @code{list} command. You can change this using @code{set listsize}: @item set listsize @var{count} Make the @code{list} command display @var{count} source lines (unless the @code{list} argument explicitly specifies some other number). +Setting @var{count} to 0 means there's no limit and -1 means suppress +display of source lines. @kindex show listsize @item show listsize diff --git a/gdb/testsuite/gdb.base/list.exp b/gdb/testsuite/gdb.base/list.exp index 6b5b207..334db2a 100644 --- a/gdb/testsuite/gdb.base/list.exp +++ b/gdb/testsuite/gdb.base/list.exp @@ -62,7 +62,7 @@ proc set_listsize { arg } { if [gdb_test "set listsize $arg" ".*" "setting listsize to $arg #$set_listsize_count"] { return 0; } - if { $arg <= 0 } { + if { $arg == 0 } { set arg "unlimited"; } @@ -130,16 +130,15 @@ proc test_listsize {} { gdb_test "list 10" "1\[ \t\]+#include \"list0.h\".*\r\n4\[23\]\[ \t\]+\}" "list line 10 with listsize 100" } - # Try listsize of 0 which suppresses printing. + # Try listsize of -1 which suppresses printing. - set_listsize 0 + set_listsize -1 gdb_test "list 1" "" "listsize of 0 suppresses output" - # Try listsize of -1 which is special, and means unlimited. + # Try listsize of 0 which is special, and means unlimited. - set_listsize -1 - setup_xfail "*-*-*" - gdb_test "list 1" "1\[ \t\]+#include .*\r\n39\[ \t\]+\}" "list line 1 with unlimited listsize" + set_listsize 0 + gdb_test "list 1" "1\[ \t\]+#include .*\r\n43\[ \t\]+\}" "list line 1 with unlimited listsize" } # -- 1.7.7.6