/* Java language support routines for GDB, the GNU debugger.
- Copyright 1997, 1998, 1999 Free Software Foundation, Inc.
+ Copyright 1997, 1998, 1999-2000 Free Software Foundation, Inc.
This file is part of GDB.
/* Local functions */
-extern void _initialize_java_language PARAMS ((void));
+extern void _initialize_java_language (void);
-static int java_demangled_signature_length PARAMS ((char *));
-static void java_demangled_signature_copy PARAMS ((char *, char *));
+static int java_demangled_signature_length (char *);
+static void java_demangled_signature_copy (char *, char *);
-static struct symtab *get_java_class_symtab PARAMS ((void));
-static char *get_java_utf8_name PARAMS ((struct obstack * obstack, value_ptr name));
-static int java_class_is_primitive PARAMS ((value_ptr clas));
-static struct type *java_lookup_type PARAMS ((char *signature));
-static value_ptr java_value_string PARAMS ((char *ptr, int len));
+static struct symtab *get_java_class_symtab (void);
+static char *get_java_utf8_name (struct obstack *obstack, value_ptr name);
+static int java_class_is_primitive (value_ptr clas);
+static struct type *java_lookup_type (char *signature);
+static value_ptr java_value_string (char *ptr, int len);
-static void java_emit_char PARAMS ((int c, GDB_FILE * stream, int quoter));
+static void java_emit_char (int c, struct ui_file * stream, int quoter);
/* This objfile contains symtabs that have been dynamically created
to record dynamically loaded Java classes and dynamically
static struct objfile *dynamics_objfile = NULL;
-static struct type *java_link_class_type PARAMS ((struct type *, value_ptr));
+static struct type *java_link_class_type (struct type *, value_ptr);
static struct objfile *
-get_dynamics_objfile ()
+get_dynamics_objfile (void)
{
if (dynamics_objfile == NULL)
{
- dynamics_objfile = allocate_objfile (NULL, 0, 0, 0);
+ dynamics_objfile = allocate_objfile (NULL, 0);
}
return dynamics_objfile;
}
static int class_symtab_space;
static struct symtab *
-get_java_class_symtab ()
+get_java_class_symtab (void)
{
if (class_symtab == NULL)
{
}
static void
-add_class_symtab_symbol (sym)
- struct symbol *sym;
+add_class_symtab_symbol (struct symbol *sym)
{
struct symtab *symtab = get_java_class_symtab ();
struct blockvector *bv = BLOCKVECTOR (symtab);
BLOCK_NSYMS (bl) = BLOCK_NSYMS (bl) + 1;
}
-static struct symbol *add_class_symbol PARAMS ((struct type * type, CORE_ADDR addr));
+static struct symbol *add_class_symbol (struct type *type, CORE_ADDR addr);
static struct symbol *
-add_class_symbol (type, addr)
- struct type *type;
- CORE_ADDR addr;
+add_class_symbol (struct type *type, CORE_ADDR addr)
{
struct symbol *sym;
sym = (struct symbol *)
#endif
struct type *
-java_lookup_class (name)
- char *name;
+java_lookup_class (char *name)
{
struct symbol *sym;
sym = lookup_symbol (name, expression_context_block, STRUCT_NAMESPACE,
a name given by NAME (which has type Utf8Const*). */
char *
-get_java_utf8_name (obstack, name)
- struct obstack *obstack;
- value_ptr name;
+get_java_utf8_name (struct obstack *obstack, value_ptr name)
{
char *chrs;
value_ptr temp = name;
+ TYPE_LENGTH (VALUE_TYPE (temp));
chrs = obstack_alloc (obstack, name_length + 1);
chrs[name_length] = '\0';
- read_memory_section (data_addr, chrs, name_length, NULL);
+ read_memory (data_addr, chrs, name_length);
return chrs;
}
value_ptr
-java_class_from_object (obj_val)
- value_ptr obj_val;
+java_class_from_object (value_ptr obj_val)
{
/* This is all rather inefficient, since the offsets of vtable and
class are fixed. FIXME */
/* Check if CLASS_IS_PRIMITIVE(value of clas): */
static int
-java_class_is_primitive (clas)
- value_ptr clas;
+java_class_is_primitive (value_ptr clas)
{
value_ptr vtable = value_struct_elt (&clas, NULL, "vtable", NULL, "struct");
CORE_ADDR i = value_as_pointer (vtable);
/* Read a GCJ Class object, and generated a gdb (TYPE_CODE_STRUCT) type. */
struct type *
-type_from_class (clas)
- value_ptr clas;
+type_from_class (value_ptr clas)
{
struct type *type;
char *name;
/* Fill in class TYPE with data from the CLAS value. */
struct type *
-java_link_class_type (type, clas)
- struct type *type;
- value_ptr clas;
+java_link_class_type (struct type *type, value_ptr clas)
{
value_ptr temp;
char *unqualified_name;
static struct type *java_object_type;
struct type *
-get_java_object_type ()
+get_java_object_type (void)
{
if (java_object_type == NULL)
{
}
int
-get_java_object_header_size ()
+get_java_object_header_size (void)
{
struct type *objtype = get_java_object_type ();
if (objtype == NULL)
}
int
-is_object_type (type)
- struct type *type;
+is_object_type (struct type *type)
{
CHECK_TYPEDEF (type);
if (TYPE_CODE (type) == TYPE_CODE_PTR)
}
struct type *
-java_primitive_type (signature)
- int signature;
+java_primitive_type (int signature)
{
switch (signature)
{
return that type. Otherwise, return NULL. */
struct type *
-java_primitive_type_from_name (name, namelen)
- char *name;
- int namelen;
+java_primitive_type_from_name (char *name, int namelen)
{
switch (name[0])
{
signature string SIGNATURE. */
static int
-java_demangled_signature_length (signature)
- char *signature;
+java_demangled_signature_length (char *signature)
{
int array = 0;
for (; *signature == '['; signature++)
/* Demangle the Java type signature SIGNATURE, leaving the result in RESULT. */
static void
-java_demangled_signature_copy (result, signature)
- char *result;
- char *signature;
+java_demangled_signature_copy (char *result, char *signature)
{
int array = 0;
char *ptr;
as a freshly allocated copy. */
char *
-java_demangle_type_signature (signature)
- char *signature;
+java_demangle_type_signature (char *signature)
{
int length = java_demangled_signature_length (signature);
char *result = xmalloc (length + 1);
}
struct type *
-java_lookup_type (signature)
- char *signature;
+java_lookup_type (char *signature)
{
switch (signature[0])
{
If DIMS == 0, TYPE is returned. */
struct type *
-java_array_type (type, dims)
- struct type *type;
- int dims;
+java_array_type (struct type *type, int dims)
{
struct type *range_type;
/* Create a Java string in the inferior from a (Utf8) literal. */
static value_ptr
-java_value_string (ptr, len)
- char *ptr;
- int len;
+java_value_string (char *ptr, int len)
{
error ("not implemented - java_value_string"); /* FIXME */
}
characters and strings is language specific. */
static void
-java_emit_char (c, stream, quoter)
- int c;
- GDB_FILE *stream;
- int quoter;
+java_emit_char (int c, struct ui_file *stream, int quoter)
{
switch (c)
{
}
static value_ptr
-evaluate_subexp_java (expect_type, exp, pos, noside)
- struct type *expect_type;
- register struct expression *exp;
- register int *pos;
- enum noside noside;
+evaluate_subexp_java (struct type *expect_type, register struct expression *exp,
+ register int *pos, enum noside noside)
{
int pc = *pos;
int i;
}
static struct type *
-java_create_fundamental_type (objfile, typeid)
- struct objfile *objfile;
- int typeid;
+java_create_fundamental_type (struct objfile *objfile, int typeid)
{
switch (typeid)
{
c_builtin_types,
range_check_off,
type_check_off,
+ case_sensitive_on,
java_parse,
java_error,
evaluate_subexp_java,
};
void
-_initialize_java_language ()
+_initialize_java_language (void)
{
java_int_type = init_type (TYPE_CODE_INT, 4, 0, "int", NULL);
We should use make_run_cleanup to have this be called.
But will that mess up values in value histry? FIXME */
-extern void java_rerun_cleanup PARAMS ((void));
+extern void java_rerun_cleanup (void);
void
-java_rerun_cleanup ()
+java_rerun_cleanup (void)
{
if (class_symtab != NULL)
{