]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blob - gdb/testsuite/gdb.dap/cxx-exception.exp
Update copyright year range in header of all files managed by GDB
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.dap / cxx-exception.exp
1 # Copyright 2023-2024 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 load_lib ada.exp
17 load_lib dap-support.exp
18
19 require allow_cplus_tests allow_dap_tests
20
21 standard_testfile .cc
22
23 if {[build_executable ${testfile}.exp $testfile $srcfile {debug c++}] == -1} {
24 return
25 }
26
27 if {[dap_launch $testfile] == ""} {
28 return
29 }
30
31 set obj [dap_check_request_and_response "set exception catchpoints" \
32 setExceptionBreakpoints \
33 {o filters [a [s throw] [s rethrow] [s catch]]}]
34
35 set bps [dict get [lindex $obj 0] body breakpoints]
36 # We should get three responses, because we requested three
37 # breakpoints.
38 gdb_assert {[llength $bps] == 3} "three breakpoints"
39
40 dap_check_request_and_response "start inferior" configurationDone
41
42 dap_wait_for_event_and_check "stopped at throw" stopped \
43 "body reason" breakpoint \
44 "body hitBreakpointIds" 1
45
46 dap_check_request_and_response "continue to catch" continue \
47 {o threadId [i 1]}
48 dap_wait_for_event_and_check "stopped at catch" stopped \
49 "body reason" breakpoint \
50 "body hitBreakpointIds" 3
51
52 dap_check_request_and_response "continue to rethrow" continue \
53 {o threadId [i 1]}
54 dap_wait_for_event_and_check "stopped at rethrow" stopped \
55 "body reason" breakpoint \
56 "body hitBreakpointIds" 2
57
58 dap_shutdown