gdb/
[deliverable/binutils-gdb.git] / gdb / jv-valprint.c
index 125e611388f95392866288c78ce9ff4adcc9e7ed..d1274dd81a375577ffe7ed84aa4f295dd797a505 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)
        {
@@ -228,6 +231,8 @@ java_value_print (struct value *val, struct ui_file *stream,
       unsigned long count;
       struct value *mark;
 
+      fputs_filtered (" ", stream);
+
       mark = value_mark ();    /* Remember start of new values.  */
 
       data_val = value_struct_elt (&val, NULL, "data", NULL, NULL);
@@ -475,10 +480,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,16 +508,15 @@ 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));
 
       if (TYPE_CODE (target_type) == TYPE_CODE_FUNC)
        {
          /* 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);
+         print_address_demangle (options, gdbarch, addr, stream, demangle);
+         return;
        }
 
       if (options->addressprint && options->format != 's')
@@ -522,7 +525,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 +556,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;
 }
This page took 0.025298 seconds and 4 git commands to generate.