45 #include "readline/readline.h" 46 #include "readline/history.h" 55 static void handle_sigquit (
int sig);
58 static void handle_sighup (
int sig);
64 #if defined (SIGQUIT) || defined (SIGHUP) 175 rl_callback_read_char ();
177 (*after_char_processing_hook) ();
228 if (gdb_rl_expt.
reason < 0)
298 rl_callback_handler_remove ();
401 actual_gdb_prompt = new_prompt;
438 const char prefix[] =
"\n\032\032pre-prompt\n";
442 const char suffix[] =
"\n\032\032prompt\n";
473 struct ui *
ui = (
struct ui *) client_data;
579 for (c = command; *c ==
' ' || *c ==
'\t'; c++)
604 if (len > 0 && rl[len - 1] ==
'\\')
615 cmd = cmd_line_buffer->
buffer;
646 char *rl,
int repeat,
const char *annotation_suffix)
671 #define SERVER_COMMAND_PREFIX "server " 687 expanded = history_expand (cmd, &history_value);
698 xfree (history_value);
704 len = strlen (history_value);
706 cmd_line_buffer->
buffer = history_value;
714 for (p1 = cmd; *p1 ==
' ' || *p1 ==
'\t'; p1++)
716 if (repeat && *p1 ==
'\0')
756 if (cmd == (
char *) EOF)
765 else if (cmd == NULL)
790 struct buffer line_buffer;
791 static int done_once = 0;
888 signal (SIGTRAP, SIG_DFL);
900 signal (SIGQUIT, handle_sigquit);
905 if (signal (SIGHUP, handle_sighup) != SIG_IGN)
986 fd_set *readfds, fd_set *writefds, fd_set *exceptfds,
987 struct timeval *timeout)
995 readfds = &my_readfds;
996 FD_ZERO (&my_readfds);
1000 FD_SET (fd, readfds);
1006 res =
gdb_select (n, readfds, writefds, exceptfds, timeout);
1008 while (res == -1 && errno == EINTR);
1010 if (res == 1 && FD_ISSET (fd, readfds))
1057 handle_sigquit (
int sig)
1060 signal (sig, handle_sigquit);
1064 #if defined (SIGQUIT) || defined (SIGHUP) 1078 handle_sighup (
int sig)
1081 signal (sig, handle_sighup);
1111 signal (SIGHUP, SIG_DFL);
1118 handle_sigtstp (
int sig)
1121 signal (sig, handle_sigtstp);
1129 signal (SIGTSTP, SIG_DFL);
1130 #if HAVE_SIGPROCMASK 1134 sigemptyset (&zero);
1135 sigprocmask (SIG_SETMASK, &zero, 0);
1137 #elif HAVE_SIGSETMASK 1141 signal (SIGTSTP, handle_sigtstp);
1166 error (
_(
"Erroneous arithmetic operation."));
void gdb_add_history(const char *command)
void(* after_char_processing_hook)(void)
void quit_serial_event_clear(void)
void async_init_signals(void)
void gdb_rl_callback_handler_reinstall(void)
static char * command_line_append_input_line(struct buffer *cmd_line_buffer, char *rl)
void fputs_unfiltered(const char *buf, struct ui_file *file)
void ui_unregister_input_event_handler(struct ui *ui)
void gdb_rl_callback_handler_install(const char *prompt)
void async_enable_stdin(void)
void mark_async_signal_handler(async_signal_handler *async_handler_ptr)
void change_line_handler(int editing)
void internal_error(const char *file, int line, const char *fmt,...)
const struct gdb_exception exception_none
static void gdb_rl_callback_handler(char *rl) noexcept
void gdb_setup_readline(int editing)
static int quit_serial_event_fd(void)
static int callback_handler_installed
void gdb_disable_readline(void)
void command_line_handler(char *rl)
void add_file_handler(int fd, handler_func *proc, gdb_client_data client_data)
void(* input_handler)(char *)
void execute_command(const char *, int)
void async_request_quit(gdb_client_data arg)
static struct async_signal_handler * async_sigterm_token
#define CATCH(EXCEPTION, MASK)
ui(FILE *instream, FILE *outstream, FILE *errstream)
void handle_sigterm(int sig)
void throw_exception_sjlj(struct gdb_exception exception)
static struct gdb_exception gdb_rl_callback_read_char_wrapper_noexcept() noexcept
int input_interactive_p(struct ui *)
void command_handler(const char *command)
int interp_supports_command_editing(struct interp *interp)
enum prompt_state prompt_state
void initialize_async_signal_handlers(void)
void exception_print(struct ui_file *file, struct gdb_exception e)
int serial_event_fd(struct serial_event *event)
void fputs_filtered(const char *linebuffer, struct ui_file *stream)
void gdb_readline_no_editing_callback(gdb_client_data client_data)
void quit_force(int *exit_arg, int from_tty)
static std::string top_level_prompt()
quit_handler_ftype * quit_handler
void pop_all_targets(void)
void() quit_handler_ftype(void)
void reinitialize_more_filter(void)
async_signal_handler * create_async_signal_handler(sig_handler_func *proc, gdb_client_data client_data)
static int startswith(const char *string, const char *pattern)
int gdb_select(int n, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout)
#define SERVER_COMMAND_PREFIX
void printf_unfiltered(const char *format,...)
void async_disable_stdin(void)
void quit_command(const char *args, int from_tty)
char * handle_line_of_input(struct buffer *cmd_line_buffer, char *rl, int repeat, const char *annotation_suffix)
static struct async_signal_handler * sigint_token
void throw_exception(struct gdb_exception exception)
static struct serial_event * quit_serial_event
void quit_serial_event_set(void)
static struct async_signal_handler * sigfpe_token
void puts_unfiltered(const char *string)
void serial_event_clear(struct serial_event *event)
void buffer_init(struct buffer *buffer)
void ui_register_input_event_handler(struct ui *ui)
int check_quit_flag(void)
void gdb_rl_callback_handler_remove(void)
struct serial_event * make_serial_event(void)
struct interp * command_interp(void)
int call_stdin_event_handler_again_p
static void handle_sigfpe(int sig)
struct ui_file * gdb_stdtarg
void stdin_event_handler(int error, gdb_client_data client_data)
volatile int sync_quit_force_run
void serial_event_set(struct serial_event *event)
void reset_command_nest_depth(void)
struct buffer line_buffer
void display_gdb_prompt(const char *new_prompt)
struct interp * top_level_interpreter(void)
static void async_sigterm_handler(gdb_client_data arg)
void bpstat_do_actions(void)
void handle_sigint(int sig)
static void async_float_handler(gdb_client_data)
struct ui_file * gdb_stdtargerr
int interruptible_select(int n, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout)
void gdb_flush(struct ui_file *file)
char * saved_command_line
void annotate_display_prompt(void)
#define CATCH_SJLJ(EXCEPTION, MASK)
char * buffer_finish(struct buffer *buffer)
static struct buffer * get_command_line_buffer(void)
void error(const char *fmt,...)
void delete_file_handler(int fd)
void default_quit_handler(void)
void(* call_readline)(gdb_client_data)
static void buffer_grow_char(struct buffer *buffer, char c)
static void gdb_rl_callback_read_char_wrapper(gdb_client_data client_data)
void buffer_grow(struct buffer *buffer, const char *data, size_t size)
enum return_reason reason
void target_pass_ctrlc(void)
void observer_notify_before_prompt(const char *current_prompt)