OLD | NEW |
1 # Copyright 2000, 2004, 2006-2012 Free Software Foundation, Inc. | 1 # Copyright 2000, 2004, 2006-2012 Free Software Foundation, Inc. |
2 | 2 |
3 # This program is free software; you can redistribute it and/or modify | 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 | 4 # it under the terms of the GNU General Public License as published by |
5 # the Free Software Foundation; either version 3 of the License, or | 5 # the Free Software Foundation; either version 3 of the License, or |
6 # (at your option) any later version. | 6 # (at your option) any later version. |
7 # | 7 # |
8 # This program is distributed in the hope that it will be useful, | 8 # This program is distributed in the hope that it will be useful, |
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of | 9 # but WITHOUT ANY WARRANTY; without even the implied warranty of |
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
11 # GNU General Public License for more details. | 11 # GNU General Public License for more details. |
12 # | 12 # |
13 # You should have received a copy of the GNU General Public License | 13 # You should have received a copy of the GNU General Public License |
14 # along with this program. If not, see <http://www.gnu.org/licenses/>. | 14 # along with this program. If not, see <http://www.gnu.org/licenses/>. |
15 | 15 |
16 # This file was written by Anthony Green. (green@redhat.com) | 16 # This file was written by Anthony Green. (green@redhat.com) |
17 # | 17 # |
18 | 18 |
19 if $tracelevel then { | |
20 strace $tracelevel | |
21 } | |
22 | |
23 load_lib "java.exp" | 19 load_lib "java.exp" |
24 | 20 |
25 if { [skip_java_tests] } { continue } | 21 if { [skip_java_tests] } { continue } |
26 | 22 |
27 set testfile "jmisc" | 23 standard_testfile .java |
28 set srcfile ${srcdir}/$subdir/${testfile}.java | 24 if {[compile_java_from_source $srcdir/$subdir/$srcfile $binfile "-g"] != ""} { |
29 set binfile ${objdir}/${subdir}/${testfile} | |
30 if {[compile_java_from_source ${srcfile} ${binfile} "-g"] != ""} { | |
31 continue | 25 continue |
32 } | 26 } |
33 | 27 |
34 | 28 |
35 # Start with a fresh gdb. | 29 # Start with a fresh gdb. |
36 | 30 |
37 gdb_exit | 31 gdb_exit |
38 gdb_start | 32 gdb_start |
39 gdb_reinitialize_dir $srcdir/$subdir | 33 gdb_reinitialize_dir $srcdir/$subdir |
40 gdb_load $binfile | 34 gdb_load $binfile |
41 | 35 |
42 gdb_test "set print sevenbit-strings" ".*" | 36 gdb_test "set print sevenbit-strings" ".*" |
43 | 37 |
44 if [set_lang_java] then { | 38 if [set_lang_java] then { |
45 # Ref PR gdb:java/1565. Don't use the simpler "break jmisc.main". | 39 # Ref PR gdb:java/1565. Don't use the simpler "break jmisc.main". |
46 # As of 2004-02-24 it wasn't working and is being tested separatly. | 40 # As of 2004-02-24 it wasn't working and is being tested separatly. |
47 # Before GCJ 4.1 (approximately) the demangled name did not include | 41 # Before GCJ 4.1 (approximately) the demangled name did not include |
48 # a method signature; after that point it does include a trailing | 42 # a method signature; after that point it does include a trailing |
49 # signature. | 43 # signature. |
50 runto_main | 44 runto_main |
51 set function "${testfile}.main(java.lang.String\[\])" | 45 set function "${testfile}.main(java.lang.String\[\])" |
52 gdb_breakpoint "$function" { allow-pending } | 46 gdb_breakpoint "$function" allow-pending |
53 gdb_breakpoint "${function}void" { allow-pending } | 47 gdb_breakpoint "${function}void" allow-pending |
54 gdb_continue_to_breakpoint $function | 48 gdb_continue_to_breakpoint $function |
55 | 49 |
56 gdb_test_multiple "ptype jmisc" "ptype jmisc" { | 50 gdb_test_multiple "ptype jmisc" "ptype jmisc" { |
57 -re "type = class jmisc extends java.lang.Object \{\[\r\n\ \t]+void mai
n\\(java\.lang\.String\\\[]\\);\[\r\n\ \t]+jmisc\\(\\);\[\r\n\ \t]+\}\[\r\n\ \t]
+$gdb_prompt $" { | 51 -re "type = class jmisc extends java.lang.Object \{\[\r\n\ \t]+void mai
n\\(java\.lang\.String\\\[]\\);\[\r\n\ \t]+jmisc\\(\\);\[\r\n\ \t]+\}\[\r\n\ \t]
+$gdb_prompt $" { |
58 pass "ptype jmisc" | 52 pass "ptype jmisc" |
59 } | 53 } |
60 -re "type = class jmisc extends java.lang.Object \{\[\r\n\ \t]+jmisc\\(
\\);\[\r\n\ \t]+void main\\(java\.lang\.String\\\[]\\);\[\r\n\ \t]+\}\[\r\n\ \t]
+$gdb_prompt $" { | 54 -re "type = class jmisc extends java.lang.Object \{\[\r\n\ \t]+jmisc\\(
\\);\[\r\n\ \t]+void main\\(java\.lang\.String\\\[]\\);\[\r\n\ \t]+\}\[\r\n\ \t]
+$gdb_prompt $" { |
61 pass "ptype jmisc" | 55 pass "ptype jmisc" |
62 } | 56 } |
63 } | 57 } |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 } | 95 } |
102 } | 96 } |
103 } | 97 } |
104 } | 98 } |
105 } | 99 } |
106 | 100 |
107 # Test a non-mathing return type really fails the look up. | 101 # Test a non-mathing return type really fails the look up. |
108 gdb_test_no_output "set breakpoint pending off" | 102 gdb_test_no_output "set breakpoint pending off" |
109 gdb_test {break jmisc.main(java.lang.String[])int} {Function "jmisc\.main\(j
ava\.lang\.String\[\]\)int" not defined\.} | 103 gdb_test {break jmisc.main(java.lang.String[])int} {Function "jmisc\.main\(j
ava\.lang\.String\[\]\)int" not defined\.} |
110 } | 104 } |
OLD | NEW |