aboutsummaryrefslogtreecommitdiff
path: root/gdb/jv-valprint.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/jv-valprint.c')
-rw-r--r--gdb/jv-valprint.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gdb/jv-valprint.c b/gdb/jv-valprint.c
index 648dbc7..12a960f 100644
--- a/gdb/jv-valprint.c
+++ b/gdb/jv-valprint.c
@@ -51,10 +51,13 @@ java_value_print (struct value *val, struct ui_file *stream,
if (is_object_type (type))
{
CORE_ADDR obj_addr;
+ struct value *tem = val;
/* Get the run-time type, and cast the object into that. */
+ while (TYPE_CODE (value_type (tem)) == TYPE_CODE_PTR)
+ tem = value_ind (tem);
- obj_addr = unpack_pointer (type, value_contents (val));
+ obj_addr = value_address (tem);
if (obj_addr != 0)
{