diff options
author | Tom Tromey <tom@tromey.com> | 2016-10-05 08:44:34 -0600 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2016-10-06 10:10:40 -0600 |
commit | 9c37b5aed98e5996a9777a366bfcc371c0e1a92d (patch) | |
tree | ea2b3148f79fdd679281d7bdc9f1fd3a6d446613 /gdb/testsuite | |
parent | 78b86327b5301231005b08a7c589b2b58e6b4322 (diff) | |
download | gdb-9c37b5aed98e5996a9777a366bfcc371c0e1a92d.zip gdb-9c37b5aed98e5996a9777a366bfcc371c0e1a92d.tar.gz gdb-9c37b5aed98e5996a9777a366bfcc371c0e1a92d.tar.bz2 |
Remove Java support
This patch removes the Java support from gdb. gcj has not seen much
development or use for years now, and was recently removed from GCC.
This patch changes gdb to follow; in the unlikely event that there are
still users using gcj, they can continue to use an older gdb to debug.
Or, they can debug in C++ mode.
Built and regtested on x86-64 Fedora 24.
2016-10-06 Tom Tromey <tom@tromey.com>
* MAINTAINERS: Remove Java test maintainer.
* varobj.h (java_varobj_ops): Don't declare.
* valprint.h (struct value_print_options)
<pascal_static_field_print>: Update comment.
* utils.c (producer_is_gcc): Remove java reference.
* symtab.h (struct general_symbol_info): Remove java references.
(SYMBOL_SEARCH_NAME): Likewise.
* objfiles.c (allocate_objfile): Update comment.
* linespec.c (find_linespec_symbols): Remove java references.
* gnu-v3-abi.c (gnuv3_rtti_type, gnuv3_baseclass_offset): Remove
java references.
* gdbtypes.h (struct cplus_struct_type) <is_java>: Remove.
(TYPE_CPLUS_REALLY_JAVA): Remove.
* c-varobj.c (enum vsections): Update comment.
* symtab.c (symbol_set_language, symbol_set_names)
(symbol_natural_name, symbol_demangled_name)
(demangle_for_lookup, symbol_matches_domain)
(default_make_symbol_completion_list_break_on_1): Remove java
references.
(JAVA_PREFIX, JAVA_PREFIX_LEN): Remove.
* psymtab.c (match_partial_symbol, psymtab_search_name)
(lookup_partial_symbol): Remove java references.
* dwarf2read.c (find_slot_in_mapped_hash): Remove java references.
(add_partial_symbol, dwarf2_compute_name, dwarf2_physname)
(dwarf2_add_member_fn, is_vtable_name, read_structure_type)
(process_structure_scope, read_subroutine_type)
(read_subrange_type, load_partial_dies)
(new_symbol_full, determine_prefix, typename_concat)
(dwarf2_name): Remove java references.
(set_cu_language): Treat Java as C++.
* c-typeprint.c (c_type_print_args): Remove java reference.
* defs.h (enum language) <language_java>: Remove.
* Makefile.in (SFILES, HFILES_NO_SRCDIR, COMMON_OBS, YYFILES)
(YYOBJ, local-maintainer-clean): Don't mention java files.
* jv-exp.y, jv-lang.c, jv-lang.h, jv-typeprint.c, jv-valprint.c,
jv-varobj.c: Remove.
2016-10-06 Tom Tromey <tom@tromey.com>
* guile.texi (Types In Guile): Remove Java mentions.
* python.texi (Types In Python): Remove Java mentions.
* gdb.texinfo (Address Locations, Supported Languages)
(Index Section Format): Remove Java mentions.
2016-10-06 Tom Tromey <tom@tromey.com>
* gdb.compile/compile.exp: Change java tests to rust.
* gdb.base/setshow.exp: Change java tests to rust.
* gdb.base/default.exp: Remove java from language list.
* README (Examples): Update language example.
* gdb.python/py-lookup-type.exp (test_lookup_type): Remove java
test.
* lib/gdb.exp (skip_java_tests): Remove.
* lib/java.exp: Remove.
* gdb.java: Remove.
Diffstat (limited to 'gdb/testsuite')
-rw-r--r-- | gdb/testsuite/ChangeLog | 12 | ||||
-rw-r--r-- | gdb/testsuite/README | 2 | ||||
-rw-r--r-- | gdb/testsuite/gdb.base/default.exp | 2 | ||||
-rw-r--r-- | gdb/testsuite/gdb.base/setshow.exp | 8 | ||||
-rw-r--r-- | gdb/testsuite/gdb.compile/compile.exp | 4 | ||||
-rw-r--r-- | gdb/testsuite/gdb.java/jmain.exp | 87 | ||||
-rw-r--r-- | gdb/testsuite/gdb.java/jmain.java | 7 | ||||
-rw-r--r-- | gdb/testsuite/gdb.java/jmisc.exp | 104 | ||||
-rw-r--r-- | gdb/testsuite/gdb.java/jmisc.java | 7 | ||||
-rw-r--r-- | gdb/testsuite/gdb.java/jnpe.exp | 55 | ||||
-rw-r--r-- | gdb/testsuite/gdb.java/jnpe.java | 39 | ||||
-rw-r--r-- | gdb/testsuite/gdb.java/jprint.exp | 77 | ||||
-rw-r--r-- | gdb/testsuite/gdb.java/jprint.java | 68 | ||||
-rw-r--r-- | gdb/testsuite/gdb.java/jv-exp.exp | 41 | ||||
-rw-r--r-- | gdb/testsuite/gdb.java/jv-print.exp | 153 | ||||
-rw-r--r-- | gdb/testsuite/gdb.python/py-lookup-type.exp | 2 | ||||
-rw-r--r-- | gdb/testsuite/lib/gdb.exp | 6 | ||||
-rw-r--r-- | gdb/testsuite/lib/java.exp | 123 |
18 files changed, 20 insertions, 777 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 56d28ac..7157544 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,15 @@ +2016-10-06 Tom Tromey <tom@tromey.com> + + * gdb.compile/compile.exp: Change java tests to rust. + * gdb.base/setshow.exp: Change java tests to rust. + * gdb.base/default.exp: Remove java from language list. + * README (Examples): Update language example. + * gdb.python/py-lookup-type.exp (test_lookup_type): Remove java + test. + * lib/gdb.exp (skip_java_tests): Remove. + * lib/java.exp: Remove. + * gdb.java: Remove. + 2016-10-06 Maciej W. Rozycki <macro@imgtec.com> * gdb.arch/mips-fcr.exp: New test. diff --git a/gdb/testsuite/README b/gdb/testsuite/README index 152318a..037a340 100644 --- a/gdb/testsuite/README +++ b/gdb/testsuite/README @@ -484,7 +484,7 @@ ANSI/ISO C, and C++. gdb.<lang> Language-specific tests for any language besides C. Examples are -gdb.cp for C++ and gdb.java for Java. +gdb.cp for C++ and gdb.rust for Rust. gdb.<platform> diff --git a/gdb/testsuite/gdb.base/default.exp b/gdb/testsuite/gdb.base/default.exp index 38c3d4a..b8a449b 100644 --- a/gdb/testsuite/gdb.base/default.exp +++ b/gdb/testsuite/gdb.base/default.exp @@ -511,7 +511,7 @@ gdb_test "set history size" "Argument required .integer to set it to.*" "set his #test set history gdb_test "set history" "\"set history\" must be followed by the name of a history subcommand.(\[^\r\n\]*\[\r\n\])+List of set history subcommands:(\[^\r\n\]*\[\r\n\])+set history expansion -- Set history expansion on command input(\[^\r\n\]*\[\r\n\])+set history filename -- Set the filename in which to record the command history(\[^\r\n\]*\[\r\n\])+set history save -- Set saving of the history record on exit(\[^\r\n\]*\[\r\n\])+set history size -- Set the size of the command history(\[^\r\n\]*\[\r\n\])+Type \"help set history\" followed by set history subcommand name for full documentation.(\[^\r\n\]*\[\r\n\])+Command name abbreviations are allowed if unambiguous." "set history" #test set language -gdb_test "set language" "Requires an argument. Valid arguments are auto, local, unknown, ada, c, c.., asm, minimal, d, fortran, objective-c, go, java, modula-2, opencl, pascal, rust." "set language" +gdb_test "set language" "Requires an argument. Valid arguments are auto, local, unknown, ada, c, c.., asm, minimal, d, fortran, objective-c, go, modula-2, opencl, pascal, rust." "set language" #test set listsize gdb_test "set listsize" "Argument required .integer to set it to.*" "set listsize" #test set print "p" abbreviation diff --git a/gdb/testsuite/gdb.base/setshow.exp b/gdb/testsuite/gdb.base/setshow.exp index 2a86cdd..93dd926 100644 --- a/gdb/testsuite/gdb.base/setshow.exp +++ b/gdb/testsuite/gdb.base/setshow.exp @@ -211,10 +211,10 @@ gdb_test "show history size" "The size of the command history is 100..*" "show h gdb_test "set language asm" ".*" "set language asm" #test show language asm gdb_test "show language" "The current source language is \"asm\"..*" "show language (asm)" -#test set language java, with a trailing space -gdb_test_no_output "set language java " "set language java" -#test show language java -gdb_test "show language" "The current source language is \"java\"..*" "show language (java)" +#test set language rust, with a trailing space +gdb_test_no_output "set language rust " "set language rust" +#test show language rust +gdb_test "show language" "The current source language is \"rust\"..*" "show language (rust)" #test completion for set language. gdb_test "complete set language min" "set language minimal" \ "complete set language minimal" diff --git a/gdb/testsuite/gdb.compile/compile.exp b/gdb/testsuite/gdb.compile/compile.exp index f3c1cb9..610cf7e 100644 --- a/gdb/testsuite/gdb.compile/compile.exp +++ b/gdb/testsuite/gdb.compile/compile.exp @@ -322,9 +322,9 @@ gdb_test "show compile-args" \ "Compile command command-line arguments are .*" gdb_test "compile code -z" "Unknown argument.*" -gdb_test "set lang java" \ +gdb_test "set lang rust" \ "Warning: the current language does not match this frame." -gdb_test "compile code globalvar" "No compiler support for language java\\." +gdb_test "compile code globalvar" "No compiler support for language rust\\." gdb_test_no_output "set lang auto" gdb_test_no_output "compile code union union_type newdecl_u" diff --git a/gdb/testsuite/gdb.java/jmain.exp b/gdb/testsuite/gdb.java/jmain.exp deleted file mode 100644 index de9a6d3..0000000 --- a/gdb/testsuite/gdb.java/jmain.exp +++ /dev/null @@ -1,87 +0,0 @@ -# Copyright 2000-2016 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. - -# This file was based on jmisc.exp which in turn was written by -# Anthony Green. (green@redhat.com) - -load_lib "java.exp" - -if { [skip_java_tests] } { continue } - -standard_testfile .java -if {[compile_java_from_source $srcdir/$subdir/$srcfile $binfile "-g"] != ""} { - continue -} - - -# Start with a fresh gdb. - -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir - -gdb_test "set print sevenbit-strings" ".*" - -# Check that plain old "main" works. The load should both set the -# language to java and (since --main=jmain), some how set the scope to -# jmain's main. - -# Where the breakpoint should always land - -set bpmain "Breakpoint .* file .*jmain.java, line 5\." - -# Where GCC PR 16439 puts the breakpoint. -set earlybpmain "Breakpoint .* file .*jmain.java, line 4\." - -gdb_load "${binfile}" -setup_kfail java/1567 *-*-* -gdb_test "break main" "${bpmain}" - -# Check that an unqualified "main" works. - -gdb_load "${binfile}" -setup_kfail java/1565 *-*-* -gdb_test "break jmain.main" "${bpmain}" - -# Check that a fully qualified "main" works. -gdb_load "${binfile}" -set cmd "break ${testfile}.main(java.lang.String\[\])" -set msg $cmd -gdb_test_multiple $cmd $msg { - -re "${bpmain}\r\n$gdb_prompt $" { - pass $msg - } - -re "${earlybpmain}\r\n$gdb_prompt $" { - setup_xfail *-*-* gcc/16439 - fail $msg - } - -re "Make breakpoint pending.* \\(y or \\\[n\\\]\\) $" { - gdb_test "n" "" "" - - # Check again with a method signature at the end. - set cmd "break ${testfile}.main(java.lang.String\[\])void" - set msg $cmd - gdb_test_multiple $cmd $msg { - -re "${bpmain}\r\n$gdb_prompt $" { - pass $msg - } - -re "${earlybpmain}\r\n$gdb_prompt $" { - setup_xfail *-*-* gcc/16439 - fail $msg - } - } - } -} - diff --git a/gdb/testsuite/gdb.java/jmain.java b/gdb/testsuite/gdb.java/jmain.java deleted file mode 100644 index ee5c8bb..0000000 --- a/gdb/testsuite/gdb.java/jmain.java +++ /dev/null @@ -1,7 +0,0 @@ -public class jmain -{ - public static void main (String[] args) - { - return; - } -} diff --git a/gdb/testsuite/gdb.java/jmisc.exp b/gdb/testsuite/gdb.java/jmisc.exp deleted file mode 100644 index 43e68f5..0000000 --- a/gdb/testsuite/gdb.java/jmisc.exp +++ /dev/null @@ -1,104 +0,0 @@ -# Copyright 2000-2016 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. - -# This file was written by Anthony Green. (green@redhat.com) -# - -load_lib "java.exp" - -if { [skip_java_tests] } { continue } - -standard_testfile .java -if {[compile_java_from_source $srcdir/$subdir/$srcfile $binfile "-g"] != ""} { - continue -} - - -# Start with a fresh gdb. - -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir -gdb_load $binfile - -gdb_test "set print sevenbit-strings" ".*" - -if [set_lang_java] then { - # Ref PR gdb:java/1565. Don't use the simpler "break jmisc.main". - # As of 2004-02-24 it wasn't working and is being tested separatly. - # Before GCJ 4.1 (approximately) the demangled name did not include - # a method signature; after that point it does include a trailing - # signature. - runto_main - set function "${testfile}.main(java.lang.String\[\])" - gdb_breakpoint "$function" allow-pending - gdb_breakpoint "${function}void" allow-pending - gdb_continue_to_breakpoint $function - - gdb_test_multiple "ptype jmisc" "ptype jmisc" { - -re "type = class jmisc extends java.lang.Object \{\[\r\n\ \t]+void main\\(java\.lang\.String\\\[]\\);\[\r\n\ \t]+jmisc\\(\\);\[\r\n\ \t]+\}\[\r\n\ \t]+$gdb_prompt $" { - pass "ptype jmisc" - } - -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 $" { - pass "ptype jmisc" - } - } - - gdb_test "p args" \ - "\\\$1 = java\.lang\.String\\\[]@\[a-f0-9]+" - - gdb_test_multiple "p *args" "p *args" { - -re "\\\$2 = \{length: 0\}\[\r\n\ \t]+$gdb_prompt $" { - pass "p *args" - } - -re "\\\$2 = cannot find java.lang.Object.*$gdb_prompt $" { - # Sometimes GCC 4.x does not emit the necessary information - # about java.lang.Object. - kfail "p *args" gdb/2214 - } - } - - # The idea of running to 'exit' is that 'exit' is in a different - # objfile from the rest of the program (provided that program is - # linked normally with a shared libc). That causes gdb to examine - # fresh objfiles. There is nothing important about 'exit' - # semantics; it could be any symbol that is in a shared library. - # -- chastain 2003-08-06 - - if [gdb_breakpoint exit] { - pass "break exit" - } - gdb_test_multiple "continue" "continue to exit" { - -re ".*Breakpoint $decimal, .*exit.*$gdb_prompt $" { - pass "continue to exit" - } - -re ".*internal-error: sect_index_text not initialized.*\\(y or n\\) " { - # gdb choked on the "anonymous objfile" (probably). - kfail "gdb/1322" "continue to exit" - # get back to the gdb prompt - gdb_test_multiple "no" "internal sync 1" { - -re ".*\\(y or n\\) " { - gdb_test_multiple "no" "internal sync 2" { - -re ".*$gdb_prompt $" { ; } - } - } - } - } - } - - # Test a non-mathing return type really fails the look up. - gdb_test_no_output "set breakpoint pending off" - gdb_test {break jmisc.main(java.lang.String[])int} {Function "jmisc\.main\(java\.lang\.String\[\]\)int" not defined\.} -} diff --git a/gdb/testsuite/gdb.java/jmisc.java b/gdb/testsuite/gdb.java/jmisc.java deleted file mode 100644 index a11ba54..0000000 --- a/gdb/testsuite/gdb.java/jmisc.java +++ /dev/null @@ -1,7 +0,0 @@ -public class jmisc -{ - public static void main (String[] args) - { - return; - } -} diff --git a/gdb/testsuite/gdb.java/jnpe.exp b/gdb/testsuite/gdb.java/jnpe.exp deleted file mode 100644 index 745cdf3..0000000 --- a/gdb/testsuite/gdb.java/jnpe.exp +++ /dev/null @@ -1,55 +0,0 @@ -# Copyright 2009-2016 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. - -load_lib "java.exp" - -standard_testfile .java -if { [compile_java_from_source $srcdir/$subdir/$srcfile $binfile "-g"] != "" } { - untested "Couldn't compile $subdir/${srcfile}" - return -1 -} - -# Start with a fresh gdb. - -clean_restart $testfile - -set line [gdb_get_line_number "break here" $testfile.java] -if ![runto "$testfile.java:$line"] then { - perror "couldn't run to jnpe.main" - continue -} - -if {![skip_unwinder_tests]} { - unsupported "jnpe.exp could not find _Unwind_DebugHook" - return -1 -} - -gdb_test "handle SIGSEGV nostop noprint" \ - "SIGSEGV.*fault" \ - "disable SIGSEGV for next-over-NPE" - -# The line where we stop differs according to gcj; just check that we -# did not already execute the catch point. This is done in a somewhat -# funny way due to other gcj debuginfo oddities that don't -# meaningfully affect the user's experience. - -gdb_test "next" \ - ".*" \ - "next over NPE" - -set line [gdb_get_line_number "stop point"] -gdb_breakpoint $line -gdb_test "continue" "Continuing.\[\r\n\]*success\[\r\n\]*Thread .* hit Breakpoint .*:$line\[\r\n\]*.*// stop point\[\r\n\]*" \ - "continue to success for next-over-NPE" diff --git a/gdb/testsuite/gdb.java/jnpe.java b/gdb/testsuite/gdb.java/jnpe.java deleted file mode 100644 index ca62399..0000000 --- a/gdb/testsuite/gdb.java/jnpe.java +++ /dev/null @@ -1,39 +0,0 @@ -// Test next-over-NPE. -/* This testcase is part of GDB, the GNU debugger. - - Copyright 2009-2016 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see <http://www.gnu.org/licenses/>. */ - -public class jnpe -{ - public static String npe () - { - return ((Object) null).toString(); - } - - public static void main (String[] args) - { - try - { - System.out.println (npe ()); // break here - } - catch (NullPointerException n) - { - System.out.println ("success"); - } - - System.out.println ("blah"); // stop point - } -} diff --git a/gdb/testsuite/gdb.java/jprint.exp b/gdb/testsuite/gdb.java/jprint.exp deleted file mode 100644 index 1974a61..0000000 --- a/gdb/testsuite/gdb.java/jprint.exp +++ /dev/null @@ -1,77 +0,0 @@ -# Copyright 2004-2016 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. - -# This file was written by Jeff Johnston. (jjohnstn@redhat.com) -# - -load_lib "java.exp" - -if { [skip_java_tests] } { continue } - -standard_testfile .java -if {[compile_java_from_source $srcdir/$subdir/$srcfile $binfile "-g"] != ""} { - continue -} - - -# Start with a fresh gdb. - -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir -gdb_load $binfile - -gdb_test "set print sevenbit-strings" ".*" - -if [set_lang_java] then { - # Ref PR gdb:java/1565. Don't use the simpler "break jmisc.main". - # As of 2004-02-24 it wasn't working and is being tested separatly. - # Before GCJ 4.1 (approximately) the demangled name did not include - # a method signature; after that point it does include a trailing - # signature. - runto_main - set function "${testfile}.main(java.lang.String\[\])" - gdb_breakpoint "$function" allow-pending - gdb_breakpoint "${function}void" allow-pending - gdb_continue_to_breakpoint $function - - gdb_test "p jvclass.addprint(4,5,6)" " = 15" "unambiguous static call" - - gdb_test "next" "" - gdb_test "next" "" - - gdb_test "p x.print(44)" " = 44" "single argument call" - gdb_test "p x.print(22,33)" " = 33" "double argument call" - gdb_test "p x.dothat(55)" " = 62.*" "virtual fn call" - gdb_test "p x.addprint(1,2,3)" "= 6" "inherited static call" - gdb_test "p x.addk(44)" " = 121" "inherited virtual fn call" - - # Regression test for a crasher. - # GCC does not output location information for static class members, - # so GDB will report these as "optimized out". See gcc/43260. - setup_xfail *-*-* gcc/43260 - gdb_test "print *jprint.props" " = .*" "print a java.util.Properties" - - set test "print a java.lang.String" - gdb_test_multiple "print jprint.hi" $test { - -re " = java.lang.String \"hi maude\"\r\n$gdb_prompt $" { - pass $test - } - -re "There is no member named data\\.\r\n$gdb_prompt $" { - # GCJ system debug info for java.lang.String is not installed. - xfail $test - } - } -} diff --git a/gdb/testsuite/gdb.java/jprint.java b/gdb/testsuite/gdb.java/jprint.java deleted file mode 100644 index 5d5131b..0000000 --- a/gdb/testsuite/gdb.java/jprint.java +++ /dev/null @@ -1,68 +0,0 @@ -// jprint.java test program. -// -// Copyright 2004-2016 Free Software Foundation, Inc. -// -// Written by Jeff Johnston <jjohnstn@redhat.com> -// Contributed by Red Hat -// -// This file is part of GDB. -// -// This program is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see <http://www.gnu.org/licenses/>. - -import java.util.Properties; - -class jvclass { - public static int k; - static { - k = 77; - } - public static int addprint (int x, int y, int z) { - int sum = x + y + z; - System.out.println ("sum is " + sum); - return sum; - } - - public int addk (int x) { - int sum = x + k; - System.out.println ("adding k gives " + sum); - return sum; - } -} - -public class jprint extends jvclass { - public static Properties props = new Properties (); - public static String hi = "hi maude"; - - public int dothat (int x) { - int y = x + 3; - System.out.println ("new value is " + y); - return y + 4; - } - public static int print (int x) { - System.out.println("x is " + x); - return x; - } - public static int print (int x, int y) { - System.out.println("y is " + y); - return y; - } - public static void main(String[] args) { - jprint x = new jprint (); - x.dothat (44); - print (k, 33); - print (x.addk(0), 33); - } -} - - diff --git a/gdb/testsuite/gdb.java/jv-exp.exp b/gdb/testsuite/gdb.java/jv-exp.exp deleted file mode 100644 index 0a88e09..0000000 --- a/gdb/testsuite/gdb.java/jv-exp.exp +++ /dev/null @@ -1,41 +0,0 @@ -# Copyright 2000-2016 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. - -load_lib "java.exp" - -proc test_comparisons {} { - global gdb_prompt - - # Test various comparisons. - - gdb_test "p 1 > 2" " = false" - gdb_test "p 1 < 2" " = true" -} - -# Start with a fresh gdb. - -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir - -gdb_test "set print sevenbit-strings" "" -gdb_test "set print address off" "" "" -gdb_test "set width 0" "" - -if [set_lang_java] then { - test_comparisons -} else { - warning "Java expression tests suppressed" -} diff --git a/gdb/testsuite/gdb.java/jv-print.exp b/gdb/testsuite/gdb.java/jv-print.exp deleted file mode 100644 index 96f749e..0000000 --- a/gdb/testsuite/gdb.java/jv-print.exp +++ /dev/null @@ -1,153 +0,0 @@ -# Copyright 1999-2016 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. - -load_lib "java.exp" - -if { [skip_java_tests] } { continue } - -proc test_integer_literals_accepted {} { - global gdb_prompt - - # Test various decimal values. - - gdb_test "p 123" " = 123" - gdb_test "p -123" " = -123" - gdb_test "p/d 123" " = 123" - - # Test various octal values. - - gdb_test "p 0123" " = 83" - gdb_test "p 00123" " = 83" - gdb_test "p -0123" " = -83" - gdb_test "p/o 0123" " = 0123" - - # Test various hexadecimal values. - - gdb_test "p 0x123" " = 291" - gdb_test "p -0x123" " = -291" - gdb_test "p 0x0123" " = 291" - gdb_test "p -0x0123" " = -291" - gdb_test "p 0xABCDEF" " = 11259375" - gdb_test "p 0xabcdef" " = 11259375" - gdb_test "p 0xAbCdEf" " = 11259375" - gdb_test "p/x 0x123" " = 0x123" -} - -proc test_character_literals_accepted {} { - global gdb_prompt - - gdb_test "p 'a'" " = 'a'" - gdb_test "p/c 'a'" " = 'a'" - gdb_test "p/c 70" " = 'F'" - gdb_test "p/x 'a'" " = 0x61" - gdb_test "p/d 'a'" " = 97" - gdb_test "p/t 'a'" " = 1100001" - gdb_test "p/x '\\377'" " = 0xff" - gdb_test "p '\\''" " = '\\\\''" - # Note "p '\\'" => "= 92 '\\'" - gdb_test "p '\\\\'" " = '\\\\\\\\'" - - # Test the /c print format. -} - -proc test_integer_literals_rejected {} { - global gdb_prompt - - test_print_reject "p 0x" - gdb_test "p ''" "Empty character constant" - gdb_test "p '''" "Empty character constant" - test_print_reject "p '\\'" - - # Note that this turns into "p '\\\'" at gdb's input. - test_print_reject "p '\\\\\\'" - - # Test various decimal values. - - test_print_reject "p DEADBEEF" - - test_print_reject "p 123DEADBEEF" - test_print_reject "p 123foobar.bazfoo3" - test_print_reject "p 123EEEEEEEEEEEEEEEEE33333k333" - gdb_test "p 123.4+56.7" "180.(099\[0-9]*|100\[0-9\]*)" "check for floating addition" - - # Test various octal values. - - test_print_reject "p 09" - test_print_reject "p 079" - - # Test various hexadecimal values. - - test_print_reject "p 0xG" - test_print_reject "p 0xAG" -} - -proc test_float_accepted {} { - global gdb_prompt - - # Test parsing of fp value with legit text following. - gdb_test "p 1234.5+1" " = 1235.5" "check fp + text" - - # Test all the suffixes (including no suffix). - gdb_test "p 1." " = 1" - gdb_test "p 1.5" " = 1.5" - gdb_test "p 1.f" " = 1" - gdb_test "p 1.5f" " = 1.5" - gdb_test "p 1.d" " = 1" - gdb_test "p 1.5d" " = 1.5" - - # Test hexadecimal floating point. - set test "p 0x1.1" - gdb_test_multiple $test $test { - -re " = 1\\.0625\r\n$gdb_prompt $" { - pass $test - } - -re "Invalid number \"0x1\\.1\"\r\n$gdb_prompt $" { - # Older glibc does not support hex float, newer does. - xfail $test - } - } -} - -proc test_float_rejected {} { - # Test bad suffixes. - test_print_reject "p 1.1x" - test_print_reject "p 1.1ff" - test_print_reject "p 1.1dd" -} - - -# Start with a fresh gdb. - -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir - -gdb_test "print \$pc" "No registers\\." -# FIXME: should also test "print $pc" when there is an execfile but no -# remote debugging target, process or corefile. - -gdb_test "set print sevenbit-strings" "" -gdb_test "set print address off" "" "" -gdb_test "set width 0" "" - -if [set_lang_java] then { - test_integer_literals_accepted - test_character_literals_accepted - test_integer_literals_rejected - test_float_accepted - test_float_rejected -} else { - warning "Java print command tests suppressed" -} diff --git a/gdb/testsuite/gdb.python/py-lookup-type.exp b/gdb/testsuite/gdb.python/py-lookup-type.exp index 9d42feb..1fd571a 100644 --- a/gdb/testsuite/gdb.python/py-lookup-type.exp +++ b/gdb/testsuite/gdb.python/py-lookup-type.exp @@ -47,8 +47,6 @@ test_lookup_type "fortran" "character" test_lookup_type "go" "int32" -test_lookup_type "java" "byte" - test_lookup_type "modula-2" "CARDINAL" test_lookup_type "opencl" "ushort" diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index 1230e77..ab661ce 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -1722,12 +1722,6 @@ proc skip_go_tests {} { return 0 } -# Return a 1 if I don't even want to try to test java. - -proc skip_java_tests {} { - return 0 -} - # Return a 1 if I don't even want to try to test D. proc skip_d_tests {} { diff --git a/gdb/testsuite/lib/java.exp b/gdb/testsuite/lib/java.exp deleted file mode 100644 index 5ddc97b..0000000 --- a/gdb/testsuite/lib/java.exp +++ /dev/null @@ -1,123 +0,0 @@ -# This test code is part of GDB, the GNU debugger. - -# Copyright 1998-2016 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. - -load_lib "libgloss.exp" - -# GCJ_UNDER_TEST is the compiler under test. - -global tmpdir - -if ![info exists tmpdir] { - set tmpdir "/tmp" -} - -set java_initialized 0 - -# -# Build the status wrapper library as needed. -# -proc java_init { args } { - global wrapper_file - global wrap_compile_flags - global java_initialized - global GCJ_UNDER_TEST - global TOOL_EXECUTABLE - global env - - if { $java_initialized == 1 } { return; } - - if ![info exists GCJ_UNDER_TEST] { - if [info exists TOOL_EXECUTABLE] { - set GCJ_UNDER_TEST $TOOL_EXECUTABLE - } else { - if { [info exists env(GCJ)] && $env(GCJ) != "" } { - set GCJ_UNDER_TEST $env(GCJ) - } else { - global tool_root_dir - global target_alias - - if ![is_remote host] { - set file [lookfor_file $tool_root_dir gcj] - if { $file == "" } { - set file [lookfor_file $tool_root_dir gcc/gcj] - } - if { $file != "" } { - set CC "$file -B[file dirname $file]/ --specs=$tool_root_dir/$target_alias/libjava/libgcj-test.spec" - } else { - set CC [transform gcj] - } - } else { - set CC [transform gcj] - } - set GCJ_UNDER_TEST $CC - } - } - } - - set wrapper_file "" - set wrap_compile_flags "" - if [target_info exists needs_status_wrapper] { - set result [build_wrapper "testglue.o"] - if { $result != "" } { - set wrapper_file [lindex $result 0] - set wrap_compile_flags [lindex $result 1] - } else { - warning "Status wrapper failed to build." - } - } - - set java_initialized 1 -} - -# -# Run the test specified by srcfile and resultfile. compile_args and -# exec_args are options telling this proc how to work. -# -proc compile_java_from_source { srcfile binfile compile_args } { - global GCJ_UNDER_TEST - global java_initialized - - if { $java_initialized != 1 } { java_init } - - set args [list "compiler=$GCJ_UNDER_TEST"] - lappend args "additional_flags=--main=[file rootname [file tail $srcfile]]" - if { $compile_args != "" } { - lappend args "additional_flags=$compile_args" - } - - set result [target_compile $srcfile ${binfile} executable $args] - gdb_compile_test $srcfile $result - return $result -} - -# Auxiliary function to set the language to java. -# The result is 1 (true) for success, 0 (false) for failure. - -proc set_lang_java {} { - if [gdb_test_no_output "set language java"] { - return 0 - } - if [gdb_test "show language" ".* source language is \"java\"." \ - "set language to \"java\""] { - return 0 - } - return 1 -} - -# Local Variables: -# tcl-indent-level:4 -# End: |