-# Copyright 2008, 2009, 2010 Free Software Foundation, Inc.
+# Copyright 2008-2023 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
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-if $tracelevel then {
- strace $tracelevel
-}
-
-if { [skip_cplus_tests] } { continue }
+if { [skip_cplus_tests] } { return }
-set testfile "nextoverthrow"
-set srcfile ${testfile}.cc
-set binfile $objdir/$subdir/$testfile
+standard_testfile .cc
-# Create and source the file that provides information about the compiler
-# used to compile the test case.
-if [get_compiler_info ${binfile} "c++"] {
- untested nextoverthrow.exp
+if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
return -1
}
-if {[prepare_for_testing $testfile.exp $testfile $srcfile {debug c++}]} {
- return -1
-}
-
-if ![runto_main] then {
- perror "couldn't run to main"
- continue
+if {![runto_main]} {
+ return
}
-# See whether we have the needed unwinder hooks.
-set ok 1
-gdb_test_multiple "print _Unwind_DebugHook" "check for unwinder hook" {
- -re "= .*_Unwind_DebugHook.*\r\n$gdb_prompt $" {
- pass "check for unwinder hook"
- }
- -re "No symbol .* in current context.\r\n$gdb_prompt $" {
- # Pass the test so we don't get bogus fails in the results.
- pass "check for unwinder hook"
- set ok 0
- }
-}
-if {!$ok} {
+if {![skip_unwinder_tests]} {
unsupported "nextoverthrow.exp could not find _Unwind_DebugHook"
return -1
}
tbreak_and_cont "End: advance"
verify_testval "pre-check - advance" 8
+tbreak_and_cont "Start: resumebpt"
+gdb_test "tbreak _Unwind_RaiseException"
+gdb_test "continue" "Temporary breakpoint.*" "continuing to _Unwind_RaiseException"
+gdb_test "finish" "Run till exit .*"
+gdb_test {set $retpc=$pc}
+gdb_test {break *$retpc if dummy ()}
+tbreak_and_cont "Second: resumebpt"
+gdb_test "next"
+
tbreak_and_cont "done"
-verify_testval "post-check - advance" 9
+verify_testval "post-check - advance" 10