GDB (xrefs)

Macros | Functions | Variables
tui-io.c File Reference
`#include "defs.h"`
`#include "target.h"`
`#include "event-loop.h"`
`#include "event-top.h"`
`#include "command.h"`
`#include "top.h"`
`#include "tui/tui.h"`
`#include "tui/tui-data.h"`
`#include "tui/tui-io.h"`
`#include "tui/tui-command.h"`
`#include "tui/tui-win.h"`
`#include "tui/tui-wingeneral.h"`
`#include "tui/tui-file.h"`
`#include "tui/tui-out.h"`
`#include "ui-out.h"`
`#include "cli-out.h"`
`#include <fcntl.h>`
`#include <signal.h>`
`#include "filestuff.h"`
`#include "completer.h"`
`#include "gdb_curses.h"`
`#include "readline/readline.h"`

Go to the source code of this file.

## Macros
#define | CTRL_CHAR(c) ((c) < control_character_threshold && (((c) & 0x80) == 0))
#define | TUI_USE_PIPE_FOR_READLINE

## Functions
int | key_is_start_sequence (int ch)
int | key_is_end_sequence (int ch)
int | key_is_backspace (int ch)
static void | do_tui_putc (WINDOW *w, char c)
static void | update_cmdwin_start_line ()
static void | tui_putc (char c)
void | tui_write (const char *buf, size_t length)
void | tui_puts (const char *string)
void | tui_redisplay_readline (void)
static void | tui_prep_terminal (int notused1)
static void | tui_deprep_terminal (void)
static void | tui_readline_output (int error, gdb_client_data data)
static void | tui_mld_crlf (const struct match_list_displayer *displayer)
static void | tui_mld_putch (const struct match_list_displayer *displayer, int ch)
static void | tui_mld_puts (const struct match_list_displayer *displayer, const char *s)
static void | tui_mld_flush (const struct match_list_displayer *displayer)
static void | tui_mld_erase_entire_line (const struct match_list_displayer *displayer)
static void | tui_mld_beep (const struct match_list_displayer *displayer)
static int | tui_mld_getc (FILE *fp)
static int | tui_mld_read_key (const struct match_list_displayer *displayer)
static void | tui_rl_display_match_list (char **matches, int len, int max)
void | tui_setup_io (int mode)
void | tui_initialize_io (void)
int | tui_getc (FILE *fp)
char * | tui_expand_tabs (const char *string, int col)

## Variables
static struct ui_file * | tui_stdout
static struct ui_file * | tui_stderr
struct ui_out * | tui_out
static struct ui_file * | tui_old_stdout
static struct ui_file * | tui_old_stderr
cli_ui_out * | tui_old_uiout
static rl_getc_func_t * | tui_old_rl_getc_function
static rl_voidfunc_t * | tui_old_rl_redisplay_function
static rl_vintfunc_t * | tui_old_rl_prep_terminal
static rl_voidfunc_t * | tui_old_rl_deprep_terminal
static rl_compdisp_func_t * | tui_old_rl_display_matches_hook
static int | tui_old_rl_echoing_p
static FILE * | tui_rl_outstream
static FILE * | tui_old_rl_outstream
static int | tui_readline_pipe [2]
static char * | tui_rl_saved_prompt

## Macro Definition Documentation

## ◆ CTRL_CHAR

#define CTRL_CHAR | ( |  | c | ) | ((c) < control_character_threshold && (((c) & 0x80) == 0))

Definition at line 69 of file tui-io.c.

Referenced by gdb_fnprint(), gdb_fnwidth(), and tui_redisplay_readline().

## ◆ TUI_USE_PIPE_FOR_READLINE

#define TUI_USE_PIPE_FOR_READLINE

Definition at line 106 of file tui-io.c.

## Function Documentation

## ◆ do_tui_putc()

static void do_tui_putc | ( | WINDOW * | w,
|  | char | c
| ) |  |
| static

Definition at line 145 of file tui-io.c.

Referenced by tui_putc(), tui_puts(), and tui_write().

## ◆ key_is_backspace()

int key_is_backspace | ( | int | ch | ) |

Definition at line 62 of file tui-io.c.

## ◆ key_is_end_sequence()

int key_is_end_sequence | ( | int | ch | ) |

Definition at line 56 of file tui-io.c.

## ◆ key_is_start_sequence()

int key_is_start_sequence | ( | int | ch | ) |

Definition at line 50 of file tui-io.c.

Referenced by tui_getc().

## ◆ tui_deprep_terminal()

static void tui_deprep_terminal | ( | void |  | ) |
| static

Definition at line 340 of file tui-io.c.

Referenced by tui_setup_io().

## ◆ tui_expand_tabs()

char* tui_expand_tabs | ( | const char * | string,
|  | int | col
| ) |  |

Definition at line 691 of file tui-io.c.

References string, and xmalloc().

Referenced by tui_register_format().

## ◆ tui_getc()

int tui_getc | ( | FILE * | fp | ) |

Definition at line 603 of file tui-io.c.

References call_stdin_event_handler_again_p, ui::command_editing, current_ui, gdb_in_secondary_prompt_p(), key_is_start_sequence(), TUI_CMD_WIN, tui_dispatch_ctrl_char(), tui_putc(), and tui_readline_output().

Referenced by tui_setup_io().

## ◆ tui_initialize_io()

void tui_initialize_io | ( | void |  | ) |

Definition at line 560 of file tui-io.c.

References _, add_file_handler(), cli_out_new(), error(), gdb_pipe_cloexec(), gdb_stdout, tui_old_uiout, tui_out, tui_out_new(), tui_readline_output(), tui_readline_pipe, tui_rl_outstream, tui_stderr, and tui_stdout.

Referenced by tui_interp::init().

## ◆ tui_mld_beep()

static void tui_mld_beep | ( | const struct match_list_displayer * | displayer | ) |
| static

Definition at line 410 of file tui-io.c.

Referenced by tui_rl_display_match_list().

## ◆ tui_mld_crlf()

static void tui_mld_crlf | ( | const struct match_list_displayer * | displayer | ) |
| static

Definition at line 365 of file tui-io.c.

References tui_putc().

Referenced by tui_rl_display_match_list().

## ◆ tui_mld_erase_entire_line()

static void tui_mld_erase_entire_line | ( | const struct match_list_displayer * | displayer | ) |
| static

Definition at line 397 of file tui-io.c.

References TUI_CMD_WIN.

Referenced by tui_rl_display_match_list().

## ◆ tui_mld_flush()

static void tui_mld_flush | ( | const struct match_list_displayer * | displayer | ) |
| static

Definition at line 389 of file tui-io.c.

References TUI_CMD_WIN.

Referenced by tui_rl_display_match_list().

## ◆ tui_mld_getc()

static int tui_mld_getc | ( | FILE * | fp | ) |
| static

Definition at line 420 of file tui-io.c.

References TUI_CMD_WIN.

Referenced by tui_mld_read_key().

## ◆ tui_mld_putch()

static void tui_mld_putch | ( | const struct match_list_displayer * | displayer,
|  | int | ch
| ) |  |
| static

Definition at line 373 of file tui-io.c.

References tui_putc().

Referenced by tui_rl_display_match_list().

## ◆ tui_mld_puts()

static void tui_mld_puts | ( | const struct match_list_displayer * | displayer,
|  | const char * | s
| ) |  |
| static

Definition at line 381 of file tui-io.c.

References tui_puts().

Referenced by tui_rl_display_match_list().

## ◆ tui_mld_read_key()

static int tui_mld_read_key | ( | const struct match_list_displayer * | displayer | ) |
| static

Definition at line 431 of file tui-io.c.

References tui_mld_getc().

Referenced by tui_rl_display_match_list().

## ◆ tui_prep_terminal()

static void tui_prep_terminal | ( | int | notused1 | ) |
| static

Definition at line 328 of file tui-io.c.

References tui_rl_saved_prompt, and xfree().

Referenced by tui_setup_io().

## ◆ tui_putc()

static void tui_putc | ( | char | c | ) |
| static

Definition at line 193 of file tui-io.c.

References do_tui_putc(), TUI_CMD_WIN, and update_cmdwin_start_line().

Referenced by tui_getc(), tui_mld_crlf(), and tui_mld_putch().

## ◆ tui_puts()

void tui_puts | ( | const char * | string | ) |

Definition at line 220 of file tui-io.c.

References do_tui_putc(), TUI_CMD_WIN, and update_cmdwin_start_line().

Referenced by tui_file::puts(), tui_mld_puts(), and tui_readline_output().

## ◆ tui_readline_output()

static void tui_readline_output | ( | int | error,
|  | gdb_client_data | data
| ) |  |
| static

Definition at line 348 of file tui-io.c.

References read(), size, tui_active, tui_puts(), and tui_readline_pipe.

Referenced by tui_getc(), and tui_initialize_io().

## ◆ tui_redisplay_readline()

void tui_redisplay_readline | ( | void |  | ) |

Definition at line 234 of file tui-io.c.

References CTRL_CHAR, current_ui, gdb_in_secondary_prompt_p(), TUI_CMD_WIN, tui_current_key_mode, TUI_ONE_COMMAND_MODE, tui_rl_saved_prompt, tui_set_key_mode(), and TUI_SINGLE_KEY_MODE.

Referenced by tui_rl_startup_hook(), and tui_setup_io().

## ◆ tui_rl_display_match_list()

static void tui_rl_display_match_list | ( | char ** | matches,
|  | int | len,
|  | int | max
| ) |  |
| static

Definition at line 447 of file tui-io.c.

References match_list_displayer::beep, match_list_displayer::crlf, match_list_displayer::erase_entire_line, match_list_displayer::flush, gdb_display_match_list(), match_list_displayer::height, match_list_displayer::putch, match_list_displayer::puts, match_list_displayer::read_key, tui_mld_beep(), tui_mld_crlf(), tui_mld_erase_entire_line(), tui_mld_flush(), tui_mld_putch(), tui_mld_puts(), tui_mld_read_key(), and match_list_displayer::width.

Referenced by tui_setup_io().

## ◆ tui_setup_io()

void tui_setup_io | ( | int | mode | ) |

Definition at line 472 of file tui-io.c.

References current_uiout, gdb_assert, gdb_stderr, gdb_stdlog, gdb_stdout, gdb_stdtarg, gdb_stdtargerr, tui_deprep_terminal(), tui_getc(), tui_old_rl_deprep_terminal, tui_old_rl_display_matches_hook, tui_old_rl_echoing_p, tui_old_rl_getc_function, tui_old_rl_outstream, tui_old_rl_prep_terminal, tui_old_rl_redisplay_function, tui_old_stderr, tui_old_stdout, tui_old_uiout, tui_out, tui_prep_terminal(), tui_redisplay_readline(), tui_rl_display_match_list(), tui_rl_outstream, tui_stderr, and tui_stdout.

Referenced by tui_disable(), and tui_enable().

## ◆ tui_write()

void tui_write | ( | const char * | buf,
|  | size_t | length
| ) |  |

Definition at line 206 of file tui-io.c.

References do_tui_putc(), TUI_CMD_WIN, and update_cmdwin_start_line().

Referenced by tui_file::write().

## ◆ update_cmdwin_start_line()

static void update_cmdwin_start_line | ( |  | ) |
| static

Definition at line 182 of file tui-io.c.

References TUI_CMD_WIN.

Referenced by tui_putc(), tui_puts(), and tui_write().

## Variable Documentation

## ◆ tui_old_rl_deprep_terminal

rl_voidfunc_t* tui_old_rl_deprep_terminal
| static

Definition at line 124 of file tui-io.c.

Referenced by tui_setup_io().

## ◆ tui_old_rl_display_matches_hook

rl_compdisp_func_t* tui_old_rl_display_matches_hook
| static

Definition at line 125 of file tui-io.c.

Referenced by tui_setup_io().

## ◆ tui_old_rl_echoing_p

int tui_old_rl_echoing_p
| static

Definition at line 126 of file tui-io.c.

Referenced by tui_setup_io().

## ◆ tui_old_rl_getc_function

rl_getc_func_t* tui_old_rl_getc_function
| static

Definition at line 121 of file tui-io.c.

Referenced by tui_setup_io().

## ◆ tui_old_rl_outstream

FILE* tui_old_rl_outstream
| static

Definition at line 131 of file tui-io.c.

Referenced by tui_setup_io().

## ◆ tui_old_rl_prep_terminal

rl_vintfunc_t* tui_old_rl_prep_terminal
| static

Definition at line 123 of file tui-io.c.

Referenced by tui_setup_io().

## ◆ tui_old_rl_redisplay_function

rl_voidfunc_t* tui_old_rl_redisplay_function
| static

Definition at line 122 of file tui-io.c.

Referenced by tui_setup_io().

## ◆ tui_old_stderr

struct ui_file* tui_old_stderr
| static

Definition at line 117 of file tui-io.c.

Referenced by tui_setup_io().

## ◆ tui_old_stdout

struct ui_file* tui_old_stdout
| static

Definition at line 116 of file tui-io.c.

Referenced by tui_setup_io().

## ◆ tui_old_uiout

cli_ui_out* tui_old_uiout

Definition at line 118 of file tui-io.c.

Referenced by tui_interp::interp_ui_out(), tui_interp::resume(), tui_initialize_io(), and tui_setup_io().

## ◆ tui_out

struct ui_out* tui_out

Definition at line 113 of file tui-io.c.

Referenced by tui_interp::interp_ui_out(), tui_initialize_io(), and tui_setup_io().

## ◆ tui_readline_pipe

int tui_readline_pipe[2]
| static

Definition at line 133 of file tui-io.c.

Referenced by tui_initialize_io(), and tui_readline_output().

## ◆ tui_rl_outstream

FILE* tui_rl_outstream
| static

Definition at line 130 of file tui-io.c.

Referenced by tui_initialize_io(), and tui_setup_io().

## ◆ tui_rl_saved_prompt

char* tui_rl_saved_prompt
| static

Definition at line 138 of file tui-io.c.

Referenced by tui_prep_terminal(), and tui_redisplay_readline().

## ◆ tui_stderr

struct ui_file* tui_stderr
| static

Definition at line 112 of file tui-io.c.

Referenced by tui_initialize_io(), and tui_setup_io().

## ◆ tui_stdout

struct ui_file* tui_stdout
| static

Definition at line 111 of file tui-io.c.

Referenced by tui_initialize_io(), and tui_setup_io().