GDB (xrefs)
|
#include "defs.h"
#include "top.h"
#include "ui.h"
#include "target.h"
#include "inferior.h"
#include "symfile.h"
#include "gdbcore.h"
#include "getopt.h"
#include <sys/types.h>
#include <sys/stat.h>
#include <ctype.h>
#include "gdbsupport/event-loop.h"
#include "ui-out.h"
#include "interps.h"
#include "main.h"
#include "source.h"
#include "cli/cli-cmds.h"
#include "objfiles.h"
#include "auto-load.h"
#include "maint.h"
#include "filenames.h"
#include "gdbsupport/filestuff.h"
#include <signal.h>
#include "event-top.h"
#include "infrun.h"
#include "gdbsupport/signals-state-save-restore.h"
#include <algorithm>
#include <vector>
#include "gdbsupport/pathstuff.h"
#include "cli/cli-style.h"
#include "gdbsupport/alt-stack.h"
#include "observable.h"
#include "serial.h"
Go to the source code of this file.
Classes | |
class | gdb_initfile_finder |
struct | cmdarg |
Typedefs | |
typedef void | catch_command_errors_const_ftype(const char *, int) |
Enumerations | |
enum | cmdarg_kind { CMDARG_FILE , CMDARG_COMMAND , CMDARG_INIT_FILE , CMDARG_INIT_COMMAND , CMDARG_EARLYINIT_FILE , CMDARG_EARLYINIT_COMMAND } |
Functions | |
const char * | get_gdb_program_name (void) |
static void | print_gdb_help (struct ui_file *) |
void | set_gdb_data_directory (const char *new_datadir) |
static std::string | relocate_path (const char *progname, const char *initial, bool relocatable) |
std::string | relocate_gdb_directory (const char *initial, bool relocatable) |
static std::string | relocate_file_path_maybe_in_datadir (const std::string &file, bool relocatable) |
static void | get_init_files (std::vector< std::string > *system_gdbinit, std::string *home_gdbinit, std::string *local_gdbinit) |
static void | get_earlyinit_files (std::string *home_gdbearlyinit) |
static void | start_event_loop () |
static void | captured_command_loop () __attribute__((noinline)) |
static int | handle_command_errors (const struct gdb_exception &e) |
static int | catch_command_errors (catch_command_errors_const_ftype command, const char *arg, int from_tty, bool do_bp_actions=false) |
static void | symbol_file_add_main_adapter (const char *arg, int from_tty) |
static void | validate_readnow_readnever () |
static void | execute_cmdargs (const std::vector< struct cmdarg > *cmdarg_vec, cmdarg_kind file_type, cmdarg_kind cmd_type, int *ret) |
static void | captured_main_1 (struct captured_main_args *context) |
static void | captured_main (void *data) |
int | gdb_main (struct captured_main_args *args) |
Variables | |
std::string | interpreter_p |
std::string | gdb_sysroot |
std::string | gdb_datadir |
static int | gdb_datadir_provided = 0 |
std::string | python_libdir |
struct ui_file * | gdb_stdtargin |
struct ui_file * | gdb_stdtarg |
struct ui_file * | gdb_stdtargerr |
int | batch_flag = 0 |
int | batch_silent = 0 |
int | return_child_result = 0 |
int | return_child_result_value = -1 |
static char * | gdb_program_name |
typedef void catch_command_errors_const_ftype(const char *, int) |
enum cmdarg_kind |
|
static |
Definition at line 458 of file main.c.
References ui::async, current_ui, ui::instream, interp::pre_command_loop(), PROMPT_BLOCKED, ui::prompt_state, quit_command(), start_event_loop(), ui::stdin_stream, and top_level_interpreter().
Referenced by captured_main().
|
static |
Definition at line 1310 of file main.c.
References captured_command_loop(), captured_main_1(), exception_print(), gdb_stderr, and quit_force().
Referenced by gdb_main().
|
static |
Definition at line 618 of file main.c.
References add_substitute_path_rule(), annotation_level, captured_main_args::argc, captured_main_args::argv, attach_command(), auto_load_debug_printf, auto_load_local_gdbinit, auto_load_local_gdbinit_loaded, auto_load_local_gdbinit_pathname, batch_flag, batch_silent, baud_rate, BINDIR, catch_command_errors(), cd_command(), check_quiet_mode(), cli_styling, CMDARG_COMMAND, CMDARG_EARLYINIT_COMMAND, CMDARG_EARLYINIT_FILE, CMDARG_FILE, CMDARG_INIT_COMMAND, CMDARG_INIT_FILE, core_file_command(), current_inferior(), current_program_space, current_ui, debug_file_directory, DEBUGDIR, DEBUGDIR_RELOCATABLE, directory_switch(), exec_file_attach(), execute_cmdargs(), ext_lang_initialization(), file_is_auto_load_safe(), GDB_DATADIR, gdb_datadir, gdb_datadir_provided, GDB_DATADIR_RELOCATABLE, gdb_flush(), gdb_init(), gdb_printf(), gdb_program_name, gdb_stderr, gdb_stdin, gdb_stdout, gdb_stdtarg, gdb_stdtargerr, gdb_stdtargin, gdb_sysroot, get_earlyinit_files(), get_init_files(), global_auto_load, inhibit_gdbinit, init_history(), INTERP_CONSOLE, INTERP_INSIGHT, INTERP_TUI, interpreter_p, captured_main_args::interpreter_p, lim_at_start, load_auto_scripts_for_objfile(), main_ui, program_space::objfiles(), PACKAGE, perror_warning_with_name(), print_gdb_configuration(), print_gdb_help(), print_gdb_version(), python_libdir, PYTHON_LIBDIR_RELOCATABLE, quit_force(), rate, readnever_symbol_files, readnow_symbol_files, relocate_gdb_directory(), remote_timeout, return_child_result, inferior::set_args(), set_gdb_data_directory(), set_per_command_space(), set_per_command_time(), set_top_level_interpreter(), inferior::set_tty(), source_script(), symbol_file_add_main_adapter(), TARGET_SYSROOT_PREFIX, TARGET_SYSTEM_ROOT, TARGET_SYSTEM_ROOT_RELOCATABLE, validate_readnow_readnever(), warning_pre_print, windows_get_absolute_argv0(), WITH_PYTHON_LIBDIR, and write_files.
Referenced by captured_main().
|
static |
Definition at line 505 of file main.c.
References bpstat_do_actions(), current_ui, handle_command_errors(), maybe_wait_sync_command_done(), PROMPT_BLOCKED, ui::prompt_state, and quit_force().
Referenced by captured_main_1(), and execute_cmdargs().
|
static |
Definition at line 602 of file main.c.
References batch_flag, catch_command_errors(), execute_command(), and source_script().
Referenced by captured_main_1().
int gdb_main | ( | struct captured_main_args * | args | ) |
Definition at line 1339 of file main.c.
References captured_main(), exception_print(), and gdb_stderr.
Referenced by main().
|
static |
Definition at line 380 of file main.c.
References GDBEARLYINIT.
Referenced by captured_main_1(), and print_gdb_help().
const char * get_gdb_program_name | ( | void | ) |
Definition at line 101 of file main.c.
References gdb_program_name.
|
static |
Definition at line 358 of file main.c.
References GDBINIT, SYSTEM_GDBINIT, SYSTEM_GDBINIT_DIR, SYSTEM_GDBINIT_DIR_RELOCATABLE, and SYSTEM_GDBINIT_RELOCATABLE.
Referenced by captured_main_1(), and print_gdb_help().
|
static |
Definition at line 482 of file main.c.
References async_enable_stdin(), exception_print(), and gdb_stderr.
Referenced by catch_command_errors().
|
static |
Definition at line 1361 of file main.c.
References file_name_style, gdb_printf(), gdb_puts(), gdb_stdout, get_earlyinit_files(), get_init_files(), REPORT_BUGS_TO, cli_style_option::style(), and styled_string().
Referenced by captured_main_1().
|
static |
Definition at line 192 of file main.c.
References GDB_DATADIR, gdb_datadir, gdb_datadir_provided, gdb_program_name, and relocate_path().
Referenced by gdb_initfile_finder::gdb_initfile_finder().
std::string relocate_gdb_directory | ( | const char * | initial, |
bool | relocatable ) |
Definition at line 160 of file main.c.
References gdb_program_name, and relocate_path().
Referenced by captured_main_1().
|
static |
Definition at line 140 of file main.c.
References BINDIR.
Referenced by relocate_file_path_maybe_in_datadir(), and relocate_gdb_directory().
void set_gdb_data_directory | ( | const char * | new_datadir | ) |
Definition at line 113 of file main.c.
References file_name_style, gdb_datadir, cli_style_option::style(), styled_string(), and warning_filename_and_errno().
Referenced by captured_main_1(), and set_gdb_datadir().
|
static |
Definition at line 395 of file main.c.
References after_char_processing_hook, async_enable_stdin(), current_ui, exception_print(), gdb_stderr, interp::on_command_error(), PROMPT_NEEDED, ui::prompt_state, SWITCH_THRU_ALL_UIS, and top_level_interpreter().
Referenced by captured_command_loop().
|
static |
Definition at line 537 of file main.c.
References symbol_file_add_main(), and SYMFILE_VERBOSE.
Referenced by captured_main_1().
|
static |
Definition at line 550 of file main.c.
References gdb_program_name, readnever_symbol_files, and readnow_symbol_files.
Referenced by add_symbol_file_command(), captured_main_1(), and symbol_file_command().
int batch_flag = 0 |
Definition at line 84 of file main.c.
Referenced by captured_main_1(), execute_cmdargs(), init_page_info(), ui::input_interactive_p(), pager_file::puts(), set_batch_flag_and_restore_page_info::set_batch_flag_and_restore_page_info(), and set_batch_flag_and_restore_page_info::~set_batch_flag_and_restore_page_info().
int batch_silent = 0 |
Definition at line 87 of file main.c.
Referenced by captured_main_1().
std::string gdb_datadir |
GDB datadir, used to store data files.
Definition at line 67 of file main.c.
Referenced by auto_load_expand_dir_vars(), captured_main_1(), init_main(), relocate_file_path_maybe_in_datadir(), set_gdb_data_directory(), set_gdb_datadir(), and show_gdb_datadir().
|
static |
Definition at line 72 of file main.c.
Referenced by captured_main_1(), and relocate_file_path_maybe_in_datadir().
|
static |
Definition at line 97 of file main.c.
Referenced by captured_main_1(), get_gdb_program_name(), relocate_file_path_maybe_in_datadir(), relocate_gdb_directory(), and validate_readnow_readnever().
struct ui_file* gdb_stdtarg |
Definition at line 80 of file main.c.
Referenced by captured_main_1(), do_monitor_command(), execute_fn_to_ui_file(), gdb_os_flush_stdout(), gdb_os_write_stdout(), interpreter_exec_cmd(), remote_console_output(), remote_fileio_func_write(), mi_interp::resume(), cli_interp_base::set_logging(), and tui_setup_io().
struct ui_file* gdb_stdtargerr |
Definition at line 81 of file main.c.
Referenced by captured_main_1(), execute_fn_to_ui_file(), gdb_os_flush_stderr(), gdb_os_write_stderr(), interpreter_exec_cmd(), remote_fileio_func_write(), mi_interp::resume(), cli_interp_base::set_logging(), and tui_setup_io().
struct ui_file* gdb_stdtargin |
Definition at line 79 of file main.c.
Referenced by captured_main_1(), and remote_fileio_func_read().
std::string gdb_sysroot |
System root path, used to find libraries etc.
Definition at line 64 of file main.c.
Referenced by build_id_to_bfd_suffix(), captured_main_1(), exec_file_find(), remote_target::filesystem_is_local(), find_separate_debug_file(), gdb_sysroot_changed(), gdbsim_target_open(), and solib_find_1().
std::string interpreter_p |
The name of the interpreter if specified on the command line.
Definition at line 61 of file main.c.
Referenced by captured_main_1(), and interp_set().
std::string python_libdir |
If not empty, the possibly relocated path to python's "lib" directory specified with –with-python.
Definition at line 76 of file main.c.
Referenced by captured_main_1().
int return_child_result = 0 |
Definition at line 92 of file main.c.
Referenced by captured_main_1(), and quit_force().
int return_child_result_value = -1 |
Definition at line 93 of file main.c.
Referenced by handle_inferior_event(), and quit_force().