summaryrefslogtreecommitdiff
path: root/gdb/jv-valprint.c
diff options
context:
space:
mode:
authorUlrich Weigand <uweigand@de.ibm.com>2009-07-02 12:09:27 +0000
committerUlrich Weigand <uweigand@de.ibm.com>2009-07-02 12:09:27 +0000
commita05afb42b7c8c11a08a6f1f75bca25b23e948563 (patch)
tree13ef2222d38b71f47c7a75cdc1188ac99fd6eaac /gdb/jv-valprint.c
parent42c472625ec6b9cb657fb91be333b34829793d91 (diff)
downloadgdb-a05afb42b7c8c11a08a6f1f75bca25b23e948563.tar.gz
* jv-lang.h (java_int_type, java_byte_type, java_short_type,
java_long_type, java_boolean_type, java_char_type, java_float_type, java_double_type, java_void_type): Remove. (struct builtin_java_type): New data type. (builtin_java_type): Add prototype. (java_primitive_type): Add GDBARCH argument. (java_primitive_type_from_name): Likewise. (type_from_class): Likewise. * jv-lang.c (java_int_type, java_byte_type, java_short_type, java_long_type, java_boolean_type, java_char_type, java_float_type, java_double_type, java_void_type): Remove. (build_java_types, builtin_java_type): New functions. (java_type_data): New static variable. (_initialize_java_language): Initialize it. No longer initialize global types. (java_language_arch_info): Use per-architecture types. (java_primitive_type): Add GDBARCH argument. Return per-architecture type instead of refering to global variable. (java_primitive_type_from_name): Add GDBARCH argument. (java_primitive_type_name): New function. (java_demangled_signature_length): Use it instead of java_primitive_type_from_name. (java_demangled_signature_copy): Likewise. (type_from_class): Add GDBARCH argument. Pass to java_link_class_type, java_primitive_type, and recursive type_from_class call. (java_link_class_type): Add GDBARCH argument. Pass to type_from_class calls. Use per-architecture types instead of global types. * jv-exp.y (parse_java_type): New define. Use per-architecture types instead of global types througout. * jv-valprint.c (java_value_print): Pass architecture to type_from_class and java_primitive_type_from_name. Use per- architecture types instead of global types.
Diffstat (limited to 'gdb/jv-valprint.c')
-rw-r--r--gdb/jv-valprint.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/gdb/jv-valprint.c b/gdb/jv-valprint.c
index a15bc5768ab..2157418f167 100644
--- a/gdb/jv-valprint.c
+++ b/gdb/jv-valprint.c
@@ -58,7 +58,7 @@ java_value_print (struct value *val, struct ui_file *stream,
if (obj_addr != 0)
{
- type = type_from_class (java_class_from_object (val));
+ type = type_from_class (gdbarch, java_class_from_object (val));
type = lookup_pointer_type (type);
val = value_at (type, address);
@@ -76,7 +76,8 @@ java_value_print (struct value *val, struct ui_file *stream,
long length;
unsigned int things_printed = 0;
int reps;
- struct type *el_type = java_primitive_type_from_name (name, i - 2);
+ struct type *el_type
+ = java_primitive_type_from_name (gdbarch, name, i - 2);
i = 0;
read_memory (address + get_java_object_header_size (gdbarch), buf4, 4);
@@ -211,6 +212,7 @@ java_value_print (struct value *val, struct ui_file *stream,
&& address != 0
&& value_as_address (val) != 0)
{
+ struct type *char_type;
struct value *data_val;
CORE_ADDR data;
struct value *boffset_val;
@@ -232,7 +234,8 @@ java_value_print (struct value *val, struct ui_file *stream,
value_free_to_mark (mark); /* Release unnecessary values */
- val_print_string (java_char_type, data + boffset, count, stream, options);
+ char_type = builtin_java_type (gdbarch)->builtin_char;
+ val_print_string (char_type, data + boffset, count, stream, options);
return 0;
}