47 #include "readline/readline.h" 69 #define CTRL_CHAR(c) \ 70 ((c) < control_character_threshold && (((c) & 0x80) == 0)) 106 #define TUI_USE_PIPE_FOR_READLINE 132 #ifdef TUI_USE_PIPE_FOR_READLINE 147 static int tui_skip_line = -1;
155 else if (tui_skip_line != 1)
169 while ((col % 8) != 0);
210 for (
size_t i = 0; i < length; i++)
225 while ((c = *
string++) != 0)
263 start_line =
TUI_CMD_WIN->detail.command_info.start_line;
264 wmove (w, start_line, 0);
267 for (in = 0; prompt && prompt[in]; in++)
269 waddch (w, prompt[in]);
275 for (in = 0; in <= rl_end; in++)
281 getyx (w, c_line, c_pos);
287 c = (
unsigned char) rl_line_buffer[in];
291 waddch (w,
CTRL_CHAR (c) ? UNCTRL (c) :
'?');
301 }
while ((col % 8) != 0);
308 TUI_CMD_WIN->detail.command_info.start_line = getcury (w);
315 TUI_CMD_WIN->detail.command_info.start_line = getcury (w);
317 wmove (w, c_line, c_pos);
318 TUI_CMD_WIN->detail.command_info.start_line -= height - 1;
344 #ifdef TUI_USE_PIPE_FOR_READLINE 400 int cur_y = getcury (w);
433 rl_getc_func_t *prev = rl_getc_function;
439 rl_getc_function = prev;
451 rl_get_screen_size (&displayer.
height, &displayer.
width);
474 extern int _rl_echoing_p;
494 rl_already_prompted = 0;
531 rl_already_prompted = 0;
541 tui_cont_sig (
int sig)
554 signal (sig, tui_cont_sig);
563 signal (SIGCONT, tui_cont_sig);
574 #ifdef TUI_USE_PIPE_FOR_READLINE 579 error (
_(
"Cannot create pipe for readline"));
583 error (
_(
"Cannot redirect readline output"));
610 #ifdef TUI_USE_PIPE_FOR_READLINE 628 wmove (w, getcury (w), 0);
643 px += rl_end - rl_point;
654 if (ch == KEY_BACKSPACE)
662 ch_pending = wgetch (w);
676 if (ch_pending != ERR)
678 ungetch (ch_pending);
698 for (ncol = col, n_adjust = 0, s =
string; s; )
700 s = strpbrk (s,
"\t");
703 ncol += (s -
string) + n_adjust;
706 n_adjust += 8 - (ncol % 8) - 1;
712 ret = q = (
char *)
xmalloc (strlen (
string) + n_adjust + 1);
715 for (ncol = col, s =
string; s; )
717 const char *s1 = strpbrk (s,
"\t");
722 strncpy (q, s, s1 - s);
729 }
while ((ncol % 8) != 0);
static FILE * tui_rl_outstream
ssize_t read(int fd, void *buf, size_t count)
void tui_write(const char *buf, size_t length)
static rl_vintfunc_t * tui_old_rl_prep_terminal
static void update_cmdwin_start_line()
static struct ui_file * tui_stderr
static struct ui_file * tui_stdout
static rl_voidfunc_t * tui_old_rl_deprep_terminal
static int tui_readline_pipe[2]
int gdb_pipe_cloexec(int filedes[2])
static void do_tui_putc(WINDOW *w, char c)
static int tui_mld_read_key(const struct match_list_displayer *displayer)
static char * tui_rl_saved_prompt
static void tui_prep_terminal(int notused1)
static void tui_mld_crlf(const struct match_list_displayer *displayer)
static void tui_mld_puts(const struct match_list_displayer *displayer, const char *s)
void tui_redisplay_readline(void)
void tui_puts(const char *string)
mld_read_key_ftype * read_key
void add_file_handler(int fd, handler_func *proc, gdb_client_data client_data)
int key_is_end_sequence(int ch)
void tui_refresh_all_win(void)
static void tui_mld_flush(const struct match_list_displayer *displayer)
static FILE * tui_old_rl_outstream
void tui_set_key_mode(enum tui_key_mode mode)
static void tui_mld_erase_entire_line(const struct match_list_displayer *displayer)
static void tui_putc(char c)
static int tui_old_rl_echoing_p
static struct ui_file * tui_old_stdout
int gdb_in_secondary_prompt_p(struct ui *ui)
static void tui_mld_beep(const struct match_list_displayer *displayer)
tui_ui_out * tui_out_new(struct ui_file *stream)
static void tui_rl_display_match_list(char **matches, int len, int max)
void tui_setup_io(int mode)
static rl_getc_func_t * tui_old_rl_getc_function
void tui_initialize_io(void)
unsigned int tui_dispatch_ctrl_char(unsigned int ch)
static rl_voidfunc_t * tui_old_rl_redisplay_function
static rl_compdisp_func_t * tui_old_rl_display_matches_hook
static struct ui_file * tui_old_stderr
char * tui_expand_tabs(const char *string, int col)
static int tui_mld_getc(FILE *fp)
static void tui_deprep_terminal(void)
int call_stdin_event_handler_again_p
struct ui_file * gdb_stdtarg
int key_is_backspace(int ch)
mld_erase_entire_line_ftype * erase_entire_line
static void tui_readline_output(int error, gdb_client_data data)
struct ui_file * gdb_stdtargerr
static void tui_mld_putch(const struct match_list_displayer *displayer, int ch)
void gdb_display_match_list(char **matches, int len, int max, const struct match_list_displayer *displayer)
cli_ui_out * cli_out_new(struct ui_file *stream)
cli_ui_out * tui_old_uiout
enum tui_key_mode tui_current_key_mode
void error(const char *fmt,...)
int key_is_start_sequence(int ch)