GDB (xrefs)
Classes | Functions | Variables
/tmp/gdb-7.10/gdb/linux-fork.c File Reference
#include "defs.h"
#include "arch-utils.h"
#include "inferior.h"
#include "infrun.h"
#include "regcache.h"
#include "gdbcmd.h"
#include "infcall.h"
#include "objfiles.h"
#include "linux-fork.h"
#include "linux-nat.h"
#include "gdbthread.h"
#include "source.h"
#include <sys/ptrace.h>
#include "gdb_wait.h"
#include <dirent.h>
#include <ctype.h>

Go to the source code of this file.

Classes

struct  fork_info
 

Functions

void _initialize_linux_fork (void)
 
int forks_exist_p (void)
 
struct fork_infoadd_fork (pid_t pid)
 
static void free_fork (struct fork_info *fp)
 
static void delete_fork (ptid_t ptid)
 
static struct fork_infofind_fork_ptid (ptid_t ptid)
 
static struct fork_infofind_fork_id (int num)
 
struct fork_infofind_fork_pid (pid_t pid)
 
static ptid_t fork_id_to_ptid (int num)
 
static void init_fork_list (void)
 
static off_t call_lseek (int fd, off_t offset, int whence)
 
static void fork_load_infrun_state (struct fork_info *fp)
 
static void fork_save_infrun_state (struct fork_info *fp, int clobber_regs)
 
void linux_fork_killall (void)
 
void linux_fork_mourn_inferior (void)
 
void linux_fork_detach (const char *args, int from_tty)
 
static void inferior_call_waitpid_cleanup (void *fp)
 
static int inferior_call_waitpid (ptid_t pptid, int pid)
 
static void delete_checkpoint_command (char *args, int from_tty)
 
static void detach_checkpoint_command (char *args, int from_tty)
 
static void info_checkpoints_command (char *arg, int from_tty)
 
int linux_fork_checkpointing_p (int pid)
 
static int inf_has_multiple_thread_cb (struct thread_info *tp, void *data)
 
static int inf_has_multiple_threads (void)
 
static void checkpoint_command (char *args, int from_tty)
 
static void linux_fork_context (struct fork_info *newfp, int from_tty)
 
static void restart_command (char *args, int from_tty)
 

Variables

struct fork_infofork_list
 
static int highest_fork_num
 
static int checkpointing_pid = 0
 

Function Documentation

void _initialize_linux_fork ( void  )
struct fork_info* add_fork ( pid_t  pid)
static off_t call_lseek ( int  fd,
off_t  offset,
int  whence 
)
static

Definition at line 224 of file linux-fork.c.

References parse_and_eval_long().

Referenced by fork_load_infrun_state(), and fork_save_infrun_state().

static void checkpoint_command ( char *  args,
int  from_tty 
)
static
static void delete_checkpoint_command ( char *  args,
int  from_tty 
)
static
static void delete_fork ( ptid_t  ptid)
static
static void detach_checkpoint_command ( char *  args,
int  from_tty 
)
static
static struct fork_info* find_fork_id ( int  num)
static

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

References fork_info::next, and fork_info::num.

Referenced by fork_id_to_ptid(), and restart_command().

struct fork_info* find_fork_pid ( pid_t  pid)

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

References fork_info::next, fork_info::ptid, and ptid_get_pid().

Referenced by checkpoint_command(), and linux_handle_extended_wait().

static struct fork_info* find_fork_ptid ( ptid_t  ptid)
static
static ptid_t fork_id_to_ptid ( int  num)
static

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

References find_fork_id(), pid_to_ptid(), and fork_info::ptid.

Referenced by delete_checkpoint_command(), and detach_checkpoint_command().

static void fork_load_infrun_state ( struct fork_info fp)
static
static void fork_save_infrun_state ( struct fork_info fp,
int  clobber_regs 
)
static
int forks_exist_p ( void  )

Definition at line 61 of file linux-fork.c.

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

static void free_fork ( struct fork_info fp)
static

Definition at line 92 of file linux-fork.c.

References fork_info::filepos, regcache_xfree(), fork_info::savedregs, and xfree().

Referenced by delete_fork(), and init_fork_list().

static int inf_has_multiple_thread_cb ( struct thread_info tp,
void *  data 
)
static

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

References current_inferior(), inferior::pid, thread_info::ptid, and ptid_get_pid().

Referenced by inf_has_multiple_threads().

static int inf_has_multiple_threads ( void  )
static

Definition at line 641 of file linux-fork.c.

References inf_has_multiple_thread_cb(), and iterate_over_threads().

Referenced by checkpoint_command().

static int inferior_call_waitpid ( ptid_t  pptid,
int  pid 
)
static
static void inferior_call_waitpid_cleanup ( void *  fp)
static

Definition at line 417 of file linux-fork.c.

References fork_load_infrun_state(), insert_breakpoints(), and remove_breakpoints().

Referenced by inferior_call_waitpid().

static void info_checkpoints_command ( char *  arg,
int  from_tty 
)
static
static void init_fork_list ( void  )
static

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

References free_fork(), and fork_info::next.

Referenced by _initialize_linux_fork(), and linux_fork_killall().

int linux_fork_checkpointing_p ( int  pid)

Definition at line 617 of file linux-fork.c.

References checkpointing_pid.

Referenced by linux_handle_extended_wait().

static void linux_fork_context ( struct fork_info newfp,
int  from_tty 
)
static
void linux_fork_detach ( const char *  args,
int  from_tty 
)
void linux_fork_killall ( void  )

Definition at line 323 of file linux-fork.c.

References init_fork_list(), fork_info::next, pid, fork_info::ptid, ptid_get_pid(), status, and WIFSTOPPED.

Referenced by linux_nat_kill().

void linux_fork_mourn_inferior ( void  )
static void restart_command ( char *  args,
int  from_tty 
)
static

Definition at line 742 of file linux-fork.c.

References _, error(), find_fork_id(), linux_fork_context(), and parse_and_eval_long().

Referenced by _initialize_linux_fork().

Variable Documentation

int checkpointing_pid = 0
static

Definition at line 614 of file linux-fork.c.

Referenced by checkpoint_command(), and linux_fork_checkpointing_p().

struct fork_info* fork_list

Definition at line 38 of file linux-fork.c.

Referenced by add_fork().

int highest_fork_num
static

Definition at line 39 of file linux-fork.c.

Referenced by add_fork().