xref: /netbsd-src/external/gpl3/gdb.old/dist/gdb/testsuite/gdb.cp/try_catch.exp (revision 32d1c65c71fbdb65a012e8392a62a757dd6853e9)
1# Copyright 2002-2023 Free Software Foundation, Inc.
2
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
5# the Free Software Foundation; either version 3 of the License, or
6# (at your option) any later version.
7#
8# This program is distributed in the hope that it will be useful,
9# but WITHOUT ANY WARRANTY; without even the implied warranty of
10# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11# GNU General Public License for more details.
12#
13# You should have received a copy of the GNU General Public License
14# along with this program.  If not, see <http://www.gnu.org/licenses/>.
15
16# Tests for member data
17# 2002-05-27  Benjamin Kosnik  <bkoz@redhat.com>
18
19# This file is part of the gdb testsuite
20
21if { [skip_stl_tests] } { return }
22
23#
24# test running programs
25#
26
27standard_testfile .cc
28
29if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
30    return -1
31}
32
33if {![runto_main]} {
34    return
35}
36
37gdb_breakpoint [gdb_get_line_number "marker 1-throw"]
38gdb_continue_to_breakpoint "marker 1-throw"
39
40gdb_breakpoint [gdb_get_line_number "marker 1-catch"]
41gdb_continue_to_breakpoint "marker 1-catch"
42
43gdb_breakpoint [gdb_get_line_number "marker 2-start"]
44gdb_continue_to_breakpoint "marker 2-start"
45
46gdb_breakpoint [gdb_get_line_number "marker 2-next"]
47gdb_continue_to_breakpoint "marker 2-next"
48
49gdb_breakpoint [gdb_get_line_number "marker 2-throw"]
50gdb_continue_to_breakpoint "marker 2-throw"
51
52gdb_breakpoint [gdb_get_line_number "marker 2-catch"]
53gdb_continue_to_breakpoint "marker 2-catch"
54
55gdb_breakpoint [gdb_get_line_number "marker 3-throw"]
56gdb_continue_to_breakpoint "marker 3-throw"
57
58gdb_breakpoint [gdb_get_line_number "marker 3-catch"]
59gdb_continue_to_breakpoint "marker 3-catch"
60
61gdb_breakpoint [gdb_get_line_number "marker test-complete"]
62gdb_continue_to_breakpoint "marker test-complete"
63gdb_test "p test" "= true"
64
65gdb_exit
66return 0
67