GDB (xrefs)
Loading...
Searching...
No Matches
Macros | Functions | Variables
event-top.c File Reference
#include "defs.h"
#include "top.h"
#include "ui.h"
#include "inferior.h"
#include "infrun.h"
#include "target.h"
#include "terminal.h"
#include "gdbsupport/event-loop.h"
#include "event-top.h"
#include "interps.h"
#include <signal.h>
#include "cli/cli-script.h"
#include "main.h"
#include "gdbthread.h"
#include "observable.h"
#include "gdbcmd.h"
#include "annotate.h"
#include "maint.h"
#include "ser-event.h"
#include "gdbsupport/gdb_select.h"
#include "gdbsupport/gdb-sigmask.h"
#include "async-event.h"
#include "bt-utils.h"
#include "pager.h"
#include "readline/readline.h"
#include "readline/history.h"

Go to the source code of this file.

Macros

#define SERVER_COMMAND_PREFIX   "server "
 

Functions

static std::string top_level_prompt ()
 
static void async_sigterm_handler (gdb_client_data arg)
 
static void show_bt_on_fatal_signal (struct ui_file *file, int from_tty, struct cmd_list_element *cmd, const char *value)
 
static struct gdb_exception gdb_rl_callback_read_char_wrapper_noexcept () noexcept
 
static void gdb_rl_callback_read_char_wrapper (gdb_client_data client_data)
 
static void gdb_rl_callback_handler (char *rl) noexcept
 
void change_line_handler (int editing)
 
void gdb_rl_callback_handler_remove (void)
 
void gdb_rl_callback_handler_install (const char *prompt)
 
void gdb_rl_callback_handler_reinstall (void)
 
void display_gdb_prompt (const char *new_prompt)
 
static std::string & get_command_line_buffer (void)
 
void async_enable_stdin (void)
 
void async_disable_stdin (void)
 
void command_handler (const char *command)
 
static bool command_line_append_input_line (std::string &cmd_line_buffer, const char *rl)
 
const char * handle_line_of_input (std::string &cmd_line_buffer, const char *rl, int repeat, const char *annotation_suffix)
 
void gdb_rl_deprep_term_function (void)
 
void command_line_handler (gdb::unique_xmalloc_ptr< char > &&rl)
 
void gdb_readline_no_editing_callback (gdb_client_data client_data)
 
static bool unblock_signal (int sig)
 
static void ATTRIBUTE_NORETURN handle_fatal_signal (int sig)
 
static void handle_sigsegv (int sig)
 
static void install_handle_sigsegv ()
 
void gdb_init_signals (void)
 
void quit_serial_event_set (void)
 
void quit_serial_event_clear (void)
 
static int quit_serial_event_fd (void)
 
void default_quit_handler (void)
 
void handle_sigint (int sig)
 
int interruptible_select (int n, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout)
 
void set_force_quit_flag ()
 
void handle_sigterm (int sig)
 
void async_request_quit (gdb_client_data arg)
 
void gdb_setup_readline (int editing)
 
void gdb_disable_readline (void)
 
static void set_debug_event_loop_command (const char *args, int from_tty, cmd_list_element *c)
 
static void show_debug_event_loop_command (struct ui_file *file, int from_tty, struct cmd_list_element *cmd, const char *value)
 
void _initialize_event_top ()
 

Variables

bool set_editing_cmd_var
 
bool exec_done_display_p = false
 
int call_stdin_event_handler_again_p
 
static bool bt_on_fatal_signal = GDB_PRINT_INTERNAL_BACKTRACE_INIT_ON
 
static struct async_signal_handlersigint_token
 
static struct async_signal_handlerasync_sigterm_token
 
void(* after_char_processing_hook )(void)
 
static bool callback_handler_installed
 
static thread_local void(* thread_local_segv_handler )(int)
 
static struct serial_event * quit_serial_event
 
quit_handler_ftypequit_handler = default_quit_handler
 
volatile bool sync_quit_force_run
 
static const char debug_event_loop_off [] = "off"
 
static const char debug_event_loop_all_except_ui [] = "all-except-ui"
 
static const char debug_event_loop_all [] = "all"
 
static const char * debug_event_loop_enum []
 
static const char * debug_event_loop_value = debug_event_loop_off
 

Macro Definition Documentation

◆ SERVER_COMMAND_PREFIX

#define SERVER_COMMAND_PREFIX   "server "

Function Documentation

◆ _initialize_event_top()

void _initialize_event_top ( )

Definition at line 1375 of file event-top.c.

Referenced by initialize_all_files().

◆ async_disable_stdin()

void async_disable_stdin ( void )

◆ async_enable_stdin()

void async_enable_stdin ( void )

◆ async_request_quit()

void async_request_quit ( gdb_client_data arg)

Definition at line 1169 of file event-top.c.

References QUIT.

Referenced by gdb_init_signals().

◆ async_sigterm_handler()

static void async_sigterm_handler ( gdb_client_data arg)
static

Definition at line 1139 of file event-top.c.

References quit_force().

Referenced by gdb_init_signals().

◆ change_line_handler()

void change_line_handler ( int editing)

◆ command_handler()

void command_handler ( const char * command)

◆ command_line_append_input_line()

static bool command_line_append_input_line ( std::string & cmd_line_buffer,
const char * rl )
static

Definition at line 565 of file event-top.c.

Referenced by handle_line_of_input().

◆ command_line_handler()

void command_line_handler ( gdb::unique_xmalloc_ptr< char > && rl)

◆ default_quit_handler()

void default_quit_handler ( void )

◆ display_gdb_prompt()

void display_gdb_prompt ( const char * new_prompt)

◆ gdb_disable_readline()

void gdb_disable_readline ( void )

◆ gdb_init_signals()

void gdb_init_signals ( void )

◆ gdb_readline_no_editing_callback()

void gdb_readline_no_editing_callback ( gdb_client_data client_data)

◆ gdb_rl_callback_handler()

static void gdb_rl_callback_handler ( char * rl)
staticnoexcept

Definition at line 248 of file event-top.c.

References current_ui, and ui::input_handler.

Referenced by gdb_rl_callback_handler_install().

◆ gdb_rl_callback_handler_install()

void gdb_rl_callback_handler_install ( const char * prompt)

◆ gdb_rl_callback_handler_reinstall()

void gdb_rl_callback_handler_reinstall ( void )

◆ gdb_rl_callback_handler_remove()

void gdb_rl_callback_handler_remove ( void )

◆ gdb_rl_callback_read_char_wrapper()

static void gdb_rl_callback_read_char_wrapper ( gdb_client_data client_data)
static

Definition at line 231 of file event-top.c.

References gdb_rl_callback_read_char_wrapper_noexcept().

Referenced by change_line_handler(), and gdb_setup_readline().

◆ gdb_rl_callback_read_char_wrapper_noexcept()

static struct gdb_exception gdb_rl_callback_read_char_wrapper_noexcept ( )
staticnoexcept

Definition at line 185 of file event-top.c.

References after_char_processing_hook.

Referenced by gdb_rl_callback_read_char_wrapper().

◆ gdb_rl_deprep_term_function()

void gdb_rl_deprep_term_function ( void )

Definition at line 692 of file event-top.c.

References printf_unfiltered().

Referenced by init_main().

◆ gdb_setup_readline()

void gdb_setup_readline ( int editing)

◆ get_command_line_buffer()

static std::string & get_command_line_buffer ( void )
static

Definition at line 497 of file event-top.c.

References current_ui, and ui::line_buffer.

Referenced by command_line_handler().

◆ handle_fatal_signal()

static void ATTRIBUTE_NORETURN handle_fatal_signal ( int sig)
static

◆ handle_line_of_input()

const char * handle_line_of_input ( std::string & cmd_line_buffer,
const char * rl,
int repeat,
const char * annotation_suffix )

◆ handle_sigint()

void handle_sigint ( int sig)

◆ handle_sigsegv()

static void handle_sigsegv ( int sig)
static

◆ handle_sigterm()

void handle_sigterm ( int sig)

◆ install_handle_sigsegv()

static void install_handle_sigsegv ( )
static

Definition at line 937 of file event-top.c.

References handle_sigsegv().

Referenced by gdb_init_signals(), and handle_sigsegv().

◆ interruptible_select()

int interruptible_select ( int n,
fd_set * readfds,
fd_set * writefds,
fd_set * exceptfds,
struct timeval * timeout )

◆ quit_serial_event_clear()

void quit_serial_event_clear ( void )

Definition at line 1051 of file event-top.c.

References quit_serial_event, and serial_event_clear().

Referenced by check_quit_flag().

◆ quit_serial_event_fd()

static int quit_serial_event_fd ( void )
static

Definition at line 1060 of file event-top.c.

References quit_serial_event, and serial_event_fd().

Referenced by interruptible_select().

◆ quit_serial_event_set()

void quit_serial_event_set ( void )

Definition at line 1043 of file event-top.c.

References quit_serial_event, and serial_event_set().

Referenced by set_quit_flag().

◆ set_debug_event_loop_command()

static void set_debug_event_loop_command ( const char * args,
int from_tty,
cmd_list_element * c )
static

◆ set_force_quit_flag()

void set_force_quit_flag ( )

◆ show_bt_on_fatal_signal()

static void show_bt_on_fatal_signal ( struct ui_file * file,
int from_tty,
struct cmd_list_element * cmd,
const char * value )
static

Definition at line 112 of file event-top.c.

References gdb_printf().

◆ show_debug_event_loop_command()

static void show_debug_event_loop_command ( struct ui_file * file,
int from_tty,
struct cmd_list_element * cmd,
const char * value )
static

Definition at line 1367 of file event-top.c.

References gdb_printf().

◆ top_level_prompt()

static std::string top_level_prompt ( void )
static

Definition at line 470 of file event-top.c.

References annotation_level, gdb::observers::before_prompt, get_prompt(), and prefix.

Referenced by display_gdb_prompt().

◆ unblock_signal()

static bool unblock_signal ( int sig)
static

Definition at line 854 of file event-top.c.

Referenced by handle_fatal_signal().

Variable Documentation

◆ after_char_processing_hook

void(* after_char_processing_hook) (void) ( void )

◆ async_sigterm_token

struct async_signal_handler* async_sigterm_token
static

Definition at line 134 of file event-top.c.

Referenced by gdb_init_signals(), and handle_sigterm().

◆ bt_on_fatal_signal

bool bt_on_fatal_signal = GDB_PRINT_INTERNAL_BACKTRACE_INIT_ON
static

Definition at line 107 of file event-top.c.

Referenced by handle_fatal_signal().

◆ call_stdin_event_handler_again_p

int call_stdin_event_handler_again_p

Definition at line 103 of file event-top.c.

Referenced by start_sequence(), stdin_event_handler(), and tui_getc_1().

◆ callback_handler_installed

bool callback_handler_installed
static

◆ debug_event_loop_all

const char debug_event_loop_all[] = "all"
static

Definition at line 1341 of file event-top.c.

Referenced by set_debug_event_loop_command().

◆ debug_event_loop_all_except_ui

const char debug_event_loop_all_except_ui[] = "all-except-ui"
static

Definition at line 1340 of file event-top.c.

Referenced by set_debug_event_loop_command().

◆ debug_event_loop_enum

const char* debug_event_loop_enum[]
static
Initial value:
= {
nullptr
}
static const char debug_event_loop_all_except_ui[]
Definition event-top.c:1340
static const char debug_event_loop_all[]
Definition event-top.c:1341
static const char debug_event_loop_off[]
Definition event-top.c:1339

Definition at line 1343 of file event-top.c.

◆ debug_event_loop_off

const char debug_event_loop_off[] = "off"
static

Definition at line 1339 of file event-top.c.

Referenced by set_debug_event_loop_command().

◆ debug_event_loop_value

const char* debug_event_loop_value = debug_event_loop_off
static

Definition at line 1350 of file event-top.c.

Referenced by set_debug_event_loop_command().

◆ exec_done_display_p

bool exec_done_display_p = false

Definition at line 98 of file event-top.c.

Referenced by fetch_inferior_event(), and init_main().

◆ quit_handler

◆ quit_serial_event

struct serial_event* quit_serial_event
static

◆ set_editing_cmd_var

bool set_editing_cmd_var

Definition at line 94 of file event-top.c.

Referenced by init_main(), and set_editing().

◆ sigint_token

struct async_signal_handler* sigint_token
static

Definition at line 124 of file event-top.c.

Referenced by gdb_init_signals(), and handle_sigint().

◆ sync_quit_force_run

volatile bool sync_quit_force_run

Definition at line 1145 of file event-top.c.

Referenced by maybe_quit(), quit(), quit_force(), and set_force_quit_flag().

◆ thread_local_segv_handler

thread_local void(* thread_local_segv_handler) (int) ( int )
static