GDB (xrefs)

Classes | Macros | Enumerations | Functions | Variables
/tmp/gdb-8.1/gdb/top.h File Reference
`#include "buffer.h"`
`#include "event-loop.h"`
`#include "value.h"`

Go to the source code of this file.

## Classes
struct | ui
class | switch_thru_all_uis

## Macros
#define | SWITCH_THRU_ALL_UIS() for (switch_thru_all_uis stau_state; !stau_state.done (); stau_state.next ())
#define | ALL_UIS(UI) for (UI = ui_list; UI; UI = UI->next) \

## Enumerations
enum | prompt_state { PROMPT_BLOCKED, PROMPT_NEEDED, PROMPTED }

## Functions
void | ui_register_input_event_handler (struct ui *ui)
void | ui_unregister_input_event_handler (struct ui *ui)
void | print_gdb_version (struct ui_file *)
void | print_gdb_configuration (struct ui_file *)
void | read_command_file (FILE *)
void | init_history (void)
void | command_loop (void)
int | quit_confirm (void)
void | quit_force (int *, int)
void | quit_command (const char *, int)
void | quit_cover (void)
void | execute_command (const char *, int)
void | maybe_wait_sync_command_done (int was_sync)
void | wait_sync_command_done (void)
void | check_frame_language_change (void)
scoped_value_mark | prepare_execute_command (void)
char * | get_prompt (void)
void | set_prompt (const char *s)
int | gdb_in_secondary_prompt_p (struct ui *ui)
void | gdb_init (char *)
void | gdb_add_history (const char *)
void | show_commands (const char *args, int from_tty)
void | set_history (const char *, int)
void | show_history (const char *, int)
void | set_verbose (const char *, int, struct cmd_list_element *)
char * | handle_line_of_input (struct buffer *cmd_line_buffer, char *rl, int repeat, const char *annotation_suffix)

## Variables
struct ui * | main_ui
struct ui * | current_ui
struct ui * | ui_list
char * | saved_command_line
int | confirm
int | inhibit_gdbinit
const char | gdbinit []
int | readnow_symbol_files
int | readnever_symbol_files
int | source_line_number
const char * | source_file_name
int | history_expansion_p
int | server_command
char * | lim_at_start

## Macro Definition Documentation

## ◆ ALL_UIS

#define ALL_UIS | ( |  | UI | ) | for (UI = ui_list; UI; UI = UI->next) \

Definition at line 210 of file top.h.

Referenced by handle_no_resumed(), and quit_force().

## ◆ SWITCH_THRU_ALL_UIS

#define SWITCH_THRU_ALL_UIS | ( |  | ) | for (switch_thru_all_uis stau_state; !stau_state.done (); stau_state.next ())

Definition at line 206 of file top.h.

Referenced by all_uis_check_sync_execution_done(), all_uis_on_sync_execution_starting(), bpstat_check_watchpoint(), cli_on_end_stepping_range(), cli_on_exited(), cli_on_no_history(), cli_on_normal_stop(), cli_on_signal_exited(), cli_on_signal_received(), cli_on_user_selected_context_changed(), mi_breakpoint_created(), mi_breakpoint_deleted(), mi_breakpoint_modified(), mi_command_param_changed(), mi_inferior_added(), mi_inferior_appeared(), mi_inferior_exit(), mi_inferior_removed(), mi_memory_changed(), mi_new_thread(), mi_on_end_stepping_range(), mi_on_exited(), mi_on_no_history(), mi_on_normal_stop(), mi_on_resume(), mi_on_signal_exited(), mi_on_signal_received(), mi_output_running_pid(), mi_record_changed(), mi_solib_loaded(), mi_solib_unloaded(), mi_thread_exit(), mi_traceframe_changed(), mi_tsv_created(), mi_tsv_deleted(), mi_tsv_modified(), mi_user_selected_context_changed(), normal_stop(), tui_on_end_stepping_range(), tui_on_exited(), tui_on_no_history(), tui_on_normal_stop(), tui_on_signal_exited(), tui_on_signal_received(), tui_on_user_selected_context_changed(), and watchpoint_check().

## Enumeration Type Documentation

## ◆ prompt_state

enum prompt_state

Enumerator
PROMPT_BLOCKED |
PROMPT_NEEDED |
PROMPTED |

Definition at line 31 of file top.h.

## Function Documentation

## ◆ check_frame_language_change()

void check_frame_language_change | ( | void |  | ) |

Definition at line 456 of file top.c.

References current_language, deprecated_safe_get_selected_frame(), expected_language, get_frame_language(), has_stack_frames(), info_verbose, language_defn::la_language, lang_frame_mismatch_warn, language_info(), language_mode_auto, language_unknown, and printf_filtered().

Referenced by execute_command(), and inferior_event_handler().

## ◆ command_loop()

void command_loop | ( | void |  | ) |

## ◆ execute_command()

void execute_command | ( | const char * | ,
|  | int |
| ) |  |

Definition at line 540 of file top.c.

References _, check_frame_language_change(), class_user, cmd_func(), cmd_func_p(), cmdlist, current_ui, deprecated_call_command_hook, deprecated_cmd_warning(), cmd_list_element::deprecated_warn_user, discard_cleanups(), do_set_command(), do_show_command(), error(), execute_cmd_post_hook(), execute_cmd_pre_hook(), execute_user_command(), gdb_assert, is_complete_command(), lookup_cmd(), make_bpstat_clear_actions_cleanup(), make_scoped_restore(), maybe_wait_sync_command_done(), prepare_execute_command(), print_command_trace(), PROMPT_BLOCKED, ui::prompt_state, repeat_arguments, saved_command_line, set_cmd, show_cmd, string, target_log_command, cmd_list_element::theclass, cmd_list_element::type, and cmd_list_element::user_commands.

Referenced by execute_command_to_string().

## ◆ gdb_add_history()

void gdb_add_history | ( | const char * |  | ) |

Definition at line 1067 of file top.c.

References command_count, and history_remove_duplicates.

Referenced by handle_line_of_input().

## ◆ gdb_in_secondary_prompt_p()

int gdb_in_secondary_prompt_p | ( | struct ui * | ui | ) |

Definition at line 888 of file top.c.

References ui::secondary_prompt_depth.

Referenced by check_curr_ui_sync_execution_done(), tui_getc(), tui_redisplay_readline(), and tui_rl_startup_hook().

## ◆ gdb_init()

void gdb_init | ( | char * |  | ) |

Definition at line 2113 of file top.c.

References async_init_signals(), current_directory, current_language, expected_language, finish_ext_lang_initialization(), init_cli_cmds(), init_cmd_lists(), init_main(), init_page_info(), initialize_all_files(), initialize_current_architecture(), initialize_inferiors(), initialize_progspace(), initialize_stdin_serial(), initialize_targets(), initialize_utils(), language_c, make_final_cleanup(), pre_init_ui_hook, set_initial_gdb_ttystate(), and set_language().

Referenced by captured_main_1().

## ◆ get_prompt()

char* get_prompt | ( | void |  | ) |

Definition at line 1445 of file top.c.

References top_prompt.

Referenced by top_level_prompt().

## ◆ handle_line_of_input()

char* handle_line_of_input | ( | struct buffer * | cmd_line_buffer,
|  | char * | rl,
|  | int | repeat,
|  | const char * | annotation_suffix
| ) |  |

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

References annotation_level, buffer::buffer, buffer_finish(), buffer::buffer_size, command_line_append_input_line(), current_ui, gdb_add_history(), history_expansion_p, input_interactive_p(), ui::instream, printf_unfiltered(), puts_unfiltered(), saved_command_line, server_command, SERVER_COMMAND_PREFIX, startswith(), ui::stdin_stream, buffer::used_size, and xfree().

Referenced by command_line_handler(), and command_line_input().

## ◆ init_history()

void init_history | ( | void |  | ) |

Definition at line 1821 of file top.c.

References current_directory, history_filename, history_size_setshow_var, INT_MAX, set_readline_history_size(), skip_spaces(), and cmd_list_element::var.

Referenced by captured_main_1().

## ◆ maybe_wait_sync_command_done()

void maybe_wait_sync_command_done | ( | int | was_sync | ) |

Definition at line 511 of file top.c.

References ui::async, current_ui, PROMPT_BLOCKED, ui::prompt_state, and wait_sync_command_done().

Referenced by catch_command_errors(), and execute_command().

## ◆ prepare_execute_command()

scoped_value_mark prepare_execute_command | ( | void |  | ) |

Definition at line 440 of file top.c.

References non_stop, and target_dcache_invalidate().

Referenced by execute_command(), and mi_cmd_execute().

## ◆ print_gdb_configuration()

void print_gdb_configuration | ( | struct ui_file * |  | ) |

Definition at line 1339 of file top.c.

References _, AUTO_LOAD_DIR, AUTO_LOAD_SAFE_PATH, DEBUGDIR, DEBUGDIR_RELOCATABLE, fprintf_filtered(), GDB_DATADIR, GDB_DATADIR_RELOCATABLE, host_name, JIT_READER_DIR, JIT_READER_DIR_RELOCATABLE, PYTHON_PATH_RELOCATABLE, SYSTEM_GDBINIT, SYSTEM_GDBINIT_RELOCATABLE, target_name, TARGET_SYSTEM_ROOT, TARGET_SYSTEM_ROOT_RELOCATABLE, and WITH_PYTHON_PATH.

Referenced by captured_main_1(), and show_configuration().

## ◆ print_gdb_version()

void print_gdb_version | ( | struct ui_file * |  | ) |

Definition at line 1284 of file top.c.

References _, fprintf_filtered(), host_name, PKGVERSION, REPORT_BUGS_TO, target_name, and version.

Referenced by captured_main_1(), and show_version().

## ◆ quit_command()

void quit_command | ( | const char * | ,
|  | int |
| ) |  |

Definition at line 331 of file cli-cmds.c.

References _, error(), parse_and_eval(), query_if_trace_running(), quit_confirm(), quit_force(), and value_as_long().

Referenced by _initialize_cli_cmds(), captured_command_loop(), and stdin_event_handler().

## ◆ quit_confirm()

int quit_confirm | ( | void |  | ) |

Definition at line 1526 of file top.c.

References _, string_file::c_str(), have_live_inferiors(), iterate_over_inferiors(), print_inferior_quit_action(), ui_file::puts(), and query().

Referenced by quit_command().

## ◆ quit_cover()

void quit_cover | ( | void |  | ) |

## ◆ quit_force()

void quit_force | ( | int * | ,
|  | int |
| ) |  |

Definition at line 1566 of file top.c.

References all_cleanups(), ALL_UIS, qt_args::args, CATCH, disconnect_tracing(), do_final_cleanups(), END_CATCH, exception_print(), qt_args::from_tty, gdb_safe_append_history(), gdb_stderr, history_filename, input_interactive_p(), iterate_over_inferiors(), kill_or_detach(), pop_all_targets(), return_child_result, return_child_result_value, RETURN_MASK_ALL, TRY, ui::ui(), undo_terminal_modifications_before_exit(), and write_history_p.

Referenced by async_sigterm_handler(), captured_main_1(), mi_cmd_gdb_exit(), mi_execute_command(), quit(), and quit_command().

## ◆ read_command_file()

void read_command_file | ( | FILE * |  | ) |

Definition at line 406 of file top.c.

References command_handler(), command_line_input(), current_ui, ui::instream, and make_scoped_restore().

Referenced by script_from_file().

## ◆ set_history()

void set_history | ( | const char * | ,
|  | int |
| ) |  |

Definition at line 1778 of file top.c.

References _, all_commands, gdb_stdout, help_list(), printf_unfiltered(), and sethistlist.

Referenced by _initialize_cli_cmds().

## ◆ set_prompt()

void set_prompt | ( | const char * | s | ) |

Definition at line 1453 of file top.c.

References top_prompt, and xfree().

Referenced by gdbpy_before_prompt_hook(), and init_main().

## ◆ set_verbose()

void set_verbose | ( | const char * | ,
|  | int | ,
|  | struct cmd_list_element * |
| ) |  |

Definition at line 1795 of file top.c.

References CMD_LIST_AMBIGUOUS, cmd_list_element::doc, gdb_assert, info_verbose, lookup_cmd_1(), and showlist.

Referenced by _initialize_cli_cmds().

## ◆ show_commands()

void show_commands | ( | const char * | args,
|  | int | from_tty
| ) |  |

Definition at line 1697 of file top.c.

References Hist_print, ui::num, offset, parse_and_eval_long(), printf_filtered(), and set_repeat_arguments().

Referenced by _initialize_cli_cmds().

## ◆ show_history()

void show_history | ( | const char * | ,
|  | int |
| ) |  |

Definition at line 1786 of file top.c.

References cmd_show_list(), and showhistlist.

Referenced by _initialize_cli_cmds().

## ◆ ui_register_input_event_handler()

void ui_register_input_event_handler | ( | struct ui * | ui | ) |

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

References add_file_handler(), ui::input_fd, and stdin_event_handler().

Referenced by async_enable_stdin(), check_curr_ui_sync_execution_done(), gdb_setup_readline(), run_inferior_call(), and scoped_input_handler::scoped_input_handler().

## ◆ ui_unregister_input_event_handler()

void ui_unregister_input_event_handler | ( | struct ui * | ui | ) |

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

References delete_file_handler(), and ui::input_fd.

Referenced by scoped_input_handler::~scoped_input_handler().

## ◆ wait_sync_command_done()

void wait_sync_command_done | ( | void |  | ) |

Definition at line 497 of file top.c.

References current_ui, gdb_do_one_event(), make_scoped_restore(), PROMPT_BLOCKED, and ui::prompt_state.

Referenced by maybe_wait_sync_command_done(), and run_inferior_call().

## Variable Documentation

## ◆ confirm

int confirm

Referenced by ATTRIBUTE_PRINTF(), and init_main().

## ◆ current_ui

struct ui* current_ui

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

Referenced by abort_with_message(), all_uis_on_sync_execution_starting(), annotate_breakpoints_invalid(), annotate_frames_invalid(), async_disable_stdin(), async_enable_stdin(), ATTRIBUTE_PRINTF(), bpstat_do_actions_1(), call_function_by_hand_dummy(), call_thread_fsm_should_stop(), captured_command_loop(), captured_main_1(), catch_command_errors(), change_line_handler(), check_curr_ui_sync_execution_done(), command_handler(), command_line_handler(), command_line_input(), compile_code_command(), compile_file_command(), compile_print_command(), continue_1(), current_interpreter(), display_gdb_prompt(), display_mi_prompt(), dont_repeat(), execute_command(), execute_command_to_string(), execute_control_command(), execute_gdb_command(), execute_user_command(), fetch_inferior_event(), follow_fork_inferior(), gdb_disable_readline(), gdb_readline_no_editing(), gdb_readline_no_editing_callback(), gdb_readline_wrapper(), gdb_readline_wrapper_cleanup(), gdb_readline_wrapper_line(), gdb_rl_callback_handler(), gdb_rl_callback_handler_install(), gdb_rl_callback_handler_reinstall(), gdb_rl_callback_handler_remove(), gdb_setup_readline(), get_command_line_buffer(), get_current_interp_info(), handle_line_of_input(), if_command(), target_terminal::inferior(), inferior_event_handler(), interpreter_exec_cmd(), invoke_async_signal_handlers(), ioscm_with_output_to_port_worker(), maybe_wait_sync_command_done(), mi_cmd_interpreter_exec(), mi_execute_command(), mi_execute_command_input_handler(), mi_execute_command_wrapper(), mi_on_normal_stop_1(), mi_on_resume_1(), new_ui_command(), switch_thru_all_uis::next(), normal_stop(), target_terminal::ours(), target_terminal::ours_for_output(), postfork_child_hook(), postfork_hook(), prefork_hook(), print_flush(), python_command(), python_interactive_command(), read_command_file(), read_command_lines(), read_next_line(), reinstall_readline_callback_handler_cleanup(), cli_interp::resume(), tui_interp::resume(), mi_interp::resume(), run_inferior_call(), scoped_input_handler::scoped_input_handler(), script_from_file(), set_editing(), scoped_restore_interp::set_interp(), set_top_level_interpreter(), show_editing(), show_interactive_mode(), start_event_loop(), stdin_event_handler(), switch_thru_all_uis::switch_thru_all_uis(), tui_getc(), tui_redisplay_readline(), tui_rl_startup_hook(), undo_terminal_modifications_before_exit(), wait_sync_command_done(), and while_command().

## ◆ gdbinit

const char gdbinit[]

Referenced by file_is_auto_load_safe(), get_init_files(), and init_cli_cmds().

## ◆ history_expansion_p

int history_expansion_p

Definition at line 806 of file top.c.

Referenced by _initialize_cli_cmds(), handle_line_of_input(), and init_main().

## ◆ inhibit_gdbinit

int inhibit_gdbinit

Referenced by _initialize_check_for_gdb_ini(), and captured_main_1().

## ◆ lim_at_start

char* lim_at_start

Definition at line 175 of file top.c.

Referenced by captured_main_1(), scoped_command_stats::scoped_command_stats(), and scoped_command_stats::~scoped_command_stats().

## ◆ main_ui

struct ui* main_ui

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

Referenced by ATTRIBUTE_PRINTF(), captured_main_1(), change_line_handler(), fetch_inferior_event(), gdb_flush_out_err(), gdb_rl_callback_handler_install(), gdb_rl_callback_handler_reinstall(), gdb_rl_callback_handler_remove(), gdb_setup_readline(), target_terminal::inferior(), invoke_async_signal_handlers(), target_terminal::ours(), target_terminal::ours_for_output(), postfork_child_hook(), stdin_event_handler(), and undo_terminal_modifications_before_exit().

## ◆ readnever_symbol_files

int readnever_symbol_files

Definition at line 84 of file symfile.c.

Referenced by captured_main_1(), symbol_file_add_with_addrs(), and validate_readnow_readnever().

## ◆ readnow_symbol_files

int readnow_symbol_files

Definition at line 83 of file symfile.c.

Referenced by captured_main_1(), symbol_file_add_with_addrs(), and validate_readnow_readnever().

## ◆ saved_command_line

char* saved_command_line

Definition at line 137 of file top.c.

Referenced by captured_main_1(), dont_repeat(), dont_repeat_command(), execute_command(), and handle_line_of_input().

## ◆ server_command

int server_command

Definition at line 145 of file top.c.

Referenced by ATTRIBUTE_PRINTF(), breakpoint_1(), dont_repeat(), and handle_line_of_input().

## ◆ source_file_name

const char* source_file_name

Definition at line 402 of file top.c.

Referenced by command_line_input(), and script_from_file().

## ◆ source_line_number

int source_line_number

Definition at line 396 of file top.c.

Referenced by command_line_input(), and script_from_file().

## ◆ ui_list

struct ui* ui_list

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

Referenced by switch_thru_all_uis::switch_thru_all_uis(), ui::ui(), and ui::~ui().