GDB (xrefs)
Classes | Defines | Enumerations | Functions | Variables
/home/stan/gdb/src/gdb/solib-svr4.c File Reference
#include "defs.h"
#include "elf/external.h"
#include "elf/common.h"
#include "elf/mips.h"
#include "symtab.h"
#include "bfd.h"
#include "symfile.h"
#include "objfiles.h"
#include "gdbcore.h"
#include "target.h"
#include "inferior.h"
#include "regcache.h"
#include "gdbthread.h"
#include "observer.h"
#include "gdb_assert.h"
#include "solist.h"
#include "solib.h"
#include "solib-svr4.h"
#include "bfd-target.h"
#include "elf-bfd.h"
#include "exec.h"
#include "auxv.h"
#include "exceptions.h"
#include "gdb_bfd.h"
#include "probe.h"

Go to the source code of this file.

Classes

struct  lm_info
struct  probe_info
struct  svr4_info
struct  svr4_library_list
struct  probe_and_action
struct  solib_svr4_ops

Defines

#define NUM_PROBES   ARRAY_SIZE (probe_info)

Enumerations

enum  probe_action { PROBES_INTERFACE_FAILED, DO_NOTHING, FULL_RELOAD, UPDATE_OR_RELOAD }

Functions

static struct link_map_offsetssvr4_fetch_link_map_offsets (void)
static int svr4_have_link_map_offsets (void)
static void svr4_relocate_main_executable (void)
static void svr4_free_library_list (void *p_list)
static int svr4_same_1 (const char *gdb_so_name, const char *inferior_so_name)
static int svr4_same (struct so_list *gdb, struct so_list *inferior)
static struct lm_infolm_info_read (CORE_ADDR lm_addr)
static int has_lm_dynamic_from_link_map (void)
static CORE_ADDR lm_addr_check (const struct so_list *so, bfd *abfd)
static void free_probes_table (struct svr4_info *info)
static void free_solib_list (struct svr4_info *info)
static void svr4_pspace_data_cleanup (struct program_space *pspace, void *arg)
static struct svr4_infoget_svr4_info (void)
static int match_main (const char *)
static gdb_byteread_program_header (int type, int *p_sect_size, int *p_arch_size)
static char * find_program_interpreter (void)
static int scan_dyntag (int dyntag, bfd *abfd, CORE_ADDR *ptr)
static int scan_dyntag_auxv (int dyntag, CORE_ADDR *ptr)
static CORE_ADDR elf_locate_base (void)
static CORE_ADDR locate_base (struct svr4_info *info)
static CORE_ADDR solib_svr4_r_map (struct svr4_info *info)
static CORE_ADDR solib_svr4_r_brk (struct svr4_info *info)
static CORE_ADDR solib_svr4_r_ldsomap (struct svr4_info *info)
static int svr4_keep_data_in_core (CORE_ADDR vaddr, unsigned long size)
static int open_symbol_file_object (void *from_ttyp)
static void svr4_free_so (struct so_list *so)
static void svr4_clear_so (struct so_list *so)
static struct so_listsvr4_copy_library_list (struct so_list *src)
static int svr4_current_sos_via_xfer_libraries (struct svr4_library_list *list, const char *annex)
static struct so_listsvr4_default_sos (void)
static int svr4_read_so_list (CORE_ADDR lm, CORE_ADDR prev_lm, struct so_list ***link_ptr_ptr, int ignore_first)
static struct so_listsvr4_current_sos_direct (struct svr4_info *info)
static struct so_listsvr4_current_sos (void)
CORE_ADDR svr4_fetch_objfile_link_map (struct objfile *objfile)
int svr4_in_dynsym_resolve_code (CORE_ADDR pc)
static CORE_ADDR exec_entry_point (struct bfd *abfd, struct target_ops *targ)
static hashval_t hash_probe_and_action (const void *p)
static int equal_probe_and_action (const void *p1, const void *p2)
static void register_solib_event_probe (struct probe *probe, enum probe_action action)
static struct probe_and_actionsolib_event_probe_at (struct svr4_info *info, CORE_ADDR address)
static enum probe_action solib_event_probe_action (struct probe_and_action *pa)
static int solist_update_full (struct svr4_info *info)
static int solist_update_incremental (struct svr4_info *info, CORE_ADDR lm)
static void disable_probes_interface_cleanup (void *arg)
static void svr4_handle_solib_event (void)
static int svr4_update_solib_event_breakpoint (struct breakpoint *b, void *arg)
static void svr4_update_solib_event_breakpoints (void)
static void svr4_create_probe_breakpoints (struct gdbarch *gdbarch, VEC(probe_p)**probes)
static void svr4_create_solib_event_breakpoints (struct gdbarch *gdbarch, CORE_ADDR address)
static int cmp_name_and_sec_flags (asymbol *sym, void *data)
static int enable_break (struct svr4_info *info, int from_tty)
static void svr4_special_symbol_handling (void)
static gdb_byteread_program_headers_from_bfd (bfd *abfd, int *phdrs_size)
static int svr4_exec_displacement (CORE_ADDR *displacementp)
static void svr4_solib_create_inferior_hook (int from_tty)
static void svr4_clear_solib (void)
static CORE_ADDR svr4_truncate_ptr (CORE_ADDR addr)
static void svr4_relocate_section_addresses (struct so_list *so, struct target_section *sec)
static void * solib_svr4_init (struct obstack *obstack)
void set_solib_svr4_fetch_link_map_offsets (struct gdbarch *gdbarch, struct link_map_offsets *(*flmo)(void))
struct link_map_offsetssvr4_ilp32_fetch_link_map_offsets (void)
struct link_map_offsetssvr4_lp64_fetch_link_map_offsets (void)
static struct symbolelf_lookup_lib_symbol (const struct objfile *objfile, const char *name, const domain_enum domain)
void _initialize_svr4_solib (void)

Variables

static const char *const solib_break_names []
static const char *const bkpt_names []
static const char *const main_name_list []
static struct probe_info probe_info []
static struct program_space_data * solib_svr4_pspace_data
static struct gdbarch_datasolib_svr4_data
struct target_so_ops svr4_so_ops
initialize_file_ftype _initialize_svr4_solib

Define Documentation

#define NUM_PROBES   ARRAY_SIZE (probe_info)

Enumeration Type Documentation

Enumerator:
PROBES_INTERFACE_FAILED 
DO_NOTHING 
FULL_RELOAD 
UPDATE_OR_RELOAD 

Definition at line 113 of file solib-svr4.c.


Function Documentation

void _initialize_svr4_solib ( void  )
static int cmp_name_and_sec_flags ( asymbol *  sym,
void *  data 
) [static]

Definition at line 2056 of file solib-svr4.c.

Referenced by enable_break().

static void disable_probes_interface_cleanup ( void *  arg) [static]

Definition at line 1754 of file solib-svr4.c.

References _, free_probes_table(), free_solib_list(), get_svr4_info(), and warning().

Referenced by svr4_handle_solib_event().

static CORE_ADDR elf_locate_base ( void  ) [static]
static struct symbol* elf_lookup_lib_symbol ( const struct objfile objfile,
const char *  name,
const domain_enum  domain 
) [static, read]
static int enable_break ( struct svr4_info info,
int  from_tty 
) [static]
static int equal_probe_and_action ( const void *  p1,
const void *  p2 
) [static]

Definition at line 1594 of file solib-svr4.c.

References probe::address, and probe_and_action::probe.

Referenced by register_solib_event_probe().

static CORE_ADDR exec_entry_point ( struct bfd *  abfd,
struct target_ops targ 
) [static]
static char* find_program_interpreter ( void  ) [static]

Definition at line 592 of file solib-svr4.c.

References exec_bfd, read_program_header(), and xmalloc().

Referenced by enable_break().

static void free_probes_table ( struct svr4_info info) [static]
static void free_solib_list ( struct svr4_info info) [static]
static struct svr4_info* get_svr4_info ( void  ) [static, read]
static int has_lm_dynamic_from_link_map ( void  ) [static]

Definition at line 235 of file solib-svr4.c.

References link_map_offsets::l_ld_offset, and svr4_fetch_link_map_offsets().

Referenced by lm_addr_check().

static hashval_t hash_probe_and_action ( const void *  p) [static]

Definition at line 1583 of file solib-svr4.c.

References probe::address, and probe_and_action::probe.

Referenced by register_solib_event_probe().

static CORE_ADDR lm_addr_check ( const struct so_list so,
bfd *  abfd 
) [static]
static struct lm_info* lm_info_read ( CORE_ADDR  lm_addr) [static, read]
static CORE_ADDR locate_base ( struct svr4_info info) [static]
static int match_main ( const char *  soname) [static]

Definition at line 1518 of file solib-svr4.c.

References main_name_list.

Referenced by svr4_read_so_list().

static int open_symbol_file_object ( void *  from_ttyp) [static]
static gdb_byte* read_program_header ( int  type,
int p_sect_size,
int p_arch_size 
) [static]
static gdb_byte* read_program_headers_from_bfd ( bfd *  abfd,
int phdrs_size 
) [static]

Definition at line 2395 of file solib-svr4.c.

References xfree(), and xmalloc().

Referenced by svr4_exec_displacement().

static void register_solib_event_probe ( struct probe probe,
enum probe_action  action 
) [static]
static int scan_dyntag ( int  dyntag,
bfd *  abfd,
CORE_ADDR ptr 
) [static]
static int scan_dyntag_auxv ( int  dyntag,
CORE_ADDR ptr 
) [static]
void set_solib_svr4_fetch_link_map_offsets ( struct gdbarch gdbarch,
struct link_map_offsets *(*)(void)  flmo 
)
static enum probe_action solib_event_probe_action ( struct probe_and_action pa) [static]
static struct probe_and_action* solib_event_probe_at ( struct svr4_info info,
CORE_ADDR  address 
) [static, read]
static void* solib_svr4_init ( struct obstack *  obstack) [static]

Definition at line 2953 of file solib-svr4.c.

References solib_svr4_ops::fetch_link_map_offsets, and OBSTACK_ZALLOC.

Referenced by _initialize_svr4_solib().

static CORE_ADDR solib_svr4_r_brk ( struct svr4_info info) [static]
static CORE_ADDR solib_svr4_r_ldsomap ( struct svr4_info info) [static]
static CORE_ADDR solib_svr4_r_map ( struct svr4_info info) [static]
static int solist_update_full ( struct svr4_info info) [static]
static int solist_update_incremental ( struct svr4_info info,
CORE_ADDR  lm 
) [static]
static void svr4_clear_so ( struct so_list so) [static]

Definition at line 1064 of file solib-svr4.c.

References lm_info::l_addr_p, and so_list::lm_info.

Referenced by _initialize_svr4_solib().

static void svr4_clear_solib ( void  ) [static]
static struct so_list* svr4_copy_library_list ( struct so_list src) [static, read]

Definition at line 1089 of file solib-svr4.c.

References so_list::lm_info, memcpy(), so_list::next, and xmalloc().

Referenced by svr4_current_sos().

static void svr4_create_probe_breakpoints ( struct gdbarch gdbarch,
VEC(probe_p)**  probes 
) [static]
static void svr4_create_solib_event_breakpoints ( struct gdbarch gdbarch,
CORE_ADDR  address 
) [static]
static struct so_list* svr4_current_sos ( void  ) [static, read]
static struct so_list* svr4_current_sos_direct ( struct svr4_info info) [static, read]
static int svr4_current_sos_via_xfer_libraries ( struct svr4_library_list list,
const char *  annex 
) [static]

Definition at line 1266 of file solib-svr4.c.

Referenced by solist_update_incremental(), and svr4_current_sos_direct().

static struct so_list* svr4_default_sos ( void  ) [static, read]
static int svr4_exec_displacement ( CORE_ADDR displacementp) [static]
static struct link_map_offsets * svr4_fetch_link_map_offsets ( void  ) [static, read]
static void svr4_free_library_list ( void *  p_list) [static]

Definition at line 1073 of file solib-svr4.c.

References free_so(), and so_list::next.

Referenced by free_solib_list(), and svr4_current_sos_direct().

static void svr4_free_so ( struct so_list so) [static]

Definition at line 1056 of file solib-svr4.c.

References so_list::lm_info, and xfree().

Referenced by _initialize_svr4_solib().

static void svr4_handle_solib_event ( void  ) [static]
static int svr4_have_link_map_offsets ( void  ) [static]
static int svr4_keep_data_in_core ( CORE_ADDR  vaddr,
unsigned long  size 
) [static]
static void svr4_pspace_data_cleanup ( struct program_space pspace,
void *  arg 
) [static]

Definition at line 408 of file solib-svr4.c.

References free_probes_table(), free_solib_list(), solib_svr4_pspace_data, and xfree().

Referenced by _initialize_svr4_solib().

static int svr4_read_so_list ( CORE_ADDR  lm,
CORE_ADDR  prev_lm,
struct so_list ***  link_ptr_ptr,
int  ignore_first 
) [static]
static void svr4_relocate_main_executable ( void  ) [static]
static void svr4_relocate_section_addresses ( struct so_list so,
struct target_section sec 
) [static]
static int svr4_same ( struct so_list gdb,
struct so_list inferior 
) [static]

Definition at line 189 of file solib-svr4.c.

References so_list::so_original_name, and svr4_same_1().

Referenced by _initialize_svr4_solib().

static int svr4_same_1 ( const char *  gdb_so_name,
const char *  inferior_so_name 
) [static]

Definition at line 164 of file solib-svr4.c.

Referenced by enable_break(), and svr4_same().

static void svr4_solib_create_inferior_hook ( int  from_tty) [static]
static void svr4_special_symbol_handling ( void  ) [static]

Definition at line 2386 of file solib-svr4.c.

Referenced by _initialize_svr4_solib().

static CORE_ADDR svr4_truncate_ptr ( CORE_ADDR  addr) [static]

Definition at line 2917 of file solib-svr4.c.

References gdbarch_ptr_bit(), and target_gdbarch().

Referenced by svr4_relocate_section_addresses().

static int svr4_update_solib_event_breakpoint ( struct breakpoint b,
void *  arg 
) [static]
static void svr4_update_solib_event_breakpoints ( void  ) [static]

Variable Documentation

Referenced by initialize_all_files().

const char* const bkpt_names[] [static]
Initial value:
{
  "_start",
  "__start",
  "main",
  NULL
}

Definition at line 97 of file solib-svr4.c.

Referenced by enable_break().

const char* const main_name_list[] [static]
Initial value:
{
  "main_$main",
  NULL
}

Definition at line 105 of file solib-svr4.c.

Referenced by match_main().

struct probe_info probe_info[] [static]
Initial value:
{
  { "init_start", DO_NOTHING },
  { "init_complete", FULL_RELOAD },
  { "map_start", DO_NOTHING },
  { "map_failed", DO_NOTHING },
  { "reloc_complete", UPDATE_OR_RELOAD },
  { "unmap_start", DO_NOTHING },
  { "unmap_complete", FULL_RELOAD },
}

Definition at line 147 of file solib-svr4.c.

const char* const solib_break_names[] [static]
Initial value:
{
  "r_debug_state",
  "_r_debug_state",
  "_dl_debug_state",
  "rtld_db_dlactivity",
  "__dl_rtld_db_dlactivity",
  "_rtld_debug_state",

  NULL
}

Definition at line 85 of file solib-svr4.c.

Referenced by enable_break().

struct gdbarch_data* solib_svr4_data [static]

Definition at line 2942 of file solib-svr4.c.

struct program_space_data* solib_svr4_pspace_data [static]
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines