GDB (xrefs)
Classes | Functions | Variables
/home/stan/gdb/src/gdb/linux-fork.c File Reference
#include "defs.h"
#include "arch-utils.h"
#include "inferior.h"
#include "regcache.h"
#include "gdbcmd.h"
#include "infcall.h"
#include "objfiles.h"
#include "gdb_assert.h"
#include "gdb_string.h"
#include "linux-fork.h"
#include "linux-nat.h"
#include "gdbthread.h"
#include "source.h"
#include <sys/ptrace.h>
#include "gdb_wait.h"
#include "gdb_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 (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) [read]
static off_t call_lseek ( int  fd,
off_t  offset,
int  whence 
) [static]

Definition at line 225 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, read]

Definition at line 168 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) [read]

Definition at line 181 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, read]
static ptid_t fork_id_to_ptid ( int  num) [static]

Definition at line 193 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 62 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 93 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 418 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 203 of file linux-fork.c.

References free_fork(), and fork_info::next.

Referenced by linux_fork_killall().

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 ( char *  args,
int  from_tty 
)
void linux_fork_killall ( void  )

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

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

Referenced by linux_nat_kill().

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

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

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


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().

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

Referenced by add_fork().

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

Referenced by add_fork().

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines