2 # Free Software Foundation, Inc.
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 2 of the License, or
7 # (at your option) any later version.
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.
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 # This file is part of the gdb testsuite
20 # This tests setting a break in an ambiguous c++ method with
21 # current_language set to c.
23 if { [skip_cplus_tests] } { continue }
25 set testfile "method2"
26 set srcfile ${testfile}.cc
27 set binfile ${objdir}/${subdir}/${testfile}
29 if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } {
34 if [get_compiler_info $binfile "c++"] {
40 gdb_reinitialize_dir $srcdir/$subdir
43 if ![runto_main] then {
44 perror "couldn't run to breakpoint"
48 proc test_break { lang } {
51 gdb_test "set lang $lang" \
53 "setting language $lang"
55 send_gdb "break A::method\n"
57 -re ".0. cancel.*\[\r\n\]*.1. all.*\[\r\n\]*.2. A::method\\(A\\*\\) at .*\[\r\n\]*.3. A::method\\(int\\) at .*\[\r\n\]*\[\r\n\]*.4. A::method\\(\\) at .*\[\r\n\]*> $" {
60 "breaking in method ($lang)"
62 -re ".*$gdb_prompt $" { fail "breaking in method ($lang)" }
63 default { fail "breaking in method ($lang) (timeout)" }
70 gdb_continue_to_end "continue to end"