23#include "gdbsupport/buildargv.h"
24#include "gdbsupport/filestuff.h"
25#include "gdbsupport/gdb_file.h"
26#include "gdbsupport/scoped_fd.h"
44ui::ui (FILE *instream_, FILE *outstream_, FILE *errstream_)
73 struct ui *
ui, *uiprev;
81 gdb_assert (
ui != NULL);
117 struct ui *
ui = (
struct ui *) client_data;
168 string_printf (
"ui-%d",
num),
true);
186 scoped_fd fd = gdb_open_cloexec (
name, O_RDWR |
O_NOCTTY, 0);
188 perror_with_name (_(
"opening terminal failed"));
190 return fd.to_file (
"w+");
199 const char *interpreter_name;
200 const char *tty_name;
204 gdb_argv argv (args);
205 argc = argv.count ();
208 error (_(
"Usage: new-ui INTERPRETER TTY"));
210 interpreter_name = argv[0];
214 scoped_restore save_ui = make_scoped_restore (&
current_ui);
221 std::unique_ptr<ui>
ui
222 (
new struct ui (stream.get (), stream.get (), stream.get ()));
247Usage: new-ui INTERPRETER TTY\n\
248The first argument is the name of the interpreter to run.\n\
249The second argument is the terminal the UI runs on."), &
cmdlist);
virtual void pre_command_loop()
struct cmd_list_element * cmdlist
void quit_command(const char *args, int from_tty)
struct cmd_list_element * add_cmd(const char *name, enum command_class theclass, const char *doc, struct cmd_list_element **list)
void set_cmd_completer(struct cmd_list_element *cmd, completer_ftype *completer)
int call_stdin_event_handler_again_p
struct interp * top_level_interpreter(void)
void set_top_level_interpreter(const char *name)
void interpreter_completer(struct cmd_list_element *ignore, completion_tracker &tracker, const char *text, const char *word)
struct ui_file * m_gdb_stdin
struct ui_file * m_gdb_stdlog
struct ui_file * m_gdb_stdout
struct ui_file * m_gdb_stderr
bool input_interactive_p() const
ui(FILE *instream, FILE *outstream, FILE *errstream)
bool m_input_interactive_p
void unregister_file_handler()
void(* call_readline)(gdb_client_data)
void register_file_handler()
void unbuffer_stream(FILE *stream)
auto_boolean interactive_mode
static gdb_file_up open_terminal_stream(const char *name)
static void stdin_event_handler(int error, gdb_client_data client_data)
static void new_ui_command(const char *args, int from_tty)
static int highest_ui_num
void gdb_printf(struct ui_file *stream, const char *format,...)