| OLD | NEW |
| 1 # Copyright 2009-2012 Free Software Foundation, Inc. | 1 # Copyright 2009-2012 Free Software Foundation, Inc. |
| 2 | 2 |
| 3 # This program is free software; you can redistribute it and/or modify | 3 # This program is free software; you can redistribute it and/or modify |
| 4 # it under the terms of the GNU General Public License as published by | 4 # it under the terms of the GNU General Public License as published by |
| 5 # the Free Software Foundation; either version 3 of the License, or | 5 # the Free Software Foundation; either version 3 of the License, or |
| 6 # (at your option) any later version. | 6 # (at your option) any later version. |
| 7 # | 7 # |
| 8 # This program is distributed in the hope that it will be useful, | 8 # This program is distributed in the hope that it will be useful, |
| 9 # but WITHOUT ANY WARRANTY; without even the implied warranty of | 9 # but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 # in-frame). The default handler calls std::terminate. This will kill | 24 # in-frame). The default handler calls std::terminate. This will kill |
| 25 # the inferior. Assert that terminate should never be called in an | 25 # the inferior. Assert that terminate should never be called in an |
| 26 # inferior function call. These tests test the functionality around | 26 # inferior function call. These tests test the functionality around |
| 27 # unwinding that sequence and also tests the flag behaviour gating this | 27 # unwinding that sequence and also tests the flag behaviour gating this |
| 28 # functionality. | 28 # functionality. |
| 29 # | 29 # |
| 30 # PR c++/9600. | 30 # PR c++/9600. |
| 31 | 31 |
| 32 # This test is largely based of gdb.base/callfuncs.exp. | 32 # This test is largely based of gdb.base/callfuncs.exp. |
| 33 | 33 |
| 34 if $tracelevel then { | |
| 35 strace $tracelevel | |
| 36 } | |
| 37 | |
| 38 if { [skip_cplus_tests] } { continue } | 34 if { [skip_cplus_tests] } { continue } |
| 39 | 35 |
| 40 if [target_info exists gdb,nosignals] { | 36 if [target_info exists gdb,nosignals] { |
| 41 verbose "Skipping gdb2495.exp because of nosignals." | 37 verbose "Skipping gdb2495.exp because of nosignals." |
| 42 continue | 38 continue |
| 43 } | 39 } |
| 44 | 40 |
| 45 # On SPU this test fails because the executable exceeds local storage size. | 41 # On SPU this test fails because the executable exceeds local storage size. |
| 46 if { [istarget "spu*-*-*"] } { | 42 if { [istarget "spu*-*-*"] } { |
| 47 return 0 | 43 return 0 |
| 48 } | 44 } |
| 49 | 45 |
| 50 set testfile "gdb2495" | 46 standard_testfile .cc |
| 51 set srcfile ${testfile}.cc | |
| 52 set binfile $objdir/$subdir/$testfile | |
| 53 | 47 |
| 54 # Create and source the file that provides information about the compiler | 48 # Create and source the file that provides information about the compiler |
| 55 # used to compile the test case. | 49 # used to compile the test case. |
| 56 if [get_compiler_info ${binfile} "c++"] { | 50 if [get_compiler_info "c++"] { |
| 57 return -1 | 51 return -1 |
| 58 } | 52 } |
| 59 | 53 |
| 60 if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debu
g c++}] != "" } { | |
| 61 untested gdb2495.exp | |
| 62 return -1 | |
| 63 } | |
| 64 | |
| 65 # Some targets can't do function calls, so don't even bother with this | 54 # Some targets can't do function calls, so don't even bother with this |
| 66 # test. | 55 # test. |
| 67 if [target_info exists gdb,cannot_call_functions] { | 56 if [target_info exists gdb,cannot_call_functions] { |
| 68 setup_xfail "*-*-*" 2416 | 57 setup_xfail "*-*-*" 2416 |
| 69 fail "This target can not call functions" | 58 fail "This target can not call functions" |
| 70 continue | 59 continue |
| 71 } | 60 } |
| 72 | 61 |
| 73 gdb_exit | 62 if {[prepare_for_testing $testfile.exp $testfile $srcfile {debug c++}]} { |
| 74 gdb_start | 63 return -1 |
| 75 gdb_reinitialize_dir $srcdir/$subdir | 64 } |
| 76 gdb_load ${binfile} | |
| 77 | 65 |
| 78 if ![runto_main] then { | 66 if ![runto_main] then { |
| 79 perror "couldn't run to main" | 67 perror "couldn't run to main" |
| 80 continue | 68 continue |
| 81 } | 69 } |
| 82 | 70 |
| 83 # See http://sourceware.org/gdb/bugs/2495 | 71 # See http://sourceware.org/gdb/bugs/2495 |
| 84 | 72 |
| 85 # Test normal baseline behaviour. Call a function that | 73 # Test normal baseline behaviour. Call a function that |
| 86 # does not raise an exception. | 74 # does not raise an exception. |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 | 145 |
| 158 # Check that it is actually turned off. | 146 # Check that it is actually turned off. |
| 159 gdb_test "show unwindonsignal" \ | 147 gdb_test "show unwindonsignal" \ |
| 160 "signal is received while in a call dummy is off.*" \ | 148 "signal is received while in a call dummy is off.*" \ |
| 161 "Turn off unwind on signal" | 149 "Turn off unwind on signal" |
| 162 | 150 |
| 163 # Check to see if new behaviour interferes with | 151 # Check to see if new behaviour interferes with |
| 164 # normal signal handling in inferior function calls. | 152 # normal signal handling in inferior function calls. |
| 165 gdb_test "p exceptions.raise_signal(1)" \ | 153 gdb_test "p exceptions.raise_signal(1)" \ |
| 166 "To change this behavior use \"set unwindonsignal on\".*" | 154 "To change this behavior use \"set unwindonsignal on\".*" |
| OLD | NEW |