X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=gdb%2Ftestsuite%2Fgdb.base%2Fcall-signal-resume.exp;h=a6b07cf72f0d3c5328b40b0b000daacfc6717940;hb=cad8e26d2a2c7cee04954624fbaf91f03eec50ec;hp=58a12c0afbefdc205b42b94e7e2bc56a897533ad;hpb=02e7ea18235aafdf5ebe7c6736914b5a2f2db2c1;p=external%2Fbinutils.git diff --git a/gdb/testsuite/gdb.base/call-signal-resume.exp b/gdb/testsuite/gdb.base/call-signal-resume.exp index 58a12c0..a6b07cf 100644 --- a/gdb/testsuite/gdb.base/call-signal-resume.exp +++ b/gdb/testsuite/gdb.base/call-signal-resume.exp @@ -1,4 +1,4 @@ -# Copyright 2008, 2010 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 @@ -20,24 +20,13 @@ # 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,38 +36,24 @@ 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 } proc get_dummy_frame_number { } { - global gdb_prompt - - send_gdb "bt\n" - gdb_expect { - -re "#(\[0-9\]*) *.*$gdb_prompt $" - { - return $expect_out(1,string) - } - -re "$gdb_prompt $" - { - return "" - } - timeout - { - return "" - } - } - return "" + global gdb_prompt + + gdb_test_multiple "bt" "backtrace" { + -re "#(\[0-9\]*) *.*$gdb_prompt $" { + return $expect_out(1,string) + } + } + return "" } # 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" @@ -91,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] @@ -111,10 +81,22 @@ if { "$frame_number" == "" } { } # Pop the dummy frame. -gdb_test "frame $frame_number" "" -gdb_test "set confirm off" "" +gdb_test "frame $frame_number" ".*" +gdb_test_no_output "set confirm off" 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. gdb_test "break stop_two" "Breakpoint \[0-9\]* at .*" @@ -144,8 +126,8 @@ if { "$frame_number" == "" } { } # Pop the dummy frame. -gdb_test "frame $frame_number" "" -gdb_test "set confirm off" "" +gdb_test "frame $frame_number" ".*" +gdb_test_no_output "set confirm off" gdb_test "return" "" # Continue again, this time we should get to the signal handler. @@ -156,7 +138,7 @@ gdb_test "continue" "Breakpoint \[0-9\]*, handle_signal.*" \ # Continue one last time, the program should exit normally. -gdb_test "continue" "Program exited normally." \ +gdb_test "continue" "$inferior_exited_re normally." \ "continue to program exit" return 0