aboutsummaryrefslogtreecommitdiff
path: root/gdb/jv-lang.c
diff options
context:
space:
mode:
authorUlrich Weigand <uweigand@de.ibm.com>2009-06-23 18:11:09 +0000
committerUlrich Weigand <uweigand@de.ibm.com>2009-06-23 18:11:09 +0000
commit45d5d5ca5d94e8690843688cef1e320aca18d39e (patch)
tree1cfda95418830bf959397df27ae72632771f0d8c /gdb/jv-lang.c
parent3d857b98f555ee56c6fa6ed90c024424215574ed (diff)
downloadgdb-45d5d5ca5d94e8690843688cef1e320aca18d39e.zip
gdb-45d5d5ca5d94e8690843688cef1e320aca18d39e.tar.gz
gdb-45d5d5ca5d94e8690843688cef1e320aca18d39e.tar.bz2
* 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.
Diffstat (limited to 'gdb/jv-lang.c')
-rw-r--r--gdb/jv-lang.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/gdb/jv-lang.c b/gdb/jv-lang.c
index 4b3f803..0003e0d 100644
--- a/gdb/jv-lang.c
+++ b/gdb/jv-lang.c
@@ -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);