GDB (xrefs)
|
#include "defs.h"
#include "inferior.h"
#include "target.h"
#include "gdbcore.h"
#include "elf-bfd.h"
#include "gdbcmd.h"
#include "gdbthread.h"
#include "regcache.h"
#include "inf-child.h"
#include <sys/procfs.h>
#include <sys/errno.h>
#include "gdb_wait.h"
#include <signal.h>
#include <ctype.h>
#include "gdb_bfd.h"
#include "gdb_string.h"
#include "gdb_assert.h"
#include "inflow.h"
#include "auxv.h"
#include "procfs.h"
#include "observer.h"
#include <fcntl.h>
#include <unistd.h>
#include "gdb_stat.h"
#include "proc-utils.h"
#include "gregset.h"
Go to the source code of this file.
#define AS_PROC_NAME_FMT "/proc/%05d" |
#define CTL_PROC_NAME_FMT "/proc/%05d" |
#define gdb_pr_issyssetmember prismember |
#define gdb_praddset | ( | sp, | |
flag | |||
) | ((void) praddset (sp, flag)) |
#define gdb_praddsysset gdb_praddset |
Definition at line 288 of file procfs.c.
Referenced by proc_trace_syscalls_1(), procfs_debug_inferior(), and procfs_set_exec_trap().
#define gdb_prdelset | ( | sp, | |
flag | |||
) | ((void) prdelset (sp, flag)) |
Definition at line 275 of file procfs.c.
Referenced by procfs_debug_inferior(), and procfs_pass_signals().
#define gdb_prdelsysset gdb_prdelset |
Definition at line 295 of file procfs.c.
Referenced by proc_trace_syscalls_1().
#define gdb_premptysysset premptyset |
Definition at line 281 of file procfs.c.
Referenced by proc_get_traced_sysentry(), proc_get_traced_sysexit(), procfs_debug_inferior(), and procfs_set_exec_trap().
#define MAIN_PROC_NAME_FMT "/proc/%05d" |
Definition at line 358 of file procfs.c.
Referenced by create_procinfo().
#define MAP_PROC_NAME_FMT "/proc/%05d" |
#define MAX_PROC_NAME_SIZE sizeof("/proc/ttttppppp") |
Definition at line 363 of file procfs.c.
Referenced by iterate_over_mappings(), and open_procinfo_files().
#define STATUS_PROC_NAME_FMT "/proc/%05d" |
typedef prstatus_t gdb_lwpstatus_t |
typedef prstatus_t gdb_prstatus_t |
typedef struct sigaction gdb_sigaction_t |
typedef siginfo_t gdb_siginfo_t |
typedef sigset_t gdb_sigset_t |
anonymous enum |
void _initialize_procfs | ( | void | ) |
static void close_procinfo_files | ( | procinfo * | p | ) | [static] |
Definition at line 734 of file procfs.c.
References procinfo::as_fd, procinfo::ctl_fd, and procinfo::status_fd.
Referenced by destroy_one_procinfo(), and invalidate_cache().
static procinfo * create_procinfo | ( | int | pid, |
int | tid | ||
) | [static] |
Definition at line 686 of file procfs.c.
References find_procinfo(), find_procinfo_or_die(), MAIN_PROC_NAME_FMT, memset(), procinfo::next, procinfo::pathname, procinfo::pid, procinfo_list, procinfo::saved_entryset, procinfo::saved_exitset, sysset_t_alloc(), procinfo::thread_list, procinfo::tid, and xmalloc().
Referenced by do_attach(), procfs_info_proc(), procfs_init_inferior(), procfs_set_exec_trap(), and procfs_wait().
static void dead_procinfo | ( | procinfo * | p, |
char * | msg, | ||
int | killp | ||
) | [static] |
Definition at line 810 of file procfs.c.
References destroy_procinfo(), error(), KILL, procinfo::pathname, procinfo::pid, and print_sys_errmsg().
Referenced by do_attach(), and procfs_init_inferior().
static void destroy_one_procinfo | ( | procinfo ** | list, |
procinfo * | pi | ||
) | [static] |
Definition at line 750 of file procfs.c.
References close_procinfo_files(), procinfo::next, procinfo::saved_entryset, procinfo::saved_exitset, and xfree().
Referenced by destroy_procinfo(), and proc_delete_dead_threads().
static void destroy_procinfo | ( | procinfo * | p | ) | [static] |
Definition at line 778 of file procfs.c.
References destroy_one_procinfo(), find_procinfo(), procinfo::pid, procinfo::thread_list, and procinfo::tid.
Referenced by dead_procinfo(), do_destroy_procinfo_cleanup(), do_detach(), procfs_mourn_inferior(), procfs_thread_alive(), and unconditionally_kill_inferior().
Definition at line 3103 of file procfs.c.
References _, add_thread(), inferior::attach_flag, create_procinfo(), current_inferior(), dead_procinfo(), FD_CTL, fprintf_filtered(), gdb_stderr, procinfo::ignore_next_sigstop, arm-linux::inf, inferior_appeared(), NOKILL, open_procinfo_files(), procinfo::pid, proc_flags(), proc_get_current_thread(), proc_get_held_signals(), proc_get_traced_faults(), proc_get_traced_signals(), proc_get_traced_sysentry(), proc_get_traced_sysexit(), proc_prettyprint_why(), proc_set_run_on_last_close(), proc_stop_process(), proc_what(), proc_why(), procfs_debug_inferior(), ptid_build(), ptid_get_pid(), procinfo::saved_entryset, procinfo::saved_exitset, procinfo::saved_fltset, procinfo::saved_sighold, procinfo::saved_sigset, and procinfo::was_stopped.
Referenced by procfs_attach().
static void do_destroy_procinfo_cleanup | ( | void * | pi | ) | [static] |
Definition at line 798 of file procfs.c.
References destroy_procinfo().
Referenced by procfs_info_proc().
Definition at line 3173 of file procfs.c.
References _, destroy_procinfo(), find_procinfo_or_die(), inferior_ptid, proc_clear_current_fault(), proc_clear_current_signal(), proc_flags(), proc_set_current_signal(), proc_set_held_signals(), proc_set_run_on_last_close(), proc_set_traced_faults(), proc_set_traced_signals(), proc_set_traced_sysentry(), proc_set_traced_sysexit(), proc_warn(), ptid_get_pid(), query(), procinfo::saved_entryset, procinfo::saved_exitset, procinfo::saved_fltset, procinfo::saved_sighold, procinfo::saved_sigset, and procinfo::was_stopped.
Referenced by procfs_detach().
static int find_memory_regions_callback | ( | struct prmap * | map, |
find_memory_region_ftype | func, | ||
void * | data | ||
) | [static] |
Definition at line 5034 of file procfs.c.
Referenced by proc_find_memory_regions().
static procinfo * find_procinfo | ( | int | pid, |
int | tid | ||
) | [static] |
Definition at line 453 of file procfs.c.
References procinfo::next, procinfo::pid, procinfo::thread_list, and procinfo::tid.
Referenced by create_procinfo(), destroy_procinfo(), find_procinfo_or_die(), open_procinfo_files(), procfs_info_proc(), procfs_kill_inferior(), procfs_mourn_inferior(), procfs_resume(), procfs_thread_alive(), and procfs_wait().
static procinfo * find_procinfo_or_die | ( | int | pid, |
int | tid | ||
) | [static] |
Definition at line 482 of file procfs.c.
References _, error(), and find_procinfo().
Referenced by create_procinfo(), do_detach(), proc_clear_current_fault(), proc_clear_current_signal(), proc_find_memory_regions(), proc_get_held_signals(), proc_get_traced_faults(), proc_get_traced_signals(), proc_get_traced_sysentry(), proc_get_traced_sysexit(), proc_iterate_over_threads(), proc_modify_flag(), proc_parent_pid(), proc_set_current_signal(), proc_set_held_signals(), proc_set_traced_faults(), proc_set_traced_signals(), proc_set_traced_sysentry(), proc_set_traced_sysexit(), proc_trace_syscalls(), proc_wait_for_stop(), procfs_fetch_registers(), procfs_find_new_threads(), procfs_inferior_created(), procfs_pass_signals(), procfs_resume(), procfs_set_watchpoint(), procfs_stopped_by_watchpoint(), procfs_stopped_data_address(), procfs_wait(), and procfs_xfer_memory().
static int info_mappings_callback | ( | struct prmap * | map, |
find_memory_region_ftype | ignore, | ||
void * | unused | ||
) | [static] |
Definition at line 5098 of file procfs.c.
References gdbarch_addr_bit(), int, gdb::printing::long, mappingflags(), printf_filtered(), and target_gdbarch().
Referenced by info_proc_mappings().
static void info_proc_mappings | ( | procinfo * | pi, |
int | summary | ||
) | [static] |
Definition at line 5130 of file procfs.c.
References _, gdbarch_ptr_bit(), info_mappings_callback(), iterate_over_mappings(), printf_filtered(), and target_gdbarch().
Referenced by procfs_info_proc().
static int invalidate_cache | ( | procinfo * | parent, |
procinfo * | pi, | ||
void * | ptr | ||
) | [static] |
Definition at line 4078 of file procfs.c.
References close_procinfo_files(), procinfo::fpregs_valid, gdbarch_fp0_regnum(), procinfo::gregs_valid, proc_get_current_thread(), proc_set_fpregs(), proc_set_gregs(), proc_warn(), procinfo::status_valid, target_gdbarch(), procinfo::threads_valid, and procinfo::tid.
Referenced by procfs_resume().
static int iterate_over_mappings | ( | procinfo * | pi, |
find_memory_region_ftype | child_func, | ||
void * | data, | ||
int(*)(struct prmap *map, find_memory_region_ftype child_func, void *data) | func | ||
) | [static] |
Definition at line 4970 of file procfs.c.
References procinfo::ctl_fd, do_cleanups(), func, make_cleanup(), make_cleanup_close(), MAX_PROC_NAME_SIZE, null_cleanup(), procinfo::pid, proc_error(), and read().
Referenced by info_proc_mappings(), and proc_find_memory_regions().
static char* mappingflags | ( | long | flags | ) | [static] |
Definition at line 5070 of file procfs.c.
Referenced by info_mappings_callback().
static int open_procinfo_files | ( | procinfo * | p, |
int | which | ||
) | [static] |
Definition at line 541 of file procfs.c.
References procinfo::as_fd, procinfo::ctl_fd, FD_AS, FD_CTL, FD_STATUS, find_procinfo(), MAX_PROC_NAME_SIZE, open_with_retry(), procinfo::pathname, procinfo::pid, procinfo::status_fd, and procinfo::tid.
Referenced by do_attach(), proc_get_fpregs(), proc_get_status(), proc_get_traced_sysentry(), proc_get_traced_sysexit(), proc_kill(), proc_run_process(), proc_set_fpregs(), proc_set_gregs(), proc_stop_process(), procfs_info_proc(), procfs_init_inferior(), procfs_set_exec_trap(), and procfs_xfer_memory().
static int open_with_retry | ( | const char * | pathname, |
int | flags | ||
) | [static] |
Definition at line 509 of file procfs.c.
References sleep(), and exsummary::status.
Referenced by open_procinfo_files().
static int proc_clear_current_fault | ( | procinfo * | pi | ) | [static] |
Definition at line 2032 of file procfs.c.
References procinfo::ctl_fd, find_procinfo_or_die(), procinfo::pid, and procinfo::tid.
Referenced by do_detach().
static int proc_clear_current_signal | ( | procinfo * | pi | ) | [static] |
Definition at line 2139 of file procfs.c.
References procinfo::ctl_fd, find_procinfo_or_die(), memcpy(), procinfo::pid, and procinfo::tid.
Referenced by do_detach().
static int proc_delete_dead_threads | ( | procinfo * | parent, |
procinfo * | thread, | ||
void * | ignore | ||
) | [static] |
Definition at line 2706 of file procfs.c.
References destroy_one_procinfo(), proc_get_status(), procinfo::status_valid, and procinfo::thread_list.
static void proc_error | ( | procinfo * | pi, |
char * | func, | ||
int | line | ||
) | [static] |
Definition at line 1036 of file procfs.c.
References procinfo::pathname, and perror_with_name().
Referenced by iterate_over_mappings(), proc_trace_syscalls_1(), procfs_fetch_registers(), procfs_info_proc(), procfs_init_inferior(), procfs_pass_signals(), procfs_resume(), procfs_set_watchpoint(), procfs_wait(), and unconditionally_kill_inferior().
static int proc_find_memory_regions | ( | find_memory_region_ftype | func, |
void * | data | ||
) | [static] |
Definition at line 5059 of file procfs.c.
References find_memory_regions_callback(), find_procinfo_or_die(), inferior_ptid, iterate_over_mappings(), and ptid_get_pid().
Referenced by procfs_target().
static long proc_flags | ( | procinfo * | pi | ) | [static] |
Definition at line 1133 of file procfs.c.
References proc_get_status(), procinfo::prstatus, and procinfo::status_valid.
Referenced by do_attach(), do_detach(), proc_get_status(), proc_stop_process(), proc_wait_for_stop(), procfs_info_proc(), procfs_init_inferior(), procfs_stopped_by_watchpoint(), and procfs_wait().
static int proc_get_current_thread | ( | procinfo * | pi | ) | [static] |
Definition at line 2692 of file procfs.c.
Referenced by do_attach(), invalidate_cache(), proc_get_status(), proc_stop_process(), proc_wait_for_stop(), procfs_init_inferior(), and procfs_wait().
static gdb_fpregset_t* proc_get_fpregs | ( | procinfo * | pi | ) | [static] |
Definition at line 2199 of file procfs.c.
References procinfo::ctl_fd, FD_CTL, procinfo::fpregs_valid, procinfo::fpregset, memcpy(), open_procinfo_files(), proc_get_status(), procinfo::prstatus, procinfo::status_valid, and procinfo::tid.
Referenced by proc_set_fpregs(), and procfs_fetch_registers().
static gdb_gregset_t* proc_get_gregs | ( | procinfo * | pi | ) | [static] |
Definition at line 2182 of file procfs.c.
References procinfo::gregs_valid, proc_get_status(), procinfo::prstatus, and procinfo::status_valid.
Referenced by proc_set_gregs(), and procfs_fetch_registers().
static gdb_sigset_t* proc_get_held_signals | ( | procinfo * | pi, |
gdb_sigset_t * | save | ||
) | [static] |
Definition at line 1789 of file procfs.c.
References procinfo::ctl_fd, find_procinfo_or_die(), memcpy(), procinfo::pid, proc_get_status(), procinfo::prstatus, procinfo::status_valid, and procinfo::tid.
Referenced by do_attach(), and procfs_init_inferior().
static int proc_get_nthreads | ( | procinfo * | pi | ) | [static] |
Definition at line 2638 of file procfs.c.
Referenced by procfs_info_proc().
static int proc_get_status | ( | procinfo * | pi | ) | [static] |
Definition at line 1049 of file procfs.c.
References FD_STATUS, procinfo::fpregs_valid, procinfo::gregs_valid, memcpy(), open_procinfo_files(), proc_flags(), proc_get_current_thread(), PROC_PRETTYFPRINT_STATUS, proc_what(), proc_why(), procinfo::prstatus, read(), procinfo::status_fd, procinfo::status_valid, and procinfo::tid.
Referenced by proc_delete_dead_threads(), proc_flags(), proc_get_fpregs(), proc_get_gregs(), proc_get_held_signals(), proc_get_traced_faults(), proc_get_traced_signals(), proc_get_traced_sysentry(), proc_get_traced_sysexit(), proc_nsysarg(), proc_parent_pid(), proc_set_current_signal(), proc_sysargs(), proc_watchpoint_address(), proc_what(), proc_why(), and procfs_thread_alive().
static fltset_t* proc_get_traced_faults | ( | procinfo * | pi, |
fltset_t * | save | ||
) | [static] |
Definition at line 1861 of file procfs.c.
References procinfo::ctl_fd, find_procinfo_or_die(), memcpy(), procinfo::pid, proc_get_status(), procinfo::prstatus, procinfo::status_valid, and procinfo::tid.
Referenced by do_attach(), and procfs_init_inferior().
static gdb_sigset_t* proc_get_traced_signals | ( | procinfo * | pi, |
gdb_sigset_t * | save | ||
) | [static] |
Definition at line 1825 of file procfs.c.
References procinfo::ctl_fd, find_procinfo_or_die(), memcpy(), procinfo::pid, proc_get_status(), procinfo::prstatus, procinfo::status_valid, and procinfo::tid.
Referenced by do_attach(), and procfs_init_inferior().
static sysset_t* proc_get_traced_sysentry | ( | procinfo * | pi, |
sysset_t * | save | ||
) | [static] |
Definition at line 1897 of file procfs.c.
References procinfo::ctl_fd, FD_STATUS, find_procinfo_or_die(), gdb_premptysysset, memcpy(), open_procinfo_files(), procinfo::pid, proc_get_status(), procinfo::prstatus, read(), size, procinfo::status_fd, procinfo::status_valid, sysset_t_alloc(), sysset_t_size(), and procinfo::tid.
Referenced by do_attach(), proc_trace_syscalls_1(), and procfs_init_inferior().
static sysset_t* proc_get_traced_sysexit | ( | procinfo * | pi, |
sysset_t * | save | ||
) | [static] |
Definition at line 1964 of file procfs.c.
References procinfo::ctl_fd, FD_STATUS, find_procinfo_or_die(), gdb_premptysysset, memcpy(), open_procinfo_files(), procinfo::pid, proc_get_status(), procinfo::prstatus, read(), size, procinfo::status_fd, procinfo::status_valid, sysset_t_alloc(), sysset_t_size(), and procinfo::tid.
Referenced by do_attach(), proc_trace_syscalls_1(), and procfs_init_inferior().
static int proc_iterate_over_threads | ( | procinfo * | pi, |
int(*)(procinfo *, procinfo *, void *) | func, | ||
void * | ptr | ||
) | [static] |
Definition at line 2873 of file procfs.c.
References find_procinfo_or_die(), func, cleanup::next, procinfo::next, procinfo::pid, procinfo::thread_list, and procinfo::tid.
Referenced by procfs_find_new_threads(), and procfs_resume().
Definition at line 2366 of file procfs.c.
References procinfo::ctl_fd, FD_CTL, and open_procinfo_files().
Referenced by unconditionally_kill_inferior().
static int proc_modify_flag | ( | procinfo * | pi, |
long | flag, | ||
long | mode | ||
) | [static] |
Definition at line 1289 of file procfs.c.
References _, procinfo::ctl_fd, find_procinfo_or_die(), FLAG_RESET, FLAG_SET, procinfo::pid, procinfo::status_valid, and warning().
Referenced by proc_set_run_on_last_close(), proc_unset_inherit_on_fork(), and proc_unset_run_on_last_close().
static int proc_nsysarg | ( | procinfo * | pi | ) | [static] |
Definition at line 1208 of file procfs.c.
References proc_get_status(), procinfo::prstatus, and procinfo::status_valid.
Referenced by procfs_wait().
static int proc_parent_pid | ( | procinfo * | pi | ) | [static] |
Definition at line 2400 of file procfs.c.
References find_procinfo_or_die(), procinfo::pid, proc_get_status(), procinfo::prstatus, procinfo::status_valid, and procinfo::tid.
Referenced by unconditionally_kill_inferior().
static int proc_run_process | ( | procinfo * | pi, |
int | step, | ||
int | signo | ||
) | [static] |
Definition at line 1536 of file procfs.c.
References procinfo::ctl_fd, FD_CTL, memset(), open_procinfo_files(), and proc_set_current_signal().
Referenced by procfs_resume(), and procfs_wait().
static int proc_set_current_signal | ( | procinfo * | pi, |
int | signo | ||
) | [static] |
Definition at line 2066 of file procfs.c.
References procinfo::ctl_fd, find_procinfo_or_die(), gdb_signal_from_host(), get_last_target_status(), inferior_ptid, target_waitstatus::kind, memcpy(), procinfo::pid, proc_get_status(), procinfo::prstatus, ptid_equal(), target_waitstatus::sig, TARGET_WAITKIND_STOPPED, procinfo::tid, and target_waitstatus::value.
Referenced by do_detach(), and proc_run_process().
static int proc_set_fpregs | ( | procinfo * | pi | ) | [static] |
Definition at line 2308 of file procfs.c.
References procinfo::ctl_fd, FD_CTL, procinfo::fpregs_valid, memcpy(), open_procinfo_files(), proc_get_fpregs(), and procinfo::tid.
Referenced by invalidate_cache().
static int proc_set_gregs | ( | procinfo * | pi | ) | [static] |
Definition at line 2268 of file procfs.c.
References procinfo::ctl_fd, FD_CTL, procinfo::gregs_valid, memcpy(), open_procinfo_files(), and proc_get_gregs().
Referenced by invalidate_cache().
static int proc_set_held_signals | ( | procinfo * | pi, |
gdb_sigset_t * | sighold | ||
) | [static] |
Definition at line 1751 of file procfs.c.
References procinfo::ctl_fd, find_procinfo_or_die(), memcpy(), procinfo::pid, procinfo::status_valid, and procinfo::tid.
Referenced by do_detach().
static int proc_set_run_on_last_close | ( | procinfo * | pi | ) | [static] |
Definition at line 1391 of file procfs.c.
References FLAG_SET, and proc_modify_flag().
Referenced by do_attach(), do_detach(), and procfs_init_inferior().
static int proc_set_traced_faults | ( | procinfo * | pi, |
fltset_t * | fltset | ||
) | [static] |
Definition at line 1623 of file procfs.c.
References procinfo::ctl_fd, find_procinfo_or_die(), memcpy(), procinfo::pid, procinfo::status_valid, and procinfo::tid.
Referenced by do_detach(), and procfs_debug_inferior().
static int proc_set_traced_signals | ( | procinfo * | pi, |
gdb_sigset_t * | sigset | ||
) | [static] |
Definition at line 1583 of file procfs.c.
References _, procinfo::ctl_fd, find_procinfo_or_die(), memcpy(), procinfo::pid, procinfo::status_valid, procinfo::tid, and warning().
Referenced by do_detach(), procfs_debug_inferior(), and procfs_pass_signals().
static int proc_set_traced_sysentry | ( | procinfo * | pi, |
sysset_t * | sysset | ||
) | [static] |
Definition at line 1661 of file procfs.c.
References procinfo::ctl_fd, find_procinfo_or_die(), memcpy(), procinfo::pid, procinfo::status_valid, procinfo::tid, xfree(), and xmalloc().
Referenced by do_detach(), proc_trace_syscalls_1(), and procfs_debug_inferior().
static int proc_set_traced_sysexit | ( | procinfo * | pi, |
sysset_t * | sysset | ||
) | [static] |
Definition at line 1706 of file procfs.c.
References procinfo::ctl_fd, find_procinfo_or_die(), memcpy(), procinfo::pid, procinfo::status_valid, procinfo::tid, xfree(), and xmalloc().
Referenced by do_detach(), proc_trace_syscalls_1(), procfs_debug_inferior(), and procfs_set_exec_trap().
Definition at line 2436 of file procfs.c.
References procinfo::ctl_fd, len, and memcpy().
Referenced by procfs_set_watchpoint().
static int proc_stop_process | ( | procinfo * | pi | ) | [static] |
Definition at line 1443 of file procfs.c.
References procinfo::ctl_fd, FD_CTL, open_procinfo_files(), proc_flags(), proc_get_current_thread(), PROC_PRETTYFPRINT_STATUS, proc_what(), proc_why(), procinfo::prstatus, and procinfo::status_valid.
Referenced by do_attach().
static long* proc_sysargs | ( | procinfo * | pi | ) | [static] |
Definition at line 1225 of file procfs.c.
References proc_get_status(), procinfo::prstatus, and procinfo::status_valid.
Referenced by procfs_wait().
static void proc_trace_syscalls | ( | char * | args, |
int | from_tty, | ||
int | entry_or_exit, | ||
int | mode | ||
) | [static] |
Definition at line 5293 of file procfs.c.
References _, error(), error_no_arg(), find_procinfo_or_die(), inferior_ptid, proc_trace_syscalls_1(), and ptid_get_pid().
Referenced by proc_trace_sysentry_cmd(), proc_trace_sysexit_cmd(), proc_untrace_sysentry_cmd(), and proc_untrace_sysexit_cmd().
static void proc_trace_syscalls_1 | ( | procinfo * | pi, |
int | syscallnum, | ||
int | entry_or_exit, | ||
int | mode, | ||
int | from_tty | ||
) | [static] |
Definition at line 5262 of file procfs.c.
References FLAG_SET, gdb_praddsysset, gdb_prdelsysset, proc_error(), proc_get_traced_sysentry(), proc_get_traced_sysexit(), proc_set_traced_sysentry(), and proc_set_traced_sysexit().
Referenced by proc_trace_syscalls(), procfs_inferior_created(), procfs_init_inferior(), and procfs_wait().
static void proc_trace_sysentry_cmd | ( | char * | args, |
int | from_tty | ||
) | [static] |
Definition at line 5313 of file procfs.c.
References FLAG_SET, and proc_trace_syscalls().
static void proc_trace_sysexit_cmd | ( | char * | args, |
int | from_tty | ||
) | [static] |
Definition at line 5319 of file procfs.c.
References FLAG_SET, and proc_trace_syscalls().
static int proc_unset_inherit_on_fork | ( | procinfo * | pi | ) | [static] |
Definition at line 1412 of file procfs.c.
References FLAG_RESET, and proc_modify_flag().
Referenced by procfs_set_exec_trap().
static int proc_unset_run_on_last_close | ( | procinfo * | pi | ) | [static] |
Definition at line 1401 of file procfs.c.
References FLAG_RESET, and proc_modify_flag().
Referenced by procfs_set_exec_trap().
static void proc_untrace_sysentry_cmd | ( | char * | args, |
int | from_tty | ||
) | [static] |
Definition at line 5325 of file procfs.c.
References FLAG_RESET, and proc_trace_syscalls().
static void proc_untrace_sysexit_cmd | ( | char * | args, |
int | from_tty | ||
) | [static] |
Definition at line 5331 of file procfs.c.
References FLAG_RESET, and proc_trace_syscalls().
static int proc_update_threads | ( | procinfo * | pi | ) | [static] |
Definition at line 2851 of file procfs.c.
Referenced by procfs_find_new_threads().
static int proc_wait_for_stop | ( | procinfo * | pi | ) | [static] |
Definition at line 1480 of file procfs.c.
References procinfo::ctl_fd, find_procinfo_or_die(), procinfo::pid, proc_flags(), proc_get_current_thread(), PROC_PRETTYFPRINT_STATUS, proc_what(), proc_why(), procinfo::prstatus, procinfo::status_valid, and procinfo::tid.
Referenced by procfs_init_inferior(), and procfs_wait().
Definition at line 1029 of file procfs.c.
References procinfo::pathname, and print_sys_errmsg().
Referenced by do_detach(), invalidate_cache(), procfs_set_exec_trap(), and procfs_xfer_memory().
static int proc_watchpoint_address | ( | procinfo * | pi, |
CORE_ADDR * | addr | ||
) | [static] |
Definition at line 1184 of file procfs.c.
References builtin_type::builtin_data_ptr, builtin_type(), gdbarch_pointer_to_address(), proc_get_status(), procinfo::prstatus, procinfo::status_valid, and target_gdbarch().
Referenced by procfs_stopped_data_address().
Definition at line 1165 of file procfs.c.
References proc_get_status(), procinfo::prstatus, and procinfo::status_valid.
Referenced by do_attach(), proc_get_status(), proc_stop_process(), proc_wait_for_stop(), procfs_info_proc(), procfs_stopped_by_watchpoint(), and procfs_wait().
Definition at line 1149 of file procfs.c.
References proc_get_status(), procinfo::prstatus, and procinfo::status_valid.
Referenced by do_attach(), proc_get_status(), proc_stop_process(), proc_wait_for_stop(), procfs_info_proc(), procfs_stopped_by_watchpoint(), and procfs_wait().
static void procfs_attach | ( | struct target_ops * | ops, |
char * | args, | ||
int | from_tty | ||
) | [static] |
Definition at line 3046 of file procfs.c.
References _, do_attach(), error(), get_exec_file(), inferior_ptid, parse_pid_to_attach(), pid_to_ptid(), printf_filtered(), push_target(), and target_pid_to_str().
Referenced by procfs_target().
static int procfs_can_use_hw_breakpoint | ( | int | type, |
int | cnt, | ||
int | othertype | ||
) | [static] |
Definition at line 4842 of file procfs.c.
References builtin_type::builtin_data_ptr, builtin_type(), target_gdbarch(), and TYPE_LENGTH.
Referenced by procfs_use_watchpoints().
static void procfs_create_inferior | ( | struct target_ops * | ops, |
char * | exec_file, | ||
char * | allargs, | ||
char ** | env, | ||
int | from_tty | ||
) | [static] |
Definition at line 4605 of file procfs.c.
References _, error(), fork_inferior(), len, p, inferior::pid, procfs_init_inferior(), procfs_set_exec_trap(), and strchr().
Referenced by procfs_target().
static int procfs_debug_inferior | ( | procinfo * | pi | ) | [static] |
Definition at line 2926 of file procfs.c.
References procinfo::ctl_fd, gdb_praddsysset, gdb_prdelset, gdb_premptysysset, proc_set_traced_faults(), proc_set_traced_signals(), proc_set_traced_sysentry(), proc_set_traced_sysexit(), exsummary::status, sysset_t_alloc(), and xfree().
Referenced by do_attach(), and procfs_init_inferior().
static void procfs_detach | ( | struct target_ops * | ops, |
char * | args, | ||
int | from_tty | ||
) | [static] |
Definition at line 3074 of file procfs.c.
References _, detach_inferior(), do_detach(), gdb_flush(), gdb_stdout, get_exec_file(), inferior_ptid, null_ptid, pid_to_ptid(), printf_filtered(), ptid_get_pid(), target_pid_to_str(), and unpush_target().
Referenced by procfs_target().
static void procfs_fetch_registers | ( | struct target_ops * | ops, |
struct regcache * | regcache, | ||
int | regnum | ||
) | [static] |
Definition at line 3232 of file procfs.c.
References _, error(), find_procinfo_or_die(), gdbarch_fp0_regnum(), gdbarch_pc_regnum(), gdbarch_sp_regnum(), get_regcache_arch(), inferior_ptid, inferior::pid, proc_error(), proc_get_fpregs(), proc_get_gregs(), ptid_get_lwp(), ptid_get_pid(), supply_fpregset(), supply_gregset(), and target_pid_to_str().
Referenced by procfs_target().
static void procfs_files_info | ( | struct target_ops * | ignore | ) | [static] |
Definition at line 4254 of file procfs.c.
References _, inferior::attach_flag, current_inferior(), inferior_ptid, printf_filtered(), and target_pid_to_str().
Referenced by procfs_target().
static void procfs_find_new_threads | ( | struct target_ops * | ops | ) | [static] |
Definition at line 4727 of file procfs.c.
References find_procinfo_or_die(), inferior_ptid, proc_iterate_over_threads(), proc_update_threads(), procfs_notice_thread(), and ptid_get_pid().
Referenced by procfs_target().
ptid_t procfs_first_available | ( | void | ) |
Definition at line 5368 of file procfs.c.
References procinfo::pid, and pid_to_ptid().
Referenced by rw_common(), sol_thread_resume(), sol_thread_wait(), and sol_thread_xfer_partial().
static void procfs_inferior_created | ( | struct target_ops * | ops, |
int | from_tty | ||
) | [static] |
Definition at line 4689 of file procfs.c.
References current_inferior(), current_target, find_procinfo_or_die(), FLAG_RESET, inferior_ptid, proc_trace_syscalls_1(), ptid_get_pid(), and target_can_run.
static void procfs_info_proc | ( | struct target_ops * | ops, |
char * | args, | ||
enum info_proc_what | what | ||
) | [static] |
Definition at line 5158 of file procfs.c.
References _, create_procinfo(), do_cleanups(), do_destroy_procinfo_cleanup(), error(), FD_CTL, find_procinfo(), gdb_buildargv(), inferior_ptid, info_proc_mappings(), IP_ALL, IP_MAPPINGS, IP_MINIMAL, make_cleanup(), make_cleanup_freeargv(), mappings, null_cleanup(), open_procinfo_files(), procinfo::pid, printf_filtered(), proc_error(), proc_flags(), proc_get_nthreads(), proc_prettyprint_flags(), proc_prettyprint_why(), proc_what(), proc_why(), ptid_get_pid(), and procinfo::tid.
Referenced by procfs_target().
static void procfs_init_inferior | ( | struct target_ops * | ops, |
int | pid | ||
) | [static] |
Definition at line 4382 of file procfs.c.
References _, create_procinfo(), dead_procinfo(), FD_CTL, FLAG_SET, KILL, open_procinfo_files(), pid_to_ptid(), proc_error(), proc_flags(), proc_get_current_thread(), proc_get_held_signals(), proc_get_traced_faults(), proc_get_traced_signals(), proc_get_traced_sysentry(), proc_get_traced_sysexit(), proc_set_run_on_last_close(), proc_trace_syscalls_1(), proc_wait_for_stop(), procfs_debug_inferior(), ptid_build(), push_target(), procinfo::saved_entryset, procinfo::saved_exitset, procinfo::saved_fltset, procinfo::saved_sighold, procinfo::saved_sigset, signals, START_INFERIOR_TRAPS_EXPECTED, startup_inferior(), and thread_change_ptid().
Referenced by procfs_create_inferior().
static int procfs_insert_watchpoint | ( | CORE_ADDR | addr, |
int | len, | ||
int | type, | ||
struct expression * | cond | ||
) | [static] |
Definition at line 4905 of file procfs.c.
References gdbarch_have_nonsteppable_watchpoint(), inferior_ptid, procfs_set_watchpoint(), target_gdbarch(), and target_have_steppable_watchpoint.
Referenced by procfs_use_watchpoints().
static void procfs_kill_inferior | ( | struct target_ops * | ops | ) | [static] |
Definition at line 4337 of file procfs.c.
References find_procinfo(), inferior_ptid, null_ptid, ptid_equal(), ptid_get_pid(), target_mourn_inferior(), and unconditionally_kill_inferior().
Referenced by procfs_target().
static char * procfs_make_note_section | ( | bfd * | obfd, |
int * | note_size | ||
) | [static] |
static void procfs_mourn_inferior | ( | struct target_ops * | ops | ) | [static] |
Definition at line 4353 of file procfs.c.
References deprecated_remove_raw_breakpoint(), destroy_procinfo(), find_procinfo(), generic_mourn_inferior(), inferior_ptid, null_ptid, ptid_equal(), ptid_get_pid(), target_gdbarch(), and unpush_target().
Referenced by procfs_target().
static int procfs_notice_thread | ( | procinfo * | pi, |
procinfo * | thread, | ||
void * | ptr | ||
) | [static] |
Definition at line 4713 of file procfs.c.
References add_thread(), in_thread_list(), is_exited(), procinfo::pid, ptid_build(), and procinfo::tid.
Referenced by procfs_find_new_threads().
static void procfs_pass_signals | ( | int | numsigs, |
unsigned char * | pass_signals | ||
) | [static] |
Definition at line 4232 of file procfs.c.
References find_procinfo_or_die(), gdb_prdelset, gdb_signal_from_host(), inferior_ptid, proc_error(), proc_set_traced_signals(), ptid_get_pid(), and signals.
Referenced by procfs_target().
static char * procfs_pid_to_str | ( | struct target_ops * | ops, |
ptid_t | ptid | ||
) | [static] |
Definition at line 4769 of file procfs.c.
References ptid_get_lwp(), and ptid_get_pid().
Referenced by procfs_target().
static int procfs_region_ok_for_hw_watchpoint | ( | CORE_ADDR | addr, |
int | len | ||
) | [static] |
Definition at line 4934 of file procfs.c.
Referenced by procfs_use_watchpoints().
static int procfs_remove_watchpoint | ( | CORE_ADDR | addr, |
int | len, | ||
int | type, | ||
struct expression * | cond | ||
) | [static] |
Definition at line 4927 of file procfs.c.
References inferior_ptid, and procfs_set_watchpoint().
Referenced by procfs_use_watchpoints().
static void procfs_resume | ( | struct target_ops * | ops, |
ptid_t | ptid, | ||
int | step, | ||
enum gdb_signal | signo | ||
) | [static] |
Definition at line 4150 of file procfs.c.
References _, find_procinfo(), find_procinfo_or_die(), gdb_signal_to_host(), procinfo::ignore_next_sigstop, inferior_ptid, invalidate_cache(), proc_error(), proc_iterate_over_threads(), proc_run_process(), ptid_get_lwp(), ptid_get_pid(), procinfo::tid, and warning().
Referenced by procfs_target().
static void procfs_set_exec_trap | ( | void | ) | [static] |
Definition at line 4493 of file procfs.c.
References _, create_procinfo(), procinfo::ctl_fd, FD_CTL, gdb_flush(), gdb_praddsysset, gdb_premptysysset, gdb_stderr, open_procinfo_files(), perror_with_name(), proc_set_traced_sysexit(), proc_unset_inherit_on_fork(), proc_unset_run_on_last_close(), proc_warn(), and sysset_t_alloc().
Referenced by procfs_create_inferior().
static int procfs_set_watchpoint | ( | ptid_t | ptid, |
CORE_ADDR | addr, | ||
int | len, | ||
int | rwflag, | ||
int | after | ||
) | [static] |
Definition at line 4784 of file procfs.c.
References AFTER_WATCHFLAG, EXEC_WATCHFLAG, find_procinfo_or_die(), hw_access, hw_execute, hw_read, hw_write, inferior_ptid, proc_error(), proc_set_watchpoint(), ptid_get_pid(), READ_WATCHFLAG, and WRITE_WATCHFLAG.
Referenced by procfs_insert_watchpoint(), and procfs_remove_watchpoint().
static void procfs_stop | ( | ptid_t | ptid | ) | [static] |
Definition at line 4268 of file procfs.c.
Referenced by procfs_target().
static int procfs_stopped_by_watchpoint | ( | void | ) | [static] |
Definition at line 4866 of file procfs.c.
References find_procinfo_or_die(), inferior_ptid, proc_flags(), proc_what(), proc_why(), and ptid_get_pid().
Referenced by procfs_use_watchpoints().
static int procfs_stopped_data_address | ( | struct target_ops * | targ, |
CORE_ADDR * | addr | ||
) | [static] |
Definition at line 4896 of file procfs.c.
References find_procinfo_or_die(), inferior_ptid, proc_watchpoint_address(), and ptid_get_pid().
Referenced by procfs_use_watchpoints().
static void procfs_store_registers | ( | struct target_ops * | ops, |
struct regcache * | regcache, | ||
int | regnum | ||
) | [static] |
struct target_ops* procfs_target | ( | void | ) | [read] |
Definition at line 183 of file procfs.c.
References target_ops::deprecated_xfer_memory, inf_child_target(), OPS_MAGIC, proc_find_memory_regions(), procfs_attach(), procfs_create_inferior(), procfs_detach(), procfs_fetch_registers(), procfs_files_info(), procfs_find_new_threads(), procfs_info_proc(), procfs_kill_inferior(), procfs_make_note_section(), procfs_mourn_inferior(), procfs_pass_signals(), procfs_pid_to_str(), procfs_resume(), procfs_stop(), procfs_store_registers(), procfs_thread_alive(), procfs_wait(), procfs_xfer_memory(), procfs_xfer_partial(), tc_schedlock, target_ops::to_attach, target_ops::to_auxv_parse, target_ops::to_create_inferior, target_ops::to_detach, target_ops::to_doc, target_ops::to_fetch_registers, target_ops::to_files_info, target_ops::to_find_memory_regions, target_ops::to_find_new_threads, target_ops::to_has_thread_control, target_ops::to_info_proc, target_ops::to_kill, target_ops::to_longname, target_ops::to_magic, target_ops::to_make_corefile_notes, target_ops::to_mourn_inferior, target_ops::to_pass_signals, target_ops::to_pid_to_str, target_ops::to_resume, target_ops::to_shortname, target_ops::to_stop, target_ops::to_store_registers, target_ops::to_thread_alive, target_ops::to_wait, and target_ops::to_xfer_partial.
Referenced by _initialize_alpha_nat(), _initialize_amd64_sol2_nat(), _initialize_irix5_nat(), and _initialize_sparc_sol2_nat().
static int procfs_thread_alive | ( | struct target_ops * | ops, |
ptid_t | ptid | ||
) | [static] |
Definition at line 4742 of file procfs.c.
References destroy_procinfo(), find_procinfo(), proc_get_status(), ptid_get_lwp(), and ptid_get_pid().
Referenced by procfs_target().
void procfs_use_watchpoints | ( | struct target_ops * | t | ) |
Definition at line 4945 of file procfs.c.
References procfs_can_use_hw_breakpoint(), procfs_insert_watchpoint(), procfs_region_ok_for_hw_watchpoint(), procfs_remove_watchpoint(), procfs_stopped_by_watchpoint(), procfs_stopped_data_address(), target_ops::to_can_use_hw_breakpoint, target_ops::to_insert_watchpoint, target_ops::to_region_ok_for_hw_watchpoint, target_ops::to_remove_watchpoint, target_ops::to_stopped_by_watchpoint, and target_ops::to_stopped_data_address.
Referenced by _initialize_amd64_sol2_nat(), _initialize_irix5_nat(), and _initialize_sparc_sol2_nat().
static ptid_t procfs_wait | ( | struct target_ops * | ops, |
ptid_t | ptid, | ||
struct target_waitstatus * | status, | ||
int | options | ||
) | [static] |
Definition at line 3570 of file procfs.c.
References _, add_thread(), inferior::attach_flag, create_procinfo(), delete_thread(), error(), find_inferior_pid(), find_procinfo(), find_procinfo_or_die(), FLAG_RESET, flags, procinfo::fpregs_valid, get_current_regcache(), procinfo::gregs_valid, in_thread_list(), arm-linux::inf, inferior_ptid, info_verbose, target_waitstatus::kind, procinfo::pid, pid_to_ptid(), print_thread_events, printf_filtered(), printf_unfiltered(), proc_error(), proc_flags(), proc_get_current_thread(), proc_nsysarg(), proc_prettyprint_flags(), proc_prettyprint_syscall(), proc_prettyprint_why(), proc_run_process(), proc_sysargs(), proc_trace_syscalls_1(), proc_wait_for_stop(), proc_what(), proc_why(), ptid_build(), ptid_equal(), ptid_get_lwp(), ptid_get_pid(), regcache_read_pc(), remove_dbx_link_breakpoint(), target_waitstatus::sig, procinfo::status_valid, store_waitstatus(), syscall_is_exec(), syscall_is_exit(), syscall_is_lwp_create(), syscall_is_lwp_exit(), target_pid_to_str(), target_resume(), TARGET_WAITKIND_SPURIOUS, TARGET_WAITKIND_STOPPED, and target_waitstatus::value.
Referenced by procfs_target().
static int procfs_xfer_memory | ( | CORE_ADDR | memaddr, |
gdb_byte * | myaddr, | ||
int | len, | ||
int | dowrite, | ||
struct mem_attrib * | attrib, | ||
struct target_ops * | target | ||
) | [static] |
Definition at line 4023 of file procfs.c.
References procinfo::as_fd, FD_AS, find_procinfo_or_die(), inferior_ptid, open_procinfo_files(), proc_warn(), PROCFS_NOTE, ptid_get_pid(), and read().
Referenced by procfs_target().
static LONGEST procfs_xfer_partial | ( | struct target_ops * | ops, |
enum target_object | object, | ||
const char * | annex, | ||
gdb_byte * | readbuf, | ||
const gdb_byte * | writebuf, | ||
ULONGEST | offset, | ||
LONGEST | len | ||
) | [static] |
Definition at line 3982 of file procfs.c.
References target_ops::beneath, target_ops::deprecated_xfer_memory, len, memory_xfer_auxv(), offset, TARGET_OBJECT_AUXV, TARGET_OBJECT_MEMORY, and target_ops::to_xfer_partial.
Referenced by procfs_target().
static void remove_dbx_link_breakpoint | ( | void | ) | [static] |
Definition at line 3394 of file procfs.c.
References _, deprecated_remove_raw_breakpoint(), target_gdbarch(), and warning().
Referenced by procfs_wait().
static int syscall_is_exec | ( | procinfo * | pi, |
int | scall | ||
) | [static] |
Definition at line 3352 of file procfs.c.
Referenced by procfs_wait().
static int syscall_is_exit | ( | procinfo * | pi, |
int | scall | ||
) | [static] |
Definition at line 3338 of file procfs.c.
Referenced by procfs_wait().
static int syscall_is_lwp_create | ( | procinfo * | pi, |
int | scall | ||
) | [static] |
Definition at line 3376 of file procfs.c.
Referenced by procfs_wait().
static int syscall_is_lwp_exit | ( | procinfo * | pi, |
int | scall | ||
) | [static] |
Definition at line 3324 of file procfs.c.
Referenced by procfs_wait().
static sysset_t * sysset_t_alloc | ( | procinfo * | pi | ) | [static] |
Definition at line 849 of file procfs.c.
References size, sysset_t_size(), and xmalloc().
Referenced by create_procinfo(), proc_get_traced_sysentry(), proc_get_traced_sysexit(), procfs_debug_inferior(), and procfs_set_exec_trap().
static int sysset_t_size | ( | procinfo * | p | ) | [static] |
Definition at line 835 of file procfs.c.
Referenced by proc_get_traced_sysentry(), proc_get_traced_sysexit(), and sysset_t_alloc().
static void unconditionally_kill_inferior | ( | procinfo * | pi | ) | [static] |
Definition at line 4279 of file procfs.c.
References procinfo::ctl_fd, destroy_procinfo(), memset(), procinfo::pid, printf_filtered(), proc_error(), proc_kill(), proc_parent_pid(), and exsummary::status.
Referenced by procfs_kill_inferior().
void* dbx_link_bpt [static] |
int dbx_link_bpt_addr = 0 [static] |
procinfo* procinfo_list [static] |
Definition at line 447 of file procfs.c.
Referenced by create_procinfo().