GDBserver
Classes | Macros | Enumerations | Functions | Variables
linux-low.c File Reference
#include "server.h"
#include "linux-low.h"
#include "nat/linux-osdata.h"
#include "agent.h"
#include "tdesc.h"
#include "rsp-low.h"
#include "nat/linux-nat.h"
#include "nat/linux-waitpid.h"
#include "gdb_wait.h"
#include <sys/ptrace.h>
#include "nat/linux-ptrace.h"
#include "nat/linux-procfs.h"
#include "nat/linux-personality.h"
#include <signal.h>
#include <sys/ioctl.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/syscall.h>
#include <sched.h>
#include <ctype.h>
#include <pwd.h>
#include <sys/types.h>
#include <dirent.h>
#include <sys/stat.h>
#include <sys/vfs.h>
#include <sys/uio.h>
#include "filestuff.h"
#include "tracepoint.h"
#include "hostio.h"
#include <elf.h>
#include "nat/linux-namespaces.h"

Go to the source code of this file.

Classes

struct  Elf32_auxv_t
 
struct  Elf64_auxv_t
 
struct  simple_pid_list
 
struct  pending_signals
 
struct  counter
 
struct  iterate_over_lwps_args
 
struct  thread_resume_array
 
struct  link_map_offsets
 

Macros

#define SPUFS_MAGIC   0x23c9b64e
 
#define O_LARGEFILE   0
 
#define W_STOPCODE(sig)   ((sig) << 8 | 0x7f)
 
#define __SIGRTMIN   32
 
#define target_is_async_p()   (linux_event_pipe[0] != -1)
 
#define use_linux_regsets   0
 
#define regsets_fetch_inferior_registers(regsets_info, regcache)   1
 
#define regsets_store_inferior_registers(regsets_info, regcache)   1
 
#define usr_fetch_inferior_registers(regs_info, regcache, regno, all)   do {} while (0)
 
#define usr_store_inferior_registers(regs_info, regcache, regno, all)   do {} while (0)
 
#define linux_read_loadmap   NULL
 

Enumerations

enum  stopping_threads_kind { NOT_STOPPING_THREADS, STOPPING_THREADS, STOPPING_AND_SUSPENDING_THREADS }
 

Functions

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 pull_pid_from_list (struct simple_pid_list **listp, int pid, int *statusp)
 
static void linux_resume_one_lwp (struct lwp_info *lwp, int step, int signal, siginfo_t *info)
 
static void linux_resume (struct thread_resume *resume_info, size_t n)
 
static void stop_all_lwps (int suspend, struct lwp_info *except)
 
static void unstop_all_lwps (int unsuspend, struct lwp_info *except)
 
static int linux_wait_for_event_filtered (ptid_t wait_ptid, ptid_t filter_ptid, int *wstat, int options)
 
static int linux_wait_for_event (ptid_t ptid, int *wstat, int options)
 
static struct lwp_infoadd_lwp (ptid_t ptid)
 
static int linux_stopped_by_watchpoint (void)
 
static void mark_lwp_dead (struct lwp_info *lwp, int wstat)
 
static int lwp_is_marked_dead (struct lwp_info *lwp)
 
static void proceed_all_lwps (void)
 
static int finish_step_over (struct lwp_info *lwp)
 
static int kill_lwp (unsigned long lwpid, int signo)
 
static void enqueue_pending_signal (struct lwp_info *lwp, int signal, siginfo_t *info)
 
static void complete_ongoing_step_over (void)
 
static int can_hardware_single_step (void)
 
static int supports_breakpoints (void)
 
static int supports_fast_tracepoints (void)
 
static int lwp_in_step_range (struct lwp_info *lwp)
 
static void send_sigstop (struct lwp_info *lwp)
 
static void wait_for_sigstop (void)
 
static int elf_64_header_p (const Elf64_Ehdr *header, unsigned int *machine)
 
static int elf_64_file_p (const char *file, unsigned int *machine)
 
int linux_pid_exe_is_elf_64_file (int pid, unsigned int *machine)
 
static void delete_lwp (struct lwp_info *lwp)
 
static struct process_infolinux_add_process (int pid, int attached)
 
static CORE_ADDR get_pc (struct lwp_info *lwp)
 
static int handle_extended_wait (struct lwp_info *event_lwp, int wstat)
 
static int check_stopped_by_breakpoint (struct lwp_info *lwp)
 
static int linux_create_inferior (char *program, char **allargs)
 
int linux_attach_lwp (ptid_t ptid)
 
static int attach_proc_task_lwp_callback (ptid_t ptid)
 
static int linux_attach (unsigned long pid)
 
static int second_thread_of_pid_p (struct inferior_list_entry *entry, void *args)
 
static int last_thread_of_process_p (int pid)
 
static void linux_kill_one_lwp (struct lwp_info *lwp)
 
static void kill_wait_lwp (struct lwp_info *lwp)
 
static int kill_one_lwp_callback (struct inferior_list_entry *entry, void *args)
 
static int linux_kill (int pid)
 
static int get_detach_signal (struct thread_info *thread)
 
static int linux_detach_one_lwp (struct inferior_list_entry *entry, void *args)
 
static int linux_detach (int pid)
 
static int delete_lwp_callback (struct inferior_list_entry *entry, void *proc)
 
static void linux_mourn (struct process_info *process)
 
static void linux_join (int pid)
 
static int linux_thread_alive (ptid_t ptid)
 
static int thread_still_has_status_pending_p (struct thread_info *thread)
 
static int status_pending_p_callback (struct inferior_list_entry *entry, void *arg)
 
static int same_lwp (struct inferior_list_entry *entry, void *data)
 
struct lwp_infofind_lwp_pid (ptid_t ptid)
 
static int num_lwps (int pid)
 
static int iterate_over_lwps_filter (struct inferior_list_entry *entry, void *args_p)
 
struct lwp_infoiterate_over_lwps (ptid_t filter, iterate_over_lwps_ftype callback, void *data)
 
static void check_zombie_leaders (void)
 
static int not_stopped_callback (struct inferior_list_entry *entry, void *arg)
 
static void lwp_suspended_inc (struct lwp_info *lwp)
 
static void lwp_suspended_decr (struct lwp_info *lwp)
 
static int handle_tracepoints (struct lwp_info *lwp)
 
static int linux_fast_tracepoint_collecting (struct lwp_info *lwp, struct fast_tpoint_collect_status *status)
 
static int maybe_move_out_of_jump_pad (struct lwp_info *lwp, int *wstat)
 
static void enqueue_one_deferred_signal (struct lwp_info *lwp, int *wstat)
 
static int dequeue_one_deferred_signal (struct lwp_info *lwp, int *wstat)
 
static int check_stopped_by_watchpoint (struct lwp_info *child)
 
static int linux_low_ptrace_options (int attached)
 
static struct lwp_infolinux_low_filter_event (int lwpid, int wstat)
 
static void resume_stopped_resumed_lwps (struct inferior_list_entry *entry)
 
static int count_events_callback (struct inferior_list_entry *entry, void *data)
 
static int select_singlestep_lwp_callback (struct inferior_list_entry *entry, void *data)
 
static int select_event_lwp_callback (struct inferior_list_entry *entry, void *data)
 
static void select_event_lwp (struct lwp_info **orig_lp)
 
static int unsuspend_one_lwp (struct inferior_list_entry *entry, void *except)
 
static void unsuspend_all_lwps (struct lwp_info *except)
 
static void move_out_of_jump_pad_callback (struct inferior_list_entry *entry)
 
static int stuck_in_jump_pad_callback (struct inferior_list_entry *entry, void *data)
 
static int lwp_running (struct inferior_list_entry *entry, void *data)
 
static ptid_t linux_wait_1 (ptid_t ptid, struct target_waitstatus *ourstatus, int target_options)
 
static void linux_stabilize_threads (void)
 
static void async_file_mark (void)
 
static ptid_t ignore_event (struct target_waitstatus *ourstatus)
 
static void async_file_flush (void)
 
static ptid_t linux_wait (ptid_t ptid, struct target_waitstatus *ourstatus, int target_options)
 
void linux_stop_lwp (struct lwp_info *lwp)
 
static int send_sigstop_callback (struct inferior_list_entry *entry, void *except)
 
static int suspend_and_send_sigstop_callback (struct inferior_list_entry *entry, void *except)
 
static void linux_resume_one_lwp_throw (struct lwp_info *lwp, int step, int signal, siginfo_t *info)
 
static int check_ptrace_stopped_lwp_gone (struct lwp_info *lp)
 
static int linux_set_resume_request (struct inferior_list_entry *entry, void *arg)
 
static int resume_status_pending_p (struct inferior_list_entry *entry, void *flag_p)
 
static int need_step_over_p (struct inferior_list_entry *entry, void *dummy)
 
static int start_step_over (struct lwp_info *lwp)
 
static int linux_resume_one_thread (struct inferior_list_entry *entry, void *arg)
 
static int proceed_one_lwp (struct inferior_list_entry *entry, void *except)
 
static int unsuspend_and_proceed_one_lwp (struct inferior_list_entry *entry, void *except)
 
static int linux_register_in_regsets (const struct regs_info *regs_info, int regno)
 
void linux_fetch_registers (struct regcache *regcache, int regno)
 
void linux_store_registers (struct regcache *regcache, int regno)
 
static int linux_read_memory (CORE_ADDR memaddr, unsigned char *myaddr, int len)
 
static int linux_write_memory (CORE_ADDR memaddr, const unsigned char *myaddr, int len)
 
static void linux_look_up_symbols (void)
 
static void linux_request_interrupt (void)
 
static int linux_read_auxv (CORE_ADDR offset, unsigned char *myaddr, unsigned int len)
 
static int linux_supports_z_point_type (char z_type)
 
static int linux_insert_point (enum raw_bkpt_type type, CORE_ADDR addr, int size, struct raw_breakpoint *bp)
 
static int linux_remove_point (enum raw_bkpt_type type, CORE_ADDR addr, int size, struct raw_breakpoint *bp)
 
static int linux_stopped_by_sw_breakpoint (void)
 
static int linux_supports_stopped_by_sw_breakpoint (void)
 
static int linux_stopped_by_hw_breakpoint (void)
 
static int linux_supports_stopped_by_hw_breakpoint (void)
 
static int linux_supports_conditional_breakpoints (void)
 
static CORE_ADDR linux_stopped_data_address (void)
 
static int linux_qxfer_osdata (const char *annex, unsigned char *readbuf, unsigned const char *writebuf, CORE_ADDR offset, int len)
 
static void siginfo_fixup (siginfo_t *siginfo, void *inf_siginfo, int direction)
 
static int linux_xfer_siginfo (const char *annex, unsigned char *readbuf, unsigned const char *writebuf, CORE_ADDR offset, int len)
 
static void sigchld_handler (int signo)
 
static int linux_supports_non_stop (void)
 
static int linux_async (int enable)
 
static int linux_start_non_stop (int nonstop)
 
static int linux_supports_multi_process (void)
 
static int linux_supports_fork_events (void)
 
static int linux_supports_vfork_events (void)
 
static int reset_lwp_ptrace_options_callback (struct inferior_list_entry *entry, void *args)
 
static void linux_handle_new_gdb_connection (void)
 
static int linux_supports_disable_randomization (void)
 
static int linux_supports_agent (void)
 
static int linux_supports_range_stepping (void)
 
static int spu_enumerate_spu_ids (long pid, unsigned char *buf, CORE_ADDR offset, int len)
 
static int linux_qxfer_spu (const char *annex, unsigned char *readbuf, unsigned const char *writebuf, CORE_ADDR offset, int len)
 
static void linux_process_qsupported (const char *query)
 
static int linux_supports_tracepoints (void)
 
static CORE_ADDR linux_read_pc (struct regcache *regcache)
 
static void linux_write_pc (struct regcache *regcache, CORE_ADDR pc)
 
static int linux_thread_stopped (struct thread_info *thread)
 
static void linux_pause_all (int freeze)
 
static void linux_unpause_all (int unfreeze)
 
static int linux_prepare_to_access_memory (void)
 
static void linux_done_accessing_memory (void)
 
static int linux_install_fast_tracepoint_jump_pad (CORE_ADDR tpoint, CORE_ADDR tpaddr, CORE_ADDR collector, CORE_ADDR lockaddr, ULONGEST orig_size, CORE_ADDR *jump_entry, CORE_ADDR *trampoline, ULONGEST *trampoline_size, unsigned char *jjump_pad_insn, ULONGEST *jjump_pad_insn_size, CORE_ADDR *adjusted_insn_addr, CORE_ADDR *adjusted_insn_addr_end, char *err)
 
static struct emit_opslinux_emit_ops (void)
 
static int linux_get_min_fast_tracepoint_insn_len (void)
 
static int get_phdr_phnum_from_proc_auxv (const int pid, const int is_elf64, CORE_ADDR *phdr_memaddr, int *num_phdr)
 
static CORE_ADDR get_dynamic (const int pid, const int is_elf64)
 
static CORE_ADDR get_r_debug (const int pid, const int is_elf64)
 
static int read_one_ptr (CORE_ADDR memaddr, CORE_ADDR *ptr, int ptr_size)
 
static int linux_qxfer_libraries_svr4 (const char *annex, unsigned char *readbuf, unsigned const char *writebuf, CORE_ADDR offset, int len)
 
ptid_t current_lwp_ptid (void)
 
static void linux_init_signals ()
 
void initialize_low (void)
 

Variables

struct simple_pid_liststopped_pids
 
enum stopping_threads_kind stopping_threads = NOT_STOPPING_THREADS
 
int using_threads = 1
 
static int stabilizing_threads
 
ptid_t step_over_bkpt
 
static int linux_event_pipe [2] = { -1, -1 }
 
static struct target_ops linux_target_ops
 

Macro Definition Documentation

#define __SIGRTMIN   32
#define linux_read_loadmap   NULL

Definition at line 6018 of file linux-low.c.

#define O_LARGEFILE   0

Definition at line 70 of file linux-low.c.

Referenced by linux_read_memory().

#define regsets_fetch_inferior_registers (   regsets_info,
  regcache 
)    1

Definition at line 4954 of file linux-low.c.

Referenced by linux_fetch_registers().

#define regsets_store_inferior_registers (   regsets_info,
  regcache 
)    1

Definition at line 4955 of file linux-low.c.

Referenced by linux_store_registers().

#define SPUFS_MAGIC   0x23c9b64e

Definition at line 59 of file linux-low.c.

Referenced by spu_enumerate_spu_ids().

#define target_is_async_p ( )    (linux_event_pipe[0] != -1)

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

Referenced by linux_async(), linux_start_non_stop(), linux_wait(), and sigchld_handler().

#define use_linux_regsets   0

Definition at line 4953 of file linux-low.c.

Referenced by linux_register_in_regsets().

#define usr_fetch_inferior_registers (   regs_info,
  regcache,
  regno,
  all 
)    do {} while (0)

Definition at line 5131 of file linux-low.c.

Referenced by linux_fetch_registers().

#define usr_store_inferior_registers (   regs_info,
  regcache,
  regno,
  all 
)    do {} while (0)

Definition at line 5132 of file linux-low.c.

Referenced by linux_store_registers().

#define W_STOPCODE (   sig)    ((sig) << 8 | 0x7f)

Definition at line 74 of file linux-low.c.

Referenced by dequeue_one_deferred_signal(), and linux_stabilize_threads().

Enumeration Type Documentation

Enumerator
NOT_STOPPING_THREADS 
STOPPING_THREADS 
STOPPING_AND_SUSPENDING_THREADS 

Definition at line 234 of file linux-low.c.

Function Documentation

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 3384 of file linux-low.c.

References errno, and linux_event_pipe.

Referenced by async_file_mark(), and linux_wait().

static void async_file_mark ( void  )
static

Definition at line 3396 of file linux-low.c.

References async_file_flush(), errno, and linux_event_pipe.

Referenced by ignore_event(), linux_async(), linux_wait(), and sigchld_handler().

static int attach_proc_task_lwp_callback ( ptid_t  ptid)
static
static int can_hardware_single_step ( void  )
static
static int check_ptrace_stopped_lwp_gone ( struct lwp_info lp)
static
static int check_stopped_by_breakpoint ( struct lwp_info lwp)
static
static int check_stopped_by_watchpoint ( struct lwp_info child)
static
static void check_zombie_leaders ( void  )
static
static void complete_ongoing_step_over ( void  )
static
static int count_events_callback ( struct inferior_list_entry entry,
void *  data 
)
static
ptid_t current_lwp_ptid ( void  )
static void delete_lwp ( struct lwp_info lwp)
static
static int delete_lwp_callback ( struct inferior_list_entry entry,
void *  proc 
)
static

Definition at line 1357 of file linux-low.c.

References delete_lwp(), get_thread_lwp, and pid_of.

Referenced by linux_mourn().

static int dequeue_one_deferred_signal ( struct lwp_info lwp,
int *  wstat 
)
static
static int elf_64_file_p ( const char *  file,
unsigned int *  machine 
)
static

Definition at line 356 of file linux-low.c.

References elf_64_header_p().

Referenced by linux_pid_exe_is_elf_64_file(), and linux_qxfer_libraries_svr4().

static int elf_64_header_p ( const Elf64_Ehdr *  header,
unsigned int *  machine 
)
static

Definition at line 336 of file linux-low.c.

Referenced by elf_64_file_p().

static void enqueue_one_deferred_signal ( struct lwp_info lwp,
int *  wstat 
)
static
static void enqueue_pending_signal ( struct lwp_info lwp,
int  signal,
siginfo_t *  info 
)
static
struct lwp_info* find_lwp_pid ( ptid_t  ptid)
static int finish_step_over ( struct lwp_info lwp)
static
static int get_detach_signal ( struct thread_info thread)
static
static CORE_ADDR get_dynamic ( const int  pid,
const int  is_elf64 
)
static

Definition at line 6202 of file linux-low.c.

References alloca(), gdb_assert, get_phdr_phnum_from_proc_auxv(), and linux_read_memory().

Referenced by get_r_debug().

static CORE_ADDR get_pc ( struct lwp_info lwp)
static
static int get_phdr_phnum_from_proc_auxv ( const int  pid,
const int  is_elf64,
CORE_ADDR phdr_memaddr,
int *  num_phdr 
)
static
static CORE_ADDR get_r_debug ( const int  pid,
const int  is_elf64 
)
static

Definition at line 6279 of file linux-low.c.

References get_dynamic(), and linux_read_memory().

Referenced by linux_qxfer_libraries_svr4().

static int handle_extended_wait ( struct lwp_info event_lwp,
int  wstat 
)
static
static int handle_tracepoints ( struct lwp_info lwp)
static
static ptid_t ignore_event ( struct target_waitstatus *  ourstatus)
static

Definition at line 2779 of file linux-low.c.

References async_file_mark(), and null_ptid.

Referenced by linux_wait_1().

void initialize_low ( void  )

Definition at line 6935 of file linux-low.c.

Referenced by captured_main().

struct lwp_info* iterate_over_lwps ( ptid_t  filter,
iterate_over_lwps_ftype  callback,
void *  data 
)
static int iterate_over_lwps_filter ( struct inferior_list_entry entry,
void *  args_p 
)
static
static int kill_lwp ( unsigned long  lwpid,
int  signo 
)
static

Definition at line 3441 of file linux-low.c.

References errno.

Referenced by linux_attach_lwp(), linux_detach_one_lwp(), linux_kill_one_lwp(), and send_sigstop().

static int kill_one_lwp_callback ( struct inferior_list_entry entry,
void *  args 
)
static
static void kill_wait_lwp ( struct lwp_info lwp)
static
static int last_thread_of_process_p ( int  pid)
static
static struct process_info* linux_add_process ( int  pid,
int  attached 
)
static
static int linux_async ( int  enable)
static
static int linux_attach ( unsigned long  pid)
static
int linux_attach_lwp ( ptid_t  ptid)
static int linux_create_inferior ( char *  program,
char **  allargs 
)
static
static int linux_detach ( int  pid)
static
static int linux_detach_one_lwp ( struct inferior_list_entry entry,
void *  args 
)
static
static void linux_done_accessing_memory ( void  )
static

Definition at line 6088 of file linux-low.c.

References linux_unpause_all(), and non_stop.

static struct emit_ops* linux_emit_ops ( void  )
static

Definition at line 6119 of file linux-low.c.

References linux_target_ops::emit_ops, and the_low_target.

static int linux_fast_tracepoint_collecting ( struct lwp_info lwp,
struct fast_tpoint_collect_status status 
)
static
void linux_fetch_registers ( struct regcache regcache,
int  regno 
)
static int linux_get_min_fast_tracepoint_insn_len ( void  )
static
static void linux_handle_new_gdb_connection ( void  )
static

Definition at line 5817 of file linux-low.c.

References all_threads, find_inferior(), and reset_lwp_ptrace_options_callback().

static void linux_init_signals ( )
static

Definition at line 6914 of file linux-low.c.

References __SIGRTMIN.

Referenced by initialize_low().

static int linux_insert_point ( enum raw_bkpt_type  type,
CORE_ADDR  addr,
int  size,
struct raw_breakpoint bp 
)
static
static int linux_install_fast_tracepoint_jump_pad ( CORE_ADDR  tpoint,
CORE_ADDR  tpaddr,
CORE_ADDR  collector,
CORE_ADDR  lockaddr,
ULONGEST  orig_size,
CORE_ADDR jump_entry,
CORE_ADDR trampoline,
ULONGEST trampoline_size,
unsigned char *  jjump_pad_insn,
ULONGEST jjump_pad_insn_size,
CORE_ADDR adjusted_insn_addr,
CORE_ADDR adjusted_insn_addr_end,
char *  err 
)
static
static void linux_join ( int  pid)
static

Definition at line 1390 of file linux-low.c.

References errno, my_waitpid(), WIFEXITED, and WIFSIGNALED.

static int linux_kill ( int  pid)
static
static void linux_kill_one_lwp ( struct lwp_info lwp)
static
static void linux_look_up_symbols ( void  )
static
static struct lwp_info* linux_low_filter_event ( int  lwpid,
int  wstat 
)
static
static int linux_low_ptrace_options ( int  attached)
static
static void linux_mourn ( struct process_info process)
static
static void linux_pause_all ( int  freeze)
static

Definition at line 6063 of file linux-low.c.

References stop_all_lwps().

Referenced by linux_prepare_to_access_memory().

int linux_pid_exe_is_elf_64_file ( int  pid,
unsigned int *  machine 
)

Definition at line 379 of file linux-low.c.

References elf_64_file_p().

Referenced by tile_arch_setup(), x86_linux_read_description(), and x86_siginfo_fixup().

static int linux_prepare_to_access_memory ( void  )
static

Definition at line 6078 of file linux-low.c.

References linux_pause_all(), and non_stop.

static void linux_process_qsupported ( const char *  query)
static

Definition at line 6022 of file linux-low.c.

References linux_target_ops::process_qsupported, and the_low_target.

static int linux_qxfer_libraries_svr4 ( const char *  annex,
unsigned char *  readbuf,
unsigned const char *  writebuf,
CORE_ADDR  offset,
int  len 
)
static
static int linux_qxfer_osdata ( const char *  annex,
unsigned char *  readbuf,
unsigned const char *  writebuf,
CORE_ADDR  offset,
int  len 
)
static

Definition at line 5583 of file linux-low.c.

References linux_common_xfer_osdata().

static int linux_qxfer_spu ( const char *  annex,
unsigned char *  readbuf,
unsigned const char *  writebuf,
CORE_ADDR  offset,
int  len 
)
static

Definition at line 5902 of file linux-low.c.

References current_thread, lwpid_of, and spu_enumerate_spu_ids().

static int linux_read_auxv ( CORE_ADDR  offset,
unsigned char *  myaddr,
unsigned int  len 
)
static

Definition at line 5406 of file linux-low.c.

References current_thread, lwpid_of, and xsnprintf().

static int linux_read_memory ( CORE_ADDR  memaddr,
unsigned char *  myaddr,
int  len 
)
static
static CORE_ADDR linux_read_pc ( struct regcache regcache)
static

Definition at line 6038 of file linux-low.c.

References linux_target_ops::get_pc, and the_low_target.

static int linux_register_in_regsets ( const struct regs_info regs_info,
int  regno 
)
static

Definition at line 4963 of file linux-low.c.

References regs_info::regset_bitmap, and use_linux_regsets.

Referenced by linux_fetch_registers(), and linux_store_registers().

static int linux_remove_point ( enum raw_bkpt_type  type,
CORE_ADDR  addr,
int  size,
struct raw_breakpoint bp 
)
static
static void linux_request_interrupt ( void  )
static

Definition at line 5393 of file linux-low.c.

References signal_pid.

static void linux_resume ( struct thread_resume resume_info,
size_t  n 
)
static
static void linux_resume_one_lwp ( struct lwp_info lwp,
int  step,
int  signal,
siginfo_t *  info 
)
static
static void linux_resume_one_lwp_throw ( struct lwp_info lwp,
int  step,
int  signal,
siginfo_t *  info 
)
static
static int linux_resume_one_thread ( struct inferior_list_entry entry,
void *  arg 
)
static
static int linux_set_resume_request ( struct inferior_list_entry entry,
void *  arg 
)
static
static void linux_stabilize_threads ( void  )
static
static int linux_start_non_stop ( int  nonstop)
static

Definition at line 5750 of file linux-low.c.

References linux_async(), and target_is_async_p.

void linux_stop_lwp ( struct lwp_info lwp)
static int linux_stopped_by_hw_breakpoint ( void  )
static

Definition at line 5490 of file linux-low.c.

References current_thread, get_thread_lwp, and lwp_info::stop_reason.

static int linux_stopped_by_sw_breakpoint ( void  )
static

Definition at line 5470 of file linux-low.c.

References current_thread, get_thread_lwp, and lwp_info::stop_reason.

static int linux_stopped_by_watchpoint ( void  )
static

Definition at line 5520 of file linux-low.c.

References current_thread, get_thread_lwp, and lwp_info::stop_reason.

static CORE_ADDR linux_stopped_data_address ( void  )
static

Definition at line 5528 of file linux-low.c.

References current_thread, get_thread_lwp, and lwp_info::stopped_data_address.

void linux_store_registers ( struct regcache regcache,
int  regno 
)
static int linux_supports_agent ( void  )
static

Definition at line 5836 of file linux-low.c.

static int linux_supports_conditional_breakpoints ( void  )
static

Definition at line 5510 of file linux-low.c.

References can_hardware_single_step().

static int linux_supports_disable_randomization ( void  )
static

Definition at line 5826 of file linux-low.c.

static int linux_supports_fork_events ( void  )
static

Definition at line 5770 of file linux-low.c.

References linux_supports_tracefork().

static int linux_supports_multi_process ( void  )
static

Definition at line 5762 of file linux-low.c.

static int linux_supports_non_stop ( void  )
static

Definition at line 5689 of file linux-low.c.

static int linux_supports_range_stepping ( void  )
static

Definition at line 5842 of file linux-low.c.

References linux_target_ops::supports_range_stepping, and the_low_target.

static int linux_supports_stopped_by_hw_breakpoint ( void  )
static

Definition at line 5501 of file linux-low.c.

References USE_SIGTRAP_SIGINFO.

static int linux_supports_stopped_by_sw_breakpoint ( void  )
static

Definition at line 5481 of file linux-low.c.

References USE_SIGTRAP_SIGINFO.

static int linux_supports_tracepoints ( void  )
static

Definition at line 6029 of file linux-low.c.

References linux_target_ops::supports_tracepoints, and the_low_target.

static int linux_supports_vfork_events ( void  )
static

Definition at line 5778 of file linux-low.c.

References linux_supports_tracefork().

static int linux_supports_z_point_type ( char  z_type)
static

Definition at line 5434 of file linux-low.c.

References linux_target_ops::supports_z_point_type, and the_low_target.

static int linux_thread_alive ( ptid_t  ptid)
static

Definition at line 1403 of file linux-low.c.

References find_lwp_pid(), and lwp_is_marked_dead().

Referenced by wait_for_sigstop().

static int linux_thread_stopped ( struct thread_info thread)
static

Definition at line 6055 of file linux-low.c.

References get_thread_lwp.

static void linux_unpause_all ( int  unfreeze)
static

Definition at line 6072 of file linux-low.c.

References unstop_all_lwps().

Referenced by linux_done_accessing_memory().

static ptid_t linux_wait ( ptid_t  ptid,
struct target_waitstatus *  ourstatus,
int  target_options 
)
static
static ptid_t linux_wait_1 ( ptid_t  ptid,
struct target_waitstatus *  ourstatus,
int  target_options 
)
static

Definition at line 2793 of file linux-low.c.

References __SIGRTMIN, __WALL, agent_loaded_p(), linux_target_ops::breakpoint_at, breakpoint_here(), breakpoint_inserted_here(), linux_target_ops::breakpoint_len, check_breakpoints(), lwp_info::collecting_fast_tracepoint, current_process(), current_thread, debug_enter, debug_exit, debug_printf(), debug_threads, linux_target_ops::decr_pc_after_break, delete_breakpoint(), dequeue_one_deferred_signal(), enqueue_one_deferred_signal(), enqueue_pending_signal(), lwp_info::exit_jump_pad_bkpt, finish_step_over(), gdb_assert, gdb_breakpoint_here(), gdb_condition_true_at_breakpoint(), gdb_no_commands_at_breakpoint(), gdb_signal_from_host(), get_lwp_thread, get_thread_lwp, get_thread_regcache(), handle_tracepoints(), ignore_event(), thread_info::last_resume_kind, linux_fast_tracepoint_collecting(), linux_resume_one_lwp(), linux_wait_for_event(), linux_wstatus_maybe_breakpoint(), lwp_in_step_range(), lwpid_of, maybe_move_out_of_jump_pad(), minus_one_ptid, lwp_info::need_step_over, non_stop, null_ptid, paddress(), pass_signals, proceed_all_lwps(), ptid_equal(), ptid_of, PTRACE_GETSIGINFO, PTRACE_TYPE_ARG3, run_breakpoint_commands(), select_event_lwp(), linux_target_ops::set_pc, stabilize_threads, stabilizing_threads, lwp_info::status_pending, lwp_info::status_pending_p, lwp_info::step_range_end, lwp_info::step_range_start, lwp_info::stepping, stop_all_lwps(), lwp_info::stop_pc, lwp_info::stop_reason, supports_breakpoints(), supports_fast_tracepoints(), lwp_info::suspended, swbreak_feature, target_pid_to_str(), the_low_target, unstop_all_lwps(), unsuspend_all_lwps(), USE_THREAD_DB, lwp_info::waitstatus, WEXITSTATUS, WIFEXITED, WIFSIGNALED, WIFSTOPPED, WNOHANG, WSTOPSIG, WTERMSIG, and xfree().

Referenced by linux_stabilize_threads(), and linux_wait().

static int linux_wait_for_event ( ptid_t  ptid,
int *  wstat,
int  options 
)
static

Definition at line 2516 of file linux-low.c.

References linux_wait_for_event_filtered().

Referenced by linux_wait_1().

static int linux_wait_for_event_filtered ( ptid_t  wait_ptid,
ptid_t  filter_ptid,
int *  wstat,
int  options 
)
static
static int linux_write_memory ( CORE_ADDR  memaddr,
const unsigned char *  myaddr,
int  len 
)
static
static void linux_write_pc ( struct regcache regcache,
CORE_ADDR  pc 
)
static

Definition at line 6047 of file linux-low.c.

References gdb_assert, linux_target_ops::set_pc, and the_low_target.

static int linux_xfer_siginfo ( const char *  annex,
unsigned char *  readbuf,
unsigned const char *  writebuf,
CORE_ADDR  offset,
int  len 
)
static
struct arch_lwp_info* lwp_arch_private_info ( struct lwp_info lwp)

Definition at line 164 of file linux-low.c.

References lwp_info::arch_private.

Referenced by lwp_debug_registers_changed(), and lwp_set_debug_registers_changed().

static int lwp_in_step_range ( struct lwp_info lwp)
static

Definition at line 309 of file linux-low.c.

References lwp_info::step_range_end, lwp_info::step_range_start, and lwp_info::stop_pc.

Referenced by linux_wait_1().

static int lwp_is_marked_dead ( struct lwp_info lwp)
static
int lwp_is_stopped ( struct lwp_info lwp)

Definition at line 172 of file linux-low.c.

References lwp_info::stopped.

Referenced by update_debug_registers_callback(), and x86_linux_update_debug_registers().

static int lwp_running ( struct inferior_list_entry entry,
void *  data 
)
static

Definition at line 3697 of file linux-low.c.

References get_thread_lwp, lwp_is_marked_dead(), and lwp_info::stopped.

Referenced by linux_stabilize_threads().

void lwp_set_arch_private_info ( struct lwp_info lwp,
struct arch_lwp_info info 
)

Definition at line 155 of file linux-low.c.

References lwp_info::arch_private.

Referenced by lwp_set_debug_registers_changed().

enum target_stop_reason lwp_stop_reason ( struct lwp_info lwp)

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

References lwp_info::stop_reason.

Referenced by x86_linux_update_debug_registers().

static void lwp_suspended_decr ( struct lwp_info lwp)
static
static void lwp_suspended_inc ( struct lwp_info lwp)
static
static void mark_lwp_dead ( struct lwp_info lwp,
int  wstat 
)
static
static int maybe_move_out_of_jump_pad ( struct lwp_info lwp,
int *  wstat 
)
static
static void move_out_of_jump_pad_callback ( struct inferior_list_entry entry)
static
static int need_step_over_p ( struct inferior_list_entry entry,
void *  dummy 
)
static
static int not_stopped_callback ( struct inferior_list_entry entry,
void *  arg 
)
static

Definition at line 1683 of file linux-low.c.

References get_thread_lwp, ptid_match(), ptid_of, and lwp_info::stopped.

Referenced by linux_wait_for_event_filtered().

static int num_lwps ( int  pid)
static
static void proceed_all_lwps ( void  )
static
static int proceed_one_lwp ( struct inferior_list_entry entry,
void *  except 
)
static
ptid_t ptid_of_lwp ( struct lwp_info lwp)

Definition at line 147 of file linux-low.c.

References get_lwp_thread, and ptid_of.

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 217 of file linux-low.c.

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

Referenced by handle_extended_wait().

static int read_one_ptr ( CORE_ADDR  memaddr,
CORE_ADDR ptr,
int  ptr_size 
)
static

Definition at line 6356 of file linux-low.c.

References gdb_assert_not_reached, and linux_read_memory().

Referenced by linux_qxfer_libraries_svr4().

static int reset_lwp_ptrace_options_callback ( struct inferior_list_entry entry,
void *  args 
)
static
static int resume_status_pending_p ( struct inferior_list_entry entry,
void *  flag_p 
)
static

Definition at line 4111 of file linux-low.c.

References get_thread_lwp, lwp_info::resume, and thread_still_has_status_pending_p().

Referenced by linux_resume().

static void resume_stopped_resumed_lwps ( struct inferior_list_entry entry)
static
static int same_lwp ( struct inferior_list_entry entry,
void *  data 
)
static

Definition at line 1514 of file linux-low.c.

References inferior_list_entry::id, ptid_get_lwp(), and ptid_get_pid().

Referenced by find_lwp_pid().

static int second_thread_of_pid_p ( struct inferior_list_entry entry,
void *  args 
)
static

Definition at line 1019 of file linux-low.c.

References counter::count, inferior_list_entry::id, counter::pid, and ptid_get_pid().

Referenced by last_thread_of_process_p().

static void select_event_lwp ( struct lwp_info **  orig_lp)
static
static int select_event_lwp_callback ( struct inferior_list_entry entry,
void *  data 
)
static
static int select_singlestep_lwp_callback ( struct inferior_list_entry entry,
void *  data 
)
static
static void send_sigstop ( struct lwp_info lwp)
static
static int send_sigstop_callback ( struct inferior_list_entry entry,
void *  except 
)
static

Definition at line 3497 of file linux-low.c.

References get_thread_lwp, send_sigstop(), and lwp_info::stopped.

Referenced by stop_all_lwps(), and suspend_and_send_sigstop_callback().

static void sigchld_handler ( int  signo)
static

Definition at line 5666 of file linux-low.c.

References async_file_mark(), debug_threads, errno, and target_is_async_p.

Referenced by initialize_low().

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

Definition at line 5594 of file linux-low.c.

References linux_target_ops::siginfo_fixup, and the_low_target.

Referenced by linux_xfer_siginfo().

static int spu_enumerate_spu_ids ( long  pid,
unsigned char *  buf,
CORE_ADDR  offset,
int  len 
)
static

Definition at line 5852 of file linux-low.c.

References S_ISDIR, and SPUFS_MAGIC.

Referenced by linux_qxfer_spu().

static int start_step_over ( struct lwp_info lwp)
static
static int status_pending_p_callback ( struct inferior_list_entry entry,
void *  arg 
)
static
static void stop_all_lwps ( int  suspend,
struct lwp_info except 
)
static
static int stuck_in_jump_pad_callback ( struct inferior_list_entry entry,
void *  data 
)
static
static int supports_breakpoints ( void  )
static

Definition at line 291 of file linux-low.c.

References linux_target_ops::get_pc, and the_low_target.

Referenced by linux_resume(), linux_wait_1(), and proceed_all_lwps().

static int supports_fast_tracepoints ( void  )
static
static int suspend_and_send_sigstop_callback ( struct inferior_list_entry entry,
void *  except 
)
static

Definition at line 3516 of file linux-low.c.

References get_thread_lwp, lwp_suspended_inc(), and send_sigstop_callback().

Referenced by stop_all_lwps().

static int thread_still_has_status_pending_p ( struct thread_info thread)
static
static void unstop_all_lwps ( int  unsuspend,
struct lwp_info except 
)
static
static void unsuspend_all_lwps ( struct lwp_info except)
static

Definition at line 2659 of file linux-low.c.

References all_threads, find_inferior(), and unsuspend_one_lwp().

Referenced by complete_ongoing_step_over(), and linux_wait_1().

static int unsuspend_and_proceed_one_lwp ( struct inferior_list_entry entry,
void *  except 
)
static

Definition at line 4684 of file linux-low.c.

References get_thread_lwp, lwp_suspended_decr(), and proceed_one_lwp().

Referenced by unstop_all_lwps().

static int unsuspend_one_lwp ( struct inferior_list_entry entry,
void *  except 
)
static

Definition at line 2642 of file linux-low.c.

References get_thread_lwp, and lwp_suspended_decr().

Referenced by linux_stabilize_threads(), and unsuspend_all_lwps().

static void wait_for_sigstop ( void  )
static

Variable Documentation

int linux_event_pipe[2] = { -1, -1 }
static

Definition at line 325 of file linux-low.c.

Referenced by async_file_flush(), async_file_mark(), and linux_async().

Definition at line 6819 of file linux-low.c.

int stabilizing_threads
static
ptid_t step_over_bkpt

Definition at line 276 of file linux-low.c.

struct simple_pid_list* stopped_pids

Definition at line 200 of file linux-low.c.

int using_threads = 1

Definition at line 250 of file linux-low.c.