* gdb.guile/guile.exp (guile not supported): Verify multi-line
[deliverable/binutils-gdb.git] / gdb / jv-valprint.c
index 619aa3f1f8580728fa575aada61071ba364a8044..82bdd9bf32b8a6da5c0087dc8a6b9ac299c50260 100644 (file)
@@ -1,6 +1,6 @@
 /* Support for printing Java values for GDB, the GNU debugger.
 
-   Copyright (C) 1997-2013 Free Software Foundation, Inc.
+   Copyright (C) 1997-2014 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -29,7 +29,7 @@
 #include "jv-lang.h"
 #include "c-lang.h"
 #include "annotate.h"
-#include "gdb_string.h"
+#include <string.h>
 
 /* Local functions */
 
@@ -299,7 +299,7 @@ java_print_value_fields (struct type *type, const gdb_byte *valaddr,
 
          boffset = 0;
 
-         if (options->pretty)
+         if (options->prettyformat)
            {
              fprintf_filtered (stream, "\n");
              print_spaces_filtered (2 * (recurse + 1), stream);
@@ -341,7 +341,7 @@ java_print_value_fields (struct type *type, const gdb_byte *valaddr,
            fprintf_filtered (stream, ", ");
          else if (n_baseclasses > 0)
            {
-             if (options->pretty)
+             if (options->prettyformat)
                {
                  fprintf_filtered (stream, "\n");
                  print_spaces_filtered (2 + 2 * recurse, stream);
@@ -352,7 +352,7 @@ java_print_value_fields (struct type *type, const gdb_byte *valaddr,
            }
          fields_seen = 1;
 
-         if (options->pretty)
+         if (options->prettyformat)
            {
              fprintf_filtered (stream, "\n");
              print_spaces_filtered (2 + 2 * recurse, stream);
@@ -395,7 +395,7 @@ java_print_value_fields (struct type *type, const gdb_byte *valaddr,
              else if (!value_bits_valid (val, TYPE_FIELD_BITPOS (type, i),
                                          TYPE_FIELD_BITSIZE (type, i)))
                {
-                 val_print_optimized_out (stream);
+                 val_print_optimized_out (val, stream);
                }
              else
                {
@@ -417,22 +417,16 @@ java_print_value_fields (struct type *type, const gdb_byte *valaddr,
                }
              else if (field_is_static (&TYPE_FIELD (type, i)))
                {
+                 struct value_print_options opts;
                  struct value *v = value_static_field (type, i);
+                 struct type *t = check_typedef (value_type (v));
 
-                 if (v == NULL)
-                   val_print_optimized_out (stream);
-                 else
-                   {
-                     struct value_print_options opts;
-                     struct type *t = check_typedef (value_type (v));
-
-                     if (TYPE_CODE (t) == TYPE_CODE_STRUCT)
-                       v = value_addr (v);
-                     opts = *options;
-                     opts.deref_ref = 0;
-                     common_val_print (v, stream, recurse + 1,
-                                       &opts, current_language);
-                   }
+                 if (TYPE_CODE (t) == TYPE_CODE_STRUCT)
+                   v = value_addr (v);
+                 opts = *options;
+                 opts.deref_ref = 0;
+                 common_val_print (v, stream, recurse + 1,
+                                   &opts, current_language);
                }
              else if (TYPE_FIELD_TYPE (type, i) == NULL)
                fputs_filtered ("<unknown type>", stream);
@@ -451,7 +445,7 @@ java_print_value_fields (struct type *type, const gdb_byte *valaddr,
          annotate_field_end ();
        }
 
-      if (options->pretty)
+      if (options->prettyformat)
        {
          fprintf_filtered (stream, "\n");
          print_spaces_filtered (2 * recurse, stream);
@@ -471,7 +465,6 @@ java_val_print (struct type *type, const gdb_byte *valaddr,
                const struct value_print_options *options)
 {
   struct gdbarch *gdbarch = get_type_arch (type);
-  unsigned int i = 0;  /* Number of characters printed.  */
   struct type *target_type;
   CORE_ADDR addr;
 
This page took 0.026464 seconds and 4 git commands to generate.