GDB (xrefs)

Classes | Macros | Typedefs | Enumerations | Functions | Variables
/tmp/gdb-8.1/gdb/solib-dsbt.c File Reference
`#include "defs.h"`
`#include "inferior.h"`
`#include "gdbcore.h"`
`#include "solib.h"`
`#include "solist.h"`
`#include "objfiles.h"`
`#include "symtab.h"`
`#include "language.h"`
`#include "command.h"`
`#include "gdbcmd.h"`
`#include "elf-bfd.h"`
`#include "gdb_bfd.h"`

Go to the source code of this file.

## Classes
struct | ext_elf32_dsbt_loadseg
struct | ext_elf32_dsbt_loadmap
struct | int_elf32_dsbt_loadseg
struct | int_elf32_dsbt_loadmap
struct | ext_elf32_dsbt_loadaddr
struct | ext_link_map
struct | lm_info_dsbt
struct | dsbt_info

## Macros
#define | GOT_MODULE_OFFSET 4

## Typedefs
typedef gdb_byte | ext_Elf32_Half[2]
typedef gdb_byte | ext_Elf32_Addr[4]
typedef gdb_byte | ext_Elf32_Word[4]
typedef gdb_byte | ext_ptr[4]

## Enumerations
enum | { TIC6X_PTR_SIZE = 4 }

## Functions
static void | dsbt_pspace_data_cleanup (struct program_space *pspace, void *arg)
static struct dsbt_info * | get_dsbt_info (void)
static void | dsbt_print_loadmap (struct int_elf32_dsbt_loadmap *map)
static struct int_elf32_dsbt_loadmap * | decode_loadmap (gdb_byte *buf)
static void | dsbt_get_initial_loadmaps (void)
static struct int_elf32_dsbt_loadmap * | fetch_loadmap (CORE_ADDR ldmaddr)
static void | dsbt_relocate_main_executable (void)
static int | enable_break (void)
static int | scan_dyntag (int dyntag, bfd *abfd, CORE_ADDR *ptr)
static int | open_symbol_file_object (int from_tty)
static CORE_ADDR | displacement_from_map (struct int_elf32_dsbt_loadmap *map, CORE_ADDR addr)
static CORE_ADDR | lm_base (void)
static struct so_list * | dsbt_current_sos (void)
static int | dsbt_in_dynsym_resolve_code (CORE_ADDR pc)
static void | enable_break_failure_warning (void)
static int | cmp_name (const asymbol *sym, const void *data)
static void | dsbt_solib_create_inferior_hook (int from_tty)
static void | dsbt_clear_solib (void)
static void | dsbt_free_so (struct so_list *so)
static void | dsbt_relocate_section_addresses (struct so_list *so, struct target_section *sec)
static void | show_dsbt_debug (struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
void | _initialize_dsbt_solib (void)

## Variables
static unsigned int | solib_dsbt_debug = 0
static const struct program_space_data * | solib_dsbt_pspace_data
struct target_so_ops | dsbt_so_ops

## Macro Definition Documentation

## ◆ GOT_MODULE_OFFSET

#define GOT_MODULE_OFFSET 4

Definition at line 33 of file solib-dsbt.c.

Referenced by lm_base().

## Typedef Documentation

## ◆ ext_Elf32_Addr

typedef gdb_byte ext_Elf32_Addr[4]

Definition at line 47 of file solib-dsbt.c.

## ◆ ext_Elf32_Half

typedef gdb_byte ext_Elf32_Half[2]

Definition at line 46 of file solib-dsbt.c.

## ◆ ext_Elf32_Word

typedef gdb_byte ext_Elf32_Word[4]

Definition at line 48 of file solib-dsbt.c.

## ◆ ext_ptr

typedef gdb_byte ext_ptr[4]

Definition at line 103 of file solib-dsbt.c.

## Enumeration Type Documentation

## ◆ anonymous enum

anonymous enum

Enumerator
TIC6X_PTR_SIZE |

Definition at line 39 of file solib-dsbt.c.

## Function Documentation

## ◆ _initialize_dsbt_solib()

void _initialize_dsbt_solib | ( | void |  | ) |

Definition at line 1052 of file solib-dsbt.c.

References _, add_setshow_zuinteger_cmd(), target_so_ops::bfd_open, class_maintenance, target_so_ops::clear_solib, target_so_ops::current_sos, dsbt_clear_solib(), dsbt_current_sos(), dsbt_free_so(), dsbt_in_dynsym_resolve_code(), dsbt_pspace_data_cleanup(), dsbt_relocate_section_addresses(), dsbt_so_ops, dsbt_solib_create_inferior_hook(), target_so_ops::free_so, target_so_ops::in_dynsym_resolve_code, target_so_ops::open_symbol_file_object, open_symbol_file_object(), target_so_ops::relocate_section_addresses, setdebuglist, show_dsbt_debug(), showdebuglist, solib_bfd_open(), target_so_ops::solib_create_inferior_hook, solib_dsbt_debug, and solib_dsbt_pspace_data.

## ◆ cmp_name()

static int cmp_name | ( | const asymbol * | sym,
|  | const void * | data
| ) |  |
| static

Definition at line 780 of file solib-dsbt.c.

Referenced by enable_break().

## ◆ decode_loadmap()

static struct int_elf32_dsbt_loadmap* decode_loadmap | ( | gdb_byte * | buf | ) |
| static

Definition at line 227 of file solib-dsbt.c.

References ext_elf32_dsbt_loadseg::addr, int_elf32_dsbt_loadseg::addr, extract_unsigned_integer(), gdbarch_byte_order(), ext_elf32_dsbt_loadmap::nsegs, int_elf32_dsbt_loadmap::nsegs, ext_elf32_dsbt_loadseg::p_memsz, int_elf32_dsbt_loadseg::p_memsz, ext_elf32_dsbt_loadseg::p_vaddr, int_elf32_dsbt_loadseg::p_vaddr, ext_elf32_dsbt_loadmap::segs, int_elf32_dsbt_loadmap::segs, target_gdbarch(), version, ext_elf32_dsbt_loadmap::version, int_elf32_dsbt_loadmap::version, xfree(), and xmalloc().

Referenced by dsbt_get_initial_loadmaps().

## ◆ displacement_from_map()

static CORE_ADDR displacement_from_map | ( | struct int_elf32_dsbt_loadmap * | map,
|  | CORE_ADDR | addr
| ) |  |
| static

Definition at line 523 of file solib-dsbt.c.

References int_elf32_dsbt_loadseg::addr, int_elf32_dsbt_loadmap::nsegs, int_elf32_dsbt_loadseg::p_memsz, int_elf32_dsbt_loadseg::p_vaddr, and int_elf32_dsbt_loadmap::segs.

Referenced by enable_break(), and lm_base().

## ◆ dsbt_clear_solib()

static void dsbt_clear_solib | ( | void |  | ) |
| static

Definition at line 1002 of file solib-dsbt.c.

References get_dsbt_info(), dsbt_info::lm_base_cache, dsbt_info::main_executable_lm_info, and dsbt_info::main_lm_addr.

Referenced by _initialize_dsbt_solib().

## ◆ dsbt_current_sos()

static struct so_list* dsbt_current_sos | ( | void |  | ) |
| static

Definition at line 628 of file solib-dsbt.c.

References _, core_bfd, dsbt_relocate_main_executable(), extract_unsigned_integer(), fetch_loadmap(), fprintf_unfiltered(), gdb_stdlog, gdbarch_byte_order(), get_dsbt_info(), hex_string_custom(), lm_addr(), lm_base(), so_list::lm_info, dsbt_info::main_executable_lm_info, dsbt_info::main_lm_addr, lm_info_dsbt::map, so_list::next, safe_strerror(), so_list::so_name, SO_NAME_MAX_PATH_SIZE, so_list::so_original_name, solib_dsbt_debug, target_gdbarch(), target_read_memory(), target_read_string(), warning(), XCNEW, and xfree().

Referenced by _initialize_dsbt_solib().

## ◆ dsbt_free_so()

static void dsbt_free_so | ( | struct so_list * | so | ) |
| static

Definition at line 1014 of file solib-dsbt.c.

References so_list::lm_info.

Referenced by _initialize_dsbt_solib().

## ◆ dsbt_get_initial_loadmaps()

static void dsbt_get_initial_loadmaps | ( | void |  | ) |
| static

Definition at line 293 of file solib-dsbt.c.

References _, current_target, decode_loadmap(), dsbt_print_loadmap(), error(), dsbt_info::exec_loadmap, get_dsbt_info(), dsbt_info::interp_loadmap, solib_dsbt_debug, TARGET_OBJECT_FDPIC, and target_read_alloc().

Referenced by dsbt_relocate_main_executable(), enable_break(), and lm_base().

## ◆ dsbt_in_dynsym_resolve_code()

static int dsbt_in_dynsym_resolve_code | ( | CORE_ADDR | pc | ) |
| static

Definition at line 757 of file solib-dsbt.c.

References get_dsbt_info(), in_plt_section(), interp_plt_sect_high, dsbt_info::interp_plt_sect_low, interp_text_sect_high, and dsbt_info::interp_text_sect_low.

Referenced by _initialize_dsbt_solib().

## ◆ dsbt_print_loadmap()

static void dsbt_print_loadmap | ( | struct int_elf32_dsbt_loadmap * | map | ) |
| static

Definition at line 199 of file solib-dsbt.c.

References _, int_elf32_dsbt_loadseg::addr, int_elf32_dsbt_loadmap::nsegs, int_elf32_dsbt_loadseg::p_memsz, int_elf32_dsbt_loadseg::p_vaddr, print_core_address(), printf_filtered(), int_elf32_dsbt_loadmap::segs, target_gdbarch(), and int_elf32_dsbt_loadmap::version.

Referenced by dsbt_get_initial_loadmaps().

## ◆ dsbt_pspace_data_cleanup()

static void dsbt_pspace_data_cleanup | ( | struct program_space * | pspace,
|  | void * | arg
| ) |  |
| static

Definition at line 170 of file solib-dsbt.c.

References xfree().

Referenced by _initialize_dsbt_solib().

## ◆ dsbt_relocate_main_executable()

static void dsbt_relocate_main_executable | ( | void |  | ) |
| static

Definition at line 920 of file solib-dsbt.c.

References int_elf32_dsbt_loadseg::addr, ALL_OBJFILE_OSECTIONS, ANOFFSET, do_cleanups(), dsbt_get_initial_loadmaps(), dsbt_info::exec_loadmap, get_dsbt_info(), dsbt_info::main_executable_lm_info, make_cleanup(), lm_info_dsbt::map, int_elf32_dsbt_loadmap::nsegs, obj_section_addr, objfile_relocate(), offset, section_offsets::offsets, int_elf32_dsbt_loadseg::p_memsz, int_elf32_dsbt_loadseg::p_vaddr, int_elf32_dsbt_loadmap::segs, symfile_objfile, XCNEWVEC, and xfree().

Referenced by dsbt_current_sos(), and dsbt_solib_create_inferior_hook().

## ◆ dsbt_relocate_section_addresses()

static void dsbt_relocate_section_addresses | ( | struct so_list * | so,
|  | struct target_section * | sec
| ) |  |
| static

Definition at line 1022 of file solib-dsbt.c.

References int_elf32_dsbt_loadseg::addr, target_section::addr, target_section::endaddr, so_list::lm_info, lm_info_dsbt::map, and int_elf32_dsbt_loadmap::segs.

Referenced by _initialize_dsbt_solib().

## ◆ dsbt_solib_create_inferior_hook()

static void dsbt_solib_create_inferior_hook | ( | int | from_tty | ) |
| static

Definition at line 988 of file solib-dsbt.c.

References _, dsbt_relocate_main_executable(), enable_break(), and warning().

Referenced by _initialize_dsbt_solib().

## ◆ enable_break()

static int enable_break | ( | void |  | ) |
| static

Definition at line 794 of file solib-dsbt.c.

References CATCH, cmp_name(), create_solib_event_breakpoint(), displacement_from_map(), dsbt_get_initial_loadmaps(), enable_break_failure_warning(), END_CATCH, exec_bfd, fprintf_unfiltered(), gdb_bfd_lookup_symbol(), gdb_stdlog, gdb::ref_ptr< T, Policy >::get(), get_dsbt_info(), hex_string_custom(), dsbt_info::interp_loadmap, dsbt_info::interp_plt_sect_high, dsbt_info::interp_plt_sect_low, dsbt_info::interp_text_sect_high, dsbt_info::interp_text_sect_low, RETURN_MASK_ALL, solib_bfd_open(), solib_dsbt_debug, target_gdbarch(), target_has_execution, TRY, and xfree().

Referenced by dsbt_solib_create_inferior_hook().

## ◆ enable_break_failure_warning()

static void enable_break_failure_warning | ( | void |  | ) |
| static

Definition at line 770 of file solib-dsbt.c.

References _, and warning().

Referenced by enable_break().

## ◆ fetch_loadmap()

static struct int_elf32_dsbt_loadmap* fetch_loadmap | ( | CORE_ADDR | ldmaddr | ) |
| static

Definition at line 326 of file solib-dsbt.c.

References ext_elf32_dsbt_loadseg::addr, int_elf32_dsbt_loadseg::addr, extract_unsigned_integer(), gdbarch_byte_order(), ext_elf32_dsbt_loadmap::nsegs, int_elf32_dsbt_loadmap::nsegs, ext_elf32_dsbt_loadseg::p_memsz, int_elf32_dsbt_loadseg::p_memsz, ext_elf32_dsbt_loadseg::p_vaddr, int_elf32_dsbt_loadseg::p_vaddr, ext_elf32_dsbt_loadmap::segs, int_elf32_dsbt_loadmap::segs, target_gdbarch(), target_read_memory(), version, int_elf32_dsbt_loadmap::version, xfree(), and xmalloc().

Referenced by dsbt_current_sos().

## ◆ get_dsbt_info()

static struct dsbt_info * get_dsbt_info | ( | void |  | ) |
| static

Definition at line 179 of file solib-dsbt.c.

References current_program_space, dsbt_info::lm_base_cache, dsbt_info::main_lm_addr, solib_dsbt_pspace_data, and XCNEW.

Referenced by dsbt_clear_solib(), dsbt_current_sos(), dsbt_get_initial_loadmaps(), dsbt_in_dynsym_resolve_code(), dsbt_relocate_main_executable(), enable_break(), and lm_base().

## ◆ lm_base()

static CORE_ADDR lm_base | ( | void |  | ) |
| static

Definition at line 548 of file solib-dsbt.c.

References BMSYMBOL_VALUE_ADDRESS, displacement_from_map(), dsbt_get_initial_loadmaps(), exec_bfd, dsbt_info::exec_loadmap, extract_unsigned_integer(), fprintf_unfiltered(), gdb_stdlog, gdbarch_byte_order(), get_dsbt_info(), GOT_MODULE_OFFSET, hex_string_custom(), dsbt_info::lm_base_cache, lookup_minimal_symbol(), dsbt_info::main_executable_lm_info, bound_minimal_symbol::minsym, scan_dyntag(), solib_dsbt_debug, symfile_objfile, target_gdbarch(), target_read_memory(), and TIC6X_PTR_SIZE.

Referenced by dsbt_current_sos().

## ◆ open_symbol_file_object()

static int open_symbol_file_object | ( | int | from_tty | ) |
| static

Definition at line 513 of file solib-dsbt.c.

Referenced by _initialize_dsbt_solib().

## ◆ scan_dyntag()

static int scan_dyntag | ( | int | dyntag,
|  | bfd * | abfd,
|  | CORE_ADDR * | ptr
| ) |  |
| static

Definition at line 415 of file solib-dsbt.c.

References target_section::addr, builtin_type::builtin_data_ptr, builtin_type(), current_target_sections, extract_typed_address(), target_gdbarch(), target_read_memory(), and target_section::the_bfd_section.

Referenced by lm_base().

## ◆ show_dsbt_debug()

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

Definition at line 1043 of file solib-dsbt.c.

References _, and fprintf_filtered().

Referenced by _initialize_dsbt_solib().

## Variable Documentation

## ◆ dsbt_so_ops

struct target_so_ops dsbt_so_ops

Definition at line 1049 of file solib-dsbt.c.

Referenced by _initialize_dsbt_solib(), and tic6x_uclinux_init_abi().

## ◆ solib_dsbt_debug

unsigned int solib_dsbt_debug = 0
| static

Definition at line 36 of file solib-dsbt.c.

Referenced by _initialize_dsbt_solib(), dsbt_current_sos(), dsbt_get_initial_loadmaps(), enable_break(), and lm_base().

## ◆ solib_dsbt_pspace_data

const struct program_space_data* solib_dsbt_pspace_data
| static

Definition at line 167 of file solib-dsbt.c.

Referenced by _initialize_dsbt_solib(), and get_dsbt_info().