GDB (xrefs)
Classes | Macros | Functions | Variables
/tmp/gdb-7.10/gdb/linux-nat.c File Reference
#include "defs.h"
#include "inferior.h"
#include "infrun.h"
#include "target.h"
#include "nat/linux-nat.h"
#include "nat/linux-waitpid.h"
#include "gdb_wait.h"
#include <unistd.h>
#include <sys/syscall.h>
#include <sys/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 "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 "agent.h"
#include "tracepoint.h"
#include "buffer.h"
#include "target-descriptions.h"
#include "filestuff.h"
#include "objfiles.h"
#include "nat/linux-namespaces.h"
#include "fileio.h"

Go to the source code of this file.

Classes

struct  simple_pid_list
 

Macros

#define SPUFS_MAGIC   0x23c9b64e
 
#define O_LARGEFILE   0
 
#define linux_is_async_p()   (linux_nat_event_pipe[0] != -1)
 
#define FORMAT   "/proc/%d/task/%ld/comm"
 
#define COMM_LEN   16
 

Functions

static void show_debug_linux_nat (struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
 
static void async_file_flush (void)
 
static void async_file_mark (void)
 
static int kill_lwp (int lwpid, int signo)
 
static int stop_callback (struct lwp_info *lp, void *data)
 
static int resume_stopped_resumed_lwps (struct lwp_info *lp, void *data)
 
static void block_child_signals (sigset_t *prev_mask)
 
static void restore_child_signals_mask (sigset_t *prev_mask)
 
static struct lwp_infoadd_lwp (ptid_t ptid)
 
static void purge_lwp_list (int pid)
 
static void delete_lwp (ptid_t ptid)
 
static struct lwp_infofind_lwp_pid (ptid_t ptid)
 
static int lwp_status_pending_p (struct lwp_info *lp)
 
static int check_stopped_by_breakpoint (struct lwp_info *lp)
 
static int sigtrap_is_event (int status)
 
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_infolwp_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)
 
static void add_to_pid_list (struct simple_pid_list **listp, int pid, int status)
 
static int in_pid_list_p (struct simple_pid_list *list, int pid)
 
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 (pid_t pid, int attached)
 
static void linux_child_post_attach (struct target_ops *self, int pid)
 
static void linux_child_post_startup_inferior (struct target_ops *self, ptid_t ptid)
 
static int num_lwps (int pid)
 
static void delete_lwp_cleanup (void *lp_voidp)
 
static int linux_child_follow_fork (struct target_ops *ops, int follow_child, int detach_fork)
 
static int linux_child_insert_fork_catchpoint (struct target_ops *self, int pid)
 
static int linux_child_remove_fork_catchpoint (struct target_ops *self, int pid)
 
static int linux_child_insert_vfork_catchpoint (struct target_ops *self, int pid)
 
static int linux_child_remove_vfork_catchpoint (struct target_ops *self, int pid)
 
static int linux_child_insert_exec_catchpoint (struct target_ops *self, int pid)
 
static int linux_child_remove_exec_catchpoint (struct target_ops *self, int pid)
 
static int linux_child_set_syscall_catchpoint (struct target_ops *self, int pid, int needed, int any_count, int table_size, int *table)
 
static void linux_nat_pass_signals (struct target_ops *self, int numsigs, unsigned char *pass_signals)
 
static int stop_wait_callback (struct lwp_info *lp, void *data)
 
static int linux_thread_alive (ptid_t ptid)
 
static char * linux_child_pid_to_exec_file (struct target_ops *self, int pid)
 
static void lwp_free (struct lwp_info *lp)
 
static struct lwp_infoadd_initial_lwp (ptid_t ptid)
 
struct lwp_infoiterate_over_lwps (ptid_t filter, iterate_over_lwps_ftype callback, void *data)
 
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 first, int *cloned, int *signalled)
 
int lin_lwp_attach_lwp (ptid_t ptid)
 
static void linux_nat_create_inferior (struct target_ops *ops, char *exec_file, char *allargs, char **env, int from_tty)
 
static int attach_proc_task_lwp_callback (ptid_t ptid)
 
static void linux_nat_attach (struct target_ops *ops, const char *args, int from_tty)
 
static int get_pending_status (struct lwp_info *lp, int *status)
 
static int detach_callback (struct lwp_info *lp, void *data)
 
static void linux_nat_detach (struct target_ops *ops, const char *args, int from_tty)
 
static void linux_resume_one_lwp_throw (struct lwp_info *lp, int step, enum gdb_signal signo)
 
static int check_ptrace_stopped_lwp_gone (struct lwp_info *lp)
 
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, void *except)
 
static int resume_clear_callback (struct lwp_info *lp, void *data)
 
static int resume_set_callback (struct lwp_info *lp, void *data)
 
static void linux_nat_resume (struct target_ops *ops, ptid_t ptid, int step, enum gdb_signal signo)
 
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 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, void *data)
 
static void maybe_clear_ignore_sigint (struct lwp_info *lp)
 
static int check_stopped_by_watchpoint (struct lwp_info *lp)
 
static void save_sigtrap (struct lwp_info *lp)
 
static int linux_nat_stopped_by_watchpoint (struct target_ops *ops)
 
static int linux_nat_stopped_data_address (struct target_ops *ops, CORE_ADDR *addr_p)
 
void linux_nat_set_status_is_event (struct target_ops *t, int(*status_is_event)(int status))
 
static int status_callback (struct lwp_info *lp, void *data)
 
static int running_callback (struct lwp_info *lp, void *data)
 
static int count_events_callback (struct lwp_info *lp, void *data)
 
static int select_singlestep_lwp_callback (struct lwp_info *lp, void *data)
 
static int select_event_lwp_callback (struct lwp_info *lp, void *data)
 
static int linux_nat_stopped_by_sw_breakpoint (struct target_ops *ops)
 
static int linux_nat_supports_stopped_by_sw_breakpoint (struct target_ops *ops)
 
static int linux_nat_stopped_by_hw_breakpoint (struct target_ops *ops)
 
static int linux_nat_supports_stopped_by_hw_breakpoint (struct target_ops *ops)
 
static void select_event_lwp (ptid_t filter, struct lwp_info **orig_lp, int *status)
 
static int resumed_callback (struct lwp_info *lp, void *data)
 
static int stop_and_resume_callback (struct lwp_info *lp, void *data)
 
static struct lwp_infolinux_nat_filter_event (int lwpid, int status)
 
static void check_zombie_leaders (void)
 
static ptid_t linux_nat_wait_1 (struct target_ops *ops, ptid_t ptid, struct target_waitstatus *ourstatus, int target_options)
 
static ptid_t linux_nat_wait (struct target_ops *ops, ptid_t ptid, struct target_waitstatus *ourstatus, int target_options)
 
static int kill_callback (struct lwp_info *lp, void *data)
 
static int kill_wait_callback (struct lwp_info *lp, void *data)
 
static void linux_nat_kill (struct target_ops *ops)
 
static void linux_nat_mourn_inferior (struct target_ops *ops)
 
static void siginfo_fixup (siginfo_t *siginfo, gdb_byte *inf_siginfo, int direction)
 
static enum target_xfer_status linux_xfer_siginfo (struct target_ops *ops, 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_partial (struct target_ops *ops, enum target_object object, const char *annex, gdb_byte *readbuf, const gdb_byte *writebuf, ULONGEST offset, ULONGEST len, ULONGEST *xfered_len)
 
static int linux_nat_thread_alive (struct target_ops *ops, ptid_t ptid)
 
static void linux_nat_update_thread_list (struct target_ops *ops)
 
static char * linux_nat_pid_to_str (struct target_ops *ops, ptid_t ptid)
 
static char * linux_nat_thread_name (struct target_ops *self, struct thread_info *thr)
 
static enum target_xfer_status linux_proc_xfer_partial (struct target_ops *ops, enum target_object object, const char *annex, gdb_byte *readbuf, const gdb_byte *writebuf, ULONGEST offset, LONGEST len, ULONGEST *xfered_len)
 
static LONGEST spu_enumerate_spu_ids (int pid, gdb_byte *buf, ULONGEST offset, ULONGEST len)
 
static enum target_xfer_status linux_proc_xfer_spu (struct target_ops *ops, enum target_object object, const char *annex, gdb_byte *readbuf, const gdb_byte *writebuf, ULONGEST offset, ULONGEST 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 enum target_xfer_status linux_nat_xfer_osdata (struct target_ops *ops, 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_xfer_partial (struct target_ops *ops, enum target_object object, const char *annex, gdb_byte *readbuf, const gdb_byte *writebuf, ULONGEST offset, ULONGEST len, ULONGEST *xfered_len)
 
static void cleanup_target_stop (void *arg)
 
static VEC (static_tracepoint_marker_p)
 
static void linux_target_install_ops (struct target_ops *t)
 
struct target_opslinux_target (void)
 
struct target_opslinux_trad_target (CORE_ADDR(*register_u_offset)(struct gdbarch *, int, int))
 
static int linux_nat_is_async_p (struct target_ops *ops)
 
static int linux_nat_can_async_p (struct target_ops *ops)
 
static int linux_nat_supports_non_stop (struct target_ops *self)
 
static int linux_nat_supports_multi_process (struct target_ops *self)
 
static int linux_nat_supports_disable_randomization (struct target_ops *self)
 
static void linux_nat_terminal_inferior (struct target_ops *self)
 
static void linux_nat_terminal_ours (struct target_ops *self)
 
static void sigchld_handler (int signo)
 
static void handle_target_event (int error, gdb_client_data client_data)
 
static int linux_async_pipe (int enable)
 
static void linux_nat_async (struct target_ops *ops, int enable)
 
static int linux_nat_stop_lwp (struct lwp_info *lwp, void *data)
 
static void linux_nat_stop (struct target_ops *self, ptid_t ptid)
 
static void linux_nat_close (struct target_ops *self)
 
static struct address_spacelinux_nat_thread_address_space (struct target_ops *t, ptid_t ptid)
 
static int linux_nat_core_of_thread (struct target_ops *ops, ptid_t ptid)
 
static int linux_nat_filesystem_is_local (struct target_ops *ops)
 
static pid_t linux_nat_fileio_pid_of (struct inferior *inf)
 
static int linux_nat_fileio_open (struct target_ops *self, struct inferior *inf, const char *filename, int flags, int mode, int warn_if_slow, int *target_errno)
 
static char * linux_nat_fileio_readlink (struct target_ops *self, struct inferior *inf, const char *filename, int *target_errno)
 
static int linux_nat_fileio_unlink (struct target_ops *self, struct inferior *inf, const char *filename, int *target_errno)
 
void linux_nat_add_target (struct target_ops *t)
 
void linux_nat_set_new_thread (struct target_ops *t, void(*new_thread)(struct lwp_info *))
 
void linux_nat_set_new_fork (struct target_ops *t, linux_nat_new_fork_ftype *new_fork)
 
void linux_nat_set_forget_process (struct target_ops *t, linux_nat_forget_process_ftype *fn)
 
void linux_nat_forget_process (pid_t pid)
 
void linux_nat_set_siginfo_fixup (struct target_ops *t, int(*siginfo_fixup)(siginfo_t *, gdb_byte *, int))
 
void linux_nat_set_prepare_to_resume (struct target_ops *t, void(*prepare_to_resume)(struct lwp_info *))
 
int linux_nat_get_siginfo (ptid_t ptid, siginfo_t *siginfo)
 
ptid_t current_lwp_ptid (void)
 
void _initialize_linux_nat (void)
 
static int get_signo (const char *name)
 
void lin_thread_get_thread_signals (sigset_t *set)
 

Variables

enum tribool have_ptrace_getregset = TRIBOOL_UNKNOWN
 
static struct target_opslinux_ops
 
static struct target_ops linux_ops_saved
 
static void(* linux_nat_new_thread )(struct lwp_info *)
 
static linux_nat_new_fork_ftypelinux_nat_new_fork
 
static linux_nat_forget_process_ftypelinux_nat_forget_process_hook
 
static void(* linux_nat_prepare_to_resume )(struct lwp_info *)
 
static int(* linux_nat_siginfo_fixup )(siginfo_t *, gdb_byte *, int)
 
static target_xfer_partial_ftypesuper_xfer_partial
 
static void(* super_close )(struct target_ops *)
 
static unsigned int debug_linux_nat
 
struct simple_pid_liststopped_pids
 
static int linux_nat_event_pipe [2] = { -1, -1 }
 
static int(* linux_nat_status_is_event )(int status) = sigtrap_is_event
 
struct lwp_infolwp_list
 
static sigset_t normal_mask
 
static sigset_t suspend_mask
 
static sigset_t blocked_mask
 
struct sigaction sigchld_action
 
static sigset_t pass_mask
 
int linux_multi_process = 1
 
static int async_terminal_is_ours = 1
 
initialize_file_ftype _initialize_linux_nat
 

Macro Definition Documentation

#define COMM_LEN   16

Referenced by linux_nat_thread_name().

#define FORMAT   "/proc/%d/task/%ld/comm"

Referenced by linux_nat_thread_name().

#define linux_is_async_p ( )    (linux_nat_event_pipe[0] != -1)

Definition at line 228 of file linux-nat.c.

Referenced by linux_async_pipe(), and linux_nat_is_async_p().

#define O_LARGEFILE   0

Definition at line 165 of file linux-nat.c.

Referenced by linux_proc_xfer_partial().

#define SPUFS_MAGIC   0x23c9b64e

Definition at line 73 of file linux-nat.c.

Referenced by spu_enumerate_spu_ids().

Function Documentation

void _initialize_linux_nat ( void  )
static struct lwp_info* add_initial_lwp ( ptid_t  ptid)
static
static void add_line_to_sigset ( const char *  line,
sigset_t *  sigs 
)
static

Definition at line 4312 of file linux-nat.c.

References _, error(), len, and line.

Referenced by linux_proc_pending_signals().

static struct lwp_info * add_lwp ( ptid_t  ptid)
static
static void add_to_pid_list ( struct simple_pid_list **  listp,
int  pid,
int  status 
)
static
static void async_file_flush ( void  )
static

Definition at line 233 of file linux-nat.c.

References linux_nat_event_pipe, and read().

Referenced by async_file_mark(), and linux_nat_wait().

static void async_file_mark ( void  )
static
static int attach_proc_task_lwp_callback ( ptid_t  ptid)
static
static void block_child_signals ( sigset_t *  prev_mask)
static

Definition at line 720 of file linux-nat.c.

References blocked_mask.

Referenced by linux_async_pipe(), linux_nat_wait_1(), and wait_lwp().

static int check_ptrace_stopped_lwp_gone ( struct lwp_info lp)
static
static int check_stopped_by_breakpoint ( struct lwp_info lp)
static
static int check_stopped_by_watchpoint ( struct lwp_info lp)
static
static void check_zombie_leaders ( void  )
static
static void cleanup_target_stop ( void *  arg)
static

Definition at line 4451 of file linux-nat.c.

References gdb_assert, and target_resume().

Referenced by VEC().

static int count_events_callback ( struct lwp_info lp,
void *  data 
)
static

Definition at line 2720 of file linux-nat.c.

References gdbarch::data, gdb_assert, lwp_status_pending_p(), and lwp_info::resumed.

Referenced by select_event_lwp().

ptid_t current_lwp_ptid ( void  )
static void delete_lwp ( ptid_t  ptid)
static

Definition at line 865 of file linux-nat.c.

References lwp_free(), lwp_info::next, and ptid_equal().

Referenced by delete_lwp_cleanup(), detach_callback(), exit_lwp(), and linux_nat_detach().

static void delete_lwp_cleanup ( void *  lp_voidp)
static

Definition at line 439 of file linux-nat.c.

References delete_lwp(), and lwp_info::ptid.

Referenced by linux_child_follow_fork().

static int detach_callback ( struct lwp_info lp,
void *  data 
)
static
static void exit_lwp ( struct lwp_info lp)
static
static struct lwp_info * find_lwp_pid ( ptid_t  ptid)
static
static int get_pending_status ( struct lwp_info lp,
int status 
)
static
static int get_signo ( const char *  name)
static
static void handle_target_event ( int  error,
gdb_client_data  client_data 
)
static

Definition at line 4692 of file linux-nat.c.

References INF_REG_EVENT, and inferior_event_handler().

Referenced by linux_nat_async().

static int in_pid_list_p ( struct simple_pid_list list,
int  pid 
)
static

Definition at line 348 of file linux-nat.c.

References simple_pid_list::next, and simple_pid_list::pid.

Referenced by lin_lwp_attach_lwp().

struct lwp_info* iterate_over_lwps ( ptid_t  filter,
iterate_over_lwps_ftype  callback,
void *  data 
)
static int kill_callback ( struct lwp_info lp,
void *  data 
)
static
static int kill_lwp ( int  lwpid,
int  signo 
)
static
static int kill_wait_callback ( struct lwp_info lp,
void *  data 
)
static
int lin_lwp_attach_lwp ( ptid_t  ptid)
void lin_thread_get_thread_signals ( sigset_t *  set)

Definition at line 5202 of file linux-nat.c.

References blocked_mask, get_signo(), sigchld_handler(), and suspend_mask.

Referenced by check_thread_signals().

static int linux_async_pipe ( int  enable)
static
static int linux_child_follow_fork ( struct target_ops ops,
int  follow_child,
int  detach_fork 
)
static
static int linux_child_insert_exec_catchpoint ( struct target_ops self,
int  pid 
)
static

Definition at line 639 of file linux-nat.c.

References linux_supports_tracefork().

Referenced by linux_target_install_ops().

static int linux_child_insert_fork_catchpoint ( struct target_ops self,
int  pid 
)
static

Definition at line 615 of file linux-nat.c.

References linux_supports_tracefork().

Referenced by linux_target_install_ops().

static int linux_child_insert_vfork_catchpoint ( struct target_ops self,
int  pid 
)
static

Definition at line 627 of file linux-nat.c.

References linux_supports_tracefork().

Referenced by linux_target_install_ops().

static char * linux_child_pid_to_exec_file ( struct target_ops self,
int  pid 
)
static

Definition at line 4134 of file linux-nat.c.

References linux_proc_pid_to_exec_file().

Referenced by linux_handle_extended_wait(), and linux_target_install_ops().

static void linux_child_post_attach ( struct target_ops self,
int  pid 
)
static

Definition at line 410 of file linux-nat.c.

References linux_init_ptrace().

Referenced by linux_target_install_ops().

static void linux_child_post_startup_inferior ( struct target_ops self,
ptid_t  ptid 
)
static

Definition at line 416 of file linux-nat.c.

References linux_init_ptrace(), and ptid_get_pid().

Referenced by linux_target_install_ops().

static int linux_child_remove_exec_catchpoint ( struct target_ops self,
int  pid 
)
static

Definition at line 645 of file linux-nat.c.

Referenced by linux_target_install_ops().

static int linux_child_remove_fork_catchpoint ( struct target_ops self,
int  pid 
)
static

Definition at line 621 of file linux-nat.c.

Referenced by linux_target_install_ops().

static int linux_child_remove_vfork_catchpoint ( struct target_ops self,
int  pid 
)
static

Definition at line 633 of file linux-nat.c.

Referenced by linux_target_install_ops().

static int linux_child_set_syscall_catchpoint ( struct target_ops self,
int  pid,
int  needed,
int  any_count,
int  table_size,
int table 
)
static

Definition at line 651 of file linux-nat.c.

References linux_supports_tracesysgood().

Referenced by linux_target_install_ops().

static int linux_handle_extended_wait ( struct lwp_info lp,
int  status 
)
static
static int linux_handle_syscall_trap ( struct lwp_info lp,
int  stopping 
)
static
static void linux_init_ptrace ( pid_t  pid,
int  attached 
)
static
void linux_nat_add_target ( struct target_ops t)

Definition at line 4972 of file linux-nat.c.

References add_target(), linux_nat_async(), linux_nat_attach(), linux_nat_can_async_p(), linux_nat_close(), linux_nat_core_of_thread(), linux_nat_create_inferior(), linux_nat_detach(), linux_nat_fileio_open(), linux_nat_fileio_readlink(), linux_nat_fileio_unlink(), linux_nat_filesystem_is_local(), linux_nat_is_async_p(), linux_nat_kill(), linux_nat_mourn_inferior(), linux_nat_pass_signals(), linux_nat_pid_to_str(), linux_nat_resume(), linux_nat_stop(), linux_nat_stopped_by_hw_breakpoint(), linux_nat_stopped_by_sw_breakpoint(), linux_nat_stopped_by_watchpoint(), linux_nat_stopped_data_address(), linux_nat_supports_disable_randomization(), linux_nat_supports_multi_process(), linux_nat_supports_non_stop(), linux_nat_supports_stopped_by_hw_breakpoint(), linux_nat_supports_stopped_by_sw_breakpoint(), linux_nat_terminal_inferior(), linux_nat_terminal_ours(), linux_nat_thread_address_space(), linux_nat_thread_alive(), linux_nat_thread_name(), linux_nat_update_thread_list(), linux_nat_wait(), linux_nat_xfer_partial(), linux_ops_saved, super_close, tc_schedlock, target_ops::to_async, target_ops::to_attach, target_ops::to_can_async_p, target_ops::to_close, target_ops::to_core_of_thread, target_ops::to_create_inferior, target_ops::to_detach, target_ops::to_fileio_open, target_ops::to_fileio_readlink, target_ops::to_fileio_unlink, target_ops::to_filesystem_is_local, target_ops::to_has_thread_control, target_ops::to_is_async_p, target_ops::to_kill, target_ops::to_mourn_inferior, target_ops::to_pass_signals, target_ops::to_pid_to_str, target_ops::to_resume, target_ops::to_stop, target_ops::to_stopped_by_hw_breakpoint, target_ops::to_stopped_by_sw_breakpoint, target_ops::to_stopped_by_watchpoint, target_ops::to_stopped_data_address, target_ops::to_supports_disable_randomization, target_ops::to_supports_multi_process, target_ops::to_supports_non_stop, target_ops::to_supports_stopped_by_hw_breakpoint, target_ops::to_supports_stopped_by_sw_breakpoint, target_ops::to_terminal_inferior, target_ops::to_terminal_ours, target_ops::to_thread_address_space, target_ops::to_thread_alive, target_ops::to_thread_name, target_ops::to_update_thread_list, target_ops::to_wait, and target_ops::to_xfer_partial.

Referenced by _initialize_aarch64_linux_nat(), _initialize_alpha_linux_nat(), _initialize_arm_linux_nat(), _initialize_hppa_linux_nat(), _initialize_ia64_linux_nat(), _initialize_m32r_linux_nat(), _initialize_m68k_linux_nat(), _initialize_mips_linux_nat(), _initialize_ppc_linux_nat(), _initialize_s390_nat(), _initialize_sparc64_linux_nat(), _initialize_sparc_linux_nat(), _initialize_tile_linux_nat(), _initialize_xtensa_linux_nat(), and x86_linux_add_target().

static void linux_nat_async ( struct target_ops ops,
int  enable 
)
static
static void linux_nat_attach ( struct target_ops ops,
const char *  args,
int  from_tty 
)
static
static int linux_nat_can_async_p ( struct target_ops ops)
static

Definition at line 4576 of file linux-nat.c.

References target_async_permitted.

Referenced by linux_nat_add_target().

static void linux_nat_close ( struct target_ops self)
static
static int linux_nat_core_of_thread ( struct target_ops ops,
ptid_t  ptid 
)
static

Definition at line 4863 of file linux-nat.c.

References lwp_info::core, and find_lwp_pid().

Referenced by linux_nat_add_target().

static void linux_nat_create_inferior ( struct target_ops ops,
char *  exec_file,
char *  allargs,
char **  env,
int  from_tty 
)
static
static void linux_nat_detach ( struct target_ops ops,
const char *  args,
int  from_tty 
)
static
static int linux_nat_fileio_open ( struct target_ops self,
struct inferior inf,
const char *  filename,
int  flags,
int  mode,
int  warn_if_slow,
int target_errno 
)
static
static pid_t linux_nat_fileio_pid_of ( struct inferior inf)
static
static char* linux_nat_fileio_readlink ( struct target_ops self,
struct inferior inf,
const char *  filename,
int target_errno 
)
static
static int linux_nat_fileio_unlink ( struct target_ops self,
struct inferior inf,
const char *  filename,
int target_errno 
)
static
static int linux_nat_filesystem_is_local ( struct target_ops ops)
static
static struct lwp_info* linux_nat_filter_event ( int  lwpid,
int  status 
)
static
void linux_nat_forget_process ( pid_t  pid)

Definition at line 5072 of file linux-nat.c.

References linux_nat_forget_process_hook.

Referenced by delete_fork(), linux_nat_kill(), and linux_nat_mourn_inferior().

int linux_nat_get_siginfo ( ptid_t  ptid,
siginfo_t *  siginfo 
)
static int linux_nat_has_pending_sigint ( int  pid)
static

Definition at line 2408 of file linux-nat.c.

References linux_proc_pending_signals().

Referenced by maybe_clear_ignore_sigint().

static int linux_nat_is_async_p ( struct target_ops ops)
static

Definition at line 4568 of file linux-nat.c.

References linux_is_async_p.

Referenced by linux_nat_add_target(), and linux_nat_close().

static void linux_nat_kill ( struct target_ops ops)
static
static void linux_nat_mourn_inferior ( struct target_ops ops)
static
static void linux_nat_pass_signals ( struct target_ops self,
int  numsigs,
unsigned char *  pass_signals 
)
static
static char* linux_nat_pid_to_str ( struct target_ops ops,
ptid_t  ptid 
)
static

Definition at line 4078 of file linux-nat.c.

References normal_pid_to_str(), num_lwps(), ptid_get_lwp(), ptid_get_pid(), and ptid_lwp_p().

Referenced by linux_nat_add_target().

static int linux_nat_post_attach_wait ( ptid_t  ptid,
int  first,
int cloned,
int signalled 
)
static
static int linux_nat_ptrace_options ( int  attached)
static
static void linux_nat_resume ( struct target_ops ops,
ptid_t  ptid,
int  step,
enum gdb_signal  signo 
)
static
static int linux_nat_resume_callback ( struct lwp_info lp,
void *  except 
)
static
void linux_nat_set_forget_process ( struct target_ops t,
linux_nat_forget_process_ftype fn 
)
void linux_nat_set_new_fork ( struct target_ops t,
linux_nat_new_fork_ftype new_fork 
)
void linux_nat_set_new_thread ( struct target_ops t,
void(*)(struct lwp_info *)  new_thread 
)
void linux_nat_set_prepare_to_resume ( struct target_ops t,
void(*)(struct lwp_info *)  prepare_to_resume 
)
void linux_nat_set_siginfo_fixup ( struct target_ops t,
int(*)(siginfo_t *, gdb_byte *, int siginfo_fixup 
)

Definition at line 5082 of file linux-nat.c.

References linux_nat_siginfo_fixup, and siginfo_fixup().

Referenced by _initialize_amd64_linux_nat().

void linux_nat_set_status_is_event ( struct target_ops t,
int(*)(int status status_is_event 
)

Definition at line 2563 of file linux-nat.c.

References linux_nat_status_is_event.

Referenced by _initialize_ia64_linux_nat().

static void linux_nat_stop ( struct target_ops self,
ptid_t  ptid 
)
static

Definition at line 4807 of file linux-nat.c.

References iterate_over_lwps(), linux_nat_stop_lwp(), non_stop, and target_ops::to_stop.

Referenced by linux_nat_add_target().

static int linux_nat_stop_lwp ( struct lwp_info lwp,
void *  data 
)
static
static int linux_nat_stopped_by_hw_breakpoint ( struct target_ops ops)
static
static int linux_nat_stopped_by_sw_breakpoint ( struct target_ops ops)
static
static int linux_nat_stopped_by_watchpoint ( struct target_ops ops)
static
static int linux_nat_stopped_data_address ( struct target_ops ops,
CORE_ADDR addr_p 
)
static
static int linux_nat_supports_disable_randomization ( struct target_ops self)
static

Definition at line 4602 of file linux-nat.c.

Referenced by linux_nat_add_target().

static int linux_nat_supports_multi_process ( struct target_ops self)
static

Definition at line 4596 of file linux-nat.c.

References linux_multi_process.

Referenced by linux_nat_add_target().

static int linux_nat_supports_non_stop ( struct target_ops self)
static

Definition at line 4585 of file linux-nat.c.

Referenced by linux_nat_add_target().

static int linux_nat_supports_stopped_by_hw_breakpoint ( struct target_ops ops)
static

Definition at line 2915 of file linux-nat.c.

References USE_SIGTRAP_SIGINFO.

Referenced by linux_nat_add_target().

static int linux_nat_supports_stopped_by_sw_breakpoint ( struct target_ops ops)
static

Definition at line 2894 of file linux-nat.c.

References USE_SIGTRAP_SIGINFO.

Referenced by linux_nat_add_target().

void linux_nat_switch_fork ( ptid_t  new_ptid)
static void linux_nat_terminal_inferior ( struct target_ops self)
static
static void linux_nat_terminal_ours ( struct target_ops self)
static
static struct address_space* linux_nat_thread_address_space ( struct target_ops t,
ptid_t  ptid 
)
static
static int linux_nat_thread_alive ( struct target_ops ops,
ptid_t  ptid 
)
static

Definition at line 4055 of file linux-nat.c.

References linux_thread_alive().

Referenced by linux_nat_add_target().

static char* linux_nat_thread_name ( struct target_ops self,
struct thread_info thr 
)
static
static void linux_nat_update_thread_list ( struct target_ops ops)
static

Definition at line 4064 of file linux-nat.c.

References delete_exited_threads(), linux_supports_traceclone(), and prune_threads().

Referenced by linux_nat_add_target().

static ptid_t linux_nat_wait ( struct target_ops ops,
ptid_t  ptid,
struct target_waitstatus ourstatus,
int  target_options 
)
static
static ptid_t linux_nat_wait_1 ( struct target_ops ops,
ptid_t  ptid,
struct target_waitstatus ourstatus,
int  target_options 
)
static
static enum target_xfer_status linux_nat_xfer_osdata ( struct target_ops ops,
enum target_object  object,
const char *  annex,
gdb_byte readbuf,
const gdb_byte writebuf,
ULONGEST  offset,
ULONGEST  len,
ULONGEST xfered_len 
)
static
static enum target_xfer_status linux_nat_xfer_partial ( struct target_ops ops,
enum target_object  object,
const char *  annex,
gdb_byte readbuf,
const gdb_byte writebuf,
ULONGEST  offset,
ULONGEST  len,
ULONGEST xfered_len 
)
static
void linux_proc_pending_signals ( int  pid,
sigset_t *  pending,
sigset_t *  blocked,
sigset_t *  ignored 
)
static enum target_xfer_status linux_proc_xfer_partial ( struct target_ops ops,
enum target_object  object,
const char *  annex,
gdb_byte readbuf,
const gdb_byte writebuf,
ULONGEST  offset,
LONGEST  len,
ULONGEST xfered_len 
)
static
static enum target_xfer_status linux_proc_xfer_spu ( struct target_ops ops,
enum target_object  object,
const char *  annex,
gdb_byte readbuf,
const gdb_byte writebuf,
ULONGEST  offset,
ULONGEST  len,
ULONGEST xfered_len 
)
static
static void linux_resume_one_lwp ( struct lwp_info lp,
int  step,
enum gdb_signal  signo 
)
static
static void linux_resume_one_lwp_throw ( struct lwp_info lp,
int  step,
enum gdb_signal  signo 
)
static
void linux_stop_and_wait_all_lwps ( void  )

Definition at line 2386 of file linux-nat.c.

References iterate_over_lwps(), minus_one_ptid, stop_callback(), and stop_wait_callback().

Referenced by try_thread_db_load_1().

void linux_stop_lwp ( struct lwp_info lwp)
struct target_ops* linux_target ( void  )
static void linux_target_install_ops ( struct target_ops t)
static
static int linux_thread_alive ( ptid_t  ptid)
static
struct target_ops* linux_trad_target ( CORE_ADDR(*)(struct gdbarch *, int, int register_u_offset)
void linux_unstop_all_lwps ( void  )

Definition at line 2399 of file linux-nat.c.

References iterate_over_lwps(), minus_one_ptid, and resume_stopped_resumed_lwps().

Referenced by try_thread_db_load_1().

static enum target_xfer_status linux_xfer_partial ( struct target_ops ops,
enum target_object  object,
const char *  annex,
gdb_byte readbuf,
const gdb_byte writebuf,
ULONGEST  offset,
ULONGEST  len,
ULONGEST xfered_len 
)
static
static enum target_xfer_status linux_xfer_siginfo ( struct target_ops ops,
enum target_object  object,
const char *  annex,
gdb_byte readbuf,
const gdb_byte writebuf,
ULONGEST  offset,
ULONGEST  len,
ULONGEST xfered_len 
)
static
struct arch_lwp_info* lwp_arch_private_info ( struct lwp_info lwp)

Definition at line 312 of file linux-nat.c.

References lwp_info::arch_private.

Referenced by lwp_debug_registers_changed(), and lwp_set_debug_registers_changed().

static void lwp_free ( struct lwp_info lp)
static

Definition at line 771 of file linux-nat.c.

References lwp_info::arch_private, and xfree().

Referenced by delete_lwp(), and purge_lwp_list().

int lwp_is_stopped ( struct lwp_info lwp)

Definition at line 320 of file linux-nat.c.

References lwp_info::stopped.

Referenced by update_debug_registers_callback(), and x86_linux_update_debug_registers().

void lwp_set_arch_private_info ( struct lwp_info lwp,
struct arch_lwp_info info 
)

Definition at line 303 of file linux-nat.c.

References lwp_info::arch_private.

Referenced by lwp_set_debug_registers_changed().

static int lwp_status_pending_p ( struct lwp_info lp)
static
enum target_stop_reason lwp_stop_reason ( struct lwp_info lwp)

Definition at line 328 of file linux-nat.c.

References lwp_info::stop_reason.

Referenced by x86_linux_update_debug_registers().

static void maybe_clear_ignore_sigint ( struct lwp_info lp)
static
static int num_lwps ( int  pid)
static
ptid_t ptid_of_lwp ( struct lwp_info lwp)

Definition at line 295 of file linux-nat.c.

References lwp_info::ptid.

Referenced by x86_linux_update_debug_registers().

static int pull_pid_from_list ( struct simple_pid_list **  listp,
int  pid,
int statusp 
)
static

Definition at line 359 of file linux-nat.c.

References simple_pid_list::next, simple_pid_list::status, and xfree().

Referenced by linux_handle_extended_wait().

static void purge_lwp_list ( int  pid)
static
static void restore_child_signals_mask ( sigset_t *  prev_mask)
static

Definition at line 733 of file linux-nat.c.

Referenced by linux_async_pipe(), linux_nat_wait_1(), and wait_lwp().

static int resume_clear_callback ( struct lwp_info lp,
void *  data 
)
static

Definition at line 1729 of file linux-nat.c.

References lwp_info::last_resume_kind, resume_stop, and lwp_info::resumed.

Referenced by linux_nat_wait_1().

static void resume_lwp ( struct lwp_info lp,
int  step,
enum gdb_signal  signo 
)
static
static int resume_set_callback ( struct lwp_info lp,
void *  data 
)
static

Definition at line 1737 of file linux-nat.c.

References lwp_info::last_resume_kind, resume_continue, and lwp_info::resumed.

Referenced by linux_nat_resume().

static int resume_stopped_resumed_lwps ( struct lwp_info lp,
void *  data 
)
static
static int resumed_callback ( struct lwp_info lp,
void *  data 
)
static

Definition at line 2991 of file linux-nat.c.

References lwp_info::resumed.

Referenced by linux_nat_wait_1().

static int running_callback ( struct lwp_info lp,
void *  data 
)
static

Definition at line 2711 of file linux-nat.c.

References lwp_status_pending_p(), lwp_info::resumed, and lwp_info::stopped.

Referenced by linux_nat_filter_event().

static void save_sigtrap ( struct lwp_info lp)
static
static void select_event_lwp ( ptid_t  filter,
struct lwp_info **  orig_lp,
int status 
)
static
static int select_event_lwp_callback ( struct lwp_info lp,
void *  data 
)
static

Definition at line 2759 of file linux-nat.c.

References gdbarch::data, gdb_assert, lwp_status_pending_p(), lwp_info::resumed, and selector.

Referenced by select_event_lwp().

static int select_singlestep_lwp_callback ( struct lwp_info lp,
void *  data 
)
static

Definition at line 2736 of file linux-nat.c.

References lwp_info::last_resume_kind, resume_step, and lwp_info::status.

Referenced by select_event_lwp().

static int set_ignore_sigint ( struct lwp_info lp,
void *  data 
)
static
static void show_debug_linux_nat ( struct ui_file file,
int  from_tty,
struct cmd_list_element c,
const char *  value 
)
static

Definition at line 206 of file linux-nat.c.

References _, and fprintf_filtered().

Referenced by _initialize_linux_nat().

static void sigchld_handler ( int  signo)
static
static void siginfo_fixup ( siginfo_t *  siginfo,
gdb_byte inf_siginfo,
int  direction 
)
static

Definition at line 3926 of file linux-nat.c.

References linux_nat_siginfo_fixup.

Referenced by linux_nat_set_siginfo_fixup(), and linux_xfer_siginfo().

static int sigtrap_is_event ( int  status)
static

Definition at line 2553 of file linux-nat.c.

References WIFSTOPPED, and WSTOPSIG.

static LONGEST spu_enumerate_spu_ids ( int  pid,
gdb_byte buf,
ULONGEST  offset,
ULONGEST  len 
)
static
static int status_callback ( struct lwp_info lp,
void *  data 
)
static
static int stop_and_resume_callback ( struct lwp_info lp,
void *  data 
)
static
static int stop_callback ( struct lwp_info lp,
void *  data 
)
static
static int stop_wait_callback ( struct lwp_info lp,
void *  data 
)
static
static VEC ( static_tracepoint_marker_p  )
static
static int wait_lwp ( struct lwp_info lp)
static

Variable Documentation

initialize_file_ftype _initialize_linux_nat
int async_terminal_is_ours = 1
static

Definition at line 4611 of file linux-nat.c.

sigset_t blocked_mask
static
unsigned int debug_linux_nat
static
enum tribool have_ptrace_getregset = TRIBOOL_UNKNOWN
int linux_multi_process = 1

Definition at line 4593 of file linux-nat.c.

Referenced by linux_nat_supports_multi_process().

int linux_nat_event_pipe[2] = { -1, -1 }
static
linux_nat_forget_process_ftype* linux_nat_forget_process_hook
static

Definition at line 184 of file linux-nat.c.

Referenced by linux_nat_forget_process(), and linux_nat_set_forget_process().

linux_nat_new_fork_ftype* linux_nat_new_fork
static

Definition at line 180 of file linux-nat.c.

Referenced by linux_handle_extended_wait(), and linux_nat_set_new_fork().

void(* linux_nat_new_thread) (struct lwp_info *)
static

Definition at line 177 of file linux-nat.c.

Referenced by add_lwp(), and linux_nat_set_new_thread().

void(* linux_nat_prepare_to_resume) (struct lwp_info *)
static
int(* linux_nat_siginfo_fixup) (siginfo_t *, gdb_byte *, int)
static

Definition at line 192 of file linux-nat.c.

Referenced by linux_nat_set_siginfo_fixup(), and siginfo_fixup().

int(* linux_nat_status_is_event) (int status) = sigtrap_is_event
static

Definition at line 287 of file linux-nat.c.

Referenced by linux_nat_set_status_is_event(), linux_nat_wait_1(), and save_sigtrap().

struct target_ops* linux_ops
static

Definition at line 173 of file linux-nat.c.

struct target_ops linux_ops_saved
static

Definition at line 174 of file linux-nat.c.

Referenced by linux_nat_add_target().

struct lwp_info* lwp_list

Definition at line 700 of file linux-nat.c.

Referenced by add_initial_lwp(), and num_lwps().

sigset_t normal_mask
static

Definition at line 704 of file linux-nat.c.

Referenced by _initialize_linux_nat().

sigset_t pass_mask
static

Definition at line 739 of file linux-nat.c.

Referenced by linux_nat_filter_event(), linux_nat_pass_signals(), and linux_nat_resume().

struct sigaction sigchld_action

Definition at line 714 of file linux-nat.c.

Referenced by _initialize_linux_nat().

struct simple_pid_list* stopped_pids

Definition at line 219 of file linux-nat.c.

void(* super_close) (struct target_ops *)
static

Definition at line 202 of file linux-nat.c.

Referenced by linux_nat_add_target(), and linux_nat_close().

target_xfer_partial_ftype* super_xfer_partial
static

Definition at line 198 of file linux-nat.c.

Referenced by linux_target_install_ops(), and linux_xfer_partial().

sigset_t suspend_mask
static