Commit | Line | Data |
---|---|---|
b22a0510 DJ |
1 | # Copyright 2009 |
2 | # Free Software Foundation, Inc. | |
3 | ||
4 | # This program is free software; you can redistribute it and/or modify | |
5 | # it under the terms of the GNU General Public License as published by | |
6 | # the Free Software Foundation; either version 3 of the License, or | |
7 | # (at your option) any later version. | |
8 | # | |
9 | # This program is distributed in the hope that it will be useful, | |
10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 | # GNU General Public License for more details. | |
13 | # | |
14 | # You should have received a copy of the GNU General Public License | |
15 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | |
16 | ||
17 | # Test breakpoints on extern "C" functions implemented in C++. | |
18 | ||
19 | if { [skip_cplus_tests] } { continue } | |
20 | ||
21 | set testfile "extern-c" | |
22 | set srcfile ${testfile}.cc | |
23 | set binfile ${objdir}/${subdir}/${testfile} | |
24 | ||
25 | if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } { | |
26 | untested extern-c.exp | |
27 | return -1 | |
28 | } | |
29 | ||
30 | # Start with a fresh gdb | |
31 | ||
32 | gdb_exit | |
33 | gdb_start | |
34 | gdb_reinitialize_dir $srcdir/$subdir | |
35 | gdb_load ${binfile} | |
36 | ||
37 | runto_main | |
38 | ||
39 | if { [gdb_breakpoint "c_func"] == 1 } { | |
40 | pass "setting breakpoint at c_func" | |
41 | } | |
42 | gdb_continue_to_breakpoint "c_func" ".*c_func.*" | |
43 | ||
44 | gdb_test "rbreak c_funcs" \ | |
45 | "Breakpoint.* at .*c_funcs_1.*Breakpoint.* at .*c_funcs_2.*" | |
46 | gdb_continue_to_breakpoint "c_funcs_1" ".*c_funcs_1.*" | |
47 | gdb_continue_to_breakpoint "c_funcs_2" ".*c_funcs_2.*" |