Index: gdb/jv-lang.c |
diff --git a/gdb/jv-lang.c b/gdb/jv-lang.c |
index a7cfb76369fdf222e966945b9616383e1185f9ed..c9b6119111fd9e2a445a644666c27ab9f5cb75c8 100644 |
--- a/gdb/jv-lang.c |
+++ b/gdb/jv-lang.c |
@@ -1,7 +1,6 @@ |
/* Java language support routines for GDB, the GNU debugger. |
- Copyright (C) 1997-2000, 2003-2005, 2007-2012 Free Software |
- Foundation, Inc. |
+ Copyright (C) 1997-2013 Free Software Foundation, Inc. |
This file is part of GDB. |
@@ -28,10 +27,11 @@ |
#include "symtab.h" |
#include "symfile.h" |
#include "objfiles.h" |
-#include "gdb_string.h" |
+#include <string.h> |
#include "value.h" |
#include "c-lang.h" |
#include "jv-lang.h" |
+#include "varobj.h" |
#include "gdbcore.h" |
#include "block.h" |
#include "demangle.h" |
@@ -40,6 +40,7 @@ |
#include "gdb_assert.h" |
#include "charset.h" |
#include "valprint.h" |
+#include "cp-support.h" |
/* Local functions */ |
@@ -118,8 +119,9 @@ get_dynamics_objfile (struct gdbarch *gdbarch) |
/* Mark it as shared so that it is cleared when the inferior is |
re-run. */ |
- dynamics_objfile = allocate_objfile (NULL, OBJF_SHARED); |
- dynamics_objfile->gdbarch = gdbarch; |
+ dynamics_objfile = allocate_objfile (NULL, NULL, |
+ OBJF_SHARED | OBJF_NOT_FILENAME); |
+ dynamics_objfile->per_bfd->gdbarch = gdbarch; |
data = XCNEW (struct jv_per_objfile_data); |
set_objfile_data (dynamics_objfile, jv_dynamics_objfile_data_key, data); |
@@ -186,12 +188,10 @@ add_class_symbol (struct type *type, CORE_ADDR addr) |
struct symbol *sym; |
struct objfile *objfile = get_dynamics_objfile (get_type_arch (type)); |
- sym = (struct symbol *) |
- obstack_alloc (&objfile->objfile_obstack, sizeof (struct symbol)); |
- memset (sym, 0, sizeof (struct symbol)); |
- SYMBOL_SET_LANGUAGE (sym, language_java); |
+ sym = allocate_symbol (objfile); |
+ SYMBOL_SET_LANGUAGE (sym, language_java, &objfile->objfile_obstack); |
SYMBOL_SET_LINKAGE_NAME (sym, TYPE_TAG_NAME (type)); |
- SYMBOL_CLASS (sym) = LOC_TYPEDEF; |
+ SYMBOL_ACLASS_INDEX (sym) = LOC_TYPEDEF; |
/* SYMBOL_VALUE (sym) = valu; */ |
SYMBOL_TYPE (sym) = type; |
SYMBOL_DOMAIN (sym) = STRUCT_DOMAIN; |
@@ -270,7 +270,6 @@ type_from_class (struct gdbarch *gdbarch, struct value *clas) |
struct value *utf8_name; |
char *nptr; |
CORE_ADDR addr; |
- int is_array = 0; |
type = check_typedef (value_type (clas)); |
if (TYPE_CODE (type) == TYPE_CODE_PTR) |
@@ -319,7 +318,6 @@ type_from_class (struct gdbarch *gdbarch, struct value *clas) |
name = obstack_alloc (&objfile->objfile_obstack, namelen + 1); |
java_demangled_signature_copy (name, signature); |
name[namelen] = '\0'; |
- is_array = 1; |
temp = clas; |
/* Set array element type. */ |
temp = value_struct_elt (&temp, NULL, "methods", NULL, "structure"); |
@@ -1015,7 +1013,7 @@ nosideret: |
static char *java_demangle (const char *mangled, int options) |
{ |
- return cplus_demangle (mangled, options | DMGL_JAVA); |
+ return gdb_demangle (mangled, options | DMGL_JAVA); |
} |
/* Find the member function name of the demangled name NAME. NAME |
@@ -1165,9 +1163,9 @@ const struct exp_descriptor exp_descriptor_java = |
const struct language_defn java_language_defn = |
{ |
"java", /* Language name */ |
+ "Java", |
language_java, |
range_check_off, |
- type_check_off, |
case_sensitive_on, |
array_row_major, |
macro_expansion_no, |
@@ -1200,6 +1198,7 @@ const struct language_defn java_language_defn = |
default_get_string, |
NULL, /* la_get_symbol_name_cmp */ |
iterate_over_symbols, |
+ &java_varobj_ops, |
LANG_MAGIC |
}; |