* gdb.cp/extern-c.cc, gdb.cp/extern-c.exp: New test.
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.cp / extern-c.exp
CommitLineData
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
19if { [skip_cplus_tests] } { continue }
20
21set testfile "extern-c"
22set srcfile ${testfile}.cc
23set binfile ${objdir}/${subdir}/${testfile}
24
25if { [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
32gdb_exit
33gdb_start
34gdb_reinitialize_dir $srcdir/$subdir
35gdb_load ${binfile}
36
37runto_main
38
39if { [gdb_breakpoint "c_func"] == 1 } {
40 pass "setting breakpoint at c_func"
41}
42gdb_continue_to_breakpoint "c_func" ".*c_func.*"
43
44gdb_test "rbreak c_funcs" \
45 "Breakpoint.* at .*c_funcs_1.*Breakpoint.* at .*c_funcs_2.*"
46gdb_continue_to_breakpoint "c_funcs_1" ".*c_funcs_1.*"
47gdb_continue_to_breakpoint "c_funcs_2" ".*c_funcs_2.*"
This page took 0.024867 seconds and 4 git commands to generate.