aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.java
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2010-02-17 22:25:05 +0000
committerTom Tromey <tromey@redhat.com>2010-02-17 22:25:05 +0000
commit6f451e5ec454cf6611b99df727ba77bf8bc71da7 (patch)
tree675438e301d67eae23ddace9fed23f93fb5c5839 /gdb/testsuite/gdb.java
parentef801a0e1d880aa6ecd4655527f1f8218c741122 (diff)
downloadgdb-6f451e5ec454cf6611b99df727ba77bf8bc71da7.zip
gdb-6f451e5ec454cf6611b99df727ba77bf8bc71da7.tar.gz
gdb-6f451e5ec454cf6611b99df727ba77bf8bc71da7.tar.bz2
gdb
* objfiles.c (gdb_bfd_ref): Handle abfd==NULL. gdb/testsuite * gdb.java/jprint.java (jprint.props): New field. * gdb.java/jprint.exp (set_lang_java): Add regression test.
Diffstat (limited to 'gdb/testsuite/gdb.java')
-rw-r--r--gdb/testsuite/gdb.java/jprint.exp3
-rw-r--r--gdb/testsuite/gdb.java/jprint.java6
2 files changed, 8 insertions, 1 deletions
diff --git a/gdb/testsuite/gdb.java/jprint.exp b/gdb/testsuite/gdb.java/jprint.exp
index bb929aa..29dbf4b 100644
--- a/gdb/testsuite/gdb.java/jprint.exp
+++ b/gdb/testsuite/gdb.java/jprint.exp
@@ -84,4 +84,7 @@ if ![set_lang_java] then {
gdb_test "call x.dothat(55)" "new value is 58\r\n.*= 62.*" "virtual fn call"
gdb_test "p x.addprint(1,2,3)" "sum is 6\r\n.*" "inherited static call"
gdb_test "call x.addk(44)" "adding k gives 121\r\n.*= 121.*" "inherited virtual fn call"
+
+ # Regression test for a crasher.
+ gdb_test "print *jprint.props" " = .*" "print a java.util.Properties"
}
diff --git a/gdb/testsuite/gdb.java/jprint.java b/gdb/testsuite/gdb.java/jprint.java
index bd4fa96..01ebdbc 100644
--- a/gdb/testsuite/gdb.java/jprint.java
+++ b/gdb/testsuite/gdb.java/jprint.java
@@ -1,6 +1,6 @@
// jprint.java test program.
//
-// Copyright 2004
+// Copyright 2004, 2010
// Free Software Foundation, Inc.
//
// Written by Jeff Johnston <jjohnstn@redhat.com>
@@ -21,6 +21,8 @@
// 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 {
@@ -39,6 +41,8 @@ class jvclass {
}
public class jprint extends jvclass {
+ public static Properties props = new Properties ();
+
public int dothat (int x) {
int y = x + 3;
System.out.println ("new value is " + y);