Eliminate make_cleanup_ui_file_delete / make ui_file a class hierarchy
[deliverable/binutils-gdb.git] / gdb / printcmd.c
index 23de57cb2137b3ea87d0da603259b6be4e68064a..dab4f53b373662de170f8c52ae105673491ada3b 100644 (file)
@@ -1,6 +1,6 @@
 /* Print values for GNU debugger GDB.
 
-   Copyright (C) 1986-2016 Free Software Foundation, Inc.
+   Copyright (C) 1986-2017 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -45,6 +45,7 @@
 #include "charset.h"
 #include "arch-utils.h"
 #include "cli/cli-utils.h"
+#include "cli/cli-script.h"
 #include "format.h"
 #include "source.h"
 
@@ -322,7 +323,6 @@ print_formatted (struct value *val, int size,
     /* User specified format, so don't look to the type to tell us
        what to do.  */
     val_print_scalar_formatted (type,
-                               value_contents_for_printing (val),
                                value_embedded_offset (val),
                                val,
                                options, size, stream);
@@ -1780,7 +1780,7 @@ display_command (char *arg, int from_tty)
   newobj = new display ();
 
   newobj->exp_string = xstrdup (exp);
-  newobj->exp = gdb::move (expr);
+  newobj->exp = std::move (expr);
   newobj->block = innermost_block;
   newobj->pspace = current_program_space;
   newobj->number = ++display_number;
@@ -2717,16 +2717,13 @@ printf_command (char *arg, int from_tty)
 static void
 eval_command (char *arg, int from_tty)
 {
-  struct ui_file *ui_out = mem_fileopen ();
-  struct cleanup *cleanups = make_cleanup_ui_file_delete (ui_out);
+  string_file stb;
 
-  ui_printf (arg, ui_out);
+  ui_printf (arg, &stb);
 
-  std::string expanded = ui_file_as_string (ui_out);
+  std::string expanded = insert_user_defined_cmd_args (stb.c_str ());
 
   execute_command (&expanded[0], from_tty);
-
-  do_cleanups (cleanups);
 }
 
 void
This page took 0.027748 seconds and 4 git commands to generate.