summaryrefslogtreecommitdiff
path: root/gdb/jv-valprint.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2012-03-05 19:38:12 +0000
committerTom Tromey <tromey@redhat.com>2012-03-05 19:38:12 +0000
commit40b614d91532b1d53da015ee7b4b34d77f5c893d (patch)
tree758cb6fcb94b5b2e4505e53637d3c1b6db65eca4 /gdb/jv-valprint.c
parentae1a4d58ddd00a2f7a8f6cd90c86b56258202f93 (diff)
downloadgdb-40b614d91532b1d53da015ee7b4b34d77f5c893d.tar.gz
* jv-valprint.c (java_value_print): Correctly compute 'obj_addr'.
gdb/testsuite * gdb.java/jprint.java (jprint.main): Keep 'x' live.
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 648dbc7a3b5..12a960f09d8 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)
{