GDB (xrefs)
|
#include "defs.h"
#include "inferior.h"
#include "infrun.h"
#include "target.h"
#include "nat/linux-nat.h"
#include "nat/linux-waitpid.h"
#include "gdbsupport/gdb_wait.h"
#include <unistd.h>
#include <sys/syscall.h>
#include "nat/gdb_ptrace.h"
#include "linux-nat.h"
#include "nat/linux-ptrace.h"
#include "nat/linux-procfs.h"
#include "nat/linux-personality.h"
#include "linux-fork.h"
#include "gdbthread.h"
#include "gdbcmd.h"
#include "regcache.h"
#include "regset.h"
#include "inf-child.h"
#include "inf-ptrace.h"
#include "auxv.h"
#include <sys/procfs.h>
#include "elf-bfd.h"
#include "gregset.h"
#include "gdbcore.h"
#include <ctype.h>
#include <sys/stat.h>
#include <fcntl.h>
#include "inf-loop.h"
#include "gdbsupport/event-loop.h"
#include "event-top.h"
#include <pwd.h>
#include <sys/types.h>
#include <dirent.h>
#include "xml-support.h"
#include <sys/vfs.h>
#include "solib.h"
#include "nat/linux-osdata.h"
#include "linux-tdep.h"
#include "symfile.h"
#include "gdbsupport/agent.h"
#include "tracepoint.h"
#include "target-descriptions.h"
#include "gdbsupport/filestuff.h"
#include "objfiles.h"
#include "nat/linux-namespaces.h"
#include "gdbsupport/block-signals.h"
#include "gdbsupport/fileio.h"
#include "gdbsupport/scope-exit.h"
#include "gdbsupport/gdb-sigmask.h"
#include "gdbsupport/common-debug.h"
#include <unordered_map>
Go to the source code of this file.
Classes | |
struct | simple_pid_list |
struct | lwp_deleter |
class | proc_mem_file |
Macros | |
#define | O_LARGEFILE 0 |
#define | linux_nat_debug_printf(fmt, ...) debug_prefixed_printf_cond (debug_linux_nat, "linux-nat", fmt, ##__VA_ARGS__) |
#define | LINUX_NAT_SCOPED_DEBUG_ENTER_EXIT scoped_debug_enter_exit (debug_linux_nat, "linux-nat") |
Typedefs | |
typedef std::unique_ptr< struct lwp_info, lwp_deleter > | lwp_info_up |
Functions | |
static void | show_debug_linux_nat (struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value) |
static int | kill_lwp (int lwpid, int signo) |
static int | stop_callback (struct lwp_info *lp) |
static void | block_child_signals (sigset_t *prev_mask) |
static void | restore_child_signals_mask (sigset_t *prev_mask) |
static struct lwp_info * | add_lwp (ptid_t ptid) |
static void | purge_lwp_list (int pid) |
static void | delete_lwp (ptid_t ptid) |
static struct lwp_info * | find_lwp_pid (ptid_t ptid) |
static int | lwp_status_pending_p (struct lwp_info *lp) |
static void | save_stop_reason (struct lwp_info *lp) |
static bool | proc_mem_file_is_writable () |
static void | close_proc_mem_file (pid_t pid) |
static void | open_proc_mem_file (ptid_t ptid) |
static bool | is_leader (lwp_info *lp) |
static std::string | pending_status_str (lwp_info *lp) |
ptid_t | ptid_of_lwp (struct lwp_info *lwp) |
void | lwp_set_arch_private_info (struct lwp_info *lwp, struct arch_lwp_info *info) |
struct arch_lwp_info * | lwp_arch_private_info (struct lwp_info *lwp) |
int | lwp_is_stopped (struct lwp_info *lwp) |
enum target_stop_reason | lwp_stop_reason (struct lwp_info *lwp) |
int | lwp_is_stepping (struct lwp_info *lwp) |
static void | add_to_pid_list (struct simple_pid_list **listp, int pid, int status) |
static int | pull_pid_from_list (struct simple_pid_list **listp, int pid, int *statusp) |
static int | linux_nat_ptrace_options (int attached) |
static void | linux_init_ptrace_procfs (pid_t pid, int attached) |
static int | num_lwps (int pid) |
static hashval_t | lwp_info_hash (const void *ap) |
static int | lwp_lwpid_htab_eq (const void *a, const void *b) |
static void | lwp_lwpid_htab_create (void) |
static void | lwp_lwpid_htab_add_lwp (struct lwp_info *lp) |
lwp_info_range | all_lwps () |
lwp_info_safe_range | all_lwps_safe () |
static void | lwp_list_add (struct lwp_info *lp) |
static void | lwp_list_remove (struct lwp_info *lp) |
static int | stop_wait_callback (struct lwp_info *lp) |
static int | resume_stopped_resumed_lwps (struct lwp_info *lp, const ptid_t wait_ptid) |
static int | check_ptrace_stopped_lwp_gone (struct lwp_info *lp) |
static int | lwp_lwpid_htab_remove_pid (void **slot, void *info) |
static struct lwp_info * | add_initial_lwp (ptid_t ptid) |
struct lwp_info * | iterate_over_lwps (ptid_t filter, gdb::function_view< iterate_over_lwps_ftype > callback) |
void | linux_nat_switch_fork (ptid_t new_ptid) |
static void | exit_lwp (struct lwp_info *lp) |
static int | linux_nat_post_attach_wait (ptid_t ptid, int *signalled) |
static int | attach_proc_task_lwp_callback (ptid_t ptid) |
static void | detach_one_pid (int pid, int signo) |
static int | get_detach_signal (struct lwp_info *lp) |
static void | detach_one_lwp (struct lwp_info *lp, int *signo_p) |
static int | detach_callback (struct lwp_info *lp) |
static void | linux_resume_one_lwp_throw (struct lwp_info *lp, int step, enum gdb_signal signo) |
static void | linux_resume_one_lwp (struct lwp_info *lp, int step, enum gdb_signal signo) |
static void | resume_lwp (struct lwp_info *lp, int step, enum gdb_signal signo) |
static int | linux_nat_resume_callback (struct lwp_info *lp, struct lwp_info *except) |
static int | resume_clear_callback (struct lwp_info *lp) |
static int | resume_set_callback (struct lwp_info *lp) |
static int | linux_handle_syscall_trap (struct lwp_info *lp, int stopping) |
static int | linux_handle_extended_wait (struct lwp_info *lp, int status) |
static void | wait_for_signal () |
static int | wait_lwp (struct lwp_info *lp) |
void | linux_stop_lwp (struct lwp_info *lwp) |
void | linux_stop_and_wait_all_lwps (void) |
void | linux_unstop_all_lwps (void) |
static int | linux_nat_has_pending_sigint (int pid) |
static int | set_ignore_sigint (struct lwp_info *lp) |
static void | maybe_clear_ignore_sigint (struct lwp_info *lp) |
static int | check_stopped_by_watchpoint (struct lwp_info *lp) |
static int | status_callback (struct lwp_info *lp) |
static int | count_events_callback (struct lwp_info *lp, int *count) |
static int | select_singlestep_lwp_callback (struct lwp_info *lp) |
static int | select_event_lwp_callback (struct lwp_info *lp, int *selector) |
static void | select_event_lwp (ptid_t filter, struct lwp_info **orig_lp, int *status) |
static int | resumed_callback (struct lwp_info *lp) |
static void | linux_nat_filter_event (int lwpid, int status) |
static void | check_zombie_leaders (void) |
static ptid_t | filter_exit_event (struct lwp_info *event_child, struct target_waitstatus *ourstatus) |
static ptid_t | linux_nat_wait_1 (ptid_t ptid, struct target_waitstatus *ourstatus, target_wait_flags target_options) |
static void | kill_one_lwp (pid_t pid) |
static void | kill_wait_one_lwp (pid_t pid) |
static int | kill_callback (struct lwp_info *lp) |
static int | kill_wait_callback (struct lwp_info *lp) |
static void | kill_unfollowed_fork_children (struct inferior *inf) |
static void | siginfo_fixup (siginfo_t *siginfo, gdb_byte *inf_siginfo, int direction) |
static enum target_xfer_status | linux_xfer_siginfo (ptid_t ptid, enum target_object object, const char *annex, gdb_byte *readbuf, const gdb_byte *writebuf, ULONGEST offset, ULONGEST len, ULONGEST *xfered_len) |
static enum target_xfer_status | linux_nat_xfer_osdata (enum target_object object, const char *annex, gdb_byte *readbuf, const gdb_byte *writebuf, ULONGEST offset, ULONGEST len, ULONGEST *xfered_len) |
static enum target_xfer_status | linux_proc_xfer_memory_partial (int pid, gdb_byte *readbuf, const gdb_byte *writebuf, ULONGEST offset, LONGEST len, ULONGEST *xfered_len) |
static enum target_xfer_status | linux_proc_xfer_memory_partial_fd (int fd, int pid, gdb_byte *readbuf, const gdb_byte *writebuf, ULONGEST offset, LONGEST len, ULONGEST *xfered_len) |
static void | add_line_to_sigset (const char *line, sigset_t *sigs) |
void | linux_proc_pending_signals (int pid, sigset_t *pending, sigset_t *blocked, sigset_t *ignored) |
static void | sigchld_handler (int signo) |
static void | handle_target_event (int error, gdb_client_data client_data) |
static int | linux_nat_stop_lwp (struct lwp_info *lwp) |
static pid_t | linux_nat_fileio_pid_of (struct inferior *inf) |
bool | linux_nat_get_siginfo (ptid_t ptid, siginfo_t *siginfo) |
ptid_t | current_lwp_ptid (void) |
void | _initialize_linux_nat () |
unsigned int | lin_thread_get_thread_signal_num (void) |
int | lin_thread_get_thread_signal (unsigned int i) |
Variables | |
struct linux_nat_target * | linux_target |
enum tribool | have_ptrace_getregset = TRIBOOL_UNKNOWN |
static bool | debug_linux_nat |
static struct simple_pid_list * | stopped_pids |
static int | report_thread_events |
static htab_t | lwp_lwpid_htab |
static intrusive_list< lwp_info > | lwp_list |
static sigset_t | suspend_mask |
static sigset_t | blocked_mask |
static struct sigaction | sigchld_action |
static sigset_t | pass_mask |
static std::unordered_map< int, proc_mem_file > | proc_mem_file_map |
static int | lin_thread_signals [] = { __SIGRTMIN, __SIGRTMIN + 1 } |
#define linux_nat_debug_printf | ( | fmt, | |
... ) debug_prefixed_printf_cond (debug_linux_nat, "linux-nat", fmt, ##__VA_ARGS__) |
Definition at line 210 of file linux-nat.c.
Referenced by linux_nat_target::attach(), attach_proc_task_lwp_callback(), check_zombie_leaders(), detach_one_lwp(), detach_one_pid(), linux_nat_target::follow_fork(), get_detach_signal(), kill_one_lwp(), kill_wait_one_lwp(), linux_handle_extended_wait(), linux_handle_syscall_trap(), linux_nat_filter_event(), linux_nat_post_attach_wait(), linux_nat_stop_lwp(), linux_nat_wait_1(), linux_proc_xfer_memory_partial_fd(), maybe_clear_ignore_sigint(), open_proc_mem_file(), linux_nat_target::resume(), resume_lwp(), resume_stopped_resumed_lwps(), save_stop_reason(), select_event_lwp(), status_callback(), stop_callback(), stop_wait_callback(), linux_nat_target::wait(), wait_for_signal(), wait_lwp(), and proc_mem_file::~proc_mem_file().
#define LINUX_NAT_SCOPED_DEBUG_ENTER_EXIT scoped_debug_enter_exit (debug_linux_nat, "linux-nat") |
Definition at line 215 of file linux-nat.c.
Referenced by linux_nat_target::detach(), detach_one_lwp(), linux_nat_wait_1(), linux_nat_target::mourn_inferior(), linux_nat_target::stop(), and linux_nat_target::wait().
#define O_LARGEFILE 0 |
Definition at line 186 of file linux-nat.c.
Referenced by open_proc_mem_file(), and proc_mem_file_is_writable().
typedef std::unique_ptr<struct lwp_info, lwp_deleter> lwp_info_up |
Definition at line 433 of file linux-nat.c.
void _initialize_linux_nat | ( | ) |
Definition at line 4496 of file linux-nat.c.
Referenced by initialize_all_files().
|
static |
Definition at line 781 of file linux-nat.c.
References lwp_info::lwp_info(), lwp_list_add(), lwp_lwpid_htab_add_lwp(), and lwp_info::ptid.
Referenced by add_lwp(), linux_nat_target::attach(), and linux_nat_wait_1().
|
static |
Definition at line 4050 of file linux-nat.c.
Referenced by linux_proc_pending_signals().
|
static |
Definition at line 802 of file linux-nat.c.
References add_initial_lwp(), linux_target, linux_nat_target::low_new_thread(), and lwp_info::ptid.
Referenced by attach_proc_task_lwp_callback(), linux_nat_target::follow_fork(), linux_handle_extended_wait(), linux_nat_filter_event(), and linux_nat_switch_fork().
|
static |
Definition at line 327 of file linux-nat.c.
References simple_pid_list::next, pid, simple_pid_list::pid, status, and simple_pid_list::status.
Referenced by linux_nat_filter_event().
lwp_info_range all_lwps | ( | ) |
Definition at line 638 of file linux-nat.c.
References lwp_list.
Referenced by ia64_linux_nat_target::insert_watchpoint(), num_lwps(), ia64_linux_nat_target::remove_watchpoint(), try_thread_db_load_1(), linux_nat_target::update_thread_list(), and write_watchpoint_regs().
lwp_info_safe_range all_lwps_safe | ( | ) |
|
static |
Definition at line 995 of file linux-nat.c.
References add_lwp(), add_thread(), err, find_lwp_pid(), linux_nat_debug_printf, linux_proc_pid_is_gone(), linux_ptrace_attach_fail_reason_string(), linux_target, lwp_info::must_set_ptrace_flags, lwp_info::ptid, ptrace, lwp_info::resumed, set_executing(), set_running(), and lwp_info::signalled.
Referenced by linux_nat_target::attach().
|
static |
Definition at line 685 of file linux-nat.c.
References blocked_mask.
Referenced by linux_nat_wait_1(), and wait_lwp().
|
static |
Definition at line 1494 of file linux-nat.c.
References linux_proc_pid_is_trace_stopped_nowarn(), lwp_info::ptid, target_waitstatus::set_ignore(), lwp_info::status, lwp_info::stop_reason, lwp_info::stopped, TARGET_STOPPED_BY_NO_REASON, and lwp_info::waitstatus.
Referenced by detach_one_lwp(), linux_resume_one_lwp(), and resume_stopped_resumed_lwps().
|
static |
Definition at line 2302 of file linux-nat.c.
References inferior_ptid, linux_target, linux_nat_target::low_stopped_by_watchpoint(), linux_nat_target::low_stopped_data_address(), lwp_info::ptid, lwp_info::stop_reason, lwp_info::stopped_data_address, lwp_info::stopped_data_address_p, and TARGET_STOPPED_BY_WATCHPOINT.
Referenced by save_stop_reason().
|
static |
Definition at line 3028 of file linux-nat.c.
References all_inferiors(), exit_lwp(), find_lwp_pid(), linux_nat_debug_printf, linux_proc_pid_is_zombie(), num_lwps(), and inf::pid.
Referenced by linux_nat_wait_1().
|
static |
Definition at line 3873 of file linux-nat.c.
References pid, and proc_mem_file_map.
Referenced by linux_nat_target::detach(), linux_nat_target::follow_fork(), linux_handle_extended_wait(), and linux_nat_target::mourn_inferior().
|
static |
Definition at line 2484 of file linux-nat.c.
References lwp_status_pending_p(), and lwp_info::resumed.
Referenced by select_event_lwp().
ptid_t current_lwp_ptid | ( | void | ) |
Definition at line 4488 of file linux-nat.c.
References inferior_ptid.
Referenced by aarch64_downgrade_regs(), s390_refresh_per_info(), x86_linux_dr_get_addr(), x86_linux_dr_get_control(), x86_linux_dr_get_status(), x86_linux_dr_set_addr(), and x86_linux_dr_set_control().
|
static |
Definition at line 820 of file linux-nat.c.
References dummy, lwp_list_remove(), lwp_lwpid_htab, and lwp_info::ptid.
Referenced by detach_one_lwp(), exit_lwp(), and lwp_deleter::operator()().
|
static |
Definition at line 1388 of file linux-nat.c.
References detach_one_lwp(), and lwp_info::ptid.
Referenced by linux_nat_target::detach().
|
static |
Definition at line 1288 of file linux-nat.c.
References check_ptrace_stopped_lwp_gone(), target_waitstatus::child_ptid, delete_lwp(), detach_one_pid(), process_stratum_target::find_thread(), get_detach_signal(), thread_info::has_pending_waitstatus(), kill_lwp(), target_waitstatus::kind(), linux_is_extended_waitstatus(), linux_nat_debug_printf, LINUX_NAT_SCOPED_DEBUG_ENTER_EXIT, linux_ptrace_get_extended_event(), linux_target, linux_nat_target::low_prepare_to_resume(), thread_info::pending_follow, thread_info::pending_waitstatus(), perror_warning_with_name(), lwp_info::ptid, ptrace, PTRACE_EVENT_FORK, PTRACE_EVENT_VFORK, PTRACE_GETEVENTMSG, lwp_info::signalled, lwp_info::status, lwp_info::stopped, TARGET_WAITKIND_FORKED, TARGET_WAITKIND_VFORKED, and lwp_info::waitstatus.
Referenced by linux_nat_target::detach(), and detach_callback().
|
static |
Definition at line 1156 of file linux-nat.c.
References __WALL, linux_nat_debug_printf, my_waitpid(), pid, ptrace, and status.
Referenced by detach_one_lwp().
|
static |
Definition at line 904 of file linux-nat.c.
References delete_lwp(), delete_thread(), process_stratum_target::find_thread(), linux_target, and lwp_info::ptid.
Referenced by check_zombie_leaders(), filter_exit_event(), linux_nat_filter_event(), and wait_lwp().
|
static |
Definition at line 3108 of file linux-nat.c.
References exit_lwp(), is_leader(), lwp_info::ptid, report_thread_events, target_waitstatus::set_ignore(), and target_waitstatus::set_thread_exited().
Referenced by linux_nat_wait_1().
|
static |
Definition at line 844 of file linux-nat.c.
References dummy, lwp_lwpid_htab, and lwp_info::ptid.
Referenced by attach_proc_task_lwp_callback(), check_zombie_leaders(), linux_nat_target::core_of_thread(), linux_nat_target::detach(), linux_nat_target::follow_fork(), linux_nat_filter_event(), linux_nat_wait_1(), linux_nat_target::resume(), linux_nat_target::stopped_by_hw_breakpoint(), linux_nat_target::stopped_by_sw_breakpoint(), linux_nat_target::stopped_by_watchpoint(), linux_nat_target::stopped_data_address(), linux_nat_target::thread_address_space(), and linux_nat_target::thread_alive().
|
static |
Definition at line 1198 of file linux-nat.c.
References thread_info::executing(), process_stratum_target::find_thread(), get_last_target_status(), thread_info::has_pending_waitstatus(), target_waitstatus::kind(), linux_nat_debug_printf, linux_target, thread_info::pending_waitstatus(), lwp_info::ptid, target_waitstatus::sig, signal_pass_state(), lwp_info::status, thread_info::stop_signal(), target_is_non_stop_p(), TARGET_WAITKIND_IGNORE, TARGET_WAITKIND_STOPPED, and lwp_info::waitstatus.
Referenced by linux_nat_target::detach(), and detach_one_lwp().
|
static |
Definition at line 4241 of file linux-nat.c.
References INF_REG_EVENT, and inferior_event_handler().
|
static |
Definition at line 253 of file linux-nat.c.
References lwp_info::ptid.
Referenced by filter_exit_event(), and linux_nat_filter_event().
struct lwp_info * iterate_over_lwps | ( | ptid_t | filter, |
gdb::function_view< iterate_over_lwps_ftype > | callback ) |
Definition at line 860 of file linux-nat.c.
References all_lwps_safe().
Referenced by aarch64_notify_debug_reg_change(), arm_linux_insert_hw_breakpoint1(), arm_linux_remove_hw_breakpoint1(), linux_nat_target::detach(), linux_nat_target::kill(), linux_nat_filter_event(), linux_nat_wait_1(), linux_stop_and_wait_all_lwps(), linux_unstop_all_lwps(), ppc_linux_nat_target::mark_debug_registers_changed(), linux_nat_target::resume(), s390_refresh_per_info(), select_event_lwp(), linux_nat_target::stop(), linux_nat_target::wait(), x86_linux_dr_set_addr(), and x86_linux_dr_set_control().
|
static |
Definition at line 3523 of file linux-nat.c.
References kill_one_lwp(), and lwp_info::ptid.
Referenced by linux_nat_target::kill().
|
static |
Definition at line 1699 of file linux-nat.c.
Referenced by detach_one_lwp(), kill_one_lwp(), linux_nat_post_attach_wait(), and stop_callback().
|
static |
Definition at line 3460 of file linux-nat.c.
References debug_linux_nat, kill_lwp(), linux_nat_debug_printf, pid, and ptrace.
Referenced by kill_callback(), kill_unfollowed_fork_children(), and kill_wait_one_lwp().
|
static |
Definition at line 3542 of file linux-nat.c.
References target_waitstatus::child_ptid, kill_one_lwp(), kill_wait_one_lwp(), target_waitstatus::kind(), linux_target, linux_nat_target::low_forget_process(), TARGET_WAITKIND_FORKED, and TARGET_WAITKIND_VFORKED.
Referenced by linux_nat_target::kill().
|
static |
Definition at line 3532 of file linux-nat.c.
References kill_wait_one_lwp(), and lwp_info::ptid.
Referenced by linux_nat_target::kill().
|
static |
Definition at line 3493 of file linux-nat.c.
References __WALL, kill_one_lwp(), linux_nat_debug_printf, my_waitpid(), and pid.
Referenced by kill_unfollowed_fork_children(), and kill_wait_callback().
int lin_thread_get_thread_signal | ( | unsigned int | i | ) |
Definition at line 4554 of file linux-nat.c.
References lin_thread_get_thread_signal_num(), and lin_thread_signals.
Referenced by check_thread_signals().
unsigned int lin_thread_get_thread_signal_num | ( | void | ) |
Definition at line 4546 of file linux-nat.c.
References lin_thread_signals.
Referenced by check_thread_signals(), and lin_thread_get_thread_signal().
|
static |
Definition at line 1836 of file linux-nat.c.
References __WALL, add_fork(), add_lwp(), add_thread(), target_waitstatus::child_ptid, close_proc_mem_file(), detach_breakpoints(), find_fork_pid(), linux_fork_checkpointing_p(), linux_nat_debug_printf, linux_proc_pid_to_exec_file(), linux_ptrace_get_extended_event(), linux_target, linux_nat_target::low_new_clone(), linux_nat_target::low_new_fork(), my_waitpid(), open_proc_mem_file(), pid, lwp_info::ptid, ptrace, PTRACE_EVENT_CLONE, PTRACE_EVENT_EXEC, PTRACE_EVENT_FORK, PTRACE_EVENT_VFORK, PTRACE_EVENT_VFORK_DONE, PTRACE_GETEVENTMSG, pull_pid_from_list(), report_thread_events, lwp_info::resumed, target_waitstatus::set_execd(), set_executing(), target_waitstatus::set_forked(), target_waitstatus::set_ignore(), set_running(), target_waitstatus::set_spurious(), target_waitstatus::set_thread_created(), target_waitstatus::set_vfork_done(), target_waitstatus::set_vforked(), lwp_info::signalled, status, lwp_info::status, status_to_str(), lwp_info::stopped, stopped_pids, lwp_info::syscall_state, TARGET_WAITKIND_SYSCALL_ENTRY, thread_db_notice_clone(), and lwp_info::waitstatus.
Referenced by linux_nat_filter_event(), and wait_lwp().
|
static |
Definition at line 1721 of file linux-nat.c.
References catch_syscall_enabled(), catching_syscall_number(), process_stratum_target::find_thread(), gdbarch_get_syscall_number(), linux_nat_debug_printf, linux_resume_one_lwp(), linux_target, lwp_info::ptid, ptrace, target_waitstatus::set_syscall_entry(), target_waitstatus::set_syscall_return(), lwp_info::step, lwp_info::stopped, lwp_info::syscall_state, target_thread_architecture(), TARGET_WAITKIND_IGNORE, TARGET_WAITKIND_SYSCALL_ENTRY, TARGET_WAITKIND_SYSCALL_RETURN, and lwp_info::waitstatus.
Referenced by linux_nat_filter_event(), and wait_lwp().
|
static |
Definition at line 380 of file linux-nat.c.
References linux_enable_event_reporting(), linux_nat_ptrace_options(), linux_proc_init_warnings(), linux_ptrace_init_warnings(), pid, and proc_mem_file_is_writable().
Referenced by linux_nat_target::post_attach(), and linux_nat_target::post_startup_inferior().
|
static |
Definition at line 4389 of file linux-nat.c.
References inf::pid.
Referenced by linux_nat_target::fileio_open(), linux_nat_target::fileio_readlink(), and linux_nat_target::fileio_unlink().
|
static |
Definition at line 2780 of file linux-nat.c.
References add_lwp(), add_thread(), add_to_pid_list(), all_inferiors(), exit_lwp(), find_inferior_pid(), find_lwp_pid(), process_stratum_target::find_thread(), host_status_to_waitstatus(), lwp_info::ignore_sigint, is_leader(), iterate_over_lwps(), lwp_info::last_resume_kind, linux_enable_event_reporting(), linux_handle_extended_wait(), linux_handle_syscall_trap(), linux_is_extended_waitstatus(), linux_nat_debug_printf, linux_nat_ptrace_options(), linux_ptrace_get_extended_event(), linux_resume_one_lwp(), linux_target, linux_wstatus_maybe_breakpoint(), maybe_clear_ignore_sigint(), lwp_info::must_set_ptrace_flags, pass_mask, inf::pid, lwp_info::ptid, PTRACE_EVENT_EXEC, report_thread_events, resume_stop, lwp_info::resumed, save_stop_reason(), set_ignore_sigint(), signal_pass_state(), lwp_info::signalled, status, lwp_info::status, status_to_str(), lwp_info::step, thread_info::stop_requested, lwp_info::stopped, stopped_pids, SYSCALL_SIGTRAP, lwp_info::syscall_state, target_is_non_stop_p(), TARGET_WAITKIND_IGNORE, and lwp_info::waitstatus.
Referenced by linux_nat_wait_1().
bool linux_nat_get_siginfo | ( | ptid_t | ptid, |
siginfo_t * | siginfo ) |
Definition at line 4479 of file linux-nat.c.
References get_ptrace_pid(), pid, ptrace, PTRACE_GETSIGINFO, and PTRACE_TYPE_ARG3.
Referenced by linux_xfer_siginfo(), ppc_linux_nat_target::low_stopped_data_address(), save_stop_reason(), s390_linux_nat_target::stopped_by_watchpoint(), aarch64_linux_nat_target::stopped_data_address(), arm_linux_nat_target::stopped_data_address(), and ia64_linux_nat_target::stopped_data_address().
|
static |
Definition at line 2237 of file linux-nat.c.
References linux_proc_pending_signals(), and pid.
Referenced by maybe_clear_ignore_sigint().
|
static |
Definition at line 918 of file linux-nat.c.
References __WALL, kill_lwp(), linux_nat_debug_printf, linux_proc_pid_is_stopped(), my_waitpid(), pid, ptrace, status, and status_to_str().
Referenced by linux_nat_target::attach().
|
static |
Definition at line 358 of file linux-nat.c.
References PTRACE_O_EXITKILL, PTRACE_O_TRACEEXEC, PTRACE_O_TRACEFORK, PTRACE_O_TRACESYSGOOD, PTRACE_O_TRACEVFORK, and PTRACE_O_TRACEVFORKDONE.
Referenced by linux_init_ptrace_procfs(), linux_nat_filter_event(), and wait_lwp().
Definition at line 1576 of file linux-nat.c.
References process_stratum_target::find_thread(), linux_target, lwp_info::ptid, resume_lwp(), thread_info::set_stop_signal(), thread_info::stop_signal(), and lwp_info::stopped.
Referenced by linux_nat_target::resume().
|
static |
Definition at line 4281 of file linux-nat.c.
References debug_linux_nat, process_stratum_target::find_thread(), lwp_info::last_resume_kind, linux_nat_debug_printf, linux_target, lwp_info::ptid, resume_stop, stop_callback(), thread_info::stop_requested, and lwp_info::stopped.
Referenced by linux_nat_target::stop().
void linux_nat_switch_fork | ( | ptid_t | new_ptid | ) |
Definition at line 881 of file linux-nat.c.
References add_lwp(), inferior_ptid, linux_target, purge_lwp_list(), registers_changed(), lwp_info::stopped, and thread_change_ptid().
Referenced by fork_load_infrun_state().
|
static |
Definition at line 3127 of file linux-nat.c.
References __WALL, add_initial_lwp(), reg_buffer::arch(), block_child_signals(), check_zombie_leaders(), lwp_info::core, filter_exit_event(), find_lwp_pid(), gdbarch_decr_pc_after_break(), get_thread_regcache(), host_status_to_waitstatus(), iterate_over_lwps(), target_waitstatus::kind(), lwp_info::last_resume_kind, linux_common_core_of_thread(), linux_nat_debug_printf, linux_nat_filter_event(), LINUX_NAT_SCOPED_DEBUG_ENTER_EXIT, linux_target, linux_nat_target::low_status_is_event(), my_waitpid(), pending_status_str(), lwp_info::ptid, regcache_read_pc(), regcache_write_pc(), restore_child_signals_mask(), resume_clear_callback(), resume_stop, resume_stopped_resumed_lwps(), lwp_info::resumed, resumed_callback(), select_event_lwp(), target_waitstatus::set_ignore(), target_waitstatus::set_no_resumed(), target_waitstatus::set_stopped(), status, lwp_info::status, status_callback(), status_to_str(), stop_callback(), lwp_info::stop_reason, stop_wait_callback(), target_is_non_stop_p(), TARGET_STOPPED_BY_SW_BREAKPOINT, TARGET_WAITKIND_EXITED, TARGET_WAITKIND_IGNORE, TARGET_WAITKIND_SIGNALLED, TARGET_WAITKIND_STOPPED, TARGET_WNOHANG, thread_change_ptid(), USE_SIGTRAP_SIGINFO, wait_for_signal(), and lwp_info::waitstatus.
Referenced by linux_nat_target::wait().
|
static |
Definition at line 4126 of file linux-nat.c.
References linux_common_xfer_osdata(), TARGET_OBJECT_OSDATA, TARGET_XFER_EOF, and TARGET_XFER_OK.
Referenced by linux_nat_target::xfer_partial().
void linux_proc_pending_signals | ( | int | pid, |
sigset_t * | pending, | ||
sigset_t * | blocked, | ||
sigset_t * | ignored ) |
Definition at line 4091 of file linux-nat.c.
References add_line_to_sigset(), and pid.
Referenced by linux_nat_has_pending_sigint().
|
static |
Definition at line 3977 of file linux-nat.c.
References linux_proc_xfer_memory_partial_fd(), pid, proc_mem_file_map, and TARGET_XFER_EOF.
Referenced by linux_nat_target::xfer_partial().
|
static |
Definition at line 3919 of file linux-nat.c.
References linux_nat_debug_printf, pid, read(), SEEK_SET, TARGET_XFER_E_IO, TARGET_XFER_EOF, and TARGET_XFER_OK.
Referenced by linux_proc_xfer_memory_partial(), and proc_mem_file_is_writable().
|
static |
Definition at line 1523 of file linux-nat.c.
References check_ptrace_stopped_lwp_gone(), and linux_resume_one_lwp_throw().
Referenced by linux_handle_syscall_trap(), linux_nat_filter_event(), linux_nat_target::resume(), resume_lwp(), and status_callback().
|
static |
Definition at line 1455 of file linux-nat.c.
References lwp_info::core, get_thread_regcache(), linux_target, linux_nat_target::low_prepare_to_resume(), linux_nat_target::low_resume(), lwp_info::ptid, regcache_read_pc(), registers_changed_ptid(), lwp_info::step, lwp_info::stop_pc, lwp_info::stop_reason, lwp_info::stopped, and TARGET_STOPPED_BY_NO_REASON.
Referenced by linux_resume_one_lwp(), and resume_stopped_resumed_lwps().
void linux_stop_and_wait_all_lwps | ( | void | ) |
Definition at line 2212 of file linux-nat.c.
References iterate_over_lwps(), stop_callback(), and stop_wait_callback().
Referenced by check_thread_db(), and try_thread_db_load_1().
void linux_stop_lwp | ( | struct lwp_info * | lwp | ) |
Definition at line 2204 of file linux-nat.c.
References stop_callback().
Referenced by debug_reg_change_callback(), ppc_linux_nat_target::mark_debug_registers_changed(), s390_refresh_per_info_cb(), update_debug_registers_callback(), and update_registers_callback().
void linux_unstop_all_lwps | ( | void | ) |
Definition at line 2225 of file linux-nat.c.
References iterate_over_lwps(), and resume_stopped_resumed_lwps().
Referenced by check_thread_db(), and try_thread_db_load_1().
|
static |
Definition at line 3638 of file linux-nat.c.
References get_ptrace_pid(), linux_nat_get_siginfo(), pid, ptrace, PTRACE_SETSIGINFO, PTRACE_TYPE_ARG3, siginfo_fixup(), TARGET_OBJECT_SIGNAL_INFO, TARGET_XFER_E_IO, and TARGET_XFER_OK.
Referenced by linux_nat_target::xfer_partial().
struct arch_lwp_info * lwp_arch_private_info | ( | struct lwp_info * | lwp | ) |
Definition at line 294 of file linux-nat.c.
References lwp_info::arch_private.
Referenced by aarch64_linux_prepare_to_resume(), debug_reg_change_callback(), ppc_linux_nat_target::get_arch_lwp_info(), ppc_linux_nat_target::init_arch_lwp_info(), s390_linux_nat_target::low_new_fork(), s390_linux_nat_target::low_prepare_to_resume(), lwp_debug_registers_changed(), lwp_set_debug_registers_changed(), and s390_mark_per_info_changed().
|
static |
Definition at line 588 of file linux-nat.c.
References pid, and lwp_info::ptid.
Referenced by lwp_lwpid_htab_create().
int lwp_is_stepping | ( | struct lwp_info * | lwp | ) |
Definition at line 318 of file linux-nat.c.
References lwp_info::step.
Referenced by s390_linux_nat_target::low_prepare_to_resume().
int lwp_is_stopped | ( | struct lwp_info * | lwp | ) |
Definition at line 302 of file linux-nat.c.
References lwp_info::stopped.
Referenced by debug_reg_change_callback(), ppc_linux_nat_target::mark_debug_registers_changed(), s390_refresh_per_info_cb(), update_debug_registers_callback(), and x86_linux_update_debug_registers().
|
static |
|
static |
Definition at line 663 of file linux-nat.c.
References lwp_list.
Referenced by delete_lwp(), and lwp_lwpid_htab_remove_pid().
|
static |
Definition at line 619 of file linux-nat.c.
References lwp_lwpid_htab.
Referenced by add_initial_lwp().
|
static |
Definition at line 611 of file linux-nat.c.
References lwp_info_hash(), lwp_lwpid_htab, and lwp_lwpid_htab_eq().
|
static |
Definition at line 600 of file linux-nat.c.
References lwp_info::ptid.
Referenced by lwp_lwpid_htab_create().
|
static |
Definition at line 743 of file linux-nat.c.
References lwp_list_remove(), lwp_lwpid_htab, pid, and lwp_info::ptid.
Referenced by purge_lwp_list().
void lwp_set_arch_private_info | ( | struct lwp_info * | lwp, |
struct arch_lwp_info * | info ) |
Definition at line 285 of file linux-nat.c.
References lwp_info::arch_private.
Referenced by aarch64_linux_new_thread(), debug_reg_change_callback(), ppc_linux_nat_target::init_arch_lwp_info(), lwp_set_debug_registers_changed(), and s390_mark_per_info_changed().
|
static |
Definition at line 2510 of file linux-nat.c.
References target_waitstatus::kind(), lwp_info::status, TARGET_WAITKIND_IGNORE, and lwp_info::waitstatus.
Referenced by count_events_callback(), pending_status_str(), linux_nat_target::resume(), resume_lwp(), resume_stopped_resumed_lwps(), select_event_lwp_callback(), and status_callback().
enum target_stop_reason lwp_stop_reason | ( | struct lwp_info * | lwp | ) |
Definition at line 310 of file linux-nat.c.
References lwp_info::stop_reason.
Referenced by x86_linux_update_debug_registers().
|
static |
Definition at line 2273 of file linux-nat.c.
References lwp_info::ignore_sigint, linux_nat_debug_printf, linux_nat_has_pending_sigint(), and lwp_info::ptid.
Referenced by linux_nat_filter_event(), and stop_wait_callback().
|
static |
Definition at line 410 of file linux-nat.c.
References all_lwps(), and pid.
Referenced by check_zombie_leaders(), linux_nat_target::detach(), and linux_nat_target::pid_to_str().
|
static |
Definition at line 3886 of file linux-nat.c.
References linux_nat_debug_printf, O_LARGEFILE, and proc_mem_file_map.
Referenced by linux_nat_target::attach(), linux_nat_target::create_inferior(), and linux_handle_extended_wait().
|
static |
Definition at line 261 of file linux-nat.c.
References target_waitstatus::kind(), lwp_status_pending_p(), lwp_info::status, status_to_str(), TARGET_WAITKIND_IGNORE, target_waitstatus::to_string(), and lwp_info::waitstatus.
Referenced by linux_nat_wait_1(), and linux_nat_target::resume().
|
static |
Definition at line 4002 of file linux-nat.c.
References linux_proc_xfer_memory_partial_fd(), O_LARGEFILE, and TARGET_XFER_OK.
Referenced by linux_init_ptrace_procfs(), and linux_nat_target::xfer_partial().
ptid_t ptid_of_lwp | ( | struct lwp_info * | lwp | ) |
Definition at line 277 of file linux-nat.c.
References lwp_info::ptid.
Referenced by aarch64_linux_new_thread(), aarch64_linux_prepare_to_resume(), debug_reg_change_callback(), s390_linux_nat_target::low_prepare_to_resume(), and x86_linux_update_debug_registers().
|
static |
Definition at line 338 of file linux-nat.c.
References simple_pid_list::next, pid, simple_pid_list::status, and xfree().
Referenced by linux_handle_extended_wait().
|
static |
Definition at line 761 of file linux-nat.c.
References lwp_lwpid_htab, lwp_lwpid_htab_remove_pid(), and pid.
Referenced by linux_nat_switch_fork(), and linux_nat_target::mourn_inferior().
|
static |
Definition at line 698 of file linux-nat.c.
Referenced by linux_nat_wait_1(), and wait_lwp().
|
static |
Definition at line 1600 of file linux-nat.c.
References lwp_info::last_resume_kind, resume_stop, and lwp_info::resumed.
Referenced by linux_nat_wait_1().
|
static |
Definition at line 1539 of file linux-nat.c.
References find_inferior_ptid(), linux_nat_debug_printf, linux_resume_one_lwp(), linux_target, lwp_status_pending_p(), lwp_info::ptid, and lwp_info::stopped.
Referenced by linux_nat_resume_callback().
|
static |
Definition at line 1608 of file linux-nat.c.
References lwp_info::last_resume_kind, resume_continue, and lwp_info::resumed.
Referenced by linux_nat_target::resume().
|
static |
Definition at line 3352 of file linux-nat.c.
References reg_buffer::arch(), regcache::aspace(), breakpoint_inserted_here_p(), check_ptrace_stopped_lwp_gone(), find_inferior_ptid(), get_thread_regcache(), linux_nat_debug_printf, linux_resume_one_lwp_throw(), linux_target, lwp_status_pending_p(), paddress(), lwp_info::ptid, regcache_read_pc(), lwp_info::resumed, lwp_info::step, and lwp_info::stopped.
Referenced by linux_nat_wait_1(), linux_unstop_all_lwps(), and linux_nat_target::wait().
|
static |
Definition at line 2770 of file linux-nat.c.
References lwp_info::resumed.
Referenced by linux_nat_wait_1().
|
static |
Definition at line 2540 of file linux-nat.c.
References reg_buffer::arch(), regcache::aspace(), check_stopped_by_watchpoint(), find_inferior_ptid(), GDB_ARCH_IS_TRAP_BRKPT, GDB_ARCH_IS_TRAP_HWBKPT, gdbarch_decr_pc_after_break(), get_thread_regcache(), hardware_breakpoint_inserted_here_p(), linux_nat_debug_printf, linux_nat_get_siginfo(), linux_target, linux_nat_target::low_status_is_event(), lwp_info::ptid, reg_buffer::regcache, regcache_read_pc(), regcache_write_pc(), software_breakpoint_inserted_here_p(), lwp_info::status, lwp_info::step, lwp_info::stop_pc, lwp_info::stop_reason, TARGET_STOPPED_BY_HW_BREAKPOINT, TARGET_STOPPED_BY_NO_REASON, TARGET_STOPPED_BY_SW_BREAKPOINT, and TARGET_STOPPED_BY_WATCHPOINT.
Referenced by linux_nat_filter_event(), and stop_wait_callback().
|
static |
Definition at line 2697 of file linux-nat.c.
References count_events_callback(), iterate_over_lwps(), linux_nat_debug_printf, lwp_info::ptid, select_event_lwp_callback(), select_singlestep_lwp_callback(), status, lwp_info::status, and target_is_non_stop_p().
Referenced by linux_nat_wait_1().
|
static |
Definition at line 2521 of file linux-nat.c.
References lwp_status_pending_p(), lwp_info::resumed, and selector.
Referenced by select_event_lwp().
|
static |
Definition at line 2498 of file linux-nat.c.
References lwp_info::last_resume_kind, resume_step, and lwp_info::status.
Referenced by select_event_lwp().
|
static |
Definition at line 2253 of file linux-nat.c.
References lwp_info::ignore_sigint, lwp_info::status, and lwp_info::stopped.
Referenced by linux_nat_filter_event().
|
static |
Definition at line 201 of file linux-nat.c.
References gdb_printf().
|
static |
Definition at line 4222 of file linux-nat.c.
References inf_ptrace_target::async_file_mark_if_open(), debug_linux_nat, and gdb_stdlog.
|
static |
Definition at line 3624 of file linux-nat.c.
References linux_target, and linux_nat_target::low_siginfo_fixup().
Referenced by linux_xfer_siginfo().
|
static |
Definition at line 2428 of file linux-nat.c.
References regcache::aspace(), breakpoint_inserted_here_p(), get_thread_regcache(), linux_nat_debug_printf, linux_resume_one_lwp(), linux_target, lwp_status_pending_p(), paddress(), lwp_info::ptid, regcache_read_pc(), lwp_info::resumed, lwp_info::status, lwp_info::step, lwp_info::stop_pc, lwp_info::stop_reason, target_gdbarch(), TARGET_STOPPED_BY_HW_BREAKPOINT, and TARGET_STOPPED_BY_SW_BREAKPOINT.
Referenced by linux_nat_wait_1().
|
static |
Definition at line 2180 of file linux-nat.c.
References kill_lwp(), linux_nat_debug_printf, lwp_info::ptid, lwp_info::signalled, lwp_info::status, and lwp_info::stopped.
Referenced by linux_nat_target::detach(), linux_nat_target::kill(), linux_nat_stop_lwp(), linux_nat_wait_1(), linux_stop_and_wait_all_lwps(), and linux_stop_lwp().
|
static |
Definition at line 2352 of file linux-nat.c.
References find_inferior_ptid(), lwp_info::ignore_sigint, lwp_info::last_resume_kind, linux_nat_debug_printf, linux_target, maybe_clear_ignore_sigint(), lwp_info::ptid, ptrace, resume_stop, save_stop_reason(), lwp_info::signalled, status, lwp_info::status, status_to_str(), stop_wait_callback(), lwp_info::stopped, and wait_lwp().
Referenced by linux_nat_target::detach(), linux_nat_target::kill(), linux_nat_wait_1(), linux_stop_and_wait_all_lwps(), and stop_wait_callback().
|
static |
Definition at line 2013 of file linux-nat.c.
References check_quit_flag(), target_terminal::is_ours(), linux_nat_debug_printf, suspend_mask, and target_pass_ctrlc().
Referenced by linux_nat_wait_1(), and wait_lwp().
|
static |
Definition at line 2036 of file linux-nat.c.
References __WALL, block_child_signals(), exit_lwp(), find_inferior_pid(), host_status_to_waitstatus(), linux_enable_event_reporting(), linux_handle_extended_wait(), linux_handle_syscall_trap(), linux_is_extended_waitstatus(), linux_nat_debug_printf, linux_nat_ptrace_options(), linux_proc_pid_is_zombie(), linux_target, lwp_info::must_set_ptrace_flags, my_waitpid(), pid, lwp_info::ptid, report_thread_events, restore_child_signals_mask(), status, lwp_info::status, status_to_str(), lwp_info::stopped, SYSCALL_SIGTRAP, lwp_info::syscall_state, TARGET_WAITKIND_IGNORE, wait_for_signal(), wait_lwp(), and lwp_info::waitstatus.
Referenced by stop_wait_callback(), and wait_lwp().
|
static |
Definition at line 676 of file linux-nat.c.
Referenced by block_child_signals().
|
static |
Definition at line 196 of file linux-nat.c.
Referenced by kill_one_lwp(), linux_nat_stop_lwp(), and sigchld_handler().
enum tribool have_ptrace_getregset = TRIBOOL_UNKNOWN |
Definition at line 192 of file linux-nat.c.
Referenced by fetch_fpregs(), amd64_linux_nat_target::fetch_registers(), fetch_regs(), fetch_vfp_regs(), fetch_xstateregs(), arm_linux_nat_target::read_description(), x86_linux_nat_target::read_description(), store_fpregs(), amd64_linux_nat_target::store_registers(), store_regs(), store_vfp_regs(), and store_xstateregs().
|
static |
Definition at line 4541 of file linux-nat.c.
Referenced by lin_thread_get_thread_signal(), and lin_thread_get_thread_signal_num().
struct linux_nat_target* linux_target |
Definition at line 189 of file linux-nat.c.
Referenced by _initialize_aarch64_linux_nat(), _initialize_alpha_linux_nat(), _initialize_arc_linux_nat(), _initialize_arm_linux_nat(), _initialize_hppa_linux_nat(), _initialize_i386_linux_nat(), _initialize_ia64_linux_nat(), _initialize_loongarch_linux_nat(), _initialize_m32r_linux_nat(), _initialize_m68k_linux_nat(), _initialize_mips_linux_nat(), _initialize_or1k_linux_nat(), _initialize_ppc_linux_nat(), _initialize_riscv_linux_nat(), _initialize_s390_nat(), _initialize_sparc64_linux_nat(), _initialize_sparc_linux_nat(), _initialize_tile_linux_nat(), _initialize_xtensa_linux_nat(), add_lwp(), linux_nat_target::attach(), attach_proc_task_lwp_callback(), check_stopped_by_watchpoint(), check_thread_db_callback(), delete_checkpoint_command(), delete_fork(), detach_one_lwp(), exit_lwp(), linux_nat_target::follow_fork(), get_detach_signal(), kill_unfollowed_fork_children(), linux_handle_extended_wait(), linux_handle_syscall_trap(), linux_nat_filter_event(), linux_nat_resume_callback(), linux_nat_stop_lwp(), linux_nat_switch_fork(), linux_nat_wait_1(), linux_resume_one_lwp_throw(), linux_nat_target::mourn_inferior(), resume_lwp(), resume_stopped_resumed_lwps(), save_stop_reason(), siginfo_fixup(), status_callback(), stop_wait_callback(), thread_db_notice_clone(), wait_lwp(), and lwp_info::~lwp_info().
|
static |
Definition at line 633 of file linux-nat.c.
Referenced by all_lwps(), all_lwps_safe(), lwp_list_add(), and lwp_list_remove().
|
static |
Definition at line 583 of file linux-nat.c.
Referenced by delete_lwp(), find_lwp_pid(), lwp_lwpid_htab_add_lwp(), lwp_lwpid_htab_create(), lwp_lwpid_htab_remove_pid(), and purge_lwp_list().
|
static |
Definition at line 704 of file linux-nat.c.
Referenced by linux_nat_filter_event(), linux_nat_target::pass_signals(), and linux_nat_target::resume().
|
static |
Definition at line 3868 of file linux-nat.c.
Referenced by close_proc_mem_file(), linux_proc_xfer_memory_partial(), and open_proc_mem_file().
|
static |
Definition at line 227 of file linux-nat.c.
Referenced by filter_exit_event(), linux_handle_extended_wait(), linux_nat_filter_event(), linux_nat_target::thread_events(), and wait_lwp().
|
static |
Definition at line 679 of file linux-nat.c.
|
static |
Definition at line 224 of file linux-nat.c.
Referenced by linux_handle_extended_wait(), and linux_nat_filter_event().
|
static |
Definition at line 673 of file linux-nat.c.
Referenced by wait_for_signal().