Fix some duplicate test names
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.base / sigbpt.exp
index 960d5891852f1a613a42ac3f9f611ffc24667214..bd7e1d8db94a1fcb8d9ce3466225710f652b8b6b 100644 (file)
@@ -1,6 +1,6 @@
 # This testcase is part of GDB, the GNU debugger.
 
-# Copyright 2004, 2005, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+# Copyright 2004-2020 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
@@ -33,32 +33,20 @@ if [target_info exists gdb,nosignals] {
     continue
 }
 
-if $tracelevel {
-    strace $tracelevel
-}
 
-set prms_id 0
-set bug_id 0
+standard_testfile
 
-set testfile "sigbpt"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
-if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
-    untested sigbpt.exp
+if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
     return -1
 }
 
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
-
 #
 # Run to `main' where we begin our tests.
 #
 
 if ![runto_main] then {
-    gdb_suppress_tests
+    fail "can't run to main"
+    return 0
 }
 
 # If we can examine what's at memory address 0, it is possible that we
@@ -67,14 +55,9 @@ if ![runto_main] then {
 # especially on targets without an MMU.  Don't run the tests in that
 # case.
 
-send_gdb "x 0\n"
-gdb_expect {
-    -re "0x0:.*Cannot access memory at address 0x0.*$gdb_prompt $" { }
-    -re "0x0:.*Error accessing memory address 0x0.*$gdb_prompt $" { }
-    -re ".*$gdb_prompt $" {
-       untested "Memory at address 0 is possibly executable"
-       return
-    }
+if { [is_address_zero_readable] } {
+    untested "memory at address 0 is possibly executable"
+    return
 }
 
 gdb_test "break keeper"
@@ -89,7 +72,7 @@ gdb_test "break keeper"
 set bowler_addrs bowler
 set segv_addr none
 gdb_test {display/i $pc}
-gdb_test "advance *bowler" "bowler.*" "advance to the bowler"
+gdb_test "advance bowler" "bowler.*" "advance to the bowler"
 set test "stepping to fault"
 set signame "SIGSEGV"
 gdb_test_multiple "stepi" "$test" {
@@ -136,7 +119,7 @@ proc after_segv { } {
 
 # Check that the address table and SIGSEGV correspond.
 
-set test "Verify that ${signame} occurs at the last STEPI insn"
+set test "verify that ${signame} occurs at the last STEPI insn"
 if {[string compare $segv_addr [at_segv]] == 0} {
     pass "$test"
 } else {
@@ -155,10 +138,12 @@ proc stepi_out { name args } {
     # disable SIGSEGV, ensuring that further signals stop the
     # inferior.  Stops a SIGSEGV infinite loop when a broke system
     # keeps re-executing the faulting instruction.
-    rerun_to_main
-    gdb_test "handle ${signame} nostop print pass" "" "${name}; pass ${signame}"
+    with_test_prefix $name {
+       rerun_to_main
+    }
+    gdb_test "handle ${signame} nostop print pass" ".*" "${name}; pass ${signame}"
     gdb_test "continue" "keeper.*" "${name}; continue to keeper"
-    gdb_test "handle ${signame} stop print nopass" "" "${name}; nopass ${signame}"
+    gdb_test "handle ${signame} stop print nopass" ".*" "${name}; nopass ${signame}"
 
     # Insert all the breakpoints.  To avoid the need to step over
     # these instructions, this is delayed until after the keeper has
@@ -173,7 +158,11 @@ proc stepi_out { name args } {
     set test "${name}; stepi out of handler"
     gdb_test_multiple "stepi" "$test" {
        -re "Could not insert single-step breakpoint.*$gdb_prompt $" {
-           setup_kfail "sparc*-*-openbsd*" gdb/1736
+           setup_kfail gdb/8841 "sparc*-*-openbsd*"
+           fail "$test (could not insert single-step breakpoint)"
+       }
+       -re "Cannot insert breakpoint.*Cannot access memory.*$gdb_prompt $" {
+           setup_kfail gdb/8841 "nios2*-*-linux*"
            fail "$test (could not insert single-step breakpoint)"
        }
        -re "keeper.*$gdb_prompt $" {
@@ -185,22 +174,22 @@ proc stepi_out { name args } {
            exp_continue
        }
        -re "Program received signal SIGSEGV.*$gdb_prompt $" {
-           kfail gdb/1702 "$test (executed fault insn)"
+           kfail gdb/8807 "$test (executed fault insn)"
        }
        -re "Breakpoint.*pc(\r\n| *)[at_segv] .*bowler.*$gdb_prompt $" {
            pass "$test (at breakpoint)"
        }
        -re "Breakpoint.*pc(\r\n| *)[after_segv] .*bowler.*$gdb_prompt $" {
-           kfail gdb/1702 "$test (executed breakpoint)"
+           kfail gdb/8807 "$test (executed breakpoint)"
        }
        -re "pc(\r\n| *)[at_segv] .*bowler.*$gdb_prompt $" {
            pass "$test"
        }
        -re "pc(\r\n| *)[after_segv] .*bowler.*$gdb_prompt $" {
-           kfail gdb/1702 "$test (skipped fault insn)"
+           kfail gdb/8807 "$test (skipped fault insn)"
        }
        -re "pc(\r\n| *)=> 0x\[a-z0-9\]* .*bowler.*$gdb_prompt $" {
-           kfail gdb/1702 "$test (corrupt pc)"
+           kfail gdb/8807 "$test (corrupt pc)"
        }
     }
 
@@ -225,10 +214,12 @@ proc cont_out { name args } {
     # disable SIGSEGV, ensuring that further signals stop the
     # inferior.  Stops a SIGSEGV infinite loop when a broke system
     # keeps re-executing the faulting instruction.
-    rerun_to_main
-    gdb_test "handle ${signame} nostop print pass" "" "${name}; pass ${signame}"
+    with_test_prefix $name {
+       rerun_to_main
+    }
+    gdb_test "handle ${signame} nostop print pass" ".*" "${name}; pass ${signame}"
     gdb_test "continue" "keeper.*" "${name}; continue to keeper"
-    gdb_test "handle ${signame} stop print nopass" "" "${name}; nopass ${signame}"
+    gdb_test "handle ${signame} stop print nopass" ".*" "${name}; nopass ${signame}"
 
     # Insert all the breakpoints.  To avoid the need to step over
     # these instructions, this is delayed until after the keeper has
This page took 0.034844 seconds and 4 git commands to generate.