From: Yao Qi <yao@codesourcery.com>
To: Pedro Alves <palves@redhat.com>
Cc: <gdb-patches@sourceware.org>
Subject: Re: [PATCH 5/5] range stepping: tests
Date: Fri, 24 May 2013 02:27:00 -0000 [thread overview]
Message-ID: <519ED019.4020401@codesourcery.com> (raw)
In-Reply-To: <519E59EB.10704@redhat.com>
On 05/24/2013 02:03 AM, Pedro Alves wrote:
> But I'm not understanding how this is catching the issue. Why
> would "print/x \$pc" fail if the stub degenerates to
> implementing vCont;r as a single instruction step?
I switch to letting proc exec_cmd_expect_vCont_count return 0 or 1 to
indicate the test pass or not, and skip the rest if it returns 1 in
the test. How about this below?
--
Yao (é½å°§)
gdb/testsuite:
2013-05-24 Yao Qi <yao@codesourcery.com>
Pedro Alves <palves@redhat.com>
* gdb.base/range-stepping.exp: Skip the rest of tests if the
test fails.
* lib/range-stepping-support.exp (exec_cmd_expect_vCont_count):
Return 0 if the test passes, otherwise return 1.
---
gdb/testsuite/gdb.base/range-stepping.exp | 10 +++++++++-
gdb/testsuite/lib/range-stepping-support.exp | 6 +++++-
2 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/gdb/testsuite/gdb.base/range-stepping.exp b/gdb/testsuite/gdb.base/range-stepping.exp
index 48fc15b..d17596c 100644
--- a/gdb/testsuite/gdb.base/range-stepping.exp
+++ b/gdb/testsuite/gdb.base/range-stepping.exp
@@ -76,7 +76,15 @@ with_test_prefix "multi insns" {
# <-- T05
# --> vCont;rSTART,END (range step)
# <-- T05
- exec_cmd_expect_vCont_count "next" 1 1
+ set result [exec_cmd_expect_vCont_count "next" 1 1]
+ if { $result } {
+ # This is the first range-stepping test, and the simplest
+ # one. If it fails, probably the rest of the tests would
+ # fail too, and the huge number of rsp packets in the test
+ # with the time-consuming loop would blow up the gdb.log file.
+ # Skip the rest of the tests.
+ return
+ }
set pc_after_stepping ""
set msg "pc after stepping"
diff --git a/gdb/testsuite/lib/range-stepping-support.exp b/gdb/testsuite/lib/range-stepping-support.exp
index d849665..ab38b11 100644
--- a/gdb/testsuite/lib/range-stepping-support.exp
+++ b/gdb/testsuite/lib/range-stepping-support.exp
@@ -14,7 +14,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# Execute command CMD and check that GDB sends the expected number of
-# vCont;s and vCont;r packets.
+# vCont;s and vCont;r packets. Returns 0 if the test passes,
+# otherwise returns 1.
proc exec_cmd_expect_vCont_count { cmd exp_vCont_s exp_vCont_r } {
global gdb_prompt
@@ -24,6 +25,7 @@ proc exec_cmd_expect_vCont_count { cmd exp_vCont_s exp_vCont_r } {
set test "${cmd}: vCont;s=${exp_vCont_s} vCont;r=${exp_vCont_r}"
set r_counter 0
set s_counter 0
+ set ret 1
gdb_test_multiple $cmd $test {
-re "vCont;s\[^\r\n\]*Packet received: T\[\[:xdigit:\]\]\[\[:xdigit:\]\]" {
incr s_counter
@@ -40,6 +42,7 @@ proc exec_cmd_expect_vCont_count { cmd exp_vCont_s exp_vCont_r } {
-re "$gdb_prompt $" {
if { $r_counter == ${exp_vCont_r} && $s_counter == ${exp_vCont_s} } {
pass $test
+ set ret 0
} else {
fail $test
}
@@ -47,4 +50,5 @@ proc exec_cmd_expect_vCont_count { cmd exp_vCont_s exp_vCont_r } {
}
gdb_test_no_output "set debug remote 0" ""
+ return $ret
}
--
1.7.7.6
next prev parent reply other threads:[~2013-05-24 2:27 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-14 19:10 [PATCH 0/5 V3] target-assisted range stepping Pedro Alves
2013-05-14 19:10 ` [PATCH 3/5] range stepping: gdb Pedro Alves
2013-05-14 19:46 ` Eli Zaretskii
2013-05-15 10:23 ` Pedro Alves
2013-05-15 11:22 ` Eli Zaretskii
2013-05-15 12:39 ` Pedro Alves
2013-05-15 13:46 ` Eli Zaretskii
2013-05-15 13:58 ` Pedro Alves
2013-05-15 18:20 ` Pedro Alves
2013-05-16 6:08 ` Eli Zaretskii
2013-05-20 18:43 ` Pedro Alves
2013-05-20 19:05 ` Eli Zaretskii
2013-05-23 0:47 ` Yao Qi
2013-05-23 17:22 ` Pedro Alves
2013-05-14 19:10 ` [PATCH 1/5] Factor out in-stepping-range checks Pedro Alves
2013-05-14 19:37 ` Tom Tromey
2013-05-14 19:10 ` [PATCH 2/5] Convert rs->support_vCont_t to a struct Pedro Alves
2013-05-14 19:40 ` Tom Tromey
2013-05-14 19:10 ` [PATCH 4/5] range stepping: gdbserver (x86 GNU/Linux) Pedro Alves
2013-05-14 19:47 ` Eli Zaretskii
2013-05-14 20:14 ` Tom Tromey
2013-05-23 17:44 ` Pedro Alves
2013-05-24 11:33 ` Pedro Alves
2013-05-15 12:14 ` Yao Qi
2013-05-20 18:01 ` Pedro Alves
2013-05-23 0:56 ` Yao Qi
2013-05-23 17:26 ` Pedro Alves
2013-05-14 19:11 ` [PATCH 5/5] range stepping: tests Pedro Alves
2013-05-22 14:32 ` Yao Qi
2013-05-23 17:34 ` Pedro Alves
2013-05-23 18:03 ` Pedro Alves
2013-05-24 2:27 ` Yao Qi [this message]
2013-05-24 9:45 ` Pedro Alves
2013-05-24 9:57 ` Yao Qi
2013-05-14 20:21 ` [PATCH 0/5 V3] target-assisted range stepping Tom Tromey
2013-05-23 17:44 ` Pedro Alves
2013-05-23 1:02 ` Yao Qi
2013-05-23 17:46 ` 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=519ED019.4020401@codesourcery.com \
--to=yao@codesourcery.com \
--cc=gdb-patches@sourceware.org \
--cc=palves@redhat.com \
/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