diff options
author | Tom Tromey <tromey@redhat.com> | 2012-03-05 19:38:17 +0000 |
---|---|---|
committer | Tom Tromey <tromey@redhat.com> | 2012-03-05 19:38:17 +0000 |
commit | b7b189f3cf682e67fb3ccd5908ec4b980735a620 (patch) | |
tree | 712adb9354716042f4a02a0cbe2758fac55b4ce5 | |
parent | 5538f557d1ddde89da010f511826d62a9f4c53ed (diff) | |
download | gdb-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.
-rw-r--r-- | gdb/ChangeLog | 4 | ||||
-rw-r--r-- | gdb/jv-valprint.c | 5 | ||||
-rw-r--r-- | gdb/testsuite/ChangeLog | 4 | ||||
-rw-r--r-- | gdb/testsuite/gdb.java/jprint.java | 1 |
4 files changed, 13 insertions, 1 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index c2d0c59..2def55d 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,7 @@ +2012-03-05 Tom Tromey <tromey@redhat.com> + + * jv-valprint.c (java_value_print): Correctly compute 'obj_addr'. + 2012-03-05 Joel Brobecker <brobecker@adacore.com> From Andreas Arnez <arnez@linux.vnet.ibm.com>: 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) { diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index d941bb5..4123476 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2012-03-05 Tom Tromey <tromey@redhat.com> + + * gdb.java/jprint.java (jprint.main): Keep 'x' live. + 2012-03-04 Yao Qi <yao@codesourcery.com> * gdb.base/disp-step-syscall.exp (disp_step_cross_syscall): Catch error diff --git a/gdb/testsuite/gdb.java/jprint.java b/gdb/testsuite/gdb.java/jprint.java index 3d55dc3..0a5e7d3 100644 --- a/gdb/testsuite/gdb.java/jprint.java +++ b/gdb/testsuite/gdb.java/jprint.java @@ -61,6 +61,7 @@ public class jprint extends jvclass { jprint x = new jprint (); x.dothat (44); print (k, 33); + print (x.addk(0), 33); } } |