* elf32-m68k.c (elf_m68k_relocate_section): Allow
[binutils-gdb.git] / gdb / jv-valprint.c
index 125e611388f95392866288c78ce9ff4adcc9e7ed..12a960f09d8e10d6f417a4ba1fd008448c25f856 100644 (file)
@@ -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)
        {
@@ -475,10 +478,9 @@ java_print_value_fields (struct type *type, const gdb_byte *valaddr,
 }
 
 /* See val_print for a description of the various parameters of this
-   function; they are identical.  The semantics of the return value is
-   also identical to val_print.  */
+   function; they are identical.  */
 
-int
+void
 java_val_print (struct type *type, const gdb_byte *valaddr,
                int embedded_offset, CORE_ADDR address,
                struct ui_file *stream, int recurse,
@@ -504,7 +506,7 @@ java_val_print (struct type *type, const gdb_byte *valaddr,
       if (addr == 0)
        {
          fputs_filtered ("null", stream);
-         return i;
+         return;
        }
       target_type = check_typedef (TYPE_TARGET_TYPE (type));
 
@@ -512,8 +514,7 @@ java_val_print (struct type *type, const gdb_byte *valaddr,
        {
          /* Try to print what function it points to.  */
          print_address_demangle (gdbarch, addr, stream, demangle);
-         /* Return value is irrelevant except for string pointers.  */
-         return (0);
+         return;
        }
 
       if (options->addressprint && options->format != 's')
@@ -522,7 +523,7 @@ java_val_print (struct type *type, const gdb_byte *valaddr,
          print_longest (stream, 'x', 0, (ULONGEST) addr);
        }
 
-      return i;
+      return;
 
     case TYPE_CODE_CHAR:
     case TYPE_CODE_INT:
@@ -553,9 +554,8 @@ java_val_print (struct type *type, const gdb_byte *valaddr,
       break;
 
     default:
-      return c_val_print (type, valaddr, embedded_offset, address, stream,
-                         recurse, val, options);
+      c_val_print (type, valaddr, embedded_offset, address, stream,
+                  recurse, val, options);
+      break;
     }
-
-  return 0;
 }