GDB (xrefs)
|
#include "defs.h"
#include "frame.h"
#include "inferior.h"
#include "target.h"
#include "gdbcmd.h"
#include "language.h"
#include "filenames.h"
#include "symfile.h"
#include "objfiles.h"
#include "completer.h"
#include "value.h"
#include "exec.h"
#include "observable.h"
#include "arch-utils.h"
#include "gdbthread.h"
#include "progspace.h"
#include "progspace-and-thread.h"
#include "gdb_bfd.h"
#include "gcore.h"
#include "source.h"
#include "build-id.h"
#include <fcntl.h>
#include "readline/tilde.h"
#include "gdbcore.h"
#include <ctype.h>
#include <sys/stat.h>
#include "solist.h"
#include <algorithm>
#include "gdbsupport/pathstuff.h"
#include "cli/cli-style.h"
#include "gdbsupport/buildargv.h"
Go to the source code of this file.
Classes | |
struct | exec_target |
Enumerations | |
enum | exec_file_mismatch_mode { exec_file_mismatch_ask , exec_file_mismatch_warn , exec_file_mismatch_off } |
Functions | |
static void | show_exec_file_mismatch_command (struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value) |
static void | set_exec_file_mismatch_command (const char *ignore, int from_tty, struct cmd_list_element *c) |
static void | show_write_files (struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value) |
static void | exec_target_open (const char *args, int from_tty) |
void | try_open_exec_file (const char *exec_file_host, struct inferior *inf, symfile_add_flags add_flags) |
void | validate_exec_file (int from_tty) |
void | exec_file_locate_attach (int pid, int defer_bp_reset, int from_tty) |
void | exec_file_attach (const char *filename, int from_tty) |
static void | exec_file_command (const char *args, int from_tty) |
static void | file_command (const char *arg, int from_tty) |
target_section_table | build_section_table (struct bfd *some_bfd) |
void | exec_on_vfork (inferior *vfork_child) |
enum target_xfer_status | exec_read_partial_read_only (gdb_byte *readbuf, ULONGEST offset, ULONGEST len, ULONGEST *xfered_len) |
static std::vector< mem_range > | section_table_available_memory (CORE_ADDR memaddr, ULONGEST len, const target_section_table §ions) |
enum target_xfer_status | section_table_read_available_memory (gdb_byte *readbuf, ULONGEST offset, ULONGEST len, ULONGEST *xfered_len) |
enum target_xfer_status | section_table_xfer_memory_partial (gdb_byte *readbuf, const gdb_byte *writebuf, ULONGEST offset, ULONGEST len, ULONGEST *xfered_len, const target_section_table §ions, gdb::function_view< bool(const struct target_section *)> match_cb) |
void | print_section_info (const target_section_table *t, bfd *abfd) |
static void | set_section_command (const char *args, int from_tty) |
void | exec_set_section_address (const char *filename, int index, CORE_ADDR address) |
void | _initialize_exec () |
Variables | |
void(* | deprecated_file_changed_hook )(const char *) |
static const target_info | exec_target_info |
static exec_target | exec_ops |
static const char *const | exec_file_mismatch_names [] = {"ask", "warn", "off", NULL } |
static const char * | exec_file_mismatch = exec_file_mismatch_names[0] |
static enum exec_file_mismatch_mode | exec_file_mismatch_mode = exec_file_mismatch_ask |
bool | write_files = false |
void _initialize_exec | ( | ) |
Definition at line 1066 of file exec.c.
Referenced by initialize_all_files().
target_section_table build_section_table | ( | struct bfd * | some_bfd | ) |
Definition at line 572 of file exec.c.
References gdb_bfd_sections().
Referenced by core_target::core_target(), exec_file_attach(), record_full_core_open_1(), and solib_map_sections().
void exec_file_attach | ( | const char * | filename, |
int | from_tty ) |
Definition at line 365 of file exec.c.
References program_space::add_target_sections(), build_section_table(), current_program_space, deprecated_exec_file_display_hook, program_space::ebfd, program_space::ebfd_mtime, program_space::exec_bfd(), program_space::exec_close(), program_space::exec_filename, gdb::observers::executable_changed, gdb_bfd_errmsg(), gdb_bfd_fopen(), gdb_bfd_open(), gdb_printf(), gnutarget, is_target_filename(), O_BINARY, openp(), OPF_TRY_CWD_FIRST, program_space::set_exec_bfd(), set_gdbarch_from_file(), target_filesystem_is_local(), TARGET_SYSROOT_PREFIX, validate_files(), and write_files.
Referenced by add_inferior_command(), captured_main_1(), clone_program_space(), exec_file_command(), exec_target_open(), locate_exec_from_corefile_build_id(), reopen_exec_file(), try_open_exec_file(), and validate_exec_file().
|
static |
Definition at line 525 of file exec.c.
References inferior::args(), exec_file_attach(), query(), and target_has_execution().
Referenced by file_command().
void exec_file_locate_attach | ( | int | pid, |
int | defer_bp_reset, | ||
int | from_tty ) |
Definition at line 314 of file exec.c.
References current_inferior(), exec_file_find(), get_exec_file(), pid, SYMFILE_DEFER_BP_RESET, SYMFILE_VERBOSE, target_pid_to_exec_file(), and try_open_exec_file().
Referenced by remote_target::remote_add_inferior(), and setup_inferior().
void exec_on_vfork | ( | inferior * | vfork_child | ) |
Definition at line 687 of file exec.c.
References exec_ops, inferior::pspace, inferior::push_target(), program_space::target_sections(), and inferior::vfork_child.
Referenced by follow_fork_inferior().
enum target_xfer_status exec_read_partial_read_only | ( | gdb_byte * | readbuf, |
ULONGEST | offset, | ||
ULONGEST | len, | ||
ULONGEST * | xfered_len ) |
Definition at line 696 of file exec.c.
References current_program_space, program_space::exec_bfd(), size, TARGET_XFER_E_IO, TARGET_XFER_EOF, and TARGET_XFER_OK.
Referenced by section_table_read_available_memory(), and tfile_target::xfer_partial().
void exec_set_section_address | ( | const char * | filename, |
int | index, | ||
CORE_ADDR | address ) |
Definition at line 1030 of file exec.c.
References current_program_space, and program_space::target_sections().
Referenced by default_symfile_offsets(), objfile_relocate1(), and svr4_relocate_main_executable().
|
static |
Definition at line 144 of file exec.c.
References exec_file_attach(), and target_preopen().
|
static |
Definition at line 558 of file exec.c.
References deprecated_file_changed_hook, exec_file_command(), and symbol_file_command().
void print_section_info | ( | const target_section_table * | t, |
bfd * | abfd ) |
Definition at line 910 of file exec.c.
References current_program_space, program_space::exec_bfd(), file_name_style, gdb_printf(), gdb_stdout, gdbarch_addr_bit(), gdbarch_addr_bits_remove(), gdbarch_from_bfd(), info_verbose, paddress(), cli_style_option::style(), and styled_string().
Referenced by core_target::files_info(), and exec_target::files_info().
|
static |
Definition at line 747 of file exec.c.
References mem_ranges_overlap().
Referenced by section_table_read_available_memory().
enum target_xfer_status section_table_read_available_memory | ( | gdb_byte * | readbuf, |
ULONGEST | offset, | ||
ULONGEST | len, | ||
ULONGEST * | xfered_len ) |
Definition at line 779 of file exec.c.
References current_inferior(), exec_read_partial_read_only(), mem_ranges_overlap(), normalize_mem_ranges(), section_table_available_memory(), status, target_get_section_table(), TARGET_XFER_UNAVAILABLE, and inferior::top_target().
Referenced by tfile_target::xfer_partial().
enum target_xfer_status section_table_xfer_memory_partial | ( | gdb_byte * | readbuf, |
const gdb_byte * | writebuf, | ||
ULONGEST | offset, | ||
ULONGEST | len, | ||
ULONGEST * | xfered_len, | ||
const target_section_table & | sections, | ||
gdb::function_view< bool(const struct target_section *)> | match_cb ) |
Definition at line 819 of file exec.c.
References TARGET_XFER_EOF, and TARGET_XFER_OK.
Referenced by memory_xfer_partial_1(), core_target::xfer_memory_via_mappings(), core_target::xfer_partial(), exec_target::xfer_partial(), and target_bfd::xfer_partial().
|
static |
Definition at line 113 of file exec.c.
References exec_file_mismatch, exec_file_mismatch_ask, exec_file_mismatch_names, and exec_file_mismatch_off.
|
static |
Definition at line 994 of file exec.c.
References current_program_space, exec_ops, exec_target::files_info(), parse_and_eval_address(), and program_space::target_sections().
|
static |
Definition at line 103 of file exec.c.
References exec_file_mismatch_names, and gdb_printf().
|
static |
Definition at line 135 of file exec.c.
References gdb_printf().
void try_open_exec_file | ( | const char * | exec_file_host, |
struct inferior * | inf, | ||
symfile_add_flags | add_flags ) |
Definition at line 166 of file exec.c.
References err, exec_file_attach(), symbol_file_add_main(), and SYMFILE_VERBOSE.
Referenced by exec_file_locate_attach(), and follow_exec().
void validate_exec_file | ( | int | from_tty | ) |
Definition at line 213 of file exec.c.
References build_id_bfd_get(), current_inferior(), current_program_space, err, program_space::exec_bfd(), exec_file_attach(), exec_file_mismatch_ask, exec_file_mismatch_names, exec_file_mismatch_off, file_name_style, gdb_bfd_open(), get_exec_file(), gnutarget, is_target_filename(), inf::pid, reopen_exec_file(), cli_style_option::style(), styled_string(), symbol_file_add_main(), SYMFILE_ALWAYS_CONFIRM, SYMFILE_MAINLINE, SYMFILE_VERBOSE, target_filesystem_is_local(), target_pid_to_exec_file(), and TARGET_SYSROOT_PREFIX.
Referenced by attach_command(), and remote_target::remote_add_inferior().
void(* deprecated_file_changed_hook) (const char *) | ( | const char * | filename | ) |
Definition at line 54 of file exec.c.
Referenced by file_command().
|
static |
Definition at line 97 of file exec.c.
Referenced by set_exec_file_mismatch_command().
|
static |
Definition at line 91 of file exec.c.
Referenced by set_exec_file_mismatch_command(), show_exec_file_mismatch_command(), and validate_exec_file().
|
static |
Definition at line 86 of file exec.c.
Referenced by program_space::add_target_sections(), exec_on_vfork(), program_space::remove_target_sections(), and set_section_command().
|
static |
Definition at line 56 of file exec.c.
Referenced by exec_target::info().
bool write_files = false |
Definition at line 133 of file exec.c.
Referenced by bsd_kvm_target_open(), captured_main_1(), core_target_open(), and exec_file_attach().