This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH 2/2] Update doc and test of 'set listsize'.


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]