1 # Copyright 2023-2024 Free Software Foundation, Inc.
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.
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.
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/>.
17 load_lib dap-support.exp
19 require allow_cplus_tests allow_dap_tests
23 if {[build_executable ${testfile}.exp $testfile $srcfile {debug c++}] == -1} {
27 if {[dap_launch $testfile] == ""} {
31 set obj [dap_check_request_and_response "set exception catchpoints" \
32 setExceptionBreakpoints \
33 {o filters [a [s throw] [s rethrow] [s catch]]}]
35 set bps [dict get [lindex $obj 0] body breakpoints]
36 # We should get three responses, because we requested three
38 gdb_assert {[llength $bps] == 3} "three breakpoints"
40 dap_check_request_and_response "start inferior" configurationDone
42 dap_wait_for_event_and_check "stopped at throw" stopped \
43 "body reason" breakpoint \
44 "body hitBreakpointIds" 1
46 dap_check_request_and_response "continue to catch" continue \
48 dap_wait_for_event_and_check "stopped at catch" stopped \
49 "body reason" breakpoint \
50 "body hitBreakpointIds" 3
52 dap_check_request_and_response "continue to rethrow" continue \
54 dap_wait_for_event_and_check "stopped at rethrow" stopped \
55 "body reason" breakpoint \
56 "body hitBreakpointIds" 2