1 # Copyright (C) 2011-2018 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/>.
16 # Test "save breakpoints" + "break -qualified".
20 if { [build_executable "failed to prepare" ${testfile} $srcfile {debug c++}] } {
27 clean_restart $testfile
30 untested "could not run to main"
33 # Delete all breakpoints so that the "runto_main" breakpoint above
34 # does not interfere with our testing.
40 with_test_prefix "save" {
45 gdb_breakpoint "function" qualified
46 gdb_breakpoint "function"
48 # Save the breakpoints into a file.
49 if {[is_remote host]} {
52 set bps [standard_output_file bps]
54 remote_file host delete "$bps"
55 gdb_test "save breakpoint $bps" "" "save breakpoint bps"
58 with_test_prefix "restore" {
63 # Restore the breakpoints.
64 gdb_test "source $bps" "" "source bps"
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" \