+/* Callback for compile_print_command. */
+
+void
+compile_print_value (struct value *val, void *data_voidp)
+{
+ const struct format_data *fmtp = (const struct format_data *) data_voidp;
+
+ print_value (val, fmtp);
+}
+
+/* Handle the input from the 'compile print' command. The "compile
+ print" command is used to evaluate and print an expression that may
+ contain calls to the GCC compiler. The language expected in this
+ compile command is the language currently set in GDB. */
+
+static void
+compile_print_command (char *arg_param, int from_tty)
+{
+ const char *arg = arg_param;
+ enum compile_i_scope_types scope = COMPILE_I_PRINT_ADDRESS_SCOPE;
+ struct format_data fmt;
+
+ scoped_restore save_async = make_scoped_restore (¤t_ui->async, 0);
+
+ /* Passing &FMT as SCOPE_DATA is safe as do_module_cleanup will not
+ touch the stale pointer if compile_object_run has already quit. */
+ print_command_parse_format (&arg, "compile print", &fmt);
+
+ if (arg && *arg)
+ eval_compile_command (NULL, arg, scope, &fmt);
+ else
+ {
+ command_line_up l = get_command_line (compile_control, "");
+
+ l->control_u.compile.scope = scope;
+ l->control_u.compile.scope_data = &fmt;
+ execute_control_command_untraced (l.get ());
+ }