GDB (xrefs)

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

Go to the source code of this file.

## Classes
struct | ext_elf32_fdpic_loadseg
struct | ext_elf32_fdpic_loadmap
struct | int_elf32_fdpic_loadseg
struct | int_elf32_fdpic_loadmap
struct | ext_elf32_fdpic_loadaddr
struct | ext_link_map
struct | lm_info_frv

## 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 | { FRV_PTR_SIZE = 4 }

## Functions
static struct int_elf32_fdpic_loadmap * | fetch_loadmap (CORE_ADDR ldmaddr)
static void | frv_relocate_main_executable (void)
static CORE_ADDR | main_got (void)
static int | enable_break2 (void)
static int | open_symbol_file_object (int from_tty)
static CORE_ADDR | lm_base (void)
static struct so_list * | frv_current_sos (void)
static int | frv_in_dynsym_resolve_code (CORE_ADDR pc)
static CORE_ADDR | displacement_from_map (struct int_elf32_fdpic_loadmap *map, CORE_ADDR addr)
static void | enable_break_failure_warning (void)
static int | cmp_name (const asymbol *sym, const void *data)
static int | enable_break (void)
static void | frv_solib_create_inferior_hook (int from_tty)
static void | frv_clear_solib (void)
static void | frv_free_so (struct so_list *so)
static void | frv_relocate_section_addresses (struct so_list *so, struct target_section *sec)
CORE_ADDR | frv_fdpic_find_global_pointer (CORE_ADDR addr)
static CORE_ADDR | find_canonical_descriptor_in_load_object (CORE_ADDR, CORE_ADDR, const char *, bfd *, lm_info_frv *)
CORE_ADDR | frv_fdpic_find_canonical_descriptor (CORE_ADDR entry_point)
CORE_ADDR | frv_fetch_objfile_link_map (struct objfile *objfile)
void | _initialize_frv_solib (void)

## Variables
static unsigned int | solib_frv_debug
static lm_info_frv * | main_executable_lm_info
static CORE_ADDR | lm_base_cache = 0
static CORE_ADDR | main_lm_addr = 0
static CORE_ADDR | interp_text_sect_low
static CORE_ADDR | interp_text_sect_high
static CORE_ADDR | interp_plt_sect_low
static CORE_ADDR | interp_plt_sect_high
static int | enable_break2_done = 0
struct target_so_ops | frv_so_ops

## Typedef Documentation

## ◆ ext_Elf32_Addr

typedef gdb_byte ext_Elf32_Addr[4]

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

## ◆ ext_Elf32_Half

typedef gdb_byte ext_Elf32_Half[2]

Definition at line 45 of file solib-frv.c.

## ◆ ext_Elf32_Word

typedef gdb_byte ext_Elf32_Word[4]

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

## ◆ ext_ptr

typedef gdb_byte ext_ptr[4]

Definition at line 181 of file solib-frv.c.

## Enumeration Type Documentation

## ◆ anonymous enum

anonymous enum

Enumerator
FRV_PTR_SIZE |

Definition at line 38 of file solib-frv.c.

## Function Documentation

## ◆ _initialize_frv_solib()

void _initialize_frv_solib | ( | void |  | ) |

Definition at line 1157 of file solib-frv.c.

References _, add_setshow_zuinteger_cmd(), target_so_ops::bfd_open, class_maintenance, target_so_ops::clear_solib, target_so_ops::current_sos, target_so_ops::free_so, frv_clear_solib(), frv_current_sos(), frv_free_so(), frv_in_dynsym_resolve_code(), frv_relocate_section_addresses(), frv_so_ops, frv_solib_create_inferior_hook(), 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, showdebuglist, solib_bfd_open(), target_so_ops::solib_create_inferior_hook, and solib_frv_debug.

## ◆ cmp_name()

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

Definition at line 494 of file solib-frv.c.

Referenced by enable_break2().

## ◆ displacement_from_map()

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

Definition at line 463 of file solib-frv.c.

References int_elf32_fdpic_loadseg::addr, int_elf32_fdpic_loadmap::nsegs, int_elf32_fdpic_loadseg::p_memsz, int_elf32_fdpic_loadseg::p_vaddr, and int_elf32_fdpic_loadmap::segs.

Referenced by enable_break2(), and find_canonical_descriptor_in_load_object().

## ◆ enable_break()

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

Definition at line 722 of file solib-frv.c.

References create_solib_event_breakpoint(), entry_point_address_query(), exec_bfd, fprintf_unfiltered(), gdb_stdlog, hex_string_custom(), solib_frv_debug, symfile_objfile, and target_gdbarch().

Referenced by frv_solib_create_inferior_hook().

## ◆ enable_break2()

static int enable_break2 | ( | void |  | ) |
| static

Definition at line 524 of file solib-frv.c.

References _, CATCH, cmp_name(), create_solib_event_breakpoint(), displacement_from_map(), enable_break2_done, enable_break_failure_warning(), END_CATCH, exec_bfd, extract_unsigned_integer(), fetch_loadmap(), fprintf_unfiltered(), frv_fdpic_loadmap_addresses(), FRV_PTR_SIZE, gdb_bfd_lookup_symbol(), gdb_stdlog, gdbarch_byte_order(), gdb::ref_ptr< T, Policy >::get(), hex_string_custom(), interp_plt_sect_high, interp_plt_sect_low, interp_text_sect_high, interp_text_sect_low, remove_solib_event_breakpoints(), RETURN_MASK_ALL, solib_bfd_open(), solib_frv_debug, status, target_gdbarch(), target_read_memory(), TRY, warning(), and xfree().

Referenced by frv_current_sos().

## ◆ enable_break_failure_warning()

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

Definition at line 484 of file solib-frv.c.

References _, and warning().

Referenced by enable_break2().

## ◆ fetch_loadmap()

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

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

References ext_elf32_fdpic_loadseg::addr, int_elf32_fdpic_loadseg::addr, extract_unsigned_integer(), gdbarch_byte_order(), ext_elf32_fdpic_loadmap::nsegs, int_elf32_fdpic_loadmap::nsegs, ext_elf32_fdpic_loadseg::p_memsz, int_elf32_fdpic_loadseg::p_memsz, ext_elf32_fdpic_loadseg::p_vaddr, int_elf32_fdpic_loadseg::p_vaddr, ext_elf32_fdpic_loadmap::segs, int_elf32_fdpic_loadmap::segs, target_gdbarch(), target_read_memory(), version, int_elf32_fdpic_loadmap::version, xfree(), and xmalloc().

Referenced by enable_break2(), frv_current_sos(), and frv_relocate_main_executable().

## ◆ find_canonical_descriptor_in_load_object()

static CORE_ADDR find_canonical_descriptor_in_load_object | ( | CORE_ADDR | entry_point,
|  | CORE_ADDR | got_value,
|  | const char * | name,
|  | bfd * | abfd,
|  | lm_info_frv * | lm
| ) |  |
| static

Definition at line 1005 of file solib-frv.c.

References so_list::abfd, displacement_from_map(), lm_info_frv::dyn_reloc_count, lm_info_frv::dyn_relocs, lm_info_frv::dyn_syms, extract_unsigned_integer(), FRV_PTR_SIZE, gdbarch_byte_order(), lm_info_frv::map, name, target_gdbarch(), target_read_memory(), and xmalloc().

Referenced by frv_fdpic_find_canonical_descriptor().

## ◆ frv_clear_solib()

static void frv_clear_solib | ( | void |  | ) |
| static

Definition at line 861 of file solib-frv.c.

References enable_break2_done, lm_base_cache, main_executable_lm_info, and main_lm_addr.

Referenced by _initialize_frv_solib().

## ◆ frv_current_sos()

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

Definition at line 322 of file solib-frv.c.

References _, core_bfd, enable_break2(), extract_unsigned_integer(), fetch_loadmap(), fprintf_unfiltered(), frv_relocate_main_executable(), gdb_stdlog, gdbarch_byte_order(), lm_info_frv::got_value, hex_string_custom(), lm_info_frv::lm_addr, lm_addr(), lm_base(), so_list::lm_info, main_executable_lm_info, main_got(), main_lm_addr, lm_info_frv::map, so_list::next, safe_strerror(), so_list::so_name, SO_NAME_MAX_PATH_SIZE, so_list::so_original_name, solib_frv_debug, target_gdbarch(), target_read_memory(), target_read_string(), warning(), XCNEW, and xfree().

Referenced by _initialize_frv_solib().

## ◆ frv_fdpic_find_canonical_descriptor()

CORE_ADDR frv_fdpic_find_canonical_descriptor | ( | CORE_ADDR | entry_point | ) |

Definition at line 955 of file solib-frv.c.

References so_list::abfd, find_canonical_descriptor_in_load_object(), find_pc_function(), frv_fdpic_find_global_pointer(), so_list::lm_info, main_executable_lm_info, master_so_list(), name, so_list::next, SYMBOL_LINKAGE_NAME, and symfile_objfile.

Referenced by find_func_descr().

## ◆ frv_fdpic_find_global_pointer()

CORE_ADDR frv_fdpic_find_global_pointer | ( | CORE_ADDR | addr | ) |

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

References lm_info_frv::got_value, so_list::lm_info, main_got(), lm_info_frv::map, master_so_list(), and so_list::next.

Referenced by find_func_descr(), frv_convert_from_func_ptr_addr(), frv_fdpic_find_canonical_descriptor(), and frv_push_dummy_call().

## ◆ frv_fetch_objfile_link_map()

CORE_ADDR frv_fetch_objfile_link_map | ( | struct objfile * | objfile | ) |

Definition at line 1128 of file solib-frv.c.

References if(), lm_info_frv::lm_addr, so_list::lm_info, main_lm_addr, master_so_list(), so_list::next, so_list::objfile, solib_add(), and symfile_objfile.

Referenced by frv_gdbarch_init().

## ◆ frv_free_so()

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

Definition at line 872 of file solib-frv.c.

References so_list::lm_info.

Referenced by _initialize_frv_solib().

## ◆ frv_in_dynsym_resolve_code()

static int frv_in_dynsym_resolve_code | ( | CORE_ADDR | pc | ) |
| static

Definition at line 452 of file solib-frv.c.

References in_plt_section(), interp_plt_sect_high, interp_plt_sect_low, interp_text_sect_high, and interp_text_sect_low.

Referenced by _initialize_frv_solib().

## ◆ frv_relocate_main_executable()

static void frv_relocate_main_executable | ( | void |  | ) |
| static

Definition at line 767 of file solib-frv.c.

References _, int_elf32_fdpic_loadseg::addr, ALL_OBJFILE_OSECTIONS, ANOFFSET, do_cleanups(), error(), fetch_loadmap(), frv_fdpic_loadmap_addresses(), lm_info_frv::got_value, main_executable_lm_info, main_got(), make_cleanup(), lm_info_frv::map, int_elf32_fdpic_loadmap::nsegs, obj_section_addr, objfile_relocate(), offset, section_offsets::offsets, int_elf32_fdpic_loadseg::p_memsz, int_elf32_fdpic_loadseg::p_vaddr, int_elf32_fdpic_loadmap::segs, status, symfile_objfile, target_gdbarch(), XCNEWVEC, and xfree().

Referenced by frv_current_sos(), and frv_solib_create_inferior_hook().

## ◆ frv_relocate_section_addresses()

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

Definition at line 880 of file solib-frv.c.

References int_elf32_fdpic_loadseg::addr, target_section::addr, target_section::endaddr, so_list::lm_info, lm_info_frv::map, and int_elf32_fdpic_loadmap::segs.

Referenced by _initialize_frv_solib().

## ◆ frv_solib_create_inferior_hook()

static void frv_solib_create_inferior_hook | ( | int | from_tty | ) |
| static

Definition at line 847 of file solib-frv.c.

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

Referenced by _initialize_frv_solib().

## ◆ lm_base()

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

Definition at line 270 of file solib-frv.c.

References BMSYMBOL_VALUE_ADDRESS, extract_unsigned_integer(), fprintf_unfiltered(), FRV_PTR_SIZE, gdb_stdlog, gdbarch_byte_order(), hex_string_custom(), lm_base_cache, lookup_minimal_symbol(), main_executable_lm_info, bound_minimal_symbol::minsym, solib_frv_debug, symfile_objfile, target_gdbarch(), and target_read_memory().

Referenced by frv_current_sos().

## ◆ main_got()

static CORE_ADDR main_got | ( | void |  | ) |
| static

Definition at line 905 of file solib-frv.c.

References BMSYMBOL_VALUE_ADDRESS, lookup_minimal_symbol(), and symfile_objfile.

Referenced by frv_current_sos(), frv_fdpic_find_global_pointer(), and frv_relocate_main_executable().

## ◆ open_symbol_file_object()

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

Definition at line 249 of file solib-frv.c.

Referenced by _initialize_frv_solib().

## Variable Documentation

## ◆ enable_break2_done

int enable_break2_done = 0
| static

Definition at line 521 of file solib-frv.c.

Referenced by enable_break2(), and frv_clear_solib().

## ◆ frv_so_ops

struct target_so_ops frv_so_ops

Definition at line 1154 of file solib-frv.c.

Referenced by _initialize_frv_solib(), and frv_gdbarch_init().

## ◆ interp_plt_sect_high

CORE_ADDR interp_plt_sect_high
| static

Definition at line 449 of file solib-frv.c.

Referenced by dsbt_in_dynsym_resolve_code(), enable_break2(), frv_in_dynsym_resolve_code(), and svr4_in_dynsym_resolve_code().

## ◆ interp_plt_sect_low

CORE_ADDR interp_plt_sect_low
| static

Definition at line 448 of file solib-frv.c.

Referenced by enable_break2(), and frv_in_dynsym_resolve_code().

## ◆ interp_text_sect_high

CORE_ADDR interp_text_sect_high
| static

Definition at line 447 of file solib-frv.c.

Referenced by dsbt_in_dynsym_resolve_code(), enable_break2(), frv_in_dynsym_resolve_code(), and svr4_in_dynsym_resolve_code().

## ◆ interp_text_sect_low

CORE_ADDR interp_text_sect_low
| static

Definition at line 446 of file solib-frv.c.

Referenced by enable_break2(), and frv_in_dynsym_resolve_code().

## ◆ lm_base_cache

CORE_ADDR lm_base_cache = 0
| static

Definition at line 256 of file solib-frv.c.

Referenced by frv_clear_solib(), and lm_base().

## ◆ main_executable_lm_info

lm_info_frv* main_executable_lm_info
| static

Definition at line 240 of file solib-frv.c.

Referenced by frv_clear_solib(), frv_current_sos(), frv_fdpic_find_canonical_descriptor(), frv_relocate_main_executable(), and lm_base().

## ◆ main_lm_addr

CORE_ADDR main_lm_addr = 0
| static

Definition at line 259 of file solib-frv.c.

Referenced by frv_clear_solib(), frv_current_sos(), and frv_fetch_objfile_link_map().

## ◆ solib_frv_debug

unsigned int solib_frv_debug
| static

Definition at line 35 of file solib-frv.c.

Referenced by _initialize_frv_solib(), enable_break(), enable_break2(), frv_current_sos(), and lm_base().