ada_val_print_1: Add language parameter
authorJoel Brobecker <brobecker@adacore.com>
Thu, 19 Dec 2013 10:33:20 +0000 (14:33 +0400)
committerJoel Brobecker <brobecker@adacore.com>
Tue, 7 Jan 2014 04:17:38 +0000 (08:17 +0400)
This is to help calling val_print.  We would like to be more systematic
in calling val_print when printing, because it allows us to make sure
we take advantage of the standard features such as pretty-printing
which are handled by val_print.

gdb/ChangeLog:

        * ada-valprint.c (ada_val_print_1): Add parameter "language".
        Update calls to self accordingly.  Replace calls to c_val_print
        by calls to val_print.

gdb/ChangeLog
gdb/ada-valprint.c

index 64d1e6b949d2b715b877876322280bd0c36fb550..2866cae229db0d81da7763b327f7f33687f81bdb 100644 (file)
@@ -1,3 +1,9 @@
+2014-01-07  Joel Brobecker  <brobecker@adacore.com>
+
+       * ada-valprint.c (ada_val_print_1): Add parameter "language".
+       Update calls to self accordingly.  Replace calls to c_val_print
+       by calls to val_print.
+
 2014-01-07  Joel Brobecker  <brobecker@adacore.com>
 
        * ada-valprint.c (print_record): Delete declaration.
index 5162737a0593e99222c95e0aaa04db67dfd38c6d..66cda39d76e881506fed71e64adf1d87eea93611 100644 (file)
@@ -780,7 +780,8 @@ ada_val_print_1 (struct type *type, const gdb_byte *valaddr,
                 int offset, CORE_ADDR address,
                 struct ui_file *stream, int recurse,
                 const struct value *original_value,
-                const struct value_print_options *options)
+                const struct value_print_options *options,
+                const struct language_defn *language)
 {
   int i;
   struct type *elttype;
@@ -814,7 +815,7 @@ ada_val_print_1 (struct type *type, const gdb_byte *valaddr,
                         value_contents_for_printing (val),
                         value_embedded_offset (val),
                         value_address (val), stream, recurse,
-                        val, options);
+                        val, options, language);
       value_free_to_mark (mark);
       return;
     }
@@ -825,14 +826,14 @@ ada_val_print_1 (struct type *type, const gdb_byte *valaddr,
   switch (TYPE_CODE (type))
     {
     default:
-      c_val_print (type, valaddr, offset, address, stream,
-                  recurse, original_value, options);
+      val_print (type, valaddr, offset, address, stream, recurse,
+                original_value, options, language_def (language_c));
       break;
 
     case TYPE_CODE_PTR:
       {
-       c_val_print (type, valaddr, offset, address,
-                    stream, recurse, original_value, options);
+       val_print (type, valaddr, offset, address, stream, recurse,
+                  original_value, options, language_def (language_c));
 
        if (ada_is_tag_type (type))
          {
@@ -875,13 +876,14 @@ ada_val_print_1 (struct type *type, const gdb_byte *valaddr,
              ada_val_print_1 (target_type,
                               value_contents_for_printing (v),
                               value_embedded_offset (v), 0,
-                              stream, recurse + 1, v, options);
+                              stream, recurse + 1, v, options,
+                              language);
            }
          else
            ada_val_print_1 (TYPE_TARGET_TYPE (type),
                             valaddr, offset,
                             address, stream, recurse,
-                            original_value, options);
+                            original_value, options, language);
          return;
        }
       else
@@ -970,8 +972,8 @@ ada_val_print_1 (struct type *type, const gdb_byte *valaddr,
     case TYPE_CODE_FLT:
       if (options->format)
        {
-         c_val_print (type, valaddr, offset, address, stream,
-                      recurse, original_value, options);
+         val_print (type, valaddr, offset, address, stream, recurse,
+                    original_value, options, language_def (language_c));
          return;
        }
       else
@@ -1066,7 +1068,8 @@ ada_val_print (struct type *type, const gdb_byte *valaddr,
   TRY_CATCH (except, RETURN_MASK_ALL)
     {
       ada_val_print_1 (type, valaddr, embedded_offset, address,
-                      stream, recurse, val, options);
+                      stream, recurse, val, options,
+                      current_language);
     }
 }