1 # Copyright 2000, 2004, 2007 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 2 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, write to the Free Software
15 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 # This file was based on jmisc.exp which in turn was written by
18 # Anthony Green. (green@redhat.com)
26 if { [skip_java_tests] } { continue }
29 set srcfile ${srcdir}/$subdir/${testfile}.java
30 set binfile ${objdir}/${subdir}/${testfile}
31 if {[compile_java_from_source ${srcfile} ${binfile} "-g"] != ""} {
38 # Start with a fresh gdb.
42 gdb_reinitialize_dir $srcdir/$subdir
44 gdb_test "set print sevenbit-strings" ".*"
46 # Check that plain old "main" works. The load should both set the
47 # language to java and (since --main=jmain), some how set the scope to
50 # Where the breakpoint should always land
52 set bpmain "Breakpoint .* file .*jmain.java, line 5\."
55 setup_kfail *-*-* java/1567
56 gdb_test "break main" "${bpmain}"
58 # Check that an unqualified "main" works.
62 setup_kfail *-*-* java/1565
63 gdb_test "break jmain.main" "${bpmain}"
65 # Check that a fully qualified "main" works.
67 setup_xfail *-*-* gcc/16439
68 gdb_test "break \'${testfile}.main(java.lang.String\[\])\'" "${bpmain}"