-# Copyright 2013 Free Software Foundation, Inc.
+# Copyright 2013-2016 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
}
if ![runto_main] {
- fail "Can't run to main"
+ fail "can't run to main"
return -1
}
-# Check whether range stepping is supported by the target.
-
-proc gdb_range_stepping_enabled { } {
- global gdb_prompt
-
- set command "set range-stepping on"
- set message "probe range-stepping support"
- gdb_test_multiple $command $message {
- -re "Range stepping is not supported.*\r\n$gdb_prompt $" {
- pass $message
- return 0
- }
- -re "^$command\r\n$gdb_prompt $" {
- pass $message
- return 1
- }
- }
-
- return 0
-}
-
if ![gdb_range_stepping_enabled] {
unsupported "range stepping not supported by the target"
return -1
# <-- 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
# <-- 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.
# --> $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
# 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"
# 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"
# Check that range stepping works well even when it is interrupted by
# ctrl-c.
-with_test_prefix "interrupt" {
- gdb_test_no_output "set debug remote 1"
-
- send_gdb "next\n"
- sleep 1
- send_gdb "\003"
-
- # GDB should send one vCont;r and receive one stop reply for
- # SIGINT:
- # --> vCont;rSTART,END (range step)
- # <-- T02 (SIGINT)
-
- set vcont_r_counter 0
-
- set test "send ctrl-c to GDB"
- gdb_test_multiple "" $test {
- -re "vCont;r\[^\r\n\]*\.\.\." {
- incr vcont_r_counter
- exp_continue
+if ![target_info exists gdb,nointerrupts] {
+ with_test_prefix "interrupt" {
+ gdb_test_no_output "set debug remote 1"
+
+ send_gdb "next\n"
+ sleep 1
+ send_gdb "\003"
+
+ # GDB should send one vCont;r and receive one stop reply for
+ # SIGINT:
+ # --> vCont;rSTART,END (range step)
+ # <-- T02 (SIGINT)
+
+ set vcont_r_counter 0
+
+ set test "send ctrl-c to GDB"
+ gdb_test_multiple "" $test {
+ -re "vCont;r\[^\r\n\]*\.\.\." {
+ incr vcont_r_counter
+ exp_continue
+ }
+ -re "Program received signal SIGINT.*$gdb_prompt $" {
+ pass $test
+ }
}
- -re "Program received signal SIGINT.*$gdb_prompt $" {
- pass $test
+ gdb_test_no_output "set debug remote 0"
+
+ # Check the number of 'vCont;r' packets.
+ if { $vcont_r_counter == 1 } {
+ pass "${test}: 1 vCont;r"
+ } else {
+ fail "${test}: 1 vCont;r"
}
- }
- gdb_test_no_output "set debug remote 0"
- # Check the number of 'vCont;r' packets.
- if { $vcont_r_counter == 1 } {
- pass "${test}: 1 vCont;r"
- } else {
- fail "${test}: 1 vCont;r"
+ # Break the loop earlier and continue range stepping.
+ gdb_test "set variable c = 0"
+ exec_cmd_expect_vCont_count "next" 1
}
-
- # Break the loop earlier and continue range stepping.
- gdb_test "set variable c = 0"
- exec_cmd_expect_vCont_count "next" 0 1
}
# Check that range stepping doesn't break software watchpoints. With