Use gdbpy_enter in python.c
[deliverable/binutils-gdb.git] / gdb / printcmd.c
index b70ed19f98b021cd56480ca864b8d62f5b0d7071..e4711e9fb8852d48158df0c1e8c85023ba4808f5 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;
@@ -2719,14 +2719,14 @@ eval_command (char *arg, int from_tty)
 {
   struct ui_file *ui_out = mem_fileopen ();
   struct cleanup *cleanups = make_cleanup_ui_file_delete (ui_out);
-  char *expanded;
 
   ui_printf (arg, ui_out);
 
-  expanded = ui_file_xstrdup (ui_out, NULL);
-  make_cleanup (xfree, expanded);
+  std::string expanded = ui_file_as_string (ui_out);
 
-  execute_command (expanded, from_tty);
+  expanded = insert_user_defined_cmd_args (expanded.c_str ());
+
+  execute_command (&expanded[0], from_tty);
 
   do_cleanups (cleanups);
 }
This page took 0.024534 seconds and 4 git commands to generate.