Fix test names starting with uppercase output by basic functions
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.base / range-stepping.exp
index 2a83331b72b574fe48c135944ff4dfed08509656..9ed92c78219fe3f40dae72f4e09a13f732a045b1 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright 2013-2014 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
@@ -23,31 +23,10 @@ if { [prepare_for_testing $testfile.exp $testfile $srcfile {debug}] } {
 }
 
 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
@@ -76,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
@@ -132,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" 2
+    exec_cmd_expect_vCont_count "next" 2
 }
 
 # Check that breakpoints interrupt range stepping correctly.
@@ -145,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" 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" 0
+    exec_cmd_expect_vCont_count "stepi" 0
     gdb_test "finish" ".*"
     gdb_test "next" ".*"
     delete_breakpoints
@@ -166,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" 1
+    exec_cmd_expect_vCont_count "next" 1
 
     # Confirm the loop completed.
     gdb_test "print a" " = 15"
@@ -183,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" 1
+    exec_cmd_expect_vCont_count "next" 1
 
     # Confirm the loop completed.
     gdb_test "print a" " = 15"
@@ -193,42 +172,44 @@ with_test_prefix "loop 2" {
 # 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
This page took 0.032907 seconds and 4 git commands to generate.