GDB (xrefs)
Loading...
Searching...
No Matches
Classes | Functions | Variables
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 "nat/gdb_ptrace.h"
#include "gdbsupport/gdb_wait.h"
#include <dirent.h>
#include <ctype.h>
#include <list>

Go to the source code of this file.

Classes

struct  fork_info
 
class  scoped_switch_fork_info
 

Functions

int forks_exist_p (void)
 
static struct fork_infofind_last_fork (void)
 
static bool one_fork_p ()
 
void add_fork (pid_t pid)
 
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 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)
 
void linux_fork_killall (void)
 
void linux_fork_mourn_inferior (void)
 
void linux_fork_detach (int from_tty)
 
static int inferior_call_waitpid (ptid_t pptid, int pid)
 
static void delete_checkpoint_command (const char *args, int from_tty)
 
static void detach_checkpoint_command (const char *args, int from_tty)
 
static void info_checkpoints_command (const char *arg, int from_tty)
 
int linux_fork_checkpointing_p (int pid)
 
static bool inf_has_multiple_threads ()
 
static void checkpoint_command (const char *args, int from_tty)
 
static void linux_fork_context (struct fork_info *newfp, int from_tty)
 
static void restart_command (const char *args, int from_tty)
 
void _initialize_linux_fork ()
 

Variables

static std::list< fork_infofork_list
 
static int highest_fork_num
 
static int checkpointing_pid = 0
 

Function Documentation

◆ _initialize_linux_fork()

void _initialize_linux_fork ( )

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

Referenced by initialize_all_files().

◆ add_fork()

void add_fork ( pid_t pid)

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

References fork_list, highest_fork_num, fork_info::num, one_fork_p(), and pid.

Referenced by linux_handle_extended_wait().

◆ call_lseek()

static off_t call_lseek ( int fd,
off_t offset,
int whence )
static

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

References parse_and_eval_long().

Referenced by fork_load_infrun_state(), and fork_save_infrun_state().

◆ checkpoint_command()

static void checkpoint_command ( const char * args,
int from_tty )
static

◆ delete_checkpoint_command()

static void delete_checkpoint_command ( const char * args,
int from_tty )
static

◆ delete_fork()

static void delete_fork ( ptid_t ptid)
static

◆ detach_checkpoint_command()

static void detach_checkpoint_command ( const char * args,
int from_tty )
static

◆ find_fork_id()

static struct fork_info * find_fork_id ( int num)
static

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

References fork_list, and fork_info::num.

Referenced by fork_id_to_ptid(), and restart_command().

◆ find_fork_pid()

struct fork_info * find_fork_pid ( pid_t pid)
extern

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

References fork_list, and pid.

Referenced by checkpoint_command(), and linux_handle_extended_wait().

◆ find_fork_ptid()

static struct fork_info * find_fork_ptid ( ptid_t ptid)
static

◆ find_last_fork()

static struct fork_info * find_last_fork ( void )
static

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

References fork_list.

Referenced by linux_fork_mourn_inferior().

◆ fork_id_to_ptid()

static ptid_t fork_id_to_ptid ( int num)
static

◆ fork_load_infrun_state()

static void fork_load_infrun_state ( struct fork_info * fp)
static

◆ fork_save_infrun_state()

static void fork_save_infrun_state ( struct fork_info * fp)
static

◆ forks_exist_p()

int forks_exist_p ( void )

◆ inf_has_multiple_threads()

static bool inf_has_multiple_threads ( )
static

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

References current_inferior(), and inferior::threads().

Referenced by checkpoint_command().

◆ inferior_call_waitpid()

static int inferior_call_waitpid ( ptid_t pptid,
int pid )
static

◆ info_checkpoints_command()

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

◆ linux_fork_checkpointing_p()

int linux_fork_checkpointing_p ( int pid)

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

References checkpointing_pid, and pid.

Referenced by linux_handle_extended_wait().

◆ linux_fork_context()

static void linux_fork_context ( struct fork_info * newfp,
int from_tty )
static

◆ linux_fork_detach()

void linux_fork_detach ( int from_tty)

◆ linux_fork_killall()

void linux_fork_killall ( void )

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

References fork_list, pid, and status.

Referenced by linux_nat_target::kill().

◆ linux_fork_mourn_inferior()

void linux_fork_mourn_inferior ( void )

◆ one_fork_p()

static bool one_fork_p ( )
static

◆ restart_command()

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

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

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

Variable Documentation

◆ checkpointing_pid

int checkpointing_pid = 0
static

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

Referenced by checkpoint_command(), and linux_fork_checkpointing_p().

◆ fork_list

std::list<fork_info> fork_list
static

◆ highest_fork_num

int highest_fork_num
static

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

Referenced by add_fork().