From 80f0110c98d4134409f38e7d498e89fe96773819 Mon Sep 17 00:00:00 2001 From: Yao Qi Date: Wed, 21 Oct 2015 16:16:25 +0100 Subject: [PATCH] Remove checking vCont;s in exec_cmd_expect_vCont_count 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, 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 * 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/ChangeLog | 7 +++++++ gdb/testsuite/gdb.base/range-stepping.exp | 14 +++++++------- gdb/testsuite/gdb.trace/range-stepping.exp | 4 ++-- gdb/testsuite/lib/range-stepping-support.exp | 9 ++++----- 4 files changed, 20 insertions(+), 14 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 8233d67cbf..37e2bb8b75 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,10 @@ +2015-10-21 Yao Qi + + * 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. + 2015-10-21 Aleksandar Ristovski * gdb/nto-tdep.c (QNX_NOTE_NAME, QNX_INFO_SECT_NAME): New defines. diff --git a/gdb/testsuite/gdb.base/range-stepping.exp b/gdb/testsuite/gdb.base/range-stepping.exp index 2ff371d159..79667ba7b7 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 dfc16d546d..67eddae533 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 d6c0e85fb8..1b273093af 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 . # 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 {