+void
+record_preopen (void)
+{
+ /* Check if a record target is already running. */
+ if (find_record_target () != NULL)
+ error (_("The process is already being recorded. Use \"record stop\" to "
+ "stop recording first."));
+}
+
+/* See record.h. */
+
+void
+record_start (const char *method, const char *format, int from_tty)
+{
+ if (method == NULL)
+ {
+ if (format == NULL)
+ execute_command_to_string ("record", from_tty, false);
+ else
+ error (_("Invalid format."));
+ }
+ else if (strcmp (method, "full") == 0)
+ {
+ if (format == NULL)
+ execute_command_to_string ("record full", from_tty, false);
+ else
+ error (_("Invalid format."));
+ }
+ else if (strcmp (method, "btrace") == 0)
+ {
+ if (format == NULL)
+ execute_command_to_string ("record btrace", from_tty, false);
+ else if (strcmp (format, "bts") == 0)
+ execute_command_to_string ("record btrace bts", from_tty, false);
+ else if (strcmp (format, "pt") == 0)
+ execute_command_to_string ("record btrace pt", from_tty, false);
+ else
+ error (_("Invalid format."));
+ }
+ else
+ error (_("Invalid method."));
+}
+
+/* See record.h. */
+
+void
+record_stop (int from_tty)
+{
+ execute_command_to_string ("record stop", from_tty, false);
+}
+
+/* See record.h. */
+