* jv-lang.h (JAVA_OBJECT_SIZE): Remove.

(get_java_object_header_size): Add GDBARCH parameter.
	* jv-lang.c (get_java_object_header_size): Add GDBARCH parameter.
	Use it instead of current_gdbarch.
	(evaluate_subexp_java): Replace JAVA_OBJECT_SIZE with call to
	get_java_object_header_size.
	* jv-valprint.c (java_value_print): Likewise.
This commit is contained in:
Ulrich Weigand
2009-06-23 18:11:09 +00:00
parent 3d857b98f5
commit 45d5d5ca5d
4 changed files with 23 additions and 14 deletions

View File

@ -589,11 +589,11 @@ get_java_object_type (void)
}
int
get_java_object_header_size (void)
get_java_object_header_size (struct gdbarch *gdbarch)
{
struct type *objtype = get_java_object_type ();
if (objtype == NULL)
return (2 * gdbarch_ptr_bit (current_gdbarch) / TARGET_CHAR_BIT);
return (2 * gdbarch_ptr_bit (gdbarch) / TARGET_CHAR_BIT);
else
return TYPE_LENGTH (objtype);
}
@ -900,7 +900,7 @@ evaluate_subexp_java (struct type *expect_type, struct expression *exp,
if (noside == EVAL_AVOID_SIDE_EFFECTS)
return value_zero (el_type, VALUE_LVAL (arg1));
address = value_as_address (arg1);
address += JAVA_OBJECT_SIZE;
address += get_java_object_header_size (exp->gdbarch);
read_memory (address, buf4, 4);
length = (long) extract_signed_integer (buf4, 4);
index = (long) value_as_long (arg2);