]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blob - gdb/testsuite/gdb.cp/save-bp-qualified.exp
Update copyright year range in header of all files managed by GDB
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.cp / save-bp-qualified.exp
1 # Copyright (C) 2011-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 # Test "save breakpoints" + "break -qualified".
17
18 standard_testfile .cc
19
20 if { [build_executable "failed to prepare" ${testfile} $srcfile {debug c++}] } {
21 return -1
22 }
23
24 proc restart {} {
25 global testfile
26
27 clean_restart $testfile
28
29 if ![runto_main] {
30 return 0
31 }
32 # Delete all breakpoints so that the "runto_main" breakpoint above
33 # does not interfere with our testing.
34 delete_breakpoints
35
36 return 1
37 }
38
39 with_test_prefix "save" {
40 if ![restart] {
41 return -1
42 }
43
44 gdb_breakpoint "function" qualified
45 gdb_breakpoint "function"
46
47 # Save the breakpoints into a file.
48 if {[is_remote host]} {
49 set bps bps
50 } else {
51 set bps [standard_output_file bps]
52 }
53 remote_file host delete "$bps"
54 gdb_test "save breakpoint $bps" "" "save breakpoint bps"
55 }
56
57 with_test_prefix "restore" {
58 if ![restart] {
59 return -1
60 }
61
62 # Restore the breakpoints.
63 gdb_test "source $bps" "" "source bps"
64
65 # Verify that all breakpoints have been created correctly.
66 gdb_test "info break" [multi_line \
67 "Num +Type +Disp +Enb +Address +What" \
68 "$decimal +breakpoint +keep +y +$hex +in function\\(\\) at \[^\r\n\]*$srcfile:$decimal" \
69 "$decimal +breakpoint +keep +y +<MULTIPLE> +" \
70 "$decimal.$decimal +y +$hex +in S::function\\(\\) at \[^\r\n\]*$srcfile:$decimal" \
71 "$decimal.$decimal +y +$hex +in function\\(\\) at \[^\r\n\]*$srcfile:$decimal" \
72 ]
73 }