GDB (xrefs)
|
#include "defs.h"
#include "symtab.h"
#include "gdbtypes.h"
#include "expression.h"
#include "parser-defs.h"
#include "language.h"
#include "symfile.h"
#include "objfiles.h"
#include "gdb_string.h"
#include "value.h"
#include "c-lang.h"
#include "jv-lang.h"
#include "gdbcore.h"
#include "block.h"
#include "demangle.h"
#include "dictionary.h"
#include <ctype.h>
#include "gdb_assert.h"
#include "charset.h"
#include "valprint.h"
#include "cp-support.h"
Go to the source code of this file.
enum java_primitive_types |
void _initialize_java_language | ( | void | ) |
static struct symbol* add_class_symbol | ( | struct type * | type, |
CORE_ADDR | addr | ||
) | [static, read] |
Definition at line 185 of file jv-lang.c.
References allocate_symbol(), get_dynamics_objfile(), get_type_arch(), language_java, LOC_TYPEDEF, objfile::objfile_obstack, STRUCT_DOMAIN, SYMBOL_ACLASS_INDEX, SYMBOL_DOMAIN, SYMBOL_SET_LANGUAGE, SYMBOL_SET_LINKAGE_NAME, SYMBOL_TYPE, SYMBOL_VALUE_ADDRESS, type, and TYPE_TAG_NAME.
Referenced by type_from_class().
static void add_class_symtab_symbol | ( | struct symbol * | sym | ) | [static] |
Definition at line 175 of file jv-lang.c.
References BLOCK_DICT, BLOCKVECTOR, BLOCKVECTOR_BLOCK, dict_add_symbol(), get_java_class_symtab(), get_objfile_arch(), GLOBAL_BLOCK, and SYMBOL_SYMTAB.
Referenced by type_from_class().
static void* build_java_types | ( | struct gdbarch * | gdbarch | ) | [static] |
Definition at line 1203 of file jv-lang.c.
References arch_boolean_type(), arch_character_type(), arch_float_type(), arch_integer_type(), arch_type(), builtin_java_type::builtin_boolean, builtin_java_type::builtin_byte, builtin_java_type::builtin_char, builtin_java_type::builtin_double, builtin_java_type::builtin_float, builtin_java_type::builtin_int, builtin_java_type(), builtin_java_type::builtin_long, builtin_java_type::builtin_short, builtin_java_type::builtin_void, GDBARCH_OBSTACK_ZALLOC, and TYPE_CODE_VOID.
struct builtin_java_type* builtin_java_type | ( | struct gdbarch * | gdbarch | ) | [read] |
Definition at line 1233 of file jv-lang.c.
References gdbarch_data().
Referenced by build_java_types(), java_language_arch_info(), java_primitive_type(), java_primitive_type_from_name(), and java_value_print().
static struct value* evaluate_subexp_java | ( | struct type * | expect_type, |
struct expression * | exp, | ||
int * | pos, | ||
enum noside | noside | ||
) | [static, read] |
Definition at line 901 of file jv-lang.c.
References _, builtin_type::builtin_int, BYTES_TO_EXP_ELEM, check_typedef(), coerce_ref(), deprecated_set_value_type(), expression::elts, error(), EVAL_AVOID_SIDE_EFFECTS, EVAL_NORMAL, EVAL_SKIP, evaluate_subexp_standard(), evaluate_subexp_with_coercion(), extract_signed_integer(), expression::gdbarch, gdbarch_byte_order(), get_java_object_header_size(), is_object_type(), java_class_from_object(), java_value_string(), type::length, gdb::printing::long, exp_element::longconst, longest_to_int(), lookup_pointer_type(), name, NULL_TYPE, exp_element::opcode, read_memory(), exp_element::string, type, TYPE_CODE, TYPE_CODE_ARRAY, TYPE_CODE_PTR, TYPE_CODE_STRUCT, type_from_class(), TYPE_LENGTH, TYPE_NAME, TYPE_TAG_NAME, TYPE_TARGET_TYPE, value_addr(), value_as_address(), value_as_long(), value_at(), value_cast(), value_from_longest(), value_ind(), VALUE_LVAL, value_struct_elt(), value_subscript(), value_type(), and value_zero().
static struct objfile* get_dynamics_objfile | ( | struct gdbarch * | gdbarch | ) | [static, read] |
Definition at line 108 of file jv-lang.c.
References allocate_objfile(), current_program_space, objfile_per_bfd_storage::gdbarch, jv_dynamics_objfile_data_key, jv_dynamics_progspace_key, OBJF_NOT_FILENAME, OBJF_SHARED, and objfile::per_bfd.
Referenced by add_class_symbol(), get_java_class_symtab(), java_link_class_type(), and type_from_class().
static struct symtab * get_java_class_symtab | ( | struct gdbarch * | gdbarch | ) | [static, read] |
Definition at line 136 of file jv-lang.c.
References allocate_block(), allocate_global_block(), allocate_symtab(), BLOCK_DICT, BLOCKVECTOR, BLOCKVECTOR_BLOCK, BLOCKVECTOR_NBLOCKS, jv_per_objfile_data::dict, dict_create_hashed_expandable(), dict_create_linear(), get_dynamics_objfile(), GLOBAL_BLOCK, jv_dynamics_objfile_data_key, symtab::language, language_java, objfile::objfile_obstack, set_block_symtab(), STATIC_BLOCK, and objfile::symtabs.
Referenced by add_class_symtab_symbol().
int get_java_object_header_size | ( | struct gdbarch * | gdbarch | ) |
Definition at line 601 of file jv-lang.c.
References gdbarch_ptr_bit(), get_java_object_type(), and TYPE_LENGTH.
Referenced by evaluate_subexp_java(), and java_value_print().
struct type* get_java_object_type | ( | void | ) | [read] |
Definition at line 590 of file jv-lang.c.
References _, error(), lookup_symbol(), STRUCT_DOMAIN, and SYMBOL_TYPE.
Referenced by get_java_object_header_size(), java_class_from_object(), and java_link_class_type().
char * get_java_utf8_name | ( | struct obstack * | obstack, |
struct value * | name | ||
) | [static] |
Definition at line 217 of file jv-lang.c.
References int, name, read_memory(), TYPE_LENGTH, value_address(), value_as_long(), value_struct_elt(), and value_type().
Referenced by java_link_class_type(), and type_from_class().
int is_object_type | ( | struct type * | type | ) |
Definition at line 612 of file jv-lang.c.
References check_typedef(), CHECK_TYPEDEF, name, TYPE_BASECLASS, TYPE_CODE, TYPE_CODE_PTR, TYPE_CODE_STRUCT, TYPE_FIELD_NAME, TYPE_N_BASECLASSES, TYPE_NFIELDS, TYPE_TAG_NAME, and TYPE_TARGET_TYPE.
Referenced by evaluate_subexp_java(), and java_value_print().
struct type* java_array_type | ( | struct type * | type, |
int | dims | ||
) | [read] |
Definition at line 820 of file jv-lang.c.
References lookup_array_range_type(), and type.
struct value* java_class_from_object | ( | struct value * | obj_val | ) | [read] |
Definition at line 234 of file jv-lang.c.
References get_java_object_type(), TYPE_CODE, TYPE_CODE_PTR, TYPE_LENGTH, TYPE_TARGET_TYPE, value_as_address(), value_at(), value_struct_elt(), and value_type().
Referenced by evaluate_subexp_java(), and java_value_print().
static int java_class_is_primitive | ( | struct value * | clas | ) | [static] |
Definition at line 251 of file jv-lang.c.
References value_as_address(), and value_struct_elt().
Referenced by type_from_class().
static char * java_class_name_from_physname | ( | const char * | physname | ) | [static] |
Definition at line 1050 of file jv-lang.c.
References java_demangle(), java_find_last_component(), memcpy(), xfree(), and xmalloc().
static char* java_demangle | ( | const char * | mangled, |
int | options | ||
) | [static] |
Definition at line 1013 of file jv-lang.c.
References gdb_demangle().
Referenced by java_class_name_from_physname().
char* java_demangle_type_signature | ( | const char * | signature | ) |
Definition at line 806 of file jv-lang.c.
References java_demangled_signature_copy(), java_demangled_signature_length(), and xmalloc().
Referenced by java_type_print_base().
static void java_demangled_signature_copy | ( | char * | result, |
const char * | signature | ||
) | [static] |
Definition at line 763 of file jv-lang.c.
References java_primitive_type_name().
Referenced by java_demangle_type_signature(), and type_from_class().
static int java_demangled_signature_length | ( | const char * | signature | ) | [static] |
Definition at line 743 of file jv-lang.c.
References java_primitive_type_name().
Referenced by java_demangle_type_signature(), and type_from_class().
static void java_emit_char | ( | int | c, |
struct type * | type, | ||
struct ui_file * | stream, | ||
int | quoter | ||
) | [static] |
Definition at line 866 of file jv-lang.c.
References encoding, generic_emit_char(), and java_get_encoding().
static const char* java_find_last_component | ( | const char * | name | ) | [static] |
Definition at line 1027 of file jv-lang.c.
Referenced by java_class_name_from_physname().
static const char* java_get_encoding | ( | struct type * | type | ) | [static] |
Definition at line 843 of file jv-lang.c.
References encoding, gdbarch_byte_order(), get_type_arch(), and target_charset().
Referenced by java_emit_char(), and java_printstr().
static void java_language_arch_info | ( | struct gdbarch * | gdbarch, |
struct language_arch_info * | lai | ||
) | [static] |
Definition at line 1120 of file jv-lang.c.
References language_arch_info::bool_type_default, language_arch_info::bool_type_symbol, builtin_java_type::builtin_boolean, builtin_java_type::builtin_byte, builtin_java_type::builtin_char, builtin_java_type::builtin_double, builtin_java_type::builtin_float, builtin_java_type::builtin_int, builtin_java_type(), builtin_java_type::builtin_long, builtin_java_type::builtin_short, builtin_java_type::builtin_void, GDBARCH_OBSTACK_CALLOC, java_primitive_type_boolean, java_primitive_type_byte, java_primitive_type_char, java_primitive_type_double, java_primitive_type_float, java_primitive_type_int, java_primitive_type_long, java_primitive_type_short, java_primitive_type_void, nr_java_primitive_types, language_arch_info::primitive_type_vector, and language_arch_info::string_char_type.
static struct type * java_link_class_type | ( | struct gdbarch * | gdbarch, |
struct type * | type, | ||
struct value * | clas | ||
) | [static, read] |
Definition at line 338 of file jv-lang.c.
References B_BYTES, B_CLRALL, B_TYPE, gdb_assert, get_dynamics_objfile(), get_java_object_type(), get_java_utf8_name(), lookup_function_type(), lookup_pointer_type(), memcpy(), memset(), name, objfile::objfile_obstack, SET_FIELD_BITPOS, SET_FIELD_PHYSADDR, SET_TYPE_FIELD_PRIVATE, SET_TYPE_FIELD_PROTECTED, set_value_address(), set_value_lazy(), strrchr(), type, TYPE_ALLOC, TYPE_BASECLASS, TYPE_CODE, TYPE_CODE_METHOD, TYPE_CODE_PTR, TYPE_CODE_STRUCT, TYPE_FIELD, TYPE_FIELD_IGNORE_BITS, TYPE_FIELD_NAME, TYPE_FIELD_PRIVATE_BITS, TYPE_FIELD_PROTECTED_BITS, TYPE_FIELD_TYPE, TYPE_FIELD_VIRTUAL_BITS, TYPE_FIELDS, TYPE_FN_FIELDLISTS, type_from_class(), TYPE_LENGTH, TYPE_N_BASECLASSES, TYPE_NFIELDS, TYPE_NFN_FIELDS, TYPE_TAG_NAME, TYPE_TARGET_TYPE, value_address(), value_as_long(), value_ind(), value_struct_elt(), and value_type().
Referenced by type_from_class().
struct type* java_lookup_class | ( | char * | name | ) | [read] |
Definition at line 202 of file jv-lang.c.
References expression_context_block, lookup_symbol(), STRUCT_DOMAIN, and SYMBOL_TYPE.
Referenced by java_type_from_name(), push_expression_name(), push_qualified_expression_name(), and type_from_class().
struct type* java_primitive_type | ( | struct gdbarch * | gdbarch, |
int | signature | ||
) | [read] |
Definition at line 635 of file jv-lang.c.
References _, builtin_java_type::builtin_boolean, builtin_java_type::builtin_byte, builtin_java_type::builtin_char, builtin_java_type::builtin_double, builtin_java_type::builtin_float, builtin_java_type::builtin_int, builtin_java_type(), builtin_java_type::builtin_long, builtin_java_type::builtin_short, builtin_java_type::builtin_void, and error().
Referenced by type_from_class().
struct type* java_primitive_type_from_name | ( | struct gdbarch * | gdbarch, |
const char * | name, | ||
int | namelen | ||
) | [read] |
Definition at line 667 of file jv-lang.c.
References builtin_java_type::builtin_boolean, builtin_java_type::builtin_byte, builtin_java_type::builtin_char, builtin_java_type::builtin_double, builtin_java_type::builtin_float, builtin_java_type::builtin_int, builtin_java_type(), builtin_java_type::builtin_long, builtin_java_type::builtin_short, builtin_java_type::builtin_void, and memcmp().
Referenced by java_value_print().
static char* java_primitive_type_name | ( | int | signature | ) | [static] |
Definition at line 713 of file jv-lang.c.
Referenced by java_demangled_signature_copy(), and java_demangled_signature_length().
static void java_printchar | ( | int | c, |
struct type * | type, | ||
struct ui_file * | stream | ||
) | [static] |
Definition at line 876 of file jv-lang.c.
References fputs_filtered(), and LA_EMIT_CHAR.
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 | ||
) | [static] |
Definition at line 886 of file jv-lang.c.
References generic_printstr(), and java_get_encoding().
static struct value * java_value_string | ( | char * | ptr, |
int | len | ||
) | [static, read] |
Definition at line 834 of file jv-lang.c.
Referenced by evaluate_subexp_java().
static void jv_per_objfile_free | ( | struct objfile * | objfile, |
void * | data | ||
) | [static] |
Definition at line 83 of file jv-lang.c.
References current_program_space, jv_per_objfile_data::dict, dict_free(), gdb_assert, jv_dynamics_progspace_key, and xfree().
struct type* type_from_class | ( | struct gdbarch * | gdbarch, |
struct value * | clas | ||
) | [read] |
Definition at line 263 of file jv-lang.c.
References add_class_symbol(), add_class_symtab_symbol(), alloc_type(), ALLOCATE_CPLUS_STRUCT_TYPE, check_typedef(), deprecated_set_value_type(), get_dynamics_objfile(), get_java_utf8_name(), INIT_CPLUS_SPECIFIC, java_class_is_primitive(), java_demangled_signature_copy(), java_demangled_signature_length(), java_link_class_type(), java_lookup_class(), java_primitive_type(), lookup_pointer_type(), name, objfile::objfile_obstack, type, TYPE_CODE, TYPE_CODE_PTR, TYPE_CODE_STRUCT, type_from_class(), TYPE_TAG_NAME, TYPE_TARGET_TYPE, value_address(), value_as_long(), value_ind(), value_logical_not(), value_struct_elt(), and value_type().
Referenced by evaluate_subexp_java(), java_link_class_type(), java_value_print(), and type_from_class().
struct language_defn java_language_defn |
struct op_print java_op_print_tab[] |
{ {",", BINOP_COMMA, PREC_COMMA, 0}, {"=", BINOP_ASSIGN, PREC_ASSIGN, 1}, {"||", BINOP_LOGICAL_OR, PREC_LOGICAL_OR, 0}, {"&&", BINOP_LOGICAL_AND, PREC_LOGICAL_AND, 0}, {"|", BINOP_BITWISE_IOR, PREC_BITWISE_IOR, 0}, {"^", BINOP_BITWISE_XOR, PREC_BITWISE_XOR, 0}, {"&", BINOP_BITWISE_AND, PREC_BITWISE_AND, 0}, {"==", BINOP_EQUAL, PREC_EQUAL, 0}, {"!=", BINOP_NOTEQUAL, PREC_EQUAL, 0}, {"<=", BINOP_LEQ, PREC_ORDER, 0}, {">=", BINOP_GEQ, PREC_ORDER, 0}, {">", BINOP_GTR, PREC_ORDER, 0}, {"<", BINOP_LESS, PREC_ORDER, 0}, {">>", BINOP_RSH, PREC_SHIFT, 0}, {"<<", BINOP_LSH, PREC_SHIFT, 0}, {"+", BINOP_ADD, PREC_ADD, 0}, {"-", BINOP_SUB, PREC_ADD, 0}, {"*", BINOP_MUL, PREC_MUL, 0}, {"/", BINOP_DIV, PREC_MUL, 0}, {"%", BINOP_REM, PREC_MUL, 0}, {"-", UNOP_NEG, PREC_PREFIX, 0}, {"!", UNOP_LOGICAL_NOT, PREC_PREFIX, 0}, {"~", UNOP_COMPLEMENT, PREC_PREFIX, 0}, {"*", UNOP_IND, PREC_PREFIX, 0}, {"++", UNOP_PREINCREMENT, PREC_PREFIX, 0}, {"--", UNOP_PREDECREMENT, PREC_PREFIX, 0}, {NULL, 0, 0, 0} }
struct gdbarch_data* java_type_data [static] |
struct objfile_data* jv_dynamics_objfile_data_key [static] |
Definition at line 61 of file jv-lang.c.
Referenced by get_dynamics_objfile(), and get_java_class_symtab().
struct program_space_data* jv_dynamics_progspace_key [static] |
Definition at line 66 of file jv-lang.c.
Referenced by get_dynamics_objfile(), and jv_per_objfile_free().