aboutsummaryrefslogtreecommitdiff
path: root/gdb/symtab.c
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2016-10-05 08:44:34 -0600
committerTom Tromey <tom@tromey.com>2016-10-06 10:10:40 -0600
commit9c37b5aed98e5996a9777a366bfcc371c0e1a92d (patch)
treeea2b3148f79fdd679281d7bdc9f1fd3a6d446613 /gdb/symtab.c
parent78b86327b5301231005b08a7c589b2b58e6b4322 (diff)
downloadgdb-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/symtab.c')
-rw-r--r--gdb/symtab.c94
1 files changed, 13 insertions, 81 deletions
diff --git a/gdb/symtab.c b/gdb/symtab.c
index e776a0c..4e03cb7 100644
--- a/gdb/symtab.c
+++ b/gdb/symtab.c
@@ -668,7 +668,6 @@ symbol_set_language (struct general_symbol_info *gsymbol,
if (gsymbol->language == language_cplus
|| gsymbol->language == language_d
|| gsymbol->language == language_go
- || gsymbol->language == language_java
|| gsymbol->language == language_objc
|| gsymbol->language == language_fortran)
{
@@ -787,25 +786,6 @@ symbol_find_demangled_name (struct general_symbol_info *gsymbol,
comes from the per-BFD storage_obstack. LINKAGE_NAME is copied,
so the pointer can be discarded after calling this function. */
-/* We have to be careful when dealing with Java names: when we run
- into a Java minimal symbol, we don't know it's a Java symbol, so it
- gets demangled as a C++ name. This is unfortunate, but there's not
- much we can do about it: but when demangling partial symbols and
- regular symbols, we'd better not reuse the wrong demangled name.
- (See PR gdb/1039.) We solve this by putting a distinctive prefix
- on Java names when storing them in the hash table. */
-
-/* FIXME: carlton/2003-03-13: This is an unfortunate situation. I
- don't mind the Java prefix so much: different languages have
- different demangling requirements, so it's only natural that we
- need to keep language data around in our demangling cache. But
- it's not good that the minimal symbol has the wrong demangled name.
- Unfortunately, I can't think of any easy solution to that
- problem. */
-
-#define JAVA_PREFIX "##JAVA$$"
-#define JAVA_PREFIX_LEN 8
-
void
symbol_set_names (struct general_symbol_info *gsymbol,
const char *linkage_name, int len, int copy_name,
@@ -814,24 +794,13 @@ symbol_set_names (struct general_symbol_info *gsymbol,
struct demangled_name_entry **slot;
/* A 0-terminated copy of the linkage name. */
const char *linkage_name_copy;
- /* A copy of the linkage name that might have a special Java prefix
- added to it, for use when looking names up in the hash table. */
- const char *lookup_name;
- /* The length of lookup_name. */
- int lookup_len;
struct demangled_name_entry entry;
struct objfile_per_bfd_storage *per_bfd = objfile->per_bfd;
if (gsymbol->language == language_ada)
{
/* In Ada, we do the symbol lookups using the mangled name, so
- we can save some space by not storing the demangled name.
-
- As a side note, we have also observed some overlap between
- the C++ mangling and Ada mangling, similarly to what has
- been observed with Java. Because we don't store the demangled
- name with the symbol, we don't need to use the same trick
- as Java. */
+ we can save some space by not storing the demangled name. */
if (!copy_name)
gsymbol->name = linkage_name;
else
@@ -851,42 +820,20 @@ symbol_set_names (struct general_symbol_info *gsymbol,
if (per_bfd->demangled_names_hash == NULL)
create_demangled_names_hash (objfile);
- /* The stabs reader generally provides names that are not
- NUL-terminated; most of the other readers don't do this, so we
- can just use the given copy, unless we're in the Java case. */
- if (gsymbol->language == language_java)
- {
- char *alloc_name;
-
- lookup_len = len + JAVA_PREFIX_LEN;
- alloc_name = (char *) alloca (lookup_len + 1);
- memcpy (alloc_name, JAVA_PREFIX, JAVA_PREFIX_LEN);
- memcpy (alloc_name + JAVA_PREFIX_LEN, linkage_name, len);
- alloc_name[lookup_len] = '\0';
-
- lookup_name = alloc_name;
- linkage_name_copy = alloc_name + JAVA_PREFIX_LEN;
- }
- else if (linkage_name[len] != '\0')
+ if (linkage_name[len] != '\0')
{
char *alloc_name;
- lookup_len = len;
- alloc_name = (char *) alloca (lookup_len + 1);
+ alloc_name = (char *) alloca (len + 1);
memcpy (alloc_name, linkage_name, len);
- alloc_name[lookup_len] = '\0';
+ alloc_name[len] = '\0';
- lookup_name = alloc_name;
linkage_name_copy = alloc_name;
}
else
- {
- lookup_len = len;
- lookup_name = linkage_name;
- linkage_name_copy = linkage_name;
- }
+ linkage_name_copy = linkage_name;
- entry.mangled = lookup_name;
+ entry.mangled = linkage_name_copy;
slot = ((struct demangled_name_entry **)
htab_find_slot (per_bfd->demangled_names_hash,
&entry, INSERT));
@@ -903,7 +850,7 @@ symbol_set_names (struct general_symbol_info *gsymbol,
int demangled_len = demangled_name ? strlen (demangled_name) : 0;
/* Suppose we have demangled_name==NULL, copy_name==0, and
- lookup_name==linkage_name. In this case, we already have the
+ linkage_name_copy==linkage_name. In this case, we already have the
mangled name saved, and we don't have a demangled name. So,
you might think we could save a little space by not recording
this in the hash table at all.
@@ -911,14 +858,14 @@ symbol_set_names (struct general_symbol_info *gsymbol,
It turns out that it is actually important to still save such
an entry in the hash table, because storing this name gives
us better bcache hit rates for partial symbols. */
- if (!copy_name && lookup_name == linkage_name)
+ if (!copy_name && linkage_name_copy == linkage_name)
{
*slot
= ((struct demangled_name_entry *)
obstack_alloc (&per_bfd->storage_obstack,
offsetof (struct demangled_name_entry, demangled)
+ demangled_len + 1));
- (*slot)->mangled = lookup_name;
+ (*slot)->mangled = linkage_name;
}
else
{
@@ -931,9 +878,9 @@ symbol_set_names (struct general_symbol_info *gsymbol,
= ((struct demangled_name_entry *)
obstack_alloc (&per_bfd->storage_obstack,
offsetof (struct demangled_name_entry, demangled)
- + lookup_len + demangled_len + 2));
+ + len + demangled_len + 2));
mangled_ptr = &((*slot)->demangled[demangled_len + 1]);
- strcpy (mangled_ptr, lookup_name);
+ strcpy (mangled_ptr, linkage_name_copy);
(*slot)->mangled = mangled_ptr;
}
@@ -946,7 +893,7 @@ symbol_set_names (struct general_symbol_info *gsymbol,
(*slot)->demangled[0] = '\0';
}
- gsymbol->name = (*slot)->mangled + lookup_len - len;
+ gsymbol->name = (*slot)->mangled;
if ((*slot)->demangled[0] != '\0')
symbol_set_demangled_name (gsymbol, (*slot)->demangled,
&per_bfd->storage_obstack);
@@ -965,7 +912,6 @@ symbol_natural_name (const struct general_symbol_info *gsymbol)
case language_cplus:
case language_d:
case language_go:
- case language_java:
case language_objc:
case language_fortran:
if (symbol_get_demangled_name (gsymbol) != NULL)
@@ -992,7 +938,6 @@ symbol_demangled_name (const struct general_symbol_info *gsymbol)
case language_cplus:
case language_d:
case language_go:
- case language_java:
case language_objc:
case language_fortran:
dem_name = symbol_get_demangled_name (gsymbol);
@@ -1852,7 +1797,7 @@ demangle_for_lookup (const char *name, enum language lang,
modified_name = name;
- /* If we are using C++, D, Go, or Java, demangle the name before doing a
+ /* If we are using C++, D, or Go, demangle the name before doing a
lookup, so we can always binary search. */
if (lang == language_cplus)
{
@@ -1874,16 +1819,6 @@ demangle_for_lookup (const char *name, enum language lang,
}
}
}
- else if (lang == language_java)
- {
- demangled_name = gdb_demangle (name,
- DMGL_ANSI | DMGL_PARAMS | DMGL_JAVA);
- if (demangled_name)
- {
- modified_name = demangled_name;
- make_cleanup (xfree, demangled_name);
- }
- }
else if (lang == language_d)
{
demangled_name = d_demangle (name, 0);
@@ -2736,11 +2671,9 @@ symbol_matches_domain (enum language symbol_language,
domain_enum domain)
{
/* For C++ "struct foo { ... }" also defines a typedef for "foo".
- A Java class declaration also defines a typedef for the class.
Similarly, any Ada type declaration implicitly defines a typedef. */
if (symbol_language == language_cplus
|| symbol_language == language_d
- || symbol_language == language_java
|| symbol_language == language_ada)
{
if ((domain == VAR_DOMAIN || domain == STRUCT_DOMAIN)
@@ -5370,7 +5303,6 @@ default_make_symbol_completion_list_break_on_1 (const char *text,
/* Prepare SYM_TEXT_LEN for compare_symbol_name. */
if (current_language->la_language == language_cplus
- || current_language->la_language == language_java
|| current_language->la_language == language_fortran)
{
/* These languages may have parameters entered by user but they are never