GDB (xrefs)
Loading...
Searching...
No Matches
Macros | Typedefs | Functions | Variables
solib.c File Reference
#include "defs.h"
#include <sys/types.h>
#include <fcntl.h>
#include "symtab.h"
#include "bfd.h"
#include "build-id.h"
#include "symfile.h"
#include "objfiles.h"
#include "gdbcore.h"
#include "command.h"
#include "target.h"
#include "frame.h"
#include "gdbsupport/gdb_regex.h"
#include "inferior.h"
#include "gdbsupport/environ.h"
#include "language.h"
#include "gdbcmd.h"
#include "completer.h"
#include "elf/external.h"
#include "elf/common.h"
#include "filenames.h"
#include "exec.h"
#include "solist.h"
#include "observable.h"
#include "readline/tilde.h"
#include "remote.h"
#include "solib.h"
#include "interps.h"
#include "filesystem.h"
#include "gdb_bfd.h"
#include "gdbsupport/filestuff.h"
#include "gdbsupport/scoped_fd.h"
#include "debuginfod-support.h"
#include "source.h"
#include "cli/cli-style.h"
#include "solib-target.h"

Go to the source code of this file.

Macros

#define DOS_BASED_FILE_SYSTEM   0
 

Typedefs

typedef std::unordered_map< std::string, std::string > soname_build_id_map
 

Functions

static void show_solib_search_path (struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
 
static gdb::unique_xmalloc_ptr< char > solib_find_1 (const char *in_pathname, int *fd, bool is_solib)
 
gdb::unique_xmalloc_ptr< char > exec_file_find (const char *in_pathname, int *fd)
 
gdb::unique_xmalloc_ptr< char > solib_find (const char *in_pathname, int *fd)
 
gdb_bfd_ref_ptr solib_bfd_fopen (const char *pathname, int fd)
 
gdb_bfd_ref_ptr solib_bfd_open (const char *pathname)
 
void set_cbfd_soname_build_id (gdb_bfd_ref_ptr abfd, const char *soname, const bfd_build_id *build_id)
 
gdb::unique_xmalloc_ptr< char > get_cbfd_soname_build_id (gdb_bfd_ref_ptr abfd, const char *soname)
 
static int solib_map_sections (struct so_list *so)
 
static void clear_so (struct so_list *so)
 
void free_so (struct so_list *so)
 
bool solib_read_symbols (struct so_list *so, symfile_add_flags flags)
 
static bool solib_used (const struct so_list *const known)
 
void update_solib_list (int from_tty)
 
bool libpthread_name_p (const char *name)
 
static bool libpthread_solib_p (struct so_list *so)
 
void solib_add (const char *pattern, int from_tty, int readsyms)
 
static void info_sharedlibrary_command (const char *pattern, int from_tty)
 
bool solib_contains_address_p (const struct so_list *const solib, CORE_ADDR address)
 
const char * solib_name_from_address (struct program_space *pspace, CORE_ADDR address)
 
bool solib_keep_data_in_core (CORE_ADDR vaddr, unsigned long size)
 
void clear_solib (void)
 
void solib_create_inferior_hook (int from_tty)
 
bool in_solib_dynsym_resolve_code (CORE_ADDR pc)
 
static void sharedlibrary_command (const char *args, int from_tty)
 
void no_shared_libraries (const char *ignored, int from_tty)
 
void update_solib_breakpoints (void)
 
void handle_solib_event (void)
 
static void reload_shared_libraries_1 (int from_tty)
 
static void reload_shared_libraries (const char *ignored, int from_tty, struct cmd_list_element *e)
 
static void gdb_sysroot_changed (const char *ignored, int from_tty, struct cmd_list_element *e)
 
static void show_auto_solib_add (struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
 
CORE_ADDR gdb_bfd_lookup_symbol_from_symtab (bfd *abfd, int(*match_sym)(const asymbol *, const void *), const void *data)
 
int gdb_bfd_scan_elf_dyntag (const int desired_dyntag, bfd *abfd, CORE_ADDR *ptr, CORE_ADDR *ptr_addr)
 
gdb::unique_xmalloc_ptr< char > gdb_bfd_read_elf_soname (const char *filename)
 
static CORE_ADDR bfd_lookup_symbol_from_dyn_symtab (bfd *abfd, int(*match_sym)(const asymbol *, const void *), const void *data)
 
CORE_ADDR gdb_bfd_lookup_symbol (bfd *abfd, int(*match_sym)(const asymbol *, const void *), const void *data)
 
static void remove_user_added_objfile (struct objfile *objfile)
 
void _initialize_solib ()
 

Variables

bool debug_solib
 
static std::string solib_search_path
 
static const struct registry< bfd >::key< soname_build_id_mapcbfd_soname_build_id_data_key
 

Macro Definition Documentation

◆ DOS_BASED_FILE_SYSTEM

#define DOS_BASED_FILE_SYSTEM   0

Definition at line 79 of file solib.c.

Typedef Documentation

◆ soname_build_id_map

typedef std::unordered_map<std::string, std::string> soname_build_id_map

Definition at line 489 of file solib.c.

Function Documentation

◆ _initialize_solib()

void _initialize_solib ( )

Definition at line 1748 of file solib.c.

Referenced by initialize_all_files().

◆ bfd_lookup_symbol_from_dyn_symtab()

static CORE_ADDR bfd_lookup_symbol_from_dyn_symtab ( bfd *  abfd,
int(*)(const asymbol *, const void *)  match_sym,
const void *  data 
)
static

Definition at line 1678 of file solib.c.

Referenced by gdb_bfd_lookup_symbol().

◆ clear_so()

static void clear_so ( struct so_list so)
static

◆ clear_solib()

void clear_solib ( void  )

◆ exec_file_find()

gdb::unique_xmalloc_ptr< char > exec_file_find ( const char *  in_pathname,
int *  fd 
)

◆ free_so()

void free_so ( struct so_list so)

◆ gdb_bfd_lookup_symbol()

CORE_ADDR gdb_bfd_lookup_symbol ( bfd *  abfd,
int(*)(const asymbol *, const void *)  match_sym,
const void *  data 
)

◆ gdb_bfd_lookup_symbol_from_symtab()

CORE_ADDR gdb_bfd_lookup_symbol_from_symtab ( bfd *  abfd,
int(*)(const asymbol *, const void *)  match_sym,
const void *  data 
)

◆ gdb_bfd_read_elf_soname()

gdb::unique_xmalloc_ptr< char > gdb_bfd_read_elf_soname ( const char *  filename)

◆ gdb_bfd_scan_elf_dyntag()

int gdb_bfd_scan_elf_dyntag ( const int  desired_dyntag,
bfd *  abfd,
CORE_ADDR *  ptr,
CORE_ADDR *  ptr_addr 
)

◆ gdb_sysroot_changed()

static void gdb_sysroot_changed ( const char *  ignored,
int  from_tty,
struct cmd_list_element e 
)
static

Definition at line 1440 of file solib.c.

References gdb_sysroot, reload_shared_libraries(), and TARGET_SYSROOT_PREFIX.

◆ get_cbfd_soname_build_id()

gdb::unique_xmalloc_ptr< char > get_cbfd_soname_build_id ( gdb_bfd_ref_ptr  abfd,
const char *  soname 
)

Definition at line 518 of file solib.c.

References cbfd_soname_build_id_data_key, and registry< T >::get().

Referenced by solib_map_sections().

◆ handle_solib_event()

void handle_solib_event ( void  )

◆ in_solib_dynsym_resolve_code()

bool in_solib_dynsym_resolve_code ( CORE_ADDR  pc)

◆ info_sharedlibrary_command()

static void info_sharedlibrary_command ( const char *  pattern,
int  from_tty 
)
static

◆ libpthread_name_p()

bool libpthread_name_p ( const char *  name)

Definition at line 959 of file solib.c.

References name.

Referenced by libpthread_objfile_p(), and libpthread_solib_p().

◆ libpthread_solib_p()

static bool libpthread_solib_p ( struct so_list so)
static

Definition at line 968 of file solib.c.

References libpthread_name_p(), and so_list::so_name.

Referenced by reload_shared_libraries_1(), and solib_add().

◆ no_shared_libraries()

void no_shared_libraries ( const char *  ignored,
int  from_tty 
)

◆ reload_shared_libraries()

static void reload_shared_libraries ( const char *  ignored,
int  from_tty,
struct cmd_list_element e 
)
static

◆ reload_shared_libraries_1()

static void reload_shared_libraries_1 ( int  from_tty)
static

◆ remove_user_added_objfile()

static void remove_user_added_objfile ( struct objfile objfile)
static

◆ set_cbfd_soname_build_id()

void set_cbfd_soname_build_id ( gdb_bfd_ref_ptr  abfd,
const char *  soname,
const bfd_build_id *  build_id 
)

◆ sharedlibrary_command()

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

Definition at line 1265 of file solib.c.

References dont_repeat(), and solib_add().

◆ show_auto_solib_add()

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

Definition at line 1467 of file solib.c.

References gdb_printf().

◆ show_solib_search_path()

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

Definition at line 67 of file solib.c.

References gdb_printf().

◆ solib_add()

void solib_add ( const char *  pattern,
int  from_tty,
int  readsyms 
)

◆ solib_bfd_fopen()

gdb_bfd_ref_ptr solib_bfd_fopen ( const char *  pathname,
int  fd 
)

◆ solib_bfd_open()

gdb_bfd_ref_ptr solib_bfd_open ( const char *  pathname)

◆ solib_contains_address_p()

bool solib_contains_address_p ( const struct so_list *const  solib,
CORE_ADDR  address 
)

Definition at line 1168 of file solib.c.

References so_list::sections.

Referenced by disable_breakpoints_in_unloaded_shlib(), and solib_name_from_address().

◆ solib_create_inferior_hook()

void solib_create_inferior_hook ( int  from_tty)

◆ solib_find()

gdb::unique_xmalloc_ptr< char > solib_find ( const char *  in_pathname,
int *  fd 
)

◆ solib_find_1()

static gdb::unique_xmalloc_ptr< char > solib_find_1 ( const char *  in_pathname,
int *  fd,
bool  is_solib 
)
static

◆ solib_keep_data_in_core()

bool solib_keep_data_in_core ( CORE_ADDR  vaddr,
unsigned long  size 
)

Definition at line 1207 of file solib.c.

References gdbarch_so_ops(), target_so_ops::keep_data_in_core, size, and target_gdbarch().

Referenced by gcore_create_callback().

◆ solib_map_sections()

static int solib_map_sections ( struct so_list so)
static

◆ solib_name_from_address()

const char * solib_name_from_address ( struct program_space pspace,
CORE_ADDR  address 
)

◆ solib_read_symbols()

bool solib_read_symbols ( struct so_list so,
symfile_add_flags  flags 
)

◆ solib_used()

static bool solib_used ( const struct so_list *const  known)
static

◆ update_solib_breakpoints()

void update_solib_breakpoints ( void  )

Definition at line 1291 of file solib.c.

References gdbarch_so_ops(), target_gdbarch(), and target_so_ops::update_breakpoints.

Referenced by set_stop_on_solib_events().

◆ update_solib_list()

void update_solib_list ( int  from_tty)

Variable Documentation

◆ cbfd_soname_build_id_data_key

const struct registry< bfd >::key<soname_build_id_map> cbfd_soname_build_id_data_key
static

Definition at line 494 of file solib.c.

Referenced by get_cbfd_soname_build_id(), and set_cbfd_soname_build_id().

◆ debug_solib

bool debug_solib

Definition at line 60 of file solib.c.

◆ solib_search_path

std::string solib_search_path
static

Definition at line 65 of file solib.c.

Referenced by solib_find_1().