gdb: Use UNSUPPORTED not XFAIL for unsupported target features
[external/binutils.git] / gdb / testsuite / gdb.base / call-signal-resume.exp
index 9c67941..a6b07cf 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright 2008, 2010-2012 Free Software Foundation, Inc.
+# Copyright 2008-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
 # 2) Inferior is stopped at a signal.  Upon resumption it should continue
 #    with that signal, regardless of whatever the hand-called function did.
 
-if $tracelevel then {
-       strace $tracelevel
-}
-
-if [target_info exists gdb,noinferiorio] {
-    verbose "Skipping call-signal-resume.exp because of no fileio capabilities."
-    continue
-}
-
 if [target_info exists gdb,nosignals] {
     verbose "Skipping call-signal-resume.exp because of nosignals."
     continue
 }
 
 
-set testfile "call-signals"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile call-signals.c
 
 if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
      untested call-signal-resume.exp
@@ -47,8 +36,7 @@ if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb
 # Some targets can't do function calls, so don't even bother with this
 # test.
 if [target_info exists gdb,cannot_call_functions] {
-    setup_xfail "*-*-*" 2416
-    fail "This target can not call functions"
+    unsupported "This target can not call functions"
     continue
 }
 
@@ -65,10 +53,7 @@ proc get_dummy_frame_number { } {
 
 # Start with a fresh gdb.
 
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
+clean_restart ${binfile}
 
 if { ![runto_main] } {
     fail "Can't run to main"
@@ -81,15 +66,10 @@ gdb_test "continue" "Continuing.*Breakpoint \[0-9\]*, stop_one.*" \
 
 # Call function (causing the program to get a signal), and see if gdb handles
 # it properly.
-gdb_test_multiple "call gen_signal ()" \
-       "inferior function call signaled" {
-    -re "\[\r\n\]*no signal\[\r\n\]+$gdb_prompt $" {
-       unsupported "inferior function call signaled"
-       return 0
-    }
-    -re "\[\r\n\]*The program being debugged was signaled.*\[\r\n\]+$gdb_prompt $" {
-       pass "inferior function call signaled"
-    }
+if {[gdb_test "call gen_signal ()"  \
+        "\[\r\n\]*The program being debugged was signaled.*" \
+        "inferior function call signaled"] != 0} {
+    return 0
 }
 
 set frame_number [get_dummy_frame_number]
@@ -103,7 +83,19 @@ if { "$frame_number" == "" } {
 # Pop the dummy frame.
 gdb_test "frame $frame_number" ".*"
 gdb_test_no_output "set confirm off"
-gdb_test_no_output "return"
+gdb_test "return" ""
+
+# Verify there are no remains of the dummy frame.
+gdb_test_no_output "maintenance print dummy-frames"
+set test "maintenance info breakpoints"
+gdb_test_multiple $test $test {
+    -re " call dummy .*\r\n$gdb_prompt $" {
+       fail $test
+    }
+    -re "\r\n$gdb_prompt $" {
+       pass $test
+    }
+}
 
 # Resume execution, the program should continue without any signal.
 
@@ -136,7 +128,7 @@ if { "$frame_number" == "" } {
 # Pop the dummy frame.
 gdb_test "frame $frame_number" ".*"
 gdb_test_no_output "set confirm off"
-gdb_test_no_output "return"
+gdb_test "return" ""
 
 # Continue again, this time we should get to the signal handler.