From: Pedro Alves <palves@redhat.com>
To: gdb-patches@sourceware.org
Subject: [PATCH 1/4] list.exp: Catch "set listsize" failures (and "set listsize -1/0"'s history).
Date: Thu, 28 Mar 2013 01:11:00 -0000 [thread overview]
Message-ID: <20130327204404.24420.91454.stgit@brno.lan> (raw)
In-Reply-To: <20130327204357.24420.94722.stgit@brno.lan>
As mentioned in the intro, before the changes starting at
http://sourceware.org/ml/gdb-patches/2012-08/msg00020.html, the 'set
listsize' command only accepted "0" as special value, meaning
"unlimited". The testsuite actually tried "set listsize -1" and
expected that to mean unlimited too.
If you tried testing list.exp at the time of that patch above,
you'd get:
(gdb) PASS: gdb.base/list.exp: list line 10 with listsize 100
set listsize 0
(gdb) PASS: gdb.base/list.exp: setting listsize to 0 #6
show listsize
Number of source lines gdb will list by default is unlimited.
(gdb) PASS: gdb.base/list.exp: show listsize unlimited #6
list 1
1 #include "list0.h"
2
...
42 /* Not used for anything */
43 }
(gdb) PASS: gdb.base/list.exp: listsize of 0 suppresses output
set listsize -1
integer 4294967295 out of range
(gdb) PASS: gdb.base/list.exp: setting listsize to -1 #7
show listsize
Number of source lines gdb will list by default is unlimited.
(gdb) PASS: gdb.base/list.exp: show listsize unlimited #7
list 1
1 #include "list0.h"
Notice that "set listsize -1" actually failed with "integer 4294967295
out of range", but we issued a PASS anyway.
(and notice how the "listsize of 0 suppresses output" test passes bogusly too.)
This patch fixes that testsuite problem in the obvious way.
gdb/testsuite/
2013-03-21 Pedro Alves <palves@redhat.com>
* gdb.base/list.exp (set_listsize): Use gdb_test_no_output for
"set listsize".
---
gdb/testsuite/gdb.base/list.exp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gdb/testsuite/gdb.base/list.exp b/gdb/testsuite/gdb.base/list.exp
index d1bdeee..8684b0c 100644
--- a/gdb/testsuite/gdb.base/list.exp
+++ b/gdb/testsuite/gdb.base/list.exp
@@ -58,7 +58,7 @@ proc set_listsize { arg } {
global set_listsize_count;
incr set_listsize_count;
- if [gdb_test "set listsize $arg" ".*" "setting listsize to $arg #$set_listsize_count"] {
+ if [gdb_test_no_output "set listsize $arg" "setting listsize to $arg #$set_listsize_count"] {
return 0
}
if { $arg < 0 } {
next prev parent reply other threads:[~2013-03-27 20:44 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-28 6:28 [PATCH 0/4 v2] [mainline+7.6] PR gdb/15294: list with unlimited listsize broken Pedro Alves
2013-03-28 1:11 ` Pedro Alves [this message]
2013-03-28 6:09 ` [PATCH 2/4] list.exp: Adjust "set listsize -1" to current test source's real line count Pedro Alves
2013-03-28 7:44 ` [PATCH 3/4] list.exp: Avoid hardcoding line numbers Pedro Alves
2013-03-28 9:12 ` [PATCH 4/4] Fix PR gdb/15294: list with unlimited listsize broken Pedro Alves
2013-03-28 9:26 ` Pedro Alves
2013-03-28 16:47 ` Pedro Alves
2013-03-28 15:39 ` [PATCH 0/4 v2] [mainline+7.6] " Pedro Alves
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=20130327204404.24420.91454.stgit@brno.lan \
--to=palves@redhat.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