aboutsummaryrefslogtreecommitdiff
path: root/gdb/jv-valprint.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2012-03-05 19:38:17 +0000
committerTom Tromey <tromey@redhat.com>2012-03-05 19:38:17 +0000
commitb7b189f3cf682e67fb3ccd5908ec4b980735a620 (patch)
tree712adb9354716042f4a02a0cbe2758fac55b4ce5 /gdb/jv-valprint.c
parent5538f557d1ddde89da010f511826d62a9f4c53ed (diff)
downloadgdb-b7b189f3cf682e67fb3ccd5908ec4b980735a620.zip
gdb-b7b189f3cf682e67fb3ccd5908ec4b980735a620.tar.gz
gdb-b7b189f3cf682e67fb3ccd5908ec4b980735a620.tar.bz2
* 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 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)
{