]>
Commit | Line | Data |
---|---|---|
42a4f53d | 1 | # Copyright (C) 2011-2019 Free Software Foundation, Inc. |
a20714ff PA |
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 | untested "could not run to main" | |
31 | return 0 | |
32 | } | |
33 | # Delete all breakpoints so that the "runto_main" breakpoint above | |
34 | # does not interfere with our testing. | |
35 | delete_breakpoints | |
36 | ||
37 | return 1 | |
38 | } | |
39 | ||
40 | with_test_prefix "save" { | |
41 | if ![restart] { | |
42 | return -1 | |
43 | } | |
44 | ||
45 | gdb_breakpoint "function" qualified | |
46 | gdb_breakpoint "function" | |
47 | ||
48 | # Save the breakpoints into a file. | |
49 | if {[is_remote host]} { | |
50 | set bps bps | |
51 | } else { | |
52 | set bps [standard_output_file bps] | |
53 | } | |
54 | remote_file host delete "$bps" | |
55 | gdb_test "save breakpoint $bps" "" "save breakpoint bps" | |
56 | } | |
57 | ||
58 | with_test_prefix "restore" { | |
59 | if ![restart] { | |
60 | return -1 | |
61 | } | |
62 | ||
63 | # Restore the breakpoints. | |
64 | gdb_test "source $bps" "" "source bps" | |
65 | ||
66 | # Verify that all breakpoints have been created correctly. | |
67 | gdb_test "info break" [multi_line \ | |
68 | "Num +Type +Disp +Enb +Address +What" \ | |
69 | "$decimal +breakpoint +keep +y +$hex +in function\\(\\) at \[^\r\n\]*$srcfile:$decimal" \ | |
70 | "$decimal +breakpoint +keep +y +<MULTIPLE> +" \ | |
71 | "$decimal.$decimal +y +$hex +in S::function\\(\\) at \[^\r\n\]*$srcfile:$decimal" \ | |
72 | "$decimal.$decimal +y +$hex +in function\\(\\) at \[^\r\n\]*$srcfile:$decimal" \ | |
73 | ] | |
74 | } |