2011-09-02 Pedro Alves <pedro@codesourcery.com>
[deliverable/binutils-gdb.git] / gdb / m2-valprint.c
index 0cf96026328b0cbcd4f3cd9ed5d94c025a35a13b..ed997b16b60d701d52610242a7b81e1fa8dd8902 100644 (file)
@@ -201,9 +201,10 @@ m2_print_unbounded_array (struct type *type, const gdb_byte *valaddr,
   len = unpack_field_as_long (type, valaddr + embedded_offset, 1);
 
   fprintf_filtered (stream, "{");  
-  m2_print_array_contents (value_type (val), value_contents(val),
+  m2_print_array_contents (value_type (val),
+                          value_contents_for_printing (val),
                           value_embedded_offset (val), addr, stream,
-                          recurse, NULL, options, len);
+                          recurse, val, options, len);
   fprintf_filtered (stream, ", HIGH = %d}", (int) len);
 }
 
@@ -309,12 +310,9 @@ m2_print_array_contents (struct type *type, const gdb_byte *valaddr,
 }
 
 
-/* Print data of type TYPE located at VALADDR (within GDB), which came from
-   the inferior at address ADDRESS, onto stdio stream STREAM according to
-   OPTIONS.  The data at VALADDR is in target byte order.
-
-   If the data are a string pointer, returns the number of string characters
-   printed.  */
+/* 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.  */
 
 int
 m2_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
@@ -387,8 +385,8 @@ m2_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
        print_variable_at_address (type, valaddr + embedded_offset,
                                   stream, recurse, options);
       else if (options->format && options->format != 's')
-       print_scalar_formatted (valaddr + embedded_offset, type,
-                               options, 0, stream);
+       val_print_scalar_formatted (type, valaddr, embedded_offset,
+                                   original_value, options, 0, stream);
       else
        {
          addr = unpack_pointer (type, valaddr + embedded_offset);
@@ -449,8 +447,8 @@ m2_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
     case TYPE_CODE_ENUM:
       if (options->format)
        {
-         print_scalar_formatted (valaddr + embedded_offset, type,
-                                 options, 0, stream);
+         val_print_scalar_formatted (type, valaddr, embedded_offset,
+                                     original_value, options, 0, stream);
          break;
        }
       len = TYPE_NFIELDS (type);
@@ -476,8 +474,8 @@ m2_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
     case TYPE_CODE_FUNC:
       if (options->format)
        {
-         print_scalar_formatted (valaddr + embedded_offset, type,
-                                 options, 0, stream);
+         val_print_scalar_formatted (type, valaddr, embedded_offset,
+                                     original_value, options, 0, stream);
          break;
        }
       /* FIXME, we should consider, at least for ANSI C language, eliminating
@@ -496,8 +494,8 @@ m2_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
 
          opts.format = (options->format ? options->format
                         : options->output_format);
-         print_scalar_formatted (valaddr + embedded_offset, type,
-                                 &opts, 0, stream);
+         val_print_scalar_formatted (type, valaddr, embedded_offset,
+                                     original_value, &opts, 0, stream);
        }
       else
        {
@@ -534,8 +532,8 @@ m2_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
 
          opts.format = (options->format ? options->format
                         : options->output_format);
-         print_scalar_formatted (valaddr + embedded_offset, type,
-                                 &opts, 0, stream);
+         val_print_scalar_formatted (type, valaddr, embedded_offset,
+                                     original_value, &opts, 0, stream);
        }
       else
        val_print_type_code_int (type, valaddr + embedded_offset, stream);
@@ -548,8 +546,8 @@ m2_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
 
          opts.format = (options->format ? options->format
                         : options->output_format);
-         print_scalar_formatted (valaddr + embedded_offset, type,
-                                 &opts, 0, stream);
+         val_print_scalar_formatted (type, valaddr, embedded_offset,
+                                     original_value, &opts, 0, stream);
        }
       else
        {
@@ -565,8 +563,8 @@ m2_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
 
     case TYPE_CODE_FLT:
       if (options->format)
-       print_scalar_formatted (valaddr + embedded_offset, type,
-                               options, 0, stream);
+       val_print_scalar_formatted (type, valaddr, embedded_offset,
+                                   original_value, options, 0, stream);
       else
        print_floating (valaddr + embedded_offset, type, stream);
       break;
This page took 0.030033 seconds and 4 git commands to generate.