#include "block.h"
#include "addrmap.h"
#include "typeprint.h"
-#include "jv-lang.h"
#include "psympriv.h"
#include <sys/stat.h>
#include "completer.h"
int (*cmp) (const char *, const char *);
if (current_language->la_language == language_cplus
- || current_language->la_language == language_java
|| current_language->la_language == language_fortran
|| current_language->la_language == language_d)
{
/* Functions used to compute the fully scoped name of a partial DIE.
Normally, this is simple. For C++, the parent DIE's fully scoped
- name is concatenated with "::" and the partial DIE's name. For
- Java, the same thing occurs except that "." is used instead of "::".
+ name is concatenated with "::" and the partial DIE's name.
Enumerators are an exception; they use the scope of their parent
enumeration type, i.e. the name of the enumeration type is not
prepended to the enumerator.
add_psymbol_to_list (actual_name, strlen (actual_name),
built_actual_name != NULL,
STRUCT_DOMAIN, LOC_TYPEDEF,
- (cu->language == language_cplus
- || cu->language == language_java)
+ cu->language == language_cplus
? &objfile->global_psymbols
: &objfile->static_psymbols,
0, cu->language, objfile);
add_psymbol_to_list (actual_name, strlen (actual_name),
built_actual_name != NULL,
VAR_DOMAIN, LOC_CONST,
- (cu->language == language_cplus
- || cu->language == language_java)
+ cu->language == language_cplus
? &objfile->global_psymbols
: &objfile->static_psymbols,
0, cu->language, objfile);
/* Compute the fully qualified name of DIE in CU. If PHYSNAME is nonzero,
compute the physname for the object, which include a method's:
- - formal parameters (C++/Java),
+ - formal parameters (C++),
- receiver type (Go),
- - return type (Java).
The term "physname" is a bit confusing.
For C++, for example, it is the demangled name.
/* These are the only languages we know how to qualify names in. */
if (name != NULL
- && (cu->language == language_cplus || cu->language == language_java
+ && (cu->language == language_cplus
|| cu->language == language_fortran || cu->language == language_d
|| cu->language == language_rust))
{
long length;
const char *prefix;
struct ui_file *buf;
- char *intermediate_name;
const char *canonical_name = NULL;
prefix = determine_prefix (die, cu);
}
}
- /* For Java and C++ methods, append formal parameter type
+ /* For C++ methods, append formal parameter type
information, if PHYSNAME. */
if (physname && die->tag == DW_TAG_subprogram
- && (cu->language == language_cplus
- || cu->language == language_java))
+ && cu->language == language_cplus)
{
struct type *type = read_type_die (die, cu);
c_type_print_args (type, buf, 1, cu->language,
&type_print_raw_options);
- if (cu->language == language_java)
- {
- /* For java, we must append the return type to method
- names. */
- if (die->tag == DW_TAG_subprogram)
- java_print_type (TYPE_TARGET_TYPE (type), "", buf,
- 0, 0, &type_print_raw_options);
- }
- else if (cu->language == language_cplus)
+ if (cu->language == language_cplus)
{
/* Assume that an artificial first parameter is
"this", but do not crash if it is not. RealView
}
}
- intermediate_name = ui_file_xstrdup (buf, &length);
+ std::string intermediate_name = ui_file_as_string (buf);
ui_file_delete (buf);
if (cu->language == language_cplus)
canonical_name
- = dwarf2_canonicalize_name (intermediate_name, cu,
+ = dwarf2_canonicalize_name (intermediate_name.c_str (), cu,
&objfile->per_bfd->storage_obstack);
/* If we only computed INTERMEDIATE_NAME, or if
INTERMEDIATE_NAME is already canonical, then we need to
copy it to the appropriate obstack. */
- if (canonical_name == NULL || canonical_name == intermediate_name)
+ if (canonical_name == NULL || canonical_name == intermediate_name.c_str ())
name = ((const char *)
obstack_copy0 (&objfile->per_bfd->storage_obstack,
- intermediate_name,
- strlen (intermediate_name)));
+ intermediate_name.c_str (),
+ intermediate_name.length ()));
else
name = canonical_name;
-
- xfree (intermediate_name);
}
}
not have a name. NAME may either be from a previous call to
dwarf2_name or NULL.
- The output string will be canonicalized (if C++/Java). */
+ The output string will be canonicalized (if C++). */
static const char *
dwarf2_full_name (const char *name, struct die_info *die, struct dwarf2_cu *cu)
allocated on the objfile_objstack or NULL if the DIE does not have a
name.
- The output string will be canonicalized (if C++/Java). */
+ The output string will be canonicalized (if C++). */
static const char *
dwarf2_physname (const char *name, struct die_info *die, struct dwarf2_cu *cu)
else
{
demangled = gdb_demangle (mangled,
- (DMGL_PARAMS | DMGL_ANSI
- | (cu->language == language_java
- ? DMGL_JAVA | DMGL_RET_POSTFIX
- : DMGL_RET_DROP)));
+ (DMGL_PARAMS | DMGL_ANSI | DMGL_RET_DROP));
}
if (demangled)
{
fnp = &new_fnfield->fnfield;
/* Delay processing of the physname until later. */
- if (cu->language == language_cplus || cu->language == language_java)
+ if (cu->language == language_cplus)
{
add_to_method_list (type, i, flp->length - 1, fieldname,
die, cu);
static const char vptr[] = "_vptr";
static const char vtable[] = "vtable";
- /* Look for the C++ and Java forms of the vtable. */
- if ((cu->language == language_java
- && startswith (name, vtable))
- || (startswith (name, vptr)
- && is_cplus_marker (name[sizeof (vptr) - 1])))
+ /* Look for the C++ form of the vtable. */
+ if (startswith (name, vptr) && is_cplus_marker (name[sizeof (vptr) - 1]))
return 1;
return 0;
if (name != NULL)
{
if (cu->language == language_cplus
- || cu->language == language_java
|| cu->language == language_d
|| cu->language == language_rust)
{
}
do_cleanups (back_to);
-
- if (HAVE_CPLUS_STRUCT (type))
- TYPE_CPLUS_REALLY_JAVA (type) = cu->language == language_java;
}
quirk_gcc_member_function_pointer (type, objfile);
if (attr)
TYPE_FIELD_ARTIFICIAL (ftype, iparams) = DW_UNSND (attr);
else
- {
- TYPE_FIELD_ARTIFICIAL (ftype, iparams) = 0;
-
- /* GCC/43521: In java, the formal parameter
- "this" is sometimes not marked with DW_AT_artificial. */
- if (cu->language == language_java)
- {
- const char *name = dwarf2_name (child_die, cu);
-
- if (name && !strcmp (name, "this"))
- TYPE_FIELD_ARTIFICIAL (ftype, iparams) = 1;
- }
- }
+ TYPE_FIELD_ARTIFICIAL (ftype, iparams) = 0;
arg_type = die_type (child_die, cu);
/* RealView does not mark THIS as const, which the testsuite
low_default_is_valid = 1;
break;
case language_d:
- case language_java:
case language_objc:
case language_rust:
low.data.const_val = 0;
else if (building_psymtab)
add_psymbol_to_list (part_die->name, strlen (part_die->name), 0,
VAR_DOMAIN, LOC_CONST,
- (cu->language == language_cplus
- || cu->language == language_java)
+ cu->language == language_cplus
? &objfile->global_psymbols
: &objfile->static_psymbols,
0, cu->language, objfile);
case DW_LANG_UPC:
cu->language = language_c;
break;
+ case DW_LANG_Java:
case DW_LANG_C_plus_plus:
case DW_LANG_C_plus_plus_11:
case DW_LANG_C_plus_plus_14:
case DW_LANG_Mips_Assembler:
cu->language = language_asm;
break;
- case DW_LANG_Java:
- cu->language = language_java;
- break;
case DW_LANG_Ada83:
case DW_LANG_Ada95:
cu->language = language_ada;
SYMBOL_DOMAIN (sym) = STRUCT_DOMAIN;
{
- /* NOTE: carlton/2003-11-10: C++ and Java class symbols shouldn't
+ /* NOTE: carlton/2003-11-10: C++ class symbols shouldn't
really ever be static objects: otherwise, if you try
to, say, break of a class's method and you're in a file
which doesn't mention that class, it won't work unless
if (!suppress_add)
{
list_to_add = (cu->list_in_scope == &file_symbols
- && (cu->language == language_cplus
- || cu->language == language_java)
+ && cu->language == language_cplus
? &global_symbols : cu->list_in_scope);
/* The semantics of C++ state that "struct foo {
- ... }" also defines a typedef for "foo". A Java
- class declaration also defines a typedef for the
- class. */
+ ... }" also defines a typedef for "foo". */
if (cu->language == language_cplus
- || cu->language == language_java
|| cu->language == language_ada
|| cu->language == language_d
|| cu->language == language_rust)
DW_TAG_class_type, etc. block. */
list_to_add = (cu->list_in_scope == &file_symbols
- && (cu->language == language_cplus
- || cu->language == language_java)
+ && cu->language == language_cplus
? &global_symbols : cu->list_in_scope);
}
break;
struct type *parent_type;
char *retval;
- if (cu->language != language_cplus && cu->language != language_java
+ if (cu->language != language_cplus
&& cu->language != language_fortran && cu->language != language_d
&& cu->language != language_rust)
return "";
if (suffix == NULL || suffix[0] == '\0'
|| prefix == NULL || prefix[0] == '\0')
sep = "";
- else if (cu->language == language_java)
- sep = ".";
else if (cu->language == language_d)
{
/* For D, the 'main' function could be defined in any module, but it
{
if (name && cu->language == language_cplus)
{
- char *canon_name = cp_canonicalize_string (name);
+ std::string canon_name = cp_canonicalize_string (name);
- if (canon_name != NULL)
+ if (!canon_name.empty ())
{
- if (strcmp (canon_name, name) != 0)
- name = (const char *) obstack_copy0 (obstack, canon_name,
- strlen (canon_name));
- xfree (canon_name);
+ if (canon_name != name)
+ name = (const char *) obstack_copy0 (obstack,
+ canon_name.c_str (),
+ canon_name.length ());
}
}
return DW_STRING (attr);
return CP_ANONYMOUS_NAMESPACE_STR;
- case DW_TAG_subprogram:
- /* Java constructors will all be named "<init>", so return
- the class name when we see this special case. */
- if (cu->language == language_java
- && DW_STRING (attr) != NULL
- && strcmp (DW_STRING (attr), "<init>") == 0)
- {
- struct dwarf2_cu *spec_cu = cu;
- struct die_info *spec_die;
-
- /* GCJ will output '<init>' for Java constructor names.
- For this special case, return the name of the parent class. */
-
- /* GCJ may output subprogram DIEs with AT_specification set.
- If so, use the name of the specified DIE. */
- spec_die = die_specification (die, &spec_cu);
- if (spec_die != NULL)
- return dwarf2_name (spec_die, spec_cu);
-
- do
- {
- die = die->parent;
- if (die->tag == DW_TAG_class_type)
- return dwarf2_name (die, cu);
- }
- while (die->tag != DW_TAG_compile_unit
- && die->tag != DW_TAG_partial_unit);
- }
- break;
-
case DW_TAG_class_type:
case DW_TAG_interface_type:
case DW_TAG_structure_type: