GDB (xrefs)
Loading...
Searching...
No Matches
Classes | Enumerations | Functions | Variables
exec.c File Reference
#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_rangesection_table_available_memory (CORE_ADDR memaddr, ULONGEST len, const target_section_table &sections)
 
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 &sections, 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
 

Enumeration Type Documentation

◆ exec_file_mismatch_mode

Enumerator
exec_file_mismatch_ask 
exec_file_mismatch_warn 
exec_file_mismatch_off 

Definition at line 93 of file exec.c.

Function Documentation

◆ _initialize_exec()

void _initialize_exec ( )

Definition at line 1066 of file exec.c.

Referenced by initialize_all_files().

◆ build_section_table()

target_section_table build_section_table ( struct bfd * some_bfd)

◆ exec_file_attach()

void exec_file_attach ( const char * filename,
int from_tty )

◆ exec_file_command()

static void exec_file_command ( const char * args,
int from_tty )
static

Definition at line 525 of file exec.c.

References inferior::args(), exec_file_attach(), query(), and target_has_execution().

Referenced by file_command().

◆ exec_file_locate_attach()

void exec_file_locate_attach ( int pid,
int defer_bp_reset,
int from_tty )

◆ exec_on_vfork()

void exec_on_vfork ( inferior * vfork_child)

◆ exec_read_partial_read_only()

enum target_xfer_status exec_read_partial_read_only ( gdb_byte * readbuf,
ULONGEST offset,
ULONGEST len,
ULONGEST * xfered_len )

◆ exec_set_section_address()

void exec_set_section_address ( const char * filename,
int index,
CORE_ADDR address )

◆ exec_target_open()

static void exec_target_open ( const char * args,
int from_tty )
static

Definition at line 144 of file exec.c.

References exec_file_attach(), and target_preopen().

◆ file_command()

static void file_command ( const char * arg,
int from_tty )
static

Definition at line 558 of file exec.c.

References deprecated_file_changed_hook, exec_file_command(), and symbol_file_command().

◆ print_section_info()

void print_section_info ( const target_section_table * t,
bfd * abfd )

◆ section_table_available_memory()

static std::vector< mem_range > section_table_available_memory ( CORE_ADDR memaddr,
ULONGEST len,
const target_section_table & sections )
static

Definition at line 747 of file exec.c.

References mem_ranges_overlap().

Referenced by section_table_read_available_memory().

◆ section_table_read_available_memory()

enum target_xfer_status section_table_read_available_memory ( gdb_byte * readbuf,
ULONGEST offset,
ULONGEST len,
ULONGEST * xfered_len )

◆ section_table_xfer_memory_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 )

◆ set_exec_file_mismatch_command()

static void set_exec_file_mismatch_command ( const char * ignore,
int from_tty,
struct cmd_list_element * c )
static

◆ set_section_command()

static void set_section_command ( const char * args,
int from_tty )
static

◆ show_exec_file_mismatch_command()

static void show_exec_file_mismatch_command ( struct ui_file * file,
int from_tty,
struct cmd_list_element * c,
const char * value )
static

Definition at line 103 of file exec.c.

References exec_file_mismatch_names, and gdb_printf().

◆ show_write_files()

static void show_write_files ( struct ui_file * file,
int from_tty,
struct cmd_list_element * c,
const char * value )
static

Definition at line 135 of file exec.c.

References gdb_printf().

◆ try_open_exec_file()

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().

◆ validate_exec_file()

void validate_exec_file ( int from_tty)

Variable Documentation

◆ deprecated_file_changed_hook

void(* deprecated_file_changed_hook) (const char *) ( const char * filename)

Definition at line 54 of file exec.c.

Referenced by file_command().

◆ exec_file_mismatch

const char* exec_file_mismatch = exec_file_mismatch_names[0]
static

Definition at line 97 of file exec.c.

Referenced by set_exec_file_mismatch_command().

◆ exec_file_mismatch_mode

Definition at line 98 of file exec.c.

◆ exec_file_mismatch_names

const char* const exec_file_mismatch_names[] = {"ask", "warn", "off", NULL }
static

◆ exec_ops

exec_target exec_ops
static

◆ exec_target_info

const target_info exec_target_info
static
Initial value:
= {
"exec",
N_("Local exec file"),
N_("Use an executable file as a target.\n\
Specify the filename of the executable file.")
}

Definition at line 56 of file exec.c.

Referenced by exec_target::info().

◆ write_files

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().