GDBserver
Classes | Defines | Enumerations | Functions | Variables
/home/stan/gdb/src/gdb/gdbserver/linux-low.c File Reference
#include "server.h"
#include "linux-low.h"
#include "linux-osdata.h"
#include "agent.h"
#include "nat/linux-nat.h"
#include "nat/linux-waitpid.h"
#include "gdb_wait.h"
#include <stdio.h>
#include <sys/ptrace.h>
#include "linux-ptrace.h"
#include "linux-procfs.h"
#include <signal.h>
#include <sys/ioctl.h>
#include <fcntl.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
#include <sys/syscall.h>
#include <sched.h>
#include <ctype.h>
#include <pwd.h>
#include <sys/types.h>
#include <dirent.h>
#include "gdb_stat.h"
#include <sys/vfs.h>
#include <sys/uio.h>
#include "filestuff.h"
#include "tracepoint.h"
#include "hostio.h"
#include <elf.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  thread_resume_array
struct  link_map_offsets

Defines

#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

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 (ptid_t ptid, int *wstat, int options)
static void * add_lwp (ptid_t ptid)
static int linux_stopped_by_watchpoint (void)
static void mark_lwp_dead (struct lwp_info *lwp, int wstat)
static void proceed_all_lwps (void)
static int finish_step_over (struct lwp_info *lwp)
static CORE_ADDR get_stop_pc (struct lwp_info *lwp)
static int kill_lwp (unsigned long lwpid, int signo)
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 (struct inferior_list_entry *entry)
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 void handle_extended_wait (struct lwp_info *event_child, int wstat)
static CORE_ADDR get_pc (struct lwp_info *lwp)
static int linux_create_inferior (char *program, char **allargs)
static void linux_attach_lwp_1 (unsigned long lwpid, int initial)
void linux_attach_lwp (unsigned long lwpid)
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 (struct thread_info *thread)
static void linux_kill_one_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 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 struct lwp_infolinux_wait_for_lwp (ptid_t ptid, int *wstatp, int options)
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 cancel_breakpoint (struct lwp_info *lwp)
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 int cancel_breakpoints_callback (struct inferior_list_entry *entry, void *data)
static void linux_cancel_breakpoints (void)
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_flush (void)
static void async_file_mark (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 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_insert_point (char type, CORE_ADDR addr, int len)
static int linux_remove_point (char type, CORE_ADDR addr, int len)
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_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)
static void linux_init_signals ()
void initialize_low (void)

Variables

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

Define Documentation

#define __SIGRTMIN   32
#define linux_read_loadmap   NULL

Definition at line 5100 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 4166 of file linux-low.c.

Referenced by linux_fetch_registers().

#define regsets_store_inferior_registers (   regsets_info,
  regcache 
)    1

Definition at line 4167 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 287 of file linux-low.c.

Referenced by linux_wait(), and sigchld_handler().

#define use_linux_regsets   0

Definition at line 4165 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 4343 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 4344 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 201 of file linux-low.c.


Function Documentation

static void * 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 2743 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 2755 of file linux-low.c.

References async_file_flush(), errno, and linux_event_pipe.

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

static int can_hardware_single_step ( void  ) [static]
static int cancel_breakpoint ( struct lwp_info lwp) [static]
static int cancel_breakpoints_callback ( struct inferior_list_entry entry,
void *  data 
) [static]
static int count_events_callback ( struct inferior_list_entry entry,
void *  data 
) [static]
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 1165 of file linux-low.c.

References delete_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 315 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 295 of file linux-low.c.

Referenced by elf_64_file_p().

static void enqueue_one_deferred_signal ( struct lwp_info lwp,
int *  wstat 
) [static]
struct lwp_info* find_lwp_pid ( ptid_t  ptid) [read]
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 5284 of file linux-low.c.

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

References get_dynamic(), and linux_read_memory().

Referenced by linux_qxfer_libraries_svr4().

static CORE_ADDR get_stop_pc ( struct lwp_info lwp) [static]
static void handle_extended_wait ( struct lwp_info event_child,
int  wstat 
) [static]
static int handle_tracepoints ( struct lwp_info lwp) [static]
void initialize_low ( void  )

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

Referenced by main().

static int kill_lwp ( unsigned long  lwpid,
int  signo 
) [static]

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

References errno.

Referenced by linux_attach_lwp_1(), linux_detach_one_lwp(), linux_request_interrupt(), and send_sigstop().

static int kill_one_lwp_callback ( struct inferior_list_entry entry,
void *  args 
) [static]
static int last_thread_of_process_p ( struct thread_info thread) [static]
static struct process_info* linux_add_process ( int  pid,
int  attached 
) [static, read]
static int linux_async ( int  enable) [static]
static int linux_attach ( unsigned long  pid) [static]
void linux_attach_lwp ( unsigned long  lwpid)

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

References linux_attach_lwp_1().

Referenced by attach_thread().

static void linux_attach_lwp_1 ( unsigned long  lwpid,
int  initial 
) [static]
static void linux_cancel_breakpoints ( void  ) [static]

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

References all_lwps, cancel_breakpoints_callback(), and find_inferior().

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

References linux_unpause_all(), and non_stop.

static struct emit_ops* linux_emit_ops ( void  ) [static, read]

Definition at line 5201 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_init_signals ( ) [static]

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

References __SIGRTMIN.

Referenced by initialize_low().

static int linux_insert_point ( char  type,
CORE_ADDR  addr,
int  len 
) [static]

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

References linux_target_ops::insert_point, and the_low_target.

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

References errno, and my_waitpid().

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 void linux_mourn ( struct process_info process) [static]
static void linux_pause_all ( int  freeze) [static]

Definition at line 5145 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 338 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 5160 of file linux-low.c.

References linux_pause_all(), and non_stop.

static void linux_process_qsupported ( const char *  query) [static]

Definition at line 5104 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 4734 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 4984 of file linux-low.c.

References current_inferior, get_thread_lwp, 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 4623 of file linux-low.c.

References current_inferior, get_thread_lwp, 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 5120 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 4175 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 ( char  type,
CORE_ADDR  addr,
int  len 
) [static]

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

References linux_target_ops::remove_point, and the_low_target.

static void linux_request_interrupt ( void  ) [static]
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 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 4894 of file linux-low.c.

References linux_async().

void linux_stop_lwp ( struct lwp_info lwp)
static int linux_stopped_by_watchpoint ( void  ) [static]

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

References current_inferior, get_thread_lwp, and lwp_info::stopped_by_watchpoint.

static CORE_ADDR linux_stopped_data_address ( void  ) [static]

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

References current_inferior, 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 4918 of file linux-low.c.

static int linux_supports_disable_randomization ( void  ) [static]

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

static int linux_supports_multi_process ( void  ) [static]

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

static int linux_supports_non_stop ( void  ) [static]

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

static int linux_supports_range_stepping ( void  ) [static]

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

References linux_target_ops::supports_range_stepping, and the_low_target.

static int linux_supports_tracepoints ( void  ) [static]

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

References linux_target_ops::supports_tracepoints, and the_low_target.

static int linux_thread_alive ( ptid_t  ptid) [static]

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

References lwp_info::dead, and find_lwp_pid().

Referenced by wait_for_sigstop().

static int linux_thread_stopped ( struct thread_info thread) [static]

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

References get_thread_lwp.

static void linux_unpause_all ( int  unfreeze) [static]

Definition at line 5154 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 2254 of file linux-low.c.

References __SIGRTMIN, agent_loaded_p(), all_lwps, all_threads, linux_target_ops::breakpoint_at, breakpoint_here(), breakpoint_inserted_here(), cancel_breakpoints, cancel_breakpoints_callback(), check_breakpoints(), lwp_info::collecting_fast_tracepoint, cont_thread, current_inferior, current_process(), debug_threads, delete_breakpoint(), dequeue_one_deferred_signal(), enqueue_one_deferred_signal(), lwp_info::exit_jump_pad_bkpt, find_inferior(), find_inferior_id(), 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(), thread_resume::kind, thread_info::last_resume_kind, last_thread_of_process_p(), linux_fast_tracepoint_collecting(), linux_resume(), linux_resume_one_lwp(), linux_wait_for_event(), 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_TYPE_ARG3, run_breakpoint_commands(), select_event_lwp(), linux_target_ops::set_pc, thread_resume::sig, 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::stopped_by_watchpoint, supports_breakpoints(), supports_fast_tracepoints(), lwp_info::suspended, target_pid_to_str(), the_low_target, thread_resume::thread, unstop_all_lwps(), and unsuspend_all_lwps().

Referenced by linux_stabilize_threads(), and linux_wait().

static int linux_wait_for_event ( ptid_t  ptid,
int *  wstat,
int  options 
) [static]
static struct lwp_info* linux_wait_for_lwp ( ptid_t  ptid,
int *  wstatp,
int  options 
) [static, read]
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 5129 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]
static int lwp_in_step_range ( struct lwp_info lwp) [static]

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

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

Referenced by linux_wait_1().

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

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

References lwp_info::dead, and lwp_info::stopped.

Referenced by linux_stabilize_threads().

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 void proceed_all_lwps ( void  ) [static]
static int proceed_one_lwp ( struct inferior_list_entry entry,
void *  except 
) [static]
static int pull_pid_from_list ( struct simple_pid_list **  listp,
int  pid,
int *  statusp 
) [static]

Definition at line 184 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 5438 of file linux-low.c.

References gdb_assert_not_reached, and linux_read_memory().

Referenced by linux_qxfer_libraries_svr4().

static int resume_status_pending_p ( struct inferior_list_entry entry,
void *  flag_p 
) [static]

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

References lwp_info::resume, and lwp_info::status_pending_p.

Referenced by linux_resume().

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

Definition at line 1249 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 853 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 2853 of file linux-low.c.

References 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 4817 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 4745 of file linux-low.c.

References memcpy(), 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 4934 of file linux-low.c.

References dirent, 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]
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 2871 of file linux-low.c.

References send_sigstop_callback(), and lwp_info::suspended.

Referenced by stop_all_lwps().

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

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

Referenced by linux_wait_1().

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

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

References gdb_assert, proceed_one_lwp(), and lwp_info::suspended.

Referenced by unstop_all_lwps().

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

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

References gdb_assert, and lwp_info::suspended.

Referenced by linux_stabilize_threads(), and unsuspend_all_lwps().

static void wait_for_sigstop ( struct inferior_list_entry entry) [static]

Variable Documentation

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

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

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

struct target_ops linux_target_ops [static]

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

int stabilizing_threads [static]

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

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

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

Referenced by handle_extended_wait(), linux_wait_for_event(), and stop_all_lwps().

int using_threads = 1

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

Referenced by prepare_resume_reply().

 All Classes Files Functions Variables Typedefs Enumerations Enumerator Defines