Move command lines types/declarations to cli-script.h
[deliverable/binutils-gdb.git] / gdb / ada-valprint.c
index 0a9e3257f0af318ec735f68e7249ef1f80f31ecf..8095eede72192c1d29795e7d4cdd2fe7be3b1ce4 100644 (file)
@@ -298,12 +298,11 @@ static void
 ada_print_floating (const gdb_byte *valaddr, struct type *type,
                    struct ui_file *stream)
 {
-  struct ui_file *tmp_stream = mem_fileopen ();
-  struct cleanup *cleanups = make_cleanup_ui_file_delete (tmp_stream);
+  string_file tmp_stream;
 
-  print_floating (valaddr, type, tmp_stream);
+  print_floating (valaddr, type, &tmp_stream);
 
-  std::string s = ui_file_as_string (tmp_stream);
+  std::string &s = tmp_stream.string ();
   size_t skip_count = 0;
 
   /* Modify for Ada rules.  */
@@ -342,8 +341,6 @@ ada_print_floating (const gdb_byte *valaddr, struct type *type,
     }
   else
     fprintf_filtered (stream, "%s", &s[skip_count]);
-
-  do_cleanups (cleanups);
 }
 
 void
@@ -862,7 +859,8 @@ ada_val_print_num (struct type *type, const gdb_byte *valaddr,
        }
       else
        {
-         val_print_type_code_int (type, valaddr + offset_aligned, stream);
+         val_print_scalar_formatted (type, offset_aligned,
+                                     original_value, options, 0, stream);
          if (ada_is_character_type (type))
            {
              LONGEST c;
@@ -1061,6 +1059,9 @@ ada_val_print_ref (struct type *type, const gdb_byte *valaddr,
      (Eg: an array whose bounds are not set yet).  */
   ada_ensure_varsize_limit (value_type (deref_val));
 
+  if (value_lazy (deref_val))
+    value_fetch_lazy (deref_val);
+
   val_print (value_type (deref_val),
             value_embedded_offset (deref_val),
             value_address (deref_val), stream, recurse + 1,
This page took 0.025488 seconds and 4 git commands to generate.