54 struct ui_file * stream,
int quoter);
83 struct objfile *dynamics_objfile;
107 struct objfile *dynamics_objfile;
112 if (dynamics_objfile == NULL)
129 return dynamics_objfile;
138 if (class_symtab == NULL)
226 chrs = obstack_alloc (obstack, name_length + 1);
227 chrs[name_length] =
'\0';
237 struct value *vtable_val;
244 vtable_val =
value_struct_elt (&obj_val, NULL,
"vtable", NULL,
"structure");
256 return (
int) (i & 0x7fffffff) == (
int) 0x7fffffff;
268 struct value *utf8_name;
296 for (nptr = name; *nptr != 0; nptr++)
312 char *signature =
name;
315 if (namelen > strlen (name))
318 name[namelen] =
'\0';
341 const char *unqualified_name;
343 int ninterfaces, nfields, nmethods;
344 int type_is_object = 0;
347 struct value *fields;
348 struct value *methods;
349 struct value *method = NULL;
356 unqualified_name = strrchr (name,
'.');
357 if (unqualified_name == NULL)
358 unqualified_name =
name;
362 if (strcmp (name,
"java.lang.Object") == 0)
387 TYPE_ALLOC (type,
sizeof (
struct field) * nfields);
389 memset (
TYPE_FIELDS (type), 0,
sizeof (
struct field) * nfields);
415 if (i > 2 && name[i - 1] ==
']' && tsuper != NULL)
465 if (accflags & 0x0001)
469 if (accflags & 0x0002)
473 if (accflags & 0x0004)
477 if (accflags & 0x0008)
481 if (accflags & 0x8000)
501 j = nmethods *
sizeof (
struct fn_field);
504 memset (fn_fields, 0, j);
509 for (i = 0; i < nmethods; i++)
534 if (strcmp (mname,
"<init>") == 0)
535 mname = unqualified_name;
548 fn_fieldlists[j].
name = mname;
549 fn_fieldlists[j].
length = 1;
550 fn_fieldlists[j].
fn_fields = &fn_fields[i];
554 if (strcmp (mname, fn_fieldlists[j].name) == 0)
558 if (mname != unqualified_name)
560 mname = fn_fieldlists[j].
name;
561 fn_fieldlists[j].
length++;
564 for (l = i; l > k; l--)
565 fn_fields[l] = fn_fields[l - 1];
567 fn_fieldlists[l].fn_fields++;
570 k += fn_fieldlists[j].
length;
595 error (
_(
"cannot find java.lang.Object"));
623 if (name != NULL && strcmp (name,
"java.lang.Object") == 0)
627 if (name != NULL && strcmp (name,
"vtable") == 0)
659 error (
_(
"unknown signature '%c' for primitive type"), (
char) signature);
667 const char *
name,
int namelen)
674 if (namelen == 4 && memcmp (name,
"byte", 4) == 0)
676 if (namelen == 7 && memcmp (name,
"boolean", 7) == 0)
680 if (namelen == 4 && memcmp (name,
"char", 4) == 0)
684 if (namelen == 6 && memcmp (name,
"double", 6) == 0)
688 if (namelen == 5 && memcmp (name,
"float", 5) == 0)
692 if (namelen == 3 && memcmp (name,
"int", 3) == 0)
696 if (namelen == 4 && memcmp (name,
"long", 4) == 0)
700 if (namelen == 5 && memcmp (name,
"short", 5) == 0)
704 if (namelen == 4 && memcmp (name,
"void", 4) == 0)
735 error (
_(
"unknown signature '%c' for primitive type"), (
char) signature);
746 for (; *signature ==
'['; signature++)
748 switch (signature[0])
752 return strlen (signature) - 2 + array;
768 while (*signature ==
'[')
773 switch (signature[0])
779 for (; *signature !=
';' && *signature !=
'\0'; signature++)
781 if (*signature ==
'/')
790 strcpy (result, ptr);
808 char *result =
xmalloc (length + 1);
811 result[length] =
'\0';
832 static struct value *
835 error (
_(
"not implemented - java_value_string"));
850 encoding =
"UTF-16BE";
852 encoding =
"UTF-16LE";
887 unsigned int length,
const char *
encoding,
int force_ellipses,
892 if (!encoding || !*encoding)
893 encoding = type_encoding;
896 force_ellipses,
'"', 0, options);
899 static struct value *
927 case BINOP_SUBSCRIPT:
944 i = name == NULL ? 0 : strlen (name);
946 && i > 2 && name[i - 1] ==
']')
951 struct type *el_type;
955 struct value *temp = clas;
971 if (index >= length || index < 0)
972 error (
_(
"array index (%ld) out of bounds (length: %ld)"),
974 address = (address + 4) + index *
TYPE_LENGTH (el_type);
985 error (
_(
"cannot subscript something of type `%s'"), name);
987 error (
_(
"cannot subscript requested type"));
1031 p = strchr (name,
'(');
1037 while (p > name && *p !=
'.')
1053 char *demangled_name =
java_demangle (physname, DMGL_PARAMS | DMGL_ANSI);
1055 if (demangled_name == NULL)
1061 ret =
xmalloc (end - demangled_name + 1);
1062 memcpy (ret, demangled_name, end - demangled_name);
1063 ret[end - demangled_name] =
'\0';
1066 xfree (demangled_name);
1192 default_make_symbol_completion_list,
struct value * value_zero(struct type *type, enum lval_type lv)
union exp_element elts[1]
const char * target_charset(struct gdbarch *gdbarch)
static struct symbol * add_class_symbol(struct type *type, CORE_ADDR addr)
struct type * lookup_array_range_type(struct type *element_type, LONGEST low_bound, LONGEST high_bound)
static void java_language_arch_info(struct gdbarch *gdbarch, struct language_arch_info *lai)
struct value * value_addr(struct value *arg1)
struct type * builtin_void
struct type * builtin_short
struct value * value_subscript(struct value *array, LONGEST index)
#define TYPE_FIELD_PRIVATE_BITS(thistype)
struct type * java_primitive_type_from_name(struct gdbarch *gdbarch, const char *name, int namelen)
static struct type * java_link_class_type(struct gdbarch *, struct type *, struct value *)
struct fn_field * fn_fields
void dict_free(struct dictionary *dict)
#define TYPE_FIELD_NAME(thistype, n)
#define TYPE_N_BASECLASSES(thistype)
static struct value * java_value_string(char *ptr, int len)
struct type * java_array_type(struct type *type, int dims)
#define TYPE_NFN_FIELDS(thistype)
struct type * arch_boolean_type(struct gdbarch *gdbarch, int bit, int unsigned_p, char *name)
#define GDBARCH_OBSTACK_CALLOC(GDBARCH, NR, TYPE)
struct type * builtin_boolean
LONGEST value_as_long(struct value *val)
void java_val_print(struct type *, const gdb_byte *, int, CORE_ADDR, struct ui_file *, int, const struct value *, const struct value_print_options *)
static struct gdbarch_data * java_type_data
struct value * evaluate_subexp_with_coercion(struct expression *exp, int *pos, enum noside noside)
#define TYPE_NAME(thistype)
#define INIT_CPLUS_SPECIFIC(type)
int gdbarch_ptr_bit(struct gdbarch *gdbarch)
struct value * value_at(struct type *type, CORE_ADDR addr)
struct type * arch_float_type(struct gdbarch *gdbarch, int bit, char *name, const struct floatformat **floatformats)
static void java_demangled_signature_copy(char *, const char *)
void * gdbarch_data(struct gdbarch *gdbarch, struct gdbarch_data *data)
struct compunit_symtab * allocate_compunit_symtab(struct objfile *objfile, const char *name)
#define TYPE_FIELD_VIRTUAL_BITS(thistype)
#define SYMBOL_SET_LINKAGE_NAME(symbol, linkage_name)
const struct builtin_java_type * builtin_java_type(struct gdbarch *gdbarch)
static int java_class_is_primitive(struct value *clas)
#define TYPE_FIELD_PROTECTED_BITS(thistype)
struct value * default_read_var_value(struct symbol *var, struct frame_info *frame)
struct value * coerce_ref(struct value *arg)
static struct value * evaluate_subexp_java(struct type *expect_type, struct expression *exp, int *pos, enum noside noside)
struct gdbarch * symbol_arch(const struct symbol *symbol)
void set_value_lazy(struct value *value, int val)
struct value * value_ind(struct value *arg1)
#define SET_FIELD_PHYSADDR(thisfld, addr)
#define BLOCKVECTOR_BLOCK(blocklist, n)
#define OBJF_NOT_FILENAME
static struct objfile * get_dynamics_objfile(struct gdbarch *gdbarch)
void default_print_typedef(struct type *type, struct symbol *new_symbol, struct ui_file *stream)
#define TYPE_FIELD_IGNORE_BITS(thistype)
struct type * string_char_type
void java_print_type(struct type *, const char *, struct ui_file *, int, int, const struct type_print_options *)
#define SET_FIELD_BITPOS(thisfld, bitpos)
#define TYPE_FIELD(thistype, n)
#define BYTES_TO_EXP_ELEM(bytes)
#define TYPE_FIELD_TYPE(thistype, n)
struct objfile_per_bfd_storage * per_bfd
void add_language(const struct language_defn *lang)
struct type * type_from_class(struct gdbarch *gdbarch, struct value *clas)
int longest_to_int(LONGEST)
#define GDBARCH_OBSTACK_ZALLOC(GDBARCH, TYPE)
static const struct objfile_data * jv_dynamics_objfile_data_key
void deprecated_set_value_type(struct value *value, struct type *type)
void set_value_address(struct value *value, CORE_ADDR addr)
struct type * arch_character_type(struct gdbarch *gdbarch, int bit, int unsigned_p, char *name)
struct obstack objfile_obstack
static void add_class_symtab_symbol(struct symbol *sym)
char * gdb_demangle(const char *name, int options)
static const struct program_space_data * jv_dynamics_progspace_key
char * default_word_break_characters(void)
struct value * value_struct_elt(struct value **argp, struct value **args, const char *name, int *static_memfuncp, const char *err)
#define LA_EMIT_CHAR(ch, type, stream, quoter)
static void * build_java_types(struct gdbarch *gdbarch)
#define SYMBOL_ACLASS_INDEX(symbol)
struct type * check_typedef(struct type *type)
#define SYMBOL_VALUE_ADDRESS(symbol)
void generic_printstr(struct ui_file *stream, struct type *type, const gdb_byte *string, unsigned int length, const char *encoding, int force_ellipses, int quote_char, int c_style_terminator, const struct value_print_options *options)
struct type * bool_type_default
void null_post_parser(struct expression **exp, int void_context_p)
#define SYMBOL_DOMAIN(symbol)
#define SYMBOL_SET_LANGUAGE(symbol, language, obstack)
static void java_emit_char(int c, struct type *type, struct ui_file *stream, int quoter)
static char * get_java_utf8_name(struct obstack *obstack, struct value *name)
static void jv_per_objfile_free(struct objfile *objfile, void *data)
void fputs_filtered(const char *linebuffer, struct ui_file *stream)
const char * bool_type_symbol
#define ALLOCATE_CPLUS_STRUCT_TYPE(type)
int default_pass_by_reference(struct type *type)
enum bfd_endian gdbarch_byte_order(struct gdbarch *gdbarch)
static char * java_demangle(const char *mangled, int options)
struct type * basic_lookup_transparent_type(const char *name)
void add_compunit_symtab_to_objfile(struct compunit_symtab *cu)
struct dictionary * dict_create_linear(struct obstack *obstack, const struct pending *symbol_list)
const struct lang_varobj_ops java_varobj_ops
static int java_demangled_signature_length(const char *)
#define SET_TYPE_FIELD_PRIVATE(thistype, n)
struct gdbarch * get_type_arch(const struct type *type)
struct type * alloc_type(struct objfile *objfile)
int dump_subexp_body_standard(struct expression *exp, struct ui_file *stream, int elt)
struct value * value_from_longest(struct type *type, LONGEST num)
void iterate_over_symbols(const struct block *block, const char *name, const domain_enum domain, symbol_found_callback_ftype *callback, void *data)
struct compunit_symtab * compunit_symtabs
struct value * value_cast(struct type *type, struct value *arg2)
static const char * java_find_last_component(const char *name)
void default_print_array_index(struct value *index_value, struct ui_file *stream, const struct value_print_options *options)
struct type * java_primitive_type(struct gdbarch *gdbarch, int signature)
struct block * allocate_block(struct obstack *obstack)
#define TYPE_BASECLASS(thistype, index)
struct value * java_class_from_object(struct value *obj_val)
struct type * arch_integer_type(struct gdbarch *gdbarch, int bit, int unsigned_p, char *name)
int get_java_object_header_size(struct gdbarch *gdbarch)
#define TYPE_FIELDS(thistype)
void read_memory(CORE_ADDR memaddr, gdb_byte *myaddr, ssize_t len)
char * op_name_standard(enum exp_opcode opcode)
static char * java_class_name_from_physname(const char *physname)
union dictionary::@50 data
static char * java_primitive_type_name(int signature)
struct type * builtin_float
struct type * builtin_double
char * java_demangle_type_signature(const char *signature)
struct type * builtin_int
#define COMPUNIT_BLOCKVECTOR(cust)
const char const char int
#define TYPE_TARGET_TYPE(thistype)
struct symbol * allocate_symbol(struct objfile *objfile)
void print_subexp_standard(struct expression *exp, int *pos, struct ui_file *stream, enum precedence prec)
void default_get_string(struct value *value, gdb_byte **buffer, int *length, struct type **char_type, const char **charset)
#define TYPE_CODE(thistype)
static struct compunit_symtab * get_java_class_symtab(struct gdbarch *gdbarch)
struct type * java_lookup_class(char *name)
void dict_add_symbol(struct dictionary *dict, struct symbol *sym)
int operator_check_standard(struct expression *exp, int pos, int(*objfile_func)(struct objfile *objfile, void *data), void *data)
struct symbol * lookup_symbol(const char *name, const struct block *block, domain_enum domain, struct field_of_this_result *is_a_field_of_this)
const struct exp_descriptor exp_descriptor_java
struct dictionary * dict_create_hashed_expandable(void)
const struct op_print java_op_print_tab[]
struct symtab * allocate_symtab(struct compunit_symtab *cust, const char *filename)
#define TYPE_NFIELDS(thistype)
void generic_emit_char(int c, struct type *type, struct ui_file *stream, int quoter, const char *encoding)
static void java_printchar(int c, struct type *type, struct ui_file *stream)
static void java_printstr(struct ui_file *stream, struct type *type, const gdb_byte *string, unsigned int length, const char *encoding, int force_ellipses, const struct value_print_options *options)
#define COMPUNIT_FILETABS(cust)
struct type * builtin_byte
#define CHECK_TYPEDEF(TYPE)
void java_value_print(struct value *, struct ui_file *, const struct value_print_options *)
#define BLOCKVECTOR_NBLOCKS(blocklist)
int value_logical_not(struct value *arg1)
#define SET_TYPE_FIELD_PROTECTED(thistype, n)
struct value * evaluate_subexp_standard(struct type *expect_type, struct expression *exp, int *pos, enum noside noside)
struct objfile * allocate_objfile(bfd *abfd, const char *name, int flags)
#define TYPE_TAG_NAME(type)
int is_object_type(struct type *type)
void operator_length_standard(const struct expression *expr, int endpos, int *oplenp, int *argsp)
void set_block_compunit_symtab(struct block *block, struct compunit_symtab *cu)
const struct block * expression_context_block
struct program_space * current_program_space
static const char * java_get_encoding(struct type *type)
struct type * builtin_char
struct symbol * basic_lookup_symbol_nonlocal(const struct language_defn *langdef, const char *name, const struct block *block, const domain_enum domain)
struct type * value_type(const struct value *value)
#define TYPE_ALLOC(t, size)
#define SYMBOL_TYPE(symbol)
CORE_ADDR value_as_address(struct value *val)
#define TYPE_FN_FIELDLISTS(thistype)
#define TYPE_LENGTH(thistype)
struct type * builtin_long
struct block * allocate_global_block(struct obstack *obstack)
struct type * arch_type(struct gdbarch *gdbarch, enum type_code code, int length, char *name)
LONGEST extract_signed_integer(const gdb_byte *, int, enum bfd_endian)
CORE_ADDR value_address(const struct value *value)
struct type ** primitive_type_vector
void _initialize_java_language(void)
void error(const char *fmt,...)
struct gdbarch_data * gdbarch_data_register_post_init(gdbarch_data_post_init_ftype *post_init)
struct type * lookup_pointer_type(struct type *type)
int java_parse(struct parser_state *par_state)
struct type * lookup_function_type(struct type *type)
struct type * builtin_int
const ULONGEST const LONGEST len
struct type * get_java_object_type(void)