GDB (xrefs)
Classes | Macros | Typedefs | Enumerations | Functions | Variables
/tmp/gdb-8.1/gdb/procfs.c File Reference
#include "defs.h"
#include "inferior.h"
#include "infrun.h"
#include "target.h"
#include "gdbcore.h"
#include "elf-bfd.h"
#include "gdbcmd.h"
#include "gdbthread.h"
#include "regcache.h"
#include "inf-child.h"
#include "nat/fork-inferior.h"
#include "filestuff.h"
#include <sys/procfs.h>
#include <sys/fault.h>
#include <sys/syscall.h>
#include "gdb_wait.h"
#include <signal.h>
#include <ctype.h>
#include "gdb_bfd.h"
#include "inflow.h"
#include "auxv.h"
#include "procfs.h"
#include "observer.h"
#include <sys/types.h>
#include <dirent.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/stat.h>
#include "proc-utils.h"
#include "gregset.h"

Go to the source code of this file.

Classes

struct  procinfo
 
struct  procfs_corefile_thread_data
 

Macros

#define _STRUCTURED_PROC   1 /* Should be done by configure script. */
 
#define MAIN_PROC_NAME_FMT   "/proc/%d"
 
#define CTL_PROC_NAME_FMT   "/proc/%d/ctl"
 
#define AS_PROC_NAME_FMT   "/proc/%d/as"
 
#define MAP_PROC_NAME_FMT   "/proc/%d/map"
 
#define STATUS_PROC_NAME_FMT   "/proc/%d/status"
 
#define MAX_PROC_NAME_SIZE   sizeof("/proc/99999/lwp/8096/lstatus")
 

Typedefs

typedef struct procinfo procinfo
 

Enumerations

enum  { READ_WATCHFLAG = WA_READ, WRITE_WATCHFLAG = WA_WRITE, EXEC_WATCHFLAG = WA_EXEC, AFTER_WATCHFLAG = WA_TRAPAFTER }
 
enum  { FD_CTL, FD_STATUS, FD_AS }
 
enum  { NOKILL, KILL }
 
enum  { FLAG_RESET, FLAG_SET }
 

Functions

static void procfs_attach (struct target_ops *, const char *, int)
 
static void procfs_detach (struct target_ops *, const char *, int)
 
static void procfs_resume (struct target_ops *, ptid_t, int, enum gdb_signal)
 
static void procfs_interrupt (struct target_ops *self, ptid_t)
 
static void procfs_files_info (struct target_ops *)
 
static void procfs_fetch_registers (struct target_ops *, struct regcache *, int)
 
static void procfs_store_registers (struct target_ops *, struct regcache *, int)
 
static void procfs_pass_signals (struct target_ops *self, int, unsigned char *)
 
static void procfs_kill_inferior (struct target_ops *ops)
 
static void procfs_mourn_inferior (struct target_ops *ops)
 
static void procfs_create_inferior (struct target_ops *, const char *, const std::string &, char **, int)
 
static ptid_t procfs_wait (struct target_ops *, ptid_t, struct target_waitstatus *, int)
 
static enum target_xfer_status procfs_xfer_memory (gdb_byte *, const gdb_byte *, ULONGEST, ULONGEST, ULONGEST *)
 
static int procfs_thread_alive (struct target_ops *ops, ptid_t)
 
static void procfs_update_thread_list (struct target_ops *ops)
 
static const char * procfs_pid_to_str (struct target_ops *, ptid_t)
 
static int proc_find_memory_regions (struct target_ops *self, find_memory_region_ftype, void *)
 
static char * procfs_make_note_section (struct target_ops *self, bfd *, int *)
 
static int procfs_can_use_hw_breakpoint (struct target_ops *self, enum bptype, int, int)
 
static void procfs_info_proc (struct target_ops *, const char *, enum info_proc_what)
 
struct target_opsprocfs_target (void)
 
static procinfofind_procinfo_or_die (int pid, int tid)
 
static procinfofind_procinfo (int pid, int tid)
 
static procinfocreate_procinfo (int pid, int tid)
 
static void destroy_procinfo (procinfo *p)
 
static void do_destroy_procinfo_cleanup (void *)
 
static void dead_procinfo (procinfo *p, const char *msg, int killp)
 
static int open_procinfo_files (procinfo *p, int which)
 
static void close_procinfo_files (procinfo *p)
 
static sysset_t * sysset_t_alloc (procinfo *pi)
 
static int iterate_over_mappings (procinfo *pi, find_memory_region_ftype child_func, void *data, int(*func)(struct prmap *map, find_memory_region_ftype child_func, void *data))
 
static int open_with_retry (const char *pathname, int flags)
 
static void destroy_one_procinfo (procinfo **list, procinfo *pi)
 
static long proc_flags (procinfo *pi)
 
static int proc_why (procinfo *pi)
 
static int proc_what (procinfo *pi)
 
static int proc_set_current_signal (procinfo *pi, int signo)
 
static int proc_get_current_thread (procinfo *pi)
 
static int proc_iterate_over_threads (procinfo *pi, int(*func)(procinfo *, procinfo *, void *), void *ptr)
 
static void proc_warn (procinfo *pi, const char *func, int line)
 
static void proc_error (procinfo *pi, const char *func, int line)
 
static int proc_get_status (procinfo *pi)
 
static int proc_watchpoint_address (procinfo *pi, CORE_ADDR *addr)
 
static int proc_nsysarg (procinfo *pi)
 
static long * proc_sysargs (procinfo *pi)
 
static int proc_modify_flag (procinfo *pi, long flag, long mode)
 
static int proc_set_run_on_last_close (procinfo *pi)
 
static int proc_unset_run_on_last_close (procinfo *pi)
 
static int proc_unset_inherit_on_fork (procinfo *pi)
 
static int proc_set_async (procinfo *pi)
 
static int proc_unset_async (procinfo *pi)
 
static int proc_stop_process (procinfo *pi)
 
static int proc_wait_for_stop (procinfo *pi)
 
static int proc_run_process (procinfo *pi, int step, int signo)
 
static int proc_set_traced_signals (procinfo *pi, sigset_t *sigset)
 
static int proc_set_traced_faults (procinfo *pi, fltset_t *fltset)
 
static int proc_set_traced_sysentry (procinfo *pi, sysset_t *sysset)
 
static int proc_set_traced_sysexit (procinfo *pi, sysset_t *sysset)
 
static int proc_set_held_signals (procinfo *pi, sigset_t *sighold)
 
static sigset_t * proc_get_held_signals (procinfo *pi, sigset_t *save)
 
static sigset_t * proc_get_traced_signals (procinfo *pi, sigset_t *save)
 
static fltset_t * proc_get_traced_faults (procinfo *pi, fltset_t *save)
 
static sysset_t * proc_get_traced_sysentry (procinfo *pi, sysset_t *save)
 
static sysset_t * proc_get_traced_sysexit (procinfo *pi, sysset_t *save)
 
static int proc_clear_current_fault (procinfo *pi)
 
static int proc_clear_current_signal (procinfo *pi)
 
static gdb_gregset_tproc_get_gregs (procinfo *pi)
 
static gdb_fpregset_tproc_get_fpregs (procinfo *pi)
 
static int proc_set_gregs (procinfo *pi)
 
static int proc_set_fpregs (procinfo *pi)
 
static int proc_kill (procinfo *pi, int signo)
 
static int proc_parent_pid (procinfo *pi)
 
static void * procfs_address_to_host_pointer (CORE_ADDR addr)
 
static int proc_set_watchpoint (procinfo *pi, CORE_ADDR addr, int len, int wflags)
 
static int proc_get_nthreads (procinfo *pi)
 
static int proc_delete_dead_threads (procinfo *parent, procinfo *thread, void *ignore)
 
static void do_closedir_cleanup (void *dir)
 
static int proc_update_threads (procinfo *pi)
 
static ptid_t do_attach (ptid_t ptid)
 
static void do_detach (int signo)
 
static void proc_trace_syscalls_1 (procinfo *pi, int syscallnum, int entry_or_exit, int mode, int from_tty)
 
static int procfs_debug_inferior (procinfo *pi)
 
static int syscall_is_lwp_exit (procinfo *pi, int scall)
 
static int syscall_is_exit (procinfo *pi, int scall)
 
static int syscall_is_exec (procinfo *pi, int scall)
 
static int syscall_is_lwp_create (procinfo *pi, int scall)
 
static enum target_xfer_status procfs_xfer_partial (struct target_ops *ops, enum target_object object, const char *annex, gdb_byte *readbuf, const gdb_byte *writebuf, ULONGEST offset, ULONGEST len, ULONGEST *xfered_len)
 
static int invalidate_cache (procinfo *parent, procinfo *pi, void *ptr)
 
static void unconditionally_kill_inferior (procinfo *pi)
 
static void procfs_init_inferior (struct target_ops *ops, int pid)
 
static void procfs_set_exec_trap (void)
 
static void procfs_inferior_created (struct target_ops *ops, int from_tty)
 
static int procfs_notice_thread (procinfo *pi, procinfo *thread, void *ptr)
 
static int procfs_set_watchpoint (ptid_t ptid, CORE_ADDR addr, int len, int rwflag, int after)
 
static int procfs_stopped_by_watchpoint (struct target_ops *ops)
 
static int procfs_stopped_data_address (struct target_ops *targ, CORE_ADDR *addr)
 
static int procfs_insert_watchpoint (struct target_ops *self, CORE_ADDR addr, int len, enum target_hw_bp_type type, struct expression *cond)
 
static int procfs_remove_watchpoint (struct target_ops *self, CORE_ADDR addr, int len, enum target_hw_bp_type type, struct expression *cond)
 
static int procfs_region_ok_for_hw_watchpoint (struct target_ops *self, CORE_ADDR addr, int len)
 
void procfs_use_watchpoints (struct target_ops *t)
 
static int find_memory_regions_callback (struct prmap *map, find_memory_region_ftype func, void *data)
 
static char * mappingflags (long flags)
 
static int info_mappings_callback (struct prmap *map, find_memory_region_ftype ignore, void *unused)
 
static void info_proc_mappings (procinfo *pi, int summary)
 
static void proc_trace_syscalls (const char *args, int from_tty, int entry_or_exit, int mode)
 
static void proc_trace_sysentry_cmd (const char *args, int from_tty)
 
static void proc_trace_sysexit_cmd (const char *args, int from_tty)
 
static void proc_untrace_sysentry_cmd (const char *args, int from_tty)
 
static void proc_untrace_sysexit_cmd (const char *args, int from_tty)
 
void _initialize_procfs (void)
 
ptid_t procfs_first_available (void)
 
static char * procfs_do_thread_registers (bfd *obfd, ptid_t ptid, char *note_data, int *note_size, enum gdb_signal stop_signal)
 
static int procfs_corefile_thread_callback (procinfo *pi, procinfo *thread, void *data)
 
static int find_signalled_thread (struct thread_info *info, void *data)
 
static enum gdb_signal find_stop_signal (void)
 

Variables

static target_xfer_partial_ftype procfs_xfer_partial
 
static char errmsg [128]
 
static procinfoprocinfo_list
 

Macro Definition Documentation

◆ _STRUCTURED_PROC

#define _STRUCTURED_PROC   1 /* Should be done by configure script. */

Definition at line 36 of file procfs.c.

◆ AS_PROC_NAME_FMT

#define AS_PROC_NAME_FMT   "/proc/%d/as"

Definition at line 233 of file procfs.c.

◆ CTL_PROC_NAME_FMT

#define CTL_PROC_NAME_FMT   "/proc/%d/ctl"

Definition at line 232 of file procfs.c.

◆ MAIN_PROC_NAME_FMT

#define MAIN_PROC_NAME_FMT   "/proc/%d"

Definition at line 231 of file procfs.c.

Referenced by create_procinfo().

◆ MAP_PROC_NAME_FMT

#define MAP_PROC_NAME_FMT   "/proc/%d/map"

Definition at line 234 of file procfs.c.

◆ MAX_PROC_NAME_SIZE

#define MAX_PROC_NAME_SIZE   sizeof("/proc/99999/lwp/8096/lstatus")

Definition at line 236 of file procfs.c.

Referenced by iterate_over_mappings(), open_procinfo_files(), and proc_update_threads().

◆ STATUS_PROC_NAME_FMT

#define STATUS_PROC_NAME_FMT   "/proc/%d/status"

Definition at line 235 of file procfs.c.

Typedef Documentation

◆ procinfo

typedef struct procinfo procinfo

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
READ_WATCHFLAG 
WRITE_WATCHFLAG 
EXEC_WATCHFLAG 
AFTER_WATCHFLAG 

Definition at line 202 of file procfs.c.

◆ anonymous enum

anonymous enum
Enumerator
FD_CTL 
FD_STATUS 
FD_AS 

Definition at line 377 of file procfs.c.

◆ anonymous enum

anonymous enum
Enumerator
NOKILL 
KILL 

Definition at line 560 of file procfs.c.

◆ anonymous enum

anonymous enum
Enumerator
FLAG_RESET 
FLAG_SET 

Definition at line 781 of file procfs.c.

Function Documentation

◆ _initialize_procfs()

void _initialize_procfs ( void  )

◆ close_procinfo_files()

static void close_procinfo_files ( procinfo p)
static

Definition at line 496 of file procfs.c.

References procinfo::as_fd, procinfo::ctl_fd, and procinfo::status_fd.

Referenced by destroy_one_procinfo(), and invalidate_cache().

◆ create_procinfo()

static procinfo * create_procinfo ( int  pid,
int  tid 
)
static

◆ dead_procinfo()

static void dead_procinfo ( procinfo p,
const char *  msg,
int  killp 
)
static

◆ destroy_one_procinfo()

static void destroy_one_procinfo ( procinfo **  list,
procinfo pi 
)
static

◆ destroy_procinfo()

static void destroy_procinfo ( procinfo p)
static

◆ do_attach()

static ptid_t do_attach ( ptid_t  ptid)
static

◆ do_closedir_cleanup()

static void do_closedir_cleanup ( void *  dir)
static

Definition at line 1734 of file procfs.c.

Referenced by proc_update_threads().

◆ do_destroy_procinfo_cleanup()

static void do_destroy_procinfo_cleanup ( void *  pi)
static

Definition at line 555 of file procfs.c.

References destroy_procinfo().

Referenced by procfs_info_proc().

◆ do_detach()

static void do_detach ( int  signo)
static

◆ find_memory_regions_callback()

static int find_memory_regions_callback ( struct prmap *  map,
find_memory_region_ftype  func,
void *  data 
)
static

Definition at line 3490 of file procfs.c.

References func.

Referenced by proc_find_memory_regions().

◆ find_procinfo()

static procinfo * find_procinfo ( int  pid,
int  tid 
)
static

◆ find_procinfo_or_die()

static procinfo * find_procinfo_or_die ( int  pid,
int  tid 
)
static

◆ find_signalled_thread()

static int find_signalled_thread ( struct thread_info info,
void *  data 
)
static

◆ find_stop_signal()

static enum gdb_signal find_stop_signal ( void  )
static

◆ info_mappings_callback()

static int info_mappings_callback ( struct prmap *  map,
find_memory_region_ftype  ignore,
void *  unused 
)
static

◆ info_proc_mappings()

static void info_proc_mappings ( procinfo pi,
int  summary 
)
static

◆ invalidate_cache()

static int invalidate_cache ( procinfo parent,
procinfo pi,
void *  ptr 
)
static

◆ iterate_over_mappings()

static int iterate_over_mappings ( procinfo pi,
find_memory_region_ftype  child_func,
void *  data,
int(*)(struct prmap *map, find_memory_region_ftype child_func, void *data)  func 
)
static

◆ mappingflags()

static char* mappingflags ( long  flags)
static

Definition at line 3527 of file procfs.c.

References flags.

Referenced by info_mappings_callback().

◆ open_procinfo_files()

static int open_procinfo_files ( procinfo p,
int  which 
)
static

◆ open_with_retry()

static int open_with_retry ( const char *  pathname,
int  flags 
)
static

Definition at line 351 of file procfs.c.

References flags, procinfo::pathname, and status.

Referenced by open_procinfo_files().

◆ proc_clear_current_fault()

static int proc_clear_current_fault ( procinfo pi)
static

Definition at line 1291 of file procfs.c.

References procinfo::ctl_fd, find_procinfo_or_die(), procinfo::pid, and procinfo::tid.

Referenced by do_detach().

◆ proc_clear_current_signal()

static int proc_clear_current_signal ( procinfo pi)
static

Definition at line 1370 of file procfs.c.

References procinfo::ctl_fd, find_procinfo_or_die(), procinfo::pid, and procinfo::tid.

Referenced by do_detach().

◆ proc_delete_dead_threads()

static int proc_delete_dead_threads ( procinfo parent,
procinfo thread,
void *  ignore 
)
static

◆ proc_error()

static void proc_error ( procinfo pi,
const char *  func,
int  line 
)
static

◆ proc_find_memory_regions()

static int proc_find_memory_regions ( struct target_ops self,
find_memory_region_ftype  func,
void *  data 
)
static

◆ proc_flags()

static long proc_flags ( procinfo pi)
static

◆ proc_get_current_thread()

static int proc_get_current_thread ( procinfo pi)
static

◆ proc_get_fpregs()

static gdb_fpregset_t* proc_get_fpregs ( procinfo pi)
static

◆ proc_get_gregs()

static gdb_gregset_t* proc_get_gregs ( procinfo pi)
static

◆ proc_get_held_signals()

static sigset_t* proc_get_held_signals ( procinfo pi,
sigset_t *  save 
)
static

◆ proc_get_nthreads()

static int proc_get_nthreads ( procinfo pi)
static

◆ proc_get_status()

static int proc_get_status ( procinfo pi)
static

◆ proc_get_traced_faults()

static fltset_t* proc_get_traced_faults ( procinfo pi,
fltset_t *  save 
)
static

◆ proc_get_traced_signals()

static sigset_t* proc_get_traced_signals ( procinfo pi,
sigset_t *  save 
)
static

◆ proc_get_traced_sysentry()

static sysset_t* proc_get_traced_sysentry ( procinfo pi,
sysset_t *  save 
)
static

◆ proc_get_traced_sysexit()

static sysset_t* proc_get_traced_sysexit ( procinfo pi,
sysset_t *  save 
)
static

◆ proc_iterate_over_threads()

static int proc_iterate_over_threads ( procinfo pi,
int(*)(procinfo *, procinfo *, void *)  func,
void *  ptr 
)
static

◆ proc_kill()

static int proc_kill ( procinfo pi,
int  signo 
)
static

Definition at line 1505 of file procfs.c.

References procinfo::ctl_fd, FD_CTL, and open_procinfo_files().

Referenced by unconditionally_kill_inferior().

◆ proc_modify_flag()

static int proc_modify_flag ( procinfo pi,
long  flag,
long  mode 
)
static

◆ proc_nsysarg()

static int proc_nsysarg ( procinfo pi)
static

Definition at line 744 of file procfs.c.

References proc_get_status(), procinfo::prstatus, and procinfo::status_valid.

Referenced by procfs_wait().

◆ proc_parent_pid()

static int proc_parent_pid ( procinfo pi)
static

◆ proc_run_process()

static int proc_run_process ( procinfo pi,
int  step,
int  signo 
)
static

Definition at line 943 of file procfs.c.

References procinfo::ctl_fd, FD_CTL, open_procinfo_files(), and proc_set_current_signal().

Referenced by procfs_resume(), and procfs_wait().

◆ proc_set_async()

static int proc_set_async ( procinfo pi)
static

Definition at line 859 of file procfs.c.

References FLAG_SET, and proc_modify_flag().

Referenced by procfs_resume().

◆ proc_set_current_signal()

static int proc_set_current_signal ( procinfo pi,
int  signo 
)
static

◆ proc_set_fpregs()

static int proc_set_fpregs ( procinfo pi)
static

◆ proc_set_gregs()

static int proc_set_gregs ( procinfo pi)
static

◆ proc_set_held_signals()

static int proc_set_held_signals ( procinfo pi,
sigset_t *  sighold 
)
static

◆ proc_set_run_on_last_close()

static int proc_set_run_on_last_close ( procinfo pi)
static

Definition at line 828 of file procfs.c.

References FLAG_SET, and proc_modify_flag().

Referenced by do_attach(), do_detach(), and procfs_init_inferior().

◆ proc_set_traced_faults()

static int proc_set_traced_faults ( procinfo pi,
fltset_t *  fltset 
)
static

◆ proc_set_traced_signals()

static int proc_set_traced_signals ( procinfo pi,
sigset_t *  sigset 
)
static

◆ proc_set_traced_sysentry()

static int proc_set_traced_sysentry ( procinfo pi,
sysset_t *  sysset 
)
static

◆ proc_set_traced_sysexit()

static int proc_set_traced_sysexit ( procinfo pi,
sysset_t *  sysset 
)
static

◆ proc_set_watchpoint()

static int proc_set_watchpoint ( procinfo pi,
CORE_ADDR  addr,
int  len,
int  wflags 
)
static

Definition at line 1566 of file procfs.c.

References procinfo::ctl_fd, and procfs_address_to_host_pointer().

Referenced by procfs_set_watchpoint().

◆ proc_stop_process()

static int proc_stop_process ( procinfo pi)
static

Definition at line 878 of file procfs.c.

References procinfo::ctl_fd, FD_CTL, and open_procinfo_files().

Referenced by do_attach().

◆ proc_sysargs()

static long* proc_sysargs ( procinfo pi)
static

Definition at line 757 of file procfs.c.

References proc_get_status(), procinfo::prstatus, and procinfo::status_valid.

Referenced by procfs_wait().

◆ proc_trace_syscalls()

static void proc_trace_syscalls ( const char *  args,
int  from_tty,
int  entry_or_exit,
int  mode 
)
static

◆ proc_trace_syscalls_1()

static void proc_trace_syscalls_1 ( procinfo pi,
int  syscallnum,
int  entry_or_exit,
int  mode,
int  from_tty 
)
static

◆ proc_trace_sysentry_cmd()

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

Definition at line 3756 of file procfs.c.

References FLAG_SET, and proc_trace_syscalls().

Referenced by _initialize_procfs().

◆ proc_trace_sysexit_cmd()

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

Definition at line 3762 of file procfs.c.

References FLAG_SET, and proc_trace_syscalls().

Referenced by _initialize_procfs().

◆ proc_unset_async()

static int proc_unset_async ( procinfo pi)
static

Definition at line 869 of file procfs.c.

References FLAG_RESET, and proc_modify_flag().

Referenced by procfs_wait().

◆ proc_unset_inherit_on_fork()

static int proc_unset_inherit_on_fork ( procinfo pi)
static

Definition at line 849 of file procfs.c.

References FLAG_RESET, and proc_modify_flag().

Referenced by procfs_set_exec_trap().

◆ proc_unset_run_on_last_close()

static int proc_unset_run_on_last_close ( procinfo pi)
static

Definition at line 838 of file procfs.c.

References FLAG_RESET, and proc_modify_flag().

Referenced by procfs_set_exec_trap().

◆ proc_untrace_sysentry_cmd()

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

Definition at line 3768 of file procfs.c.

References FLAG_RESET, and proc_trace_syscalls().

Referenced by _initialize_procfs().

◆ proc_untrace_sysexit_cmd()

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

Definition at line 3774 of file procfs.c.

References FLAG_RESET, and proc_trace_syscalls().

Referenced by _initialize_procfs().

◆ proc_update_threads()

static int proc_update_threads ( procinfo pi)
static

◆ proc_wait_for_stop()

static int proc_wait_for_stop ( procinfo pi)
static

◆ proc_warn()

static void proc_warn ( procinfo pi,
const char *  func,
int  line 
)
static

◆ proc_watchpoint_address()

static int proc_watchpoint_address ( procinfo pi,
CORE_ADDR addr 
)
static

◆ proc_what()

static int proc_what ( procinfo pi)
static

◆ proc_why()

static int proc_why ( procinfo pi)
static

◆ procfs_address_to_host_pointer()

static void* procfs_address_to_host_pointer ( CORE_ADDR  addr)
static

◆ procfs_attach()

static void procfs_attach ( struct target_ops ops,
const char *  args,
int  from_tty 
)
static

◆ procfs_can_use_hw_breakpoint()

static int procfs_can_use_hw_breakpoint ( struct target_ops self,
enum bptype  type,
int  cnt,
int  othertype 
)
static

◆ procfs_corefile_thread_callback()

static int procfs_corefile_thread_callback ( procinfo pi,
procinfo thread,
void *  data 
)
static

◆ procfs_create_inferior()

static void procfs_create_inferior ( struct target_ops ops,
const char *  exec_file,
const std::string allargs,
char **  env,
int  from_tty 
)
static

◆ procfs_debug_inferior()

static int procfs_debug_inferior ( procinfo pi)
static

◆ procfs_detach()

static void procfs_detach ( struct target_ops ops,
const char *  args,
int  from_tty 
)
static

◆ procfs_do_thread_registers()

static char* procfs_do_thread_registers ( bfd *  obfd,
ptid_t  ptid,
char *  note_data,
int *  note_size,
enum gdb_signal  stop_signal 
)
static

◆ procfs_fetch_registers()

static void procfs_fetch_registers ( struct target_ops ops,
struct regcache regcache,
int  regnum 
)
static

◆ procfs_files_info()

static void procfs_files_info ( struct target_ops ignore)
static

Definition at line 2837 of file procfs.c.

References _, current_inferior(), inferior_ptid, printf_filtered(), and target_pid_to_str().

Referenced by procfs_target().

◆ procfs_first_available()

ptid_t procfs_first_available ( void  )

◆ procfs_inferior_created()

static void procfs_inferior_created ( struct target_ops ops,
int  from_tty 
)
static

Definition at line 3173 of file procfs.c.

Referenced by _initialize_procfs().

◆ procfs_info_proc()

static void procfs_info_proc ( struct target_ops ops,
const char *  args,
enum info_proc_what  what 
)
static

◆ procfs_init_inferior()

static void procfs_init_inferior ( struct target_ops ops,
int  pid 
)
static

◆ procfs_insert_watchpoint()

static int procfs_insert_watchpoint ( struct target_ops self,
CORE_ADDR  addr,
int  len,
enum target_hw_bp_type  type,
struct expression cond 
)
static

◆ procfs_interrupt()

static void procfs_interrupt ( struct target_ops self,
ptid_t  ptid 
)
static

Definition at line 2851 of file procfs.c.

References inferior_process_group().

Referenced by procfs_target().

◆ procfs_kill_inferior()

static void procfs_kill_inferior ( struct target_ops ops)
static

◆ procfs_make_note_section()

static char * procfs_make_note_section ( struct target_ops self,
bfd *  obfd,
int *  note_size 
)
static

◆ procfs_mourn_inferior()

static void procfs_mourn_inferior ( struct target_ops ops)
static

◆ procfs_notice_thread()

static int procfs_notice_thread ( procinfo pi,
procinfo thread,
void *  ptr 
)
static

◆ procfs_pass_signals()

static void procfs_pass_signals ( struct target_ops self,
int  numsigs,
unsigned char *  pass_signals 
)
static

◆ procfs_pid_to_str()

static const char * procfs_pid_to_str ( struct target_ops ops,
ptid_t  ptid 
)
static

Definition at line 3238 of file procfs.c.

References ptid_get_lwp(), and ptid_get_pid().

Referenced by procfs_target().

◆ procfs_region_ok_for_hw_watchpoint()

static int procfs_region_ok_for_hw_watchpoint ( struct target_ops self,
CORE_ADDR  addr,
int  len 
)
static

Definition at line 3401 of file procfs.c.

Referenced by procfs_use_watchpoints().

◆ procfs_remove_watchpoint()

static int procfs_remove_watchpoint ( struct target_ops self,
CORE_ADDR  addr,
int  len,
enum target_hw_bp_type  type,
struct expression cond 
)
static

Definition at line 3392 of file procfs.c.

References inferior_ptid, and procfs_set_watchpoint().

Referenced by procfs_use_watchpoints().

◆ procfs_resume()

static void procfs_resume ( struct target_ops ops,
ptid_t  ptid,
int  step,
enum gdb_signal  signo 
)
static

◆ procfs_set_exec_trap()

static void procfs_set_exec_trap ( void  )
static

◆ procfs_set_watchpoint()

static int procfs_set_watchpoint ( ptid_t  ptid,
CORE_ADDR  addr,
int  len,
int  rwflag,
int  after 
)
static

◆ procfs_stopped_by_watchpoint()

static int procfs_stopped_by_watchpoint ( struct target_ops ops)
static

◆ procfs_stopped_data_address()

static int procfs_stopped_data_address ( struct target_ops targ,
CORE_ADDR addr 
)
static

◆ procfs_store_registers()

static void procfs_store_registers ( struct target_ops ops,
struct regcache regcache,
int  regnum 
)
static

◆ procfs_target()

struct target_ops* procfs_target ( void  )

◆ procfs_thread_alive()

static int procfs_thread_alive ( struct target_ops ops,
ptid_t  ptid 
)
static

Definition at line 3211 of file procfs.c.

References destroy_procinfo(), find_procinfo(), proc_get_status(), ptid_get_lwp(), and ptid_get_pid().

Referenced by procfs_target().

◆ procfs_update_thread_list()

static void procfs_update_thread_list ( struct target_ops ops)
static

◆ procfs_use_watchpoints()

void procfs_use_watchpoints ( struct target_ops t)

◆ procfs_wait()

static ptid_t procfs_wait ( struct target_ops ops,
ptid_t  ptid,
struct target_waitstatus status,
int  options 
)
static

◆ procfs_xfer_memory()

static enum target_xfer_status procfs_xfer_memory ( gdb_byte readbuf,
const gdb_byte writebuf,
ULONGEST  memaddr,
ULONGEST  len,
ULONGEST xfered_len 
)
static

◆ procfs_xfer_partial()

static enum target_xfer_status procfs_xfer_partial ( struct target_ops ops,
enum target_object  object,
const char *  annex,
gdb_byte readbuf,
const gdb_byte writebuf,
ULONGEST  offset,
ULONGEST  len,
ULONGEST xfered_len 
)
static

◆ syscall_is_exec()

static int syscall_is_exec ( procinfo pi,
int  scall 
)
static

Definition at line 2195 of file procfs.c.

Referenced by procfs_wait().

◆ syscall_is_exit()

static int syscall_is_exit ( procinfo pi,
int  scall 
)
static

Definition at line 2187 of file procfs.c.

Referenced by procfs_wait().

◆ syscall_is_lwp_create()

static int syscall_is_lwp_create ( procinfo pi,
int  scall 
)
static

Definition at line 2207 of file procfs.c.

Referenced by procfs_wait().

◆ syscall_is_lwp_exit()

static int syscall_is_lwp_exit ( procinfo pi,
int  scall 
)
static

Definition at line 2179 of file procfs.c.

Referenced by procfs_wait().

◆ sysset_t_alloc()

static sysset_t * sysset_t_alloc ( procinfo pi)
static

Definition at line 590 of file procfs.c.

References xmalloc().

Referenced by create_procinfo(), procfs_debug_inferior(), and procfs_set_exec_trap().

◆ unconditionally_kill_inferior()

static void unconditionally_kill_inferior ( procinfo pi)
static

Definition at line 2862 of file procfs.c.

References destroy_procinfo(), procinfo::pid, proc_error(), proc_kill(), proc_parent_pid(), and status.

Referenced by procfs_kill_inferior().

Variable Documentation

◆ errmsg

char errmsg[128]
static

Definition at line 269 of file procfs.c.

Referenced by cp_demangled_name_to_comp(), do_attach(), proc_error(), and proc_warn().

◆ procfs_xfer_partial

target_xfer_partial_ftype procfs_xfer_partial
static

Definition at line 110 of file procfs.c.

Referenced by procfs_target().

◆ procinfo_list

procinfo* procinfo_list
static

Definition at line 289 of file procfs.c.

Referenced by create_procinfo(), destroy_procinfo(), find_procinfo(), and procfs_first_available().