/* Java language support routines for GDB, the GNU debugger.
- Copyright 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
+ Copyright 1997, 1998, 1999, 2000, 2003 Free Software Foundation, Inc.
This file is part of GDB.
#include "c-lang.h"
#include "jv-lang.h"
#include "gdbcore.h"
+#include "block.h"
+#include "demangle.h"
#include <ctype.h>
struct type *java_int_type;
static struct type *java_link_class_type (struct type *, struct value *);
+/* FIXME: carlton/2003-02-04: This is the main or only caller of
+ allocate_objfile with first argument NULL; as a result, this code
+ breaks every so often. Somebody should write a test case that
+ exercises GDB in various ways (e.g. something involving loading a
+ dynamic library) after this code has been called. */
+
static struct objfile *
get_dynamics_objfile (void)
{
BLOCK_END (bl) = 0;
BLOCK_FUNCTION (bl) = NULL;
BLOCK_SUPERBLOCK (bl) = NULL;
+ BLOCK_NAMESPACE (bl) = NULL;
BLOCK_GCC_COMPILED (bl) = 0;
BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK) = bl;
obstack_alloc (&dynamics_objfile->symbol_obstack, sizeof (struct symbol));
memset (sym, 0, sizeof (struct symbol));
SYMBOL_LANGUAGE (sym) = language_java;
- SYMBOL_NAME (sym) = TYPE_TAG_NAME (type);
+ DEPRECATED_SYMBOL_NAME (sym) = TYPE_TAG_NAME (type);
SYMBOL_CLASS (sym) = LOC_TYPEDEF;
/* SYMBOL_VALUE (sym) = valu; */
SYMBOL_TYPE (sym) = type;
return c_create_fundamental_type (objfile, typeid);
}
+static char *java_demangle (const char *mangled, int options)
+{
+ return cplus_demangle (mangled, options | DMGL_JAVA);
+}
+
+
/* Table mapping opcodes into strings for printing operators
and precedences of the operators. */
java_print_type, /* Print a type using appropriate syntax */
java_val_print, /* Print a value using appropriate syntax */
java_value_print, /* Print a top-level value */
+ NULL, /* Language specific skip_trampoline */
+ java_demangle, /* Language specific symbol demangler */
{"", "", "", ""}, /* Binary format info */
{"0%lo", "0", "o", ""}, /* Octal format info */
{"%ld", "", "d", ""}, /* Decimal format info */