From: Yao Qi <yao@codesourcery.com>
To: <gdb-patches@sourceware.org>
Subject: [PATCH 2/2] Update doc and test of 'set listsize'.
Date: Sun, 09 Sep 2012 03:24:00 -0000 [thread overview]
Message-ID: <1347160965-24089-3-git-send-email-yao@codesourcery.com> (raw)
In-Reply-To: <1347160965-24089-1-git-send-email-yao@codesourcery.com>
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 <yao@codesourcery.com>
* gdb.texinfo (List): Describe the meaning of 0 and -1 in
'set listsize'.
gdb/testsuite:
2012-09-09 Yao Qi <yao@codesourcery.com>
* 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
next prev parent reply other threads:[~2012-09-09 3:24 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-09 3:23 [2nd try, RFC 0/2] Fix 'set remote XXX-limit -1' and 'set listisize' Yao Qi
2012-09-09 3:23 ` [PATCH 1/2] Check the range Yao Qi
2012-09-09 3:24 ` Yao Qi [this message]
2012-09-09 17:27 ` [PATCH 2/2] Update doc and test of 'set listsize' Eli Zaretskii
2012-09-14 18:55 ` [2nd try, RFC 0/2] Fix 'set remote XXX-limit -1' and 'set listisize' Tom Tromey
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1347160965-24089-3-git-send-email-yao@codesourcery.com \
--to=yao@codesourcery.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox