* jv-valprint.c (java_value_print): Correctly compute 'obj_addr'.
gdb/testsuite * gdb.java/jprint.java (jprint.main): Keep 'x' live.
This commit is contained in:
parent
5538f557d1
commit
b7b189f3cf
4 changed files with 13 additions and 1 deletions
|
@ -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>
|
2012-03-05 Joel Brobecker <brobecker@adacore.com>
|
||||||
|
|
||||||
From Andreas Arnez <arnez@linux.vnet.ibm.com>:
|
From Andreas Arnez <arnez@linux.vnet.ibm.com>:
|
||||||
|
|
|
@ -51,10 +51,13 @@ java_value_print (struct value *val, struct ui_file *stream,
|
||||||
if (is_object_type (type))
|
if (is_object_type (type))
|
||||||
{
|
{
|
||||||
CORE_ADDR obj_addr;
|
CORE_ADDR obj_addr;
|
||||||
|
struct value *tem = val;
|
||||||
|
|
||||||
/* Get the run-time type, and cast the object into that. */
|
/* 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)
|
if (obj_addr != 0)
|
||||||
{
|
{
|
||||||
|
|
|
@ -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>
|
2012-03-04 Yao Qi <yao@codesourcery.com>
|
||||||
|
|
||||||
* gdb.base/disp-step-syscall.exp (disp_step_cross_syscall): Catch error
|
* gdb.base/disp-step-syscall.exp (disp_step_cross_syscall): Catch error
|
||||||
|
|
|
@ -61,6 +61,7 @@ public class jprint extends jvclass {
|
||||||
jprint x = new jprint ();
|
jprint x = new jprint ();
|
||||||
x.dothat (44);
|
x.dothat (44);
|
||||||
print (k, 33);
|
print (k, 33);
|
||||||
|
print (x.addk(0), 33);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue