Remove deprecated_throw_reason.
[deliverable/binutils-gdb.git] / gdb / jv-valprint.c
index 648dbc7a3b52a4ce5fa17287c47c90f082a671a3..3b90e54fec3e3fcf18fa518ec1bd50a416fe803f 100644 (file)
@@ -1,6 +1,6 @@
 /* Support for printing Java values for GDB, the GNU debugger.
 
-   Copyright (C) 1997-2005, 2007-2012 Free Software Foundation, Inc.
+   Copyright (C) 1997-2013 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -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);
@@ -294,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);
@@ -336,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);
@@ -347,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);
@@ -356,36 +361,17 @@ java_print_value_fields (struct type *type, const gdb_byte *valaddr,
            {
              wrap_here (n_spaces (2 + 2 * recurse));
            }
-         if (options->inspect_it)
-           {
-             if (TYPE_CODE (TYPE_FIELD_TYPE (type, i)) == TYPE_CODE_PTR)
-               fputs_filtered ("\"( ptr \"", stream);
-             else
-               fputs_filtered ("\"( nodef \"", stream);
-             if (field_is_static (&TYPE_FIELD (type, i)))
-               fputs_filtered ("static ", stream);
-             fprintf_symbol_filtered (stream, TYPE_FIELD_NAME (type, i),
-                                      language_cplus,
-                                      DMGL_PARAMS | DMGL_ANSI);
-             fputs_filtered ("\" \"", stream);
-             fprintf_symbol_filtered (stream, TYPE_FIELD_NAME (type, i),
-                                      language_cplus,
-                                      DMGL_PARAMS | DMGL_ANSI);
-             fputs_filtered ("\") \"", stream);
-           }
-         else
-           {
-             annotate_field_begin (TYPE_FIELD_TYPE (type, i));
-
-             if (field_is_static (&TYPE_FIELD (type, i)))
-               fputs_filtered ("static ", stream);
-             fprintf_symbol_filtered (stream, TYPE_FIELD_NAME (type, i),
-                                      language_cplus,
-                                      DMGL_PARAMS | DMGL_ANSI);
-             annotate_field_name_end ();
-             fputs_filtered (": ", stream);
-             annotate_field_value ();
-           }
+
+         annotate_field_begin (TYPE_FIELD_TYPE (type, i));
+
+         if (field_is_static (&TYPE_FIELD (type, i)))
+           fputs_filtered ("static ", stream);
+         fprintf_symbol_filtered (stream, TYPE_FIELD_NAME (type, i),
+                                  language_cplus,
+                                  DMGL_PARAMS | DMGL_ANSI);
+         annotate_field_name_end ();
+         fputs_filtered (": ", stream);
+         annotate_field_value ();
 
          if (!field_is_static (&TYPE_FIELD (type, i))
              && TYPE_FIELD_PACKED (type, i))
@@ -465,7 +451,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);
@@ -485,7 +471,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;
 
@@ -510,7 +495,7 @@ java_val_print (struct type *type, const gdb_byte *valaddr,
       if (TYPE_CODE (target_type) == TYPE_CODE_FUNC)
        {
          /* Try to print what function it points to.  */
-         print_address_demangle (gdbarch, addr, stream, demangle);
+         print_address_demangle (options, gdbarch, addr, stream, demangle);
          return;
        }
 
This page took 0.028994 seconds and 4 git commands to generate.