summaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2011-07-05 13:36:40 +0000
committerTom Tromey <tromey@redhat.com>2011-07-05 13:36:40 +0000
commit7fe3a8a73e29f43535cc957d1904ae8d36da1bc1 (patch)
tree392b416d13f996468804bd10afec16744667e36e /gdb
parentfce248b23dbf27dc62a82cf6504f0811b8b58a8c (diff)
downloadgdb-7fe3a8a73e29f43535cc957d1904ae8d36da1bc1.tar.gz
gdb
* gnu-v3-abi.c (gnuv3_rtti_type): Check TYPE_CPLUS_REALLY_JAVA. * gdbtypes.h (struct cplus_struct_type) <is_java>: New field. (TYPE_CPLUS_REALLY_JAVA): New macro. * dwarf2read.c (process_structure_scope): Set TYPE_CPLUS_REALLY_JAVA. gdb/testsuite * gdb.java/jprint.java (jprint.hi): New field. * gdb.java/jprint.exp: Print string.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog8
-rw-r--r--gdb/dwarf2read.c3
-rw-r--r--gdb/gdbtypes.h4
-rw-r--r--gdb/gnu-v3-abi.c4
-rw-r--r--gdb/testsuite/ChangeLog5
-rw-r--r--gdb/testsuite/gdb.java/jprint.exp2
-rw-r--r--gdb/testsuite/gdb.java/jprint.java3
7 files changed, 28 insertions, 1 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index d85938cd7ea..9ea7947088c 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,11 @@
+2011-07-05 Tom Tromey <tromey@redhat.com>
+
+ * gnu-v3-abi.c (gnuv3_rtti_type): Check TYPE_CPLUS_REALLY_JAVA.
+ * gdbtypes.h (struct cplus_struct_type) <is_java>: New field.
+ (TYPE_CPLUS_REALLY_JAVA): New macro.
+ * dwarf2read.c (process_structure_scope): Set
+ TYPE_CPLUS_REALLY_JAVA.
+
2011-07-05 Thiago Jung Bauermann <bauerman.ibm.com>
* ada-lang.c: Fix typos.
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index 3ffe1ee2052..d86487a658b 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -7492,6 +7492,9 @@ process_structure_scope (struct die_info *die, struct dwarf2_cu *cu)
}
do_cleanups (back_to);
+
+ if (HAVE_CPLUS_STRUCT (type))
+ TYPE_CPLUS_REALLY_JAVA (type) = cu->language == language_java;
}
quirk_gcc_member_function_pointer (type, cu->objfile);
diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h
index 3b624530b2b..1e96293abf7 100644
--- a/gdb/gdbtypes.h
+++ b/gdb/gdbtypes.h
@@ -705,6 +705,9 @@ struct cplus_struct_type
dynamic. Zero if not yet computed. */
int is_dynamic : 2;
+ /* Non-zero if this type came from a Java CU. */
+ unsigned int is_java : 1;
+
/* For derived classes, the number of base classes is given by
n_baseclasses and virtual_field_bits is a bit vector containing
one bit per base class. If the base class is virtual, the
@@ -991,6 +994,7 @@ extern void allocate_gnat_aux_type (struct type *);
#define BASETYPE_VIA_PUBLIC(thistype, index) \
((!TYPE_FIELD_PRIVATE(thistype, index)) && (!TYPE_FIELD_PROTECTED(thistype, index)))
#define TYPE_CPLUS_DYNAMIC(thistype) TYPE_CPLUS_SPECIFIC (thistype)->is_dynamic
+#define TYPE_CPLUS_REALLY_JAVA(thistype) TYPE_CPLUS_SPECIFIC (thistype)->is_java
#define BASETYPE_VIA_VIRTUAL(thistype, index) \
(TYPE_CPLUS_SPECIFIC(thistype)->virtual_field_bits == NULL ? 0 \
diff --git a/gdb/gnu-v3-abi.c b/gdb/gnu-v3-abi.c
index 25a437b3497..6c6f92ce06e 100644
--- a/gdb/gnu-v3-abi.c
+++ b/gdb/gnu-v3-abi.c
@@ -287,6 +287,10 @@ gnuv3_rtti_type (struct value *value,
if (TYPE_CODE (values_type) != TYPE_CODE_CLASS)
return NULL;
+ /* Java doesn't have RTTI following the C++ ABI. */
+ if (TYPE_CPLUS_REALLY_JAVA (values_type))
+ return NULL;
+
/* Determine architecture. */
gdbarch = get_type_arch (values_type);
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 346f42798f7..22b6a987d41 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2011-07-05 Tom Tromey <tromey@redhat.com>
+
+ * gdb.java/jprint.java (jprint.hi): New field.
+ * gdb.java/jprint.exp: Print string.
+
2011-07-05 Thiago Jung Bauermann <bauerman.ibm.com>
* gdb.base/call-sc.c: Fix typos.
diff --git a/gdb/testsuite/gdb.java/jprint.exp b/gdb/testsuite/gdb.java/jprint.exp
index 682715aba0a..81d8ad19a5e 100644
--- a/gdb/testsuite/gdb.java/jprint.exp
+++ b/gdb/testsuite/gdb.java/jprint.exp
@@ -70,4 +70,6 @@ if [set_lang_java] then {
# 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"
+
+ gdb_test "print jprint.hi" "= java.lang.String \"hi maude\"" "print a java.lang.String"
}
diff --git a/gdb/testsuite/gdb.java/jprint.java b/gdb/testsuite/gdb.java/jprint.java
index 01ebdbc1140..b4385ab06a9 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, 2010
+// Copyright 2004, 2010, 2011
// Free Software Foundation, Inc.
//
// Written by Jeff Johnston <jjohnstn@redhat.com>
@@ -42,6 +42,7 @@ class jvclass {
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;