[PATCH] Remove checking vCont;s in exec_cmd_expect_vCont_count

Yao Qi qiyaoltc@gmail.com
Wed Oct 21 10:40:00 GMT 2015


Nowadays, in the range-stepping tests, we check not only the number of
vCont;r packets but also the number of vCont;s packets, because we think
the remote target which can do range stepping must support single step.

However, if we turn displaced stepping on, the remote target (GDBserver)
can do range stepping, and support single step, but GDB may decide to
resume instructions in the scratchpad rather than single step them one
by one for displaced stepping.  For example, when aarch64 GDB debugs
arm linux program with aarch64 GDBserver, GDBserver supports both range
stepping and single step, but GDB (with the gdbarch for arm-linux)
decides resume instructions in the scratchpad, so in the RSP traffic,
there is no vCont;s packet at all, and some range-stepping.exp tests
fail when I force using displaced stepping,

FAIL: gdb.base/range-stepping.exp: multi insns: next: vCont;s=1 vCont;r=1

This patch is to get rid of the checking to the number of vCont;s in
exec_cmd_expect_vCont_count.

gdb/testsuite:

2015-10-21  Yao Qi  <yao.qi@linaro.org>

	* lib/range-stepping-support.exp (exec_cmd_expect_vCont_count):
	Remove argument exp_vCont_s.
	* gdb.base/range-stepping.exp: Callers updated.
	* gdb.trace/range-stepping.exp: Likewise.
---
 gdb/testsuite/gdb.base/range-stepping.exp    | 14 +++++++-------
 gdb/testsuite/gdb.trace/range-stepping.exp   |  4 ++--
 gdb/testsuite/lib/range-stepping-support.exp |  9 ++++-----
 3 files changed, 13 insertions(+), 14 deletions(-)

diff --git a/gdb/testsuite/gdb.base/range-stepping.exp b/gdb/testsuite/gdb.base/range-stepping.exp
index 2ff371d..79667ba 100644
--- a/gdb/testsuite/gdb.base/range-stepping.exp
+++ b/gdb/testsuite/gdb.base/range-stepping.exp
@@ -55,7 +55,7 @@ with_test_prefix "multi insns" {
     # <-- T05
     # --> vCont;rSTART,END  (range step)
     # <-- T05
-    set result [exec_cmd_expect_vCont_count "next" 1 1]
+    set result [exec_cmd_expect_vCont_count "next" 1]
     if { $result } {
 	# This is the first range-stepping test, and the simplest
 	# one.  If it fails, probably the rest of the tests would
@@ -111,7 +111,7 @@ with_test_prefix "step over func" {
     # <-- T05  (target stops at ADDR2)
     # --> vCont;rADDR1,ADDR3  (continues range stepping)
     # <-- T05
-    exec_cmd_expect_vCont_count "next" 0 2
+    exec_cmd_expect_vCont_count "next" 2
 }
 
 # Check that breakpoints interrupt range stepping correctly.
@@ -124,14 +124,14 @@ with_test_prefix "breakpoint" {
     # --> $Z0,ADDR2  (step-resume breakpoint at ADDR2)
     # --> vCont;c  (resume)
     # <-- T05  (target hits the breakpoint at func1)
-    exec_cmd_expect_vCont_count "next" 0 1
+    exec_cmd_expect_vCont_count "next" 1
 
     gdb_test "backtrace" "#0 .* func1 .*#1 .* main .*" \
 	"backtrace from func1"
 
     # A cancelled range step should not confuse the following
     # execution commands.
-    exec_cmd_expect_vCont_count "stepi" 1 0
+    exec_cmd_expect_vCont_count "stepi" 0
     gdb_test "finish" ".*"
     gdb_test "next" ".*"
     delete_breakpoints
@@ -145,7 +145,7 @@ with_test_prefix "loop" {
     # GDB should send one vCont;r and receive one stop reply:
     # --> vCont;rSTART,END  (range step)
     # <-- T05
-    exec_cmd_expect_vCont_count "next" 0 1
+    exec_cmd_expect_vCont_count "next" 1
 
     # Confirm the loop completed.
     gdb_test "print a" " = 15"
@@ -162,7 +162,7 @@ with_test_prefix "loop 2" {
     # GDB should send one vCont;r and receive one stop reply:
     # --> vCont;rSTART,END  (range step)
     # <-- T05
-    exec_cmd_expect_vCont_count "next" 0 1
+    exec_cmd_expect_vCont_count "next" 1
 
     # Confirm the loop completed.
     gdb_test "print a" " = 15"
@@ -207,7 +207,7 @@ with_test_prefix "interrupt" {
 
     # Break the loop earlier and continue range stepping.
     gdb_test "set variable c = 0"
-    exec_cmd_expect_vCont_count "next" 0 1
+    exec_cmd_expect_vCont_count "next" 1
 }
 
 # Check that range stepping doesn't break software watchpoints.  With
diff --git a/gdb/testsuite/gdb.trace/range-stepping.exp b/gdb/testsuite/gdb.trace/range-stepping.exp
index dfc16d5..67eddae 100644
--- a/gdb/testsuite/gdb.trace/range-stepping.exp
+++ b/gdb/testsuite/gdb.trace/range-stepping.exp
@@ -52,8 +52,8 @@ proc range_stepping_with_tracepoint { type } {
 
 	# Step a line with a tracepoint in the middle.  The tracepoint
 	# itself shouldn't have any effect on range stepping.  We
-	# should see one vCont;r and no vCont;s's.
-	exec_cmd_expect_vCont_count "step" 0 1
+	# should see one vCont;r.
+	exec_cmd_expect_vCont_count "step" 1
 	gdb_test_no_output "tstop"
 	gdb_test "tfind" "Found trace frame .*" "first tfind"
 	gdb_test "tfind" \
diff --git a/gdb/testsuite/lib/range-stepping-support.exp b/gdb/testsuite/lib/range-stepping-support.exp
index d6c0e85..1b27309 100644
--- a/gdb/testsuite/lib/range-stepping-support.exp
+++ b/gdb/testsuite/lib/range-stepping-support.exp
@@ -14,15 +14,14 @@
 # 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.  Returns 0 if the test passes,
-# otherwise returns 1.
+# vCont;r packet.  Returns 0 if the test passes, otherwise returns 1.
 
-proc exec_cmd_expect_vCont_count { cmd exp_vCont_s exp_vCont_r } {
+proc exec_cmd_expect_vCont_count { cmd exp_vCont_r } {
     global gdb_prompt
 
     gdb_test_no_output "set debug remote 1" ""
 
-    set test "${cmd}: vCont;s=${exp_vCont_s} vCont;r=${exp_vCont_r}"
+    set test "${cmd}: vCont;r=${exp_vCont_r}"
     set r_counter 0
     set s_counter 0
     set ret 1
@@ -40,7 +39,7 @@ proc exec_cmd_expect_vCont_count { cmd exp_vCont_s exp_vCont_r } {
 	    exp_continue
 	}
 	-re "$gdb_prompt $" {
-	    if { $r_counter == ${exp_vCont_r} && $s_counter == ${exp_vCont_s} } {
+	    if { $r_counter == ${exp_vCont_r} } {
 		pass $test
 		set ret 0
 	    } else {
-- 
1.9.1



More information about the Gdb-patches mailing list