]>
Commit | Line | Data |
---|---|---|
618f726f | 1 | # Copyright 2000-2016 Free Software Foundation, Inc. |
11422c86 AC |
2 | |
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 | |
e22f8b7c | 5 | # the Free Software Foundation; either version 3 of the License, or |
11422c86 | 6 | # (at your option) any later version. |
e22f8b7c | 7 | # |
11422c86 AC |
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. | |
e22f8b7c | 12 | # |
11422c86 | 13 | # You should have received a copy of the GNU General Public License |
e22f8b7c | 14 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
11422c86 AC |
15 | |
16 | # This file was based on jmisc.exp which in turn was written by | |
17 | # Anthony Green. (green@redhat.com) | |
18 | ||
11422c86 AC |
19 | load_lib "java.exp" |
20 | ||
ec3c07fc NS |
21 | if { [skip_java_tests] } { continue } |
22 | ||
c24ccbce TT |
23 | standard_testfile .java |
24 | if {[compile_java_from_source $srcdir/$subdir/$srcfile $binfile "-g"] != ""} { | |
ec3c07fc | 25 | continue |
11422c86 AC |
26 | } |
27 | ||
11422c86 AC |
28 | |
29 | # Start with a fresh gdb. | |
30 | ||
31 | gdb_exit | |
32 | gdb_start | |
33 | gdb_reinitialize_dir $srcdir/$subdir | |
34 | ||
35 | gdb_test "set print sevenbit-strings" ".*" | |
36 | ||
37 | # Check that plain old "main" works. The load should both set the | |
38 | # language to java and (since --main=jmain), some how set the scope to | |
39 | # jmain's main. | |
40 | ||
41 | # Where the breakpoint should always land | |
42 | ||
935c2760 | 43 | set bpmain "Breakpoint .* file .*jmain.java, line 5\." |
11422c86 | 44 | |
b1d53152 DJ |
45 | # Where GCC PR 16439 puts the breakpoint. |
46 | set earlybpmain "Breakpoint .* file .*jmain.java, line 4\." | |
47 | ||
11422c86 | 48 | gdb_load "${binfile}" |
bbc8b958 | 49 | setup_kfail java/1567 *-*-* |
11422c86 AC |
50 | gdb_test "break main" "${bpmain}" |
51 | ||
52 | # Check that an unqualified "main" works. | |
53 | ||
11422c86 | 54 | gdb_load "${binfile}" |
bbc8b958 | 55 | setup_kfail java/1565 *-*-* |
11422c86 AC |
56 | gdb_test "break jmain.main" "${bpmain}" |
57 | ||
58 | # Check that a fully qualified "main" works. | |
59 | gdb_load "${binfile}" | |
cec808ec | 60 | set cmd "break ${testfile}.main(java.lang.String\[\])" |
b1d53152 DJ |
61 | set msg $cmd |
62 | gdb_test_multiple $cmd $msg { | |
63 | -re "${bpmain}\r\n$gdb_prompt $" { | |
64 | pass $msg | |
65 | } | |
66 | -re "${earlybpmain}\r\n$gdb_prompt $" { | |
67 | setup_xfail *-*-* gcc/16439 | |
68 | fail $msg | |
69 | } | |
70 | -re "Make breakpoint pending.* \\(y or \\\[n\\\]\\) $" { | |
71 | gdb_test "n" "" "" | |
72 | ||
73 | # Check again with a method signature at the end. | |
cec808ec | 74 | set cmd "break ${testfile}.main(java.lang.String\[\])void" |
b1d53152 DJ |
75 | set msg $cmd |
76 | gdb_test_multiple $cmd $msg { | |
77 | -re "${bpmain}\r\n$gdb_prompt $" { | |
78 | pass $msg | |
79 | } | |
80 | -re "${earlybpmain}\r\n$gdb_prompt $" { | |
81 | setup_xfail *-*-* gcc/16439 | |
82 | fail $msg | |
83 | } | |
84 | } | |
85 | } | |
86 | } | |
87 |