2004-02-15 Andrew Cagney <cagney@redhat.com>
[deliverable/binutils-gdb.git] / gdb / jv-valprint.c
index f25cd09905fadc96ddfc6e47f720f64e063c2b7f..8715257614185f227f6fb214474ab27a3716d335 100644 (file)
@@ -1,5 +1,7 @@
 /* Support for printing Java values for GDB, the GNU debugger.
-   Copyright 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
+
+   Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free
+   Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -110,14 +112,22 @@ java_value_print (struct value *val, struct ui_file *stream, int format,
                {
                  read_memory (address, buf, sizeof (buf));
                  address += TARGET_PTR_BIT / HOST_CHAR_BIT;
-                 element = extract_address (buf, sizeof (buf));
+                 /* FIXME: cagney/2003-05-24: Bogus or what.  It
+                     pulls a host sized pointer out of the target and
+                     then extracts that as an address (while assuming
+                     that the address is unsigned)!  */
+                 element = extract_unsigned_integer (buf, sizeof (buf));
                }
 
              for (reps = 1; i + reps < length; reps++)
                {
                  read_memory (address, buf, sizeof (buf));
                  address += TARGET_PTR_BIT / HOST_CHAR_BIT;
-                 next_element = extract_address (buf, sizeof (buf));
+                 /* FIXME: cagney/2003-05-24: Bogus or what.  It
+                     pulls a host sized pointer out of the target and
+                     then extracts that as an address (while assuming
+                     that the address is unsigned)!  */
+                 next_element = extract_unsigned_integer (buf, sizeof (buf));
                  if (next_element != element)
                    break;
                }
@@ -290,9 +300,6 @@ java_print_value_fields (struct type *type, char *valaddr, CORE_ADDR address,
          java_print_value_fields (baseclass, base_valaddr, address + boffset,
                                   stream, format, recurse + 1, pretty);
          fputs_filtered (", ", stream);
-
-       flush_it:
-         ;
        }
 
     }
@@ -301,7 +308,6 @@ java_print_value_fields (struct type *type, char *valaddr, CORE_ADDR address,
     fprintf_filtered (stream, "<No data fields>");
   else
     {
-      extern int inspect_it;
       int fields_seen = 0;
 
       for (i = n_baseclasses; i < len; i++)
@@ -450,7 +456,7 @@ java_val_print (struct type *type, char *valaddr, int embedded_offset,
                CORE_ADDR address, struct ui_file *stream, int format,
                int deref_ref, int recurse, enum val_prettyprint pretty)
 {
-  register unsigned int i = 0; /* Number of characters printed */
+  unsigned int i = 0;  /* Number of characters printed */
   struct type *target_type;
   CORE_ADDR addr;
 
@@ -469,7 +475,8 @@ java_val_print (struct type *type, char *valaddr, int embedded_offset,
          /* Print the unmangled name if desired.  */
          /* Print vtable entry - we only get here if we ARE using
             -fvtable_thunks.  (Otherwise, look under TYPE_CODE_STRUCT.) */
-         print_address_demangle (extract_address (valaddr, TYPE_LENGTH (type)),
+         /* Extract an address, assume that it is unsigned.  */
+         print_address_demangle (extract_unsigned_integer (valaddr, TYPE_LENGTH (type)),
                                  stream, demangle);
          break;
        }
This page took 0.039212 seconds and 4 git commands to generate.