* elf-bfd.h (elf_string_from_elf_strtab): Delete macro.
[deliverable/binutils-gdb.git] / gdb / jv-valprint.c
index 1875eefb49586d24c58e5c726c9fe89a7299451a..95823438667c82593d88027586d38c20cd595442 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, 2005 Free
+   Software Foundation, Inc.
 
    This file is part of GDB.
 
 
 /* Local functions */
 
-static void java_print_value_fields (struct type * type, char *valaddr,
-                                    CORE_ADDR address,
-                                    struct ui_file *stream, int format,
-                                    int recurse,
-                                    enum val_prettyprint pretty);
-
-
 int
 java_value_print (struct value *val, struct ui_file *stream, int format,
                  enum val_prettyprint pretty)
@@ -50,8 +45,8 @@ java_value_print (struct value *val, struct ui_file *stream, int format,
   int i;
   char *name;
 
-  type = VALUE_TYPE (val);
-  address = VALUE_ADDRESS (val) + VALUE_OFFSET (val);
+  type = value_type (val);
+  address = VALUE_ADDRESS (val) + value_offset (val);
 
   if (is_object_type (type))
     {
@@ -66,7 +61,7 @@ java_value_print (struct value *val, struct ui_file *stream, int format,
          type = type_from_class (java_class_from_object (val));
          type = lookup_pointer_type (type);
 
-         val = value_at (type, address, NULL);
+         val = value_at (type, address);
        }
     }
 
@@ -168,15 +163,15 @@ java_value_print (struct value *val, struct ui_file *stream, int format,
              else
                {
                  VALUE_LAZY (v) = 1;
-                 VALUE_OFFSET (v) = 0;
+                 v->offset = 0;
                }
 
-             VALUE_OFFSET (next_v) = VALUE_OFFSET (v);
+             next_v->offset = value_offset (v);
 
              for (reps = 1; i + reps < length; reps++)
                {
                  VALUE_LAZY (next_v) = 1;
-                 VALUE_OFFSET (next_v) += TYPE_LENGTH (el_type);
+                 next_v->offset += TYPE_LENGTH (el_type);
                  if (memcmp (VALUE_CONTENTS (v), VALUE_CONTENTS (next_v),
                              TYPE_LENGTH (el_type)) != 0)
                    break;
@@ -187,7 +182,7 @@ java_value_print (struct value *val, struct ui_file *stream, int format,
              else
                fprintf_filtered (stream, "%d..%d: ", i, i + reps - 1);
 
-             val_print (VALUE_TYPE (v), VALUE_CONTENTS (v), 0, 0,
+             val_print (value_type (v), VALUE_CONTENTS (v), 0, 0,
                         stream, format, 2, 1, pretty);
 
              things_printed++;
@@ -251,9 +246,9 @@ java_value_print (struct value *val, struct ui_file *stream, int format,
    should not print, or zero if called from top level.  */
 
 static void
-java_print_value_fields (struct type *type, char *valaddr, CORE_ADDR address,
-                        struct ui_file *stream, int format, int recurse,
-                        enum val_prettyprint pretty)
+java_print_value_fields (struct type *type, const bfd_byte *valaddr,
+                        CORE_ADDR address, struct ui_file *stream,
+                        int format, int recurse, enum val_prettyprint pretty)
 {
   int i, len, n_baseclasses;
 
@@ -272,7 +267,7 @@ java_print_value_fields (struct type *type, char *valaddr, CORE_ADDR address,
          int boffset;
          struct type *baseclass = check_typedef (TYPE_BASECLASS (type, i));
          char *basename = TYPE_NAME (baseclass);
-         char *base_valaddr;
+         const bfd_byte *base_valaddr;
 
          if (BASETYPE_VIA_VIRTUAL (type, i))
            continue;
@@ -298,9 +293,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:
-         ;
        }
 
     }
@@ -409,10 +401,10 @@ java_print_value_fields (struct type *type, char *valaddr, CORE_ADDR address,
                    fputs_filtered ("<optimized out>", stream);
                  else
                    {
-                     struct type *t = check_typedef (VALUE_TYPE (v));
+                     struct type *t = check_typedef (value_type (v));
                      if (TYPE_CODE (t) == TYPE_CODE_STRUCT)
                        v = value_addr (v);
-                     val_print (VALUE_TYPE (v),
+                     val_print (value_type (v),
                                 VALUE_CONTENTS (v), 0, VALUE_ADDRESS (v),
                                 stream, format, 0, recurse + 1, pretty);
                    }
@@ -453,9 +445,10 @@ java_print_value_fields (struct type *type, char *valaddr, CORE_ADDR address,
    The PRETTY parameter controls prettyprinting.  */
 
 int
-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)
+java_val_print (struct type *type, const bfd_byte *valaddr,
+               int embedded_offset, CORE_ADDR address,
+               struct ui_file *stream, int format, int deref_ref,
+               int recurse, enum val_prettyprint pretty)
 {
   unsigned int i = 0;  /* Number of characters printed */
   struct type *target_type;
This page took 0.025196 seconds and 4 git commands to generate.