OLD | NEW |
1 # Copyright 2008-2012 Free Software Foundation, Inc. | 1 # Copyright 2008-2012 Free Software Foundation, Inc. |
2 | 2 |
3 # This program is free software; you can redistribute it and/or modify | 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 | 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 | 5 # the Free Software Foundation; either version 3 of the License, or |
6 # (at your option) any later version. | 6 # (at your option) any later version. |
7 # | 7 # |
8 # This program is distributed in the hope that it will be useful, | 8 # This program is distributed in the hope that it will be useful, |
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of | 9 # but WITHOUT ANY WARRANTY; without even the implied warranty of |
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
11 # GNU General Public License for more details. | 11 # GNU General Public License for more details. |
12 # | 12 # |
13 # You should have received a copy of the GNU General Public License | 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/>. | 14 # along with this program. If not, see <http://www.gnu.org/licenses/>. |
15 | 15 |
16 # This file is part of the gdb testsuite. | 16 # This file is part of the gdb testsuite. |
17 | 17 |
18 # This test verifies that setting breakpoint on line in inline | 18 # This test verifies that setting breakpoint on line in inline |
19 # function will fire in all instantiations of that function. | 19 # function will fire in all instantiations of that function. |
20 | 20 |
21 if $tracelevel then { | |
22 strace $tracelevel | |
23 } | |
24 | |
25 if { [skip_cplus_tests] } { continue } | 21 if { [skip_cplus_tests] } { continue } |
26 | 22 |
| 23 standard_testfile mb-inline1.cc mb-inline2.cc |
| 24 set hdrfile "${testfile}.h" |
27 | 25 |
28 set testfile "mb-inline" | 26 if [get_compiler_info "c++"] { |
29 set hdrfile "${testfile}.h" | |
30 set srcfile1 "${testfile}1.cc" | |
31 set objfile1 "${testfile}1.o" | |
32 set srcfile2 "${testfile}2.cc" | |
33 set objfile2 "${testfile}2.o" | |
34 set binfile "${objdir}/${subdir}/${testfile}" | |
35 | |
36 if { [gdb_compile "$srcdir/$subdir/$srcfile1" "$objdir/$subdir/$objfile1" objec
t {debug c++}] != "" } { | |
37 untested mb-inline.exp | |
38 return -1 | |
39 } | |
40 | |
41 if { [gdb_compile "$srcdir/$subdir/$srcfile2" "$objdir/$subdir/$objfile2" objec
t {debug c++}] != "" } { | |
42 untested mb-inline.exp | |
43 return -1 | |
44 } | |
45 | |
46 if { [gdb_compile "$objdir/$subdir/$objfile1 $objdir/$subdir/$objfile2" "${binf
ile}" executable {debug c++}] != "" } { | |
47 untested mb-inline.exp | |
48 return -1 | |
49 } | |
50 | |
51 if [get_compiler_info ${binfile} "c++"] { | |
52 return -1 | 27 return -1 |
53 } | 28 } |
54 | 29 |
55 gdb_exit | 30 if {[prepare_for_testing $testfile.exp $testfile \ |
56 gdb_start | 31 » [list $srcfile $srcfile2] {debug c++}]} { |
57 gdb_reinitialize_dir $srcdir/$subdir | 32 return -1 |
58 gdb_load ${binfile} | 33 } |
59 | 34 |
60 set bp_location [gdb_get_line_number "set breakpoint here" $hdrfile] | 35 set bp_location [gdb_get_line_number "set breakpoint here" $hdrfile] |
61 | 36 |
62 # Set a breakpoint with multiple locations. | 37 # Set a breakpoint with multiple locations. |
63 | 38 |
64 gdb_test "break $hdrfile:$bp_location" \ | 39 gdb_test "break $hdrfile:$bp_location" \ |
65 "Breakpoint.*at.*: $hdrfile:$bp_location. \\(2 locations\\).*" \ | 40 "Breakpoint.*at.*: $hdrfile:$bp_location. \\(2 locations\\).*" \ |
66 "set breakpoint" | 41 "set breakpoint" |
67 | 42 |
68 gdb_run_cmd | 43 gdb_run_cmd |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 | 104 |
130 gdb_test "break $hdrfile:$bp_location" \ | 105 gdb_test "break $hdrfile:$bp_location" \ |
131 "Breakpoint.*at.*: $hdrfile:$bp_location. \\(2 locations\\).*" \ | 106 "Breakpoint.*at.*: $hdrfile:$bp_location. \\(2 locations\\).*" \ |
132 "set multi_line_foo breakpoint" | 107 "set multi_line_foo breakpoint" |
133 gdb_test "continue" \ | 108 gdb_test "continue" \ |
134 ".*Breakpoint.*multi_line_foo \\(i=0\\).*" \ | 109 ".*Breakpoint.*multi_line_foo \\(i=0\\).*" \ |
135 "run to multi_line_foo breakpoint 4 afn" | 110 "run to multi_line_foo breakpoint 4 afn" |
136 gdb_test "continue" \ | 111 gdb_test "continue" \ |
137 ".*Breakpoint.*multi_line_foo \\(i=1\\).*" \ | 112 ".*Breakpoint.*multi_line_foo \\(i=1\\).*" \ |
138 "run to multi_line_foo breakpoint 4 bfn" | 113 "run to multi_line_foo breakpoint 4 bfn" |
OLD | NEW |