GDB (xrefs)
|
#include "defs.h"
#include "gdbtypes.h"
#include "linux-tdep.h"
#include "auxv.h"
#include "target.h"
#include "gdbthread.h"
#include "gdbcore.h"
#include "regcache.h"
#include "regset.h"
#include "elf/common.h"
#include "elf-bfd.h"
#include "inferior.h"
#include "cli/cli-utils.h"
#include "arch-utils.h"
#include "gdb_obstack.h"
#include <ctype.h>
Go to the source code of this file.
typedef int linux_find_memory_region_ftype(ULONGEST vaddr, ULONGEST size, ULONGEST offset, ULONGEST inode, int read, int write, int exec, int modified, const char *filename, void *data) |
Definition at line 732 of file linux-tdep.c.
anonymous enum |
Definition at line 63 of file linux-tdep.c.
void _initialize_linux_tdep | ( | void | ) |
Definition at line 1792 of file linux-tdep.c.
References _initialize_linux_tdep, gdbarch_data_register_post_init(), and init_linux_gdbarch_data().
static int find_signalled_thread | ( | struct thread_info * | info, |
void * | data | ||
) | [static] |
Definition at line 882 of file linux-tdep.c.
References inferior_ptid, thread_info::ptid, ptid_get_pid(), thread_suspend_state::stop_signal, and thread_info::suspend.
Referenced by find_stop_signal().
static enum gdb_signal find_stop_signal | ( | void | ) | [static] |
Definition at line 892 of file linux-tdep.c.
References find_signalled_thread(), iterate_over_threads(), thread_suspend_state::stop_signal, and thread_info::suspend.
Referenced by linux_make_corefile_notes().
static struct linux_gdbarch_data* get_linux_gdbarch_data | ( | struct gdbarch * | gdbarch | ) | [static, read] |
Definition at line 118 of file linux-tdep.c.
References gdbarch_data().
Referenced by linux_get_siginfo_type().
static void* init_linux_gdbarch_data | ( | struct gdbarch * | gdbarch | ) | [static] |
Definition at line 112 of file linux-tdep.c.
References GDBARCH_OBSTACK_ZALLOC.
Referenced by _initialize_linux_tdep().
static char* linux_collect_thread_registers | ( | const struct regcache * | regcache, |
ptid_t | ptid, | ||
bfd * | obfd, | ||
char * | note_data, | ||
int * | note_size, | ||
enum gdb_signal | stop_signal | ||
) | [static] |
Definition at line 1085 of file linux-tdep.c.
References regset::collect_regset, gdb_assert, gdb_signal_to_host(), gdbarch_core_regset_sections(), gdbarch_regset_from_core_section(), get_regcache_arch(), ptid_get_lwp(), ptid_get_tid(), core_regset_section::sect_name, core_regset_section::size, xfree(), and xmalloc().
Referenced by linux_make_corefile_notes_1().
static void linux_core_info_proc | ( | struct gdbarch * | gdbarch, |
char * | args, | ||
enum info_proc_what | what | ||
) | [static] |
Definition at line 708 of file linux-tdep.c.
References _, core_bfd, error(), IP_ALL, IP_EXE, IP_MAPPINGS, IP_MINIMAL, linux_core_info_proc_mappings(), printf_filtered(), and warning().
Referenced by linux_init_abi().
static void linux_core_info_proc_mappings | ( | struct gdbarch * | gdbarch, |
char * | args | ||
) | [static] |
Definition at line 605 of file linux-tdep.c.
References _, core_bfd, core_gdbarch, do_cleanups(), error(), gdb_static_assert, gdbarch_addr_bit(), gdbarch_from_bfd(), hex_string(), make_cleanup(), paddress(), printf_filtered(), ULONGEST, warning(), xfree(), and xmalloc().
Referenced by linux_core_info_proc().
static char* linux_core_pid_to_str | ( | struct gdbarch * | gdbarch, |
ptid_t | ptid | ||
) | [static] |
Definition at line 265 of file linux-tdep.c.
References normal_pid_to_str(), and ptid_get_lwp().
Referenced by linux_init_abi().
static int linux_corefile_thread_callback | ( | struct thread_info * | info, |
void * | data | ||
) | [static] |
Definition at line 1188 of file linux-tdep.c.
References linux_corefile_thread_data::collect, do_cleanups(), linux_corefile_thread_data::gdbarch, get_thread_arch_regcache(), inferior_ptid, linux_get_siginfo_data(), LONGEST, make_cleanup(), linux_corefile_thread_data::note_data, linux_corefile_thread_data::note_size, linux_corefile_thread_data::num_notes, linux_corefile_thread_data::obfd, linux_corefile_thread_data::pid, thread_info::ptid, ptid_get_pid(), save_inferior_ptid(), linux_corefile_thread_data::stop_signal, target_fetch_registers(), and xfree().
Referenced by linux_make_corefile_notes().
static int linux_fill_prpsinfo | ( | struct elf_internal_linux_prpsinfo * | p | ) | [static] |
Definition at line 1238 of file linux-tdep.c.
References do_cleanups(), gdb_assert, get_inferior_args(), inferior_ptid, make_cleanup(), memset(), ptid_get_pid(), skip_spaces(), strchr(), strstr(), target_fileio_read_stralloc(), xfree(), and xsnprintf().
Referenced by linux_make_corefile_notes().
static int linux_find_memory_regions | ( | struct gdbarch * | gdbarch, |
find_memory_region_ftype | func, | ||
void * | obfd | ||
) | [static] |
Definition at line 866 of file linux-tdep.c.
References linux_find_memory_regions_data::func, func, linux_find_memory_regions_full(), linux_find_memory_regions_thunk(), and linux_find_memory_regions_data::obfd.
Referenced by linux_init_abi().
static int linux_find_memory_regions_full | ( | struct gdbarch * | gdbarch, |
linux_find_memory_region_ftype * | func, | ||
void * | obfd | ||
) | [static] |
Definition at line 742 of file linux-tdep.c.
References _, current_inferior(), gdbarch::data, do_cleanups(), func, line, make_cleanup(), offset, read(), read_mapping(), strtok(), target_fileio_read_stralloc(), ULONGEST, warning(), xfree(), and xsnprintf().
Referenced by linux_find_memory_regions(), and linux_make_mappings_corefile_notes().
static int linux_find_memory_regions_thunk | ( | ULONGEST | vaddr, |
ULONGEST | size, | ||
ULONGEST | offset, | ||
ULONGEST | inode, | ||
int | read, | ||
int | write, | ||
int | exec, | ||
int | modified, | ||
const char * | filename, | ||
void * | arg | ||
) | [static] |
Definition at line 852 of file linux-tdep.c.
References linux_find_memory_regions_data::func, and linux_find_memory_regions_data::obfd.
Referenced by linux_find_memory_regions().
enum gdb_signal linux_gdb_signal_from_target | ( | struct gdbarch * | gdbarch, |
int | signal | ||
) |
Definition at line 1523 of file linux-tdep.c.
References int, LINUX_SIGABRT, LINUX_SIGALRM, LINUX_SIGBUS, LINUX_SIGCHLD, LINUX_SIGCONT, LINUX_SIGFPE, LINUX_SIGHUP, LINUX_SIGILL, LINUX_SIGINT, LINUX_SIGIO, LINUX_SIGKILL, LINUX_SIGPIPE, LINUX_SIGPROF, LINUX_SIGPWR, LINUX_SIGQUIT, LINUX_SIGRTMAX, LINUX_SIGRTMIN, LINUX_SIGSEGV, LINUX_SIGSTOP, LINUX_SIGSYS, LINUX_SIGTERM, LINUX_SIGTRAP, LINUX_SIGTSTP, LINUX_SIGTTIN, LINUX_SIGTTOU, LINUX_SIGURG, LINUX_SIGUSR1, LINUX_SIGUSR2, LINUX_SIGVTALRM, LINUX_SIGWINCH, LINUX_SIGXCPU, LINUX_SIGXFSZ, and offset.
Referenced by alpha_linux_gdb_signal_from_target(), linux_init_abi(), mips_gdb_signal_from_target(), sparc32_linux_gdb_signal_from_target(), and xtensa_linux_gdb_signal_from_target().
int linux_gdb_signal_to_target | ( | struct gdbarch * | gdbarch, |
enum gdb_signal | signal | ||
) |
Definition at line 1646 of file linux-tdep.c.
References LINUX_SIGABRT, LINUX_SIGALRM, LINUX_SIGBUS, LINUX_SIGCHLD, LINUX_SIGCONT, LINUX_SIGFPE, LINUX_SIGHUP, LINUX_SIGILL, LINUX_SIGINT, LINUX_SIGIO, LINUX_SIGKILL, LINUX_SIGPIPE, LINUX_SIGPOLL, LINUX_SIGPROF, LINUX_SIGPWR, LINUX_SIGQUIT, LINUX_SIGRTMAX, LINUX_SIGRTMIN, LINUX_SIGSEGV, LINUX_SIGSTOP, LINUX_SIGSYS, LINUX_SIGTERM, LINUX_SIGTRAP, LINUX_SIGTSTP, LINUX_SIGTTIN, LINUX_SIGTTOU, LINUX_SIGURG, LINUX_SIGUSR1, LINUX_SIGUSR2, LINUX_SIGVTALRM, LINUX_SIGWINCH, LINUX_SIGXCPU, LINUX_SIGXFSZ, and offset.
Referenced by alpha_linux_gdb_signal_to_target(), linux_init_abi(), mips_gdb_signal_to_target(), sparc32_linux_gdb_signal_to_target(), and xtensa_linux_gdb_signal_to_target().
static gdb_byte* linux_get_siginfo_data | ( | struct gdbarch * | gdbarch, |
LONGEST * | size | ||
) | [static] |
Definition at line 1141 of file linux-tdep.c.
References current_target, discard_cleanups(), do_cleanups(), gdbarch_get_siginfo_type(), gdbarch_get_siginfo_type_p(), LONGEST, make_cleanup(), TARGET_OBJECT_SIGNAL_INFO, target_read(), TYPE_LENGTH, xfree(), and xmalloc().
Referenced by linux_corefile_thread_callback().
struct type* linux_get_siginfo_type | ( | struct gdbarch * | gdbarch | ) | [read] |
Definition at line 127 of file linux-tdep.c.
References append_composite_type_field(), append_composite_type_field_aligned(), arch_composite_type(), arch_integer_type(), arch_type(), gdbarch_int_bit(), gdbarch_long_bit(), gdbarch_ptr_bit(), get_linux_gdbarch_data(), HOST_CHAR_BIT, init_vector_type(), lookup_pointer_type(), linux_gdbarch_data::siginfo_type, type, TYPE_CODE_STRUCT, TYPE_CODE_TYPEDEF, TYPE_CODE_UNION, TYPE_LENGTH, TYPE_NAME, TYPE_TARGET_STUB, and TYPE_TARGET_TYPE.
Referenced by aarch64_linux_init_abi(), amd64_linux_init_abi_common(), arm_linux_init_abi(), i386_linux_init_abi(), m68k_linux_init_abi(), ppc_linux_init_abi(), s390_gdbarch_init(), and tilegx_linux_init_abi().
static int linux_has_shared_address_space | ( | struct gdbarch * | gdbarch | ) | [static] |
Definition at line 257 of file linux-tdep.c.
References linux_is_uclinux().
Referenced by linux_init_abi().
static void linux_info_proc | ( | struct gdbarch * | gdbarch, |
char * | args, | ||
enum info_proc_what | what | ||
) | [static] |
Definition at line 319 of file linux-tdep.c.
References _, current_inferior(), do_cleanups(), error(), gdbarch_addr_bit(), hex_string(), IP_ALL, IP_CMDLINE, IP_CWD, IP_EXE, IP_MAPPINGS, IP_MINIMAL, IP_STAT, IP_STATUS, line, make_cleanup(), offset, p, paddress(), inferior::pid, printf_filtered(), pulongest(), puts_filtered(), read_mapping(), skip_spaces(), skip_spaces_const(), strchr(), strtok(), strtoulst(), target_fileio_read_stralloc(), target_fileio_readlink(), target_has_execution, ULONGEST, warning(), xfree(), and xsnprintf().
Referenced by linux_init_abi().
void linux_init_abi | ( | struct gdbarch_info | info, |
struct gdbarch * | gdbarch | ||
) |
Definition at line 1773 of file linux-tdep.c.
References linux_core_info_proc(), linux_core_pid_to_str(), linux_find_memory_regions(), linux_gdb_signal_from_target(), linux_gdb_signal_to_target(), linux_has_shared_address_space(), linux_info_proc(), linux_make_corefile_notes_1(), set_gdbarch_core_info_proc(), set_gdbarch_core_pid_to_str(), set_gdbarch_find_memory_regions(), set_gdbarch_gdb_signal_from_target(), set_gdbarch_gdb_signal_to_target(), set_gdbarch_has_shared_address_space(), set_gdbarch_info_proc(), and set_gdbarch_make_corefile_notes().
Referenced by aarch64_linux_init_abi(), alpha_linux_init_abi(), am33_linux_init_osabi(), amd64_linux_init_abi_common(), arm_linux_init_abi(), bfin_linux_init_abi(), cris_linux_init_abi(), frv_linux_init_abi(), hppa_linux_init_abi(), i386_linux_init_abi(), ia64_linux_init_abi(), m32r_linux_init_abi(), m68k_linux_init_abi(), microblaze_linux_init_abi(), mips_linux_init_abi(), nios2_linux_init_abi(), ppc_linux_init_abi(), s390_gdbarch_init(), sh_linux_init_abi(), sparc32_linux_init_abi(), sparc64_linux_init_abi(), tic6x_uclinux_init_abi(), tilegx_linux_init_abi(), and xtensa_linux_init_abi().
int linux_is_uclinux | ( | void | ) |
Definition at line 248 of file linux-tdep.c.
References current_target, dummy, and target_auxv_search().
Referenced by linux_has_shared_address_space(), and m68k_linux_get_sigtramp_info().
char* linux_make_corefile_notes | ( | struct gdbarch * | gdbarch, |
bfd * | obfd, | ||
int * | note_size, | ||
linux_collect_thread_registers_ftype | collect | ||
) |
Definition at line 1434 of file linux-tdep.c.
References linux_corefile_thread_data::collect, current_target, find_stop_signal(), linux_corefile_thread_data::gdbarch, gdbarch_elfcore_write_linux_prpsinfo(), gdbarch_elfcore_write_linux_prpsinfo_p(), gdbarch_ptr_bit(), inferior_ptid, iterate_over_threads(), linux_corefile_thread_callback(), linux_fill_prpsinfo(), linux_make_mappings_corefile_notes(), linux_spu_make_corefile_notes(), make_cleanup(), linux_corefile_thread_data::note_data, linux_corefile_thread_data::note_size, linux_corefile_thread_data::num_notes, linux_corefile_thread_data::obfd, linux_corefile_thread_data::pid, ptid_get_pid(), linux_corefile_thread_data::stop_signal, TARGET_OBJECT_AUXV, target_read_alloc(), and xfree().
Referenced by linux_make_corefile_notes_1(), and linux_nat_make_corefile_notes().
static char* linux_make_corefile_notes_1 | ( | struct gdbarch * | gdbarch, |
bfd * | obfd, | ||
int * | note_size | ||
) | [static] |
Definition at line 1505 of file linux-tdep.c.
References gdbarch_core_regset_sections(), linux_collect_thread_registers(), linux_make_corefile_notes(), and target_make_corefile_notes.
Referenced by linux_init_abi().
static int linux_make_mappings_callback | ( | ULONGEST | vaddr, |
ULONGEST | size, | ||
ULONGEST | offset, | ||
ULONGEST | inode, | ||
int | read, | ||
int | write, | ||
int | exec, | ||
int | modified, | ||
const char * | filename, | ||
void * | data | ||
) | [static] |
Definition at line 1000 of file linux-tdep.c.
References linux_make_mappings_data::data_obstack, linux_make_mappings_data::file_count, linux_make_mappings_data::filename_obstack, linux_make_mappings_data::long_type, obstack_grow_str0, pack_long(), TYPE_LENGTH, and ULONGEST.
static char* linux_make_mappings_corefile_notes | ( | struct gdbarch * | gdbarch, |
bfd * | obfd, | ||
char * | note_data, | ||
int * | note_size | ||
) | [static] |
Definition at line 1031 of file linux-tdep.c.
References arch_integer_type(), linux_make_mappings_data::data_obstack, do_cleanups(), linux_make_mappings_data::file_count, linux_make_mappings_data::filename_obstack, gdbarch_long_bit(), linux_find_memory_regions_full(), linux_make_mappings_callback, linux_make_mappings_data::long_type, make_cleanup_obstack_free(), pack_long(), TYPE_LENGTH, and ULONGEST.
Referenced by linux_make_corefile_notes().
static char* linux_spu_make_corefile_notes | ( | bfd * | obfd, |
char * | note_data, | ||
int * | note_size | ||
) | [static] |
Definition at line 906 of file linux-tdep.c.
References current_target, extract_unsigned_integer(), gdbarch_byte_order(), LONGEST, size, target_gdbarch(), TARGET_OBJECT_SPU, target_read_alloc(), xfree(), and xsnprintf().
Referenced by linux_make_corefile_notes().
static void read_mapping | ( | const char * | line, |
ULONGEST * | addr, | ||
ULONGEST * | endaddr, | ||
const char ** | permissions, | ||
size_t * | permissions_len, | ||
ULONGEST * | offset, | ||
const char ** | device, | ||
size_t * | device_len, | ||
ULONGEST * | inode, | ||
const char ** | filename | ||
) | [static] |
Definition at line 281 of file linux-tdep.c.
References line, p, skip_spaces_const(), and strtoulst().
Referenced by linux_find_memory_regions_full(), and linux_info_proc().
Referenced by _initialize_linux_tdep(), and initialize_all_files().
struct gdbarch_data* linux_gdbarch_data_handle [static] |
Definition at line 104 of file linux-tdep.c.
Definition at line 994 of file linux-tdep.c.
Referenced by linux_make_mappings_corefile_notes().