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_ops * | procfs_target (void)
static procinfo * | find_procinfo_or_die (int pid, int tid)
static procinfo * | find_procinfo (int pid, int tid)
static procinfo * | create_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_t * | proc_get_gregs (procinfo *pi)
static gdb_fpregset_t * | proc_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 procinfo * | procinfo_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 |  | ) |

Definition at line 3780 of file procfs.c.

References _, add_com(), no_class, observer_attach_inferior_created(), proc_trace_sysentry_cmd(), proc_trace_sysexit_cmd(), proc_untrace_sysentry_cmd(), proc_untrace_sysexit_cmd(), and procfs_inferior_created().

## ◆ 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

Definition at line 456 of file procfs.c.

References find_procinfo(), find_procinfo_or_die(), MAIN_PROC_NAME_FMT, memset(), procinfo::next, procinfo::pathname, procinfo::pid, pid, procinfo_list, procinfo::saved_entryset, procinfo::saved_exitset, sysset_t_alloc(), procinfo::thread_list, selftests::ptid::tid, procinfo::tid, and XNEW.

Referenced by do_attach(), proc_update_threads(), procfs_info_proc(), procfs_init_inferior(), procfs_set_exec_trap(), and procfs_wait().

## ◆ dead_procinfo()

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

Definition at line 567 of file procfs.c.

References destroy_procinfo(), error(), KILL, procinfo::pathname, procinfo::pid, and print_sys_errmsg().

Referenced by do_attach(), and procfs_init_inferior().

## ◆ destroy_one_procinfo()

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

Definition at line 510 of file procfs.c.

References close_procinfo_files(), procinfo::next, procinfo::saved_entryset, procinfo::saved_exitset, and xfree().

Referenced by destroy_procinfo(), and proc_delete_dead_threads().

## ◆ destroy_procinfo()

static void destroy_procinfo | ( | procinfo * | p | ) |
| static

Definition at line 535 of file procfs.c.

References destroy_one_procinfo(), find_procinfo(), procinfo::pid, procinfo_list, procinfo::thread_list, and procinfo::tid.

Referenced by dead_procinfo(), do_destroy_procinfo_cleanup(), do_detach(), procfs_mourn_inferior(), procfs_thread_alive(), and unconditionally_kill_inferior().

## ◆ do_attach()

static ptid_t do_attach | ( | ptid_t | ptid | ) |
| static

Definition at line 1956 of file procfs.c.

References _, add_thread(), create_procinfo(), current_inferior(), dead_procinfo(), errmsg, FD_CTL, fprintf_filtered(), gdb_stderr, procinfo::ignore_next_sigstop, arm-linux::inf, inferior_appeared(), NOKILL, open_procinfo_files(), procinfo::pid, proc_flags(), proc_get_current_thread(), proc_get_held_signals(), proc_get_traced_faults(), proc_get_traced_signals(), proc_get_traced_sysentry(), proc_get_traced_sysexit(), proc_prettyprint_why(), proc_set_run_on_last_close(), proc_stop_process(), proc_what(), proc_why(), procfs_debug_inferior(), ptid_build(), ptid_get_pid(), procinfo::saved_entryset, procinfo::saved_exitset, procinfo::saved_fltset, procinfo::saved_sighold, procinfo::saved_sigset, and procinfo::was_stopped.

Referenced by procfs_attach().

## ◆ 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

Definition at line 2026 of file procfs.c.

References _, destroy_procinfo(), find_procinfo_or_die(), inferior_ptid, proc_clear_current_fault(), proc_clear_current_signal(), proc_flags(), proc_set_current_signal(), proc_set_held_signals(), proc_set_run_on_last_close(), proc_set_traced_faults(), proc_set_traced_signals(), proc_set_traced_sysentry(), proc_set_traced_sysexit(), proc_warn(), ptid_get_pid(), query(), procinfo::saved_entryset, procinfo::saved_exitset, procinfo::saved_fltset, procinfo::saved_sighold, procinfo::saved_sigset, and procinfo::was_stopped.

Referenced by procfs_detach().

## ◆ 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

Definition at line 295 of file procfs.c.

References procinfo::next, procinfo::pid, pid, procinfo_list, procinfo::thread_list, selftests::ptid::tid, and procinfo::tid.

Referenced by create_procinfo(), destroy_procinfo(), find_procinfo_or_die(), procfs_info_proc(), procfs_kill_inferior(), procfs_mourn_inferior(), procfs_resume(), procfs_thread_alive(), and procfs_wait().

## ◆ find_procinfo_or_die()

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

Definition at line 324 of file procfs.c.

References _, error(), find_procinfo(), pid, and selftests::ptid::tid.

Referenced by create_procinfo(), do_detach(), proc_clear_current_fault(), proc_clear_current_signal(), proc_find_memory_regions(), proc_get_current_thread(), proc_get_held_signals(), proc_get_nthreads(), proc_get_traced_faults(), proc_get_traced_signals(), proc_get_traced_sysentry(), proc_get_traced_sysexit(), proc_iterate_over_threads(), proc_modify_flag(), proc_parent_pid(), proc_set_current_signal(), proc_set_held_signals(), proc_set_traced_faults(), proc_set_traced_signals(), proc_set_traced_sysentry(), proc_set_traced_sysexit(), proc_trace_syscalls(), proc_update_threads(), proc_wait_for_stop(), procfs_fetch_registers(), procfs_make_note_section(), procfs_pass_signals(), procfs_resume(), procfs_set_watchpoint(), procfs_stopped_by_watchpoint(), procfs_stopped_data_address(), procfs_store_registers(), procfs_update_thread_list(), procfs_wait(), and procfs_xfer_memory().

## ◆ find_signalled_thread()

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

Definition at line 3878 of file procfs.c.

References inferior_ptid, thread_info::ptid, ptid_get_pid(), thread_suspend_state::stop_signal, and thread_info::suspend.

Referenced by find_stop_signal().

## ◆ find_stop_signal()

static enum gdb_signal find_stop_signal | ( | void |  | ) |
| static

Definition at line 3888 of file procfs.c.

References find_signalled_thread(), iterate_over_threads(), thread_suspend_state::stop_signal, and thread_info::suspend.

Referenced by procfs_make_note_section().

## ◆ info_mappings_callback()

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

Definition at line 3551 of file procfs.c.

References gdbarch_addr_bit(), if(), gdb.printer.bound_registers::long, mappingflags(), printf_filtered(), and target_gdbarch().

Referenced by info_proc_mappings().

## ◆ info_proc_mappings()

static void info_proc_mappings | ( | procinfo * | pi,
|  | int | summary
| ) |  |
| static

Definition at line 3579 of file procfs.c.

References _, gdbarch_ptr_bit(), info_mappings_callback(), iterate_over_mappings(), printf_filtered(), and target_gdbarch().

Referenced by procfs_info_proc().

## ◆ invalidate_cache()

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

Definition at line 2662 of file procfs.c.

References close_procinfo_files(), procinfo::fpregs_valid, gdbarch_fp0_regnum(), procinfo::gregs_valid, proc_get_current_thread(), proc_set_fpregs(), proc_set_gregs(), proc_warn(), procinfo::status_valid, target_gdbarch(), procinfo::threads_valid, and procinfo::tid.

Referenced by procfs_resume().

## ◆ 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

Definition at line 3438 of file procfs.c.

References do_cleanups(), func, make_cleanup(), make_cleanup_close(), MAX_PROC_NAME_SIZE, null_cleanup(), procinfo::pid, proc_error(), and read().

Referenced by info_proc_mappings(), and proc_find_memory_regions().

## ◆ 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

Definition at line 380 of file procfs.c.

References procinfo::as_fd, procinfo::ctl_fd, FD_AS, FD_CTL, FD_STATUS, MAX_PROC_NAME_SIZE, open_with_retry(), procinfo::pathname, procinfo::status_fd, and procinfo::tid.

Referenced by do_attach(), proc_get_status(), proc_kill(), proc_run_process(), proc_set_fpregs(), proc_set_gregs(), proc_stop_process(), procfs_info_proc(), procfs_init_inferior(), procfs_set_exec_trap(), and procfs_xfer_memory().

## ◆ 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

Definition at line 1722 of file procfs.c.

References destroy_one_procinfo(), proc_get_status(), procinfo::status_valid, and procinfo::thread_list.

Referenced by proc_update_threads().

## ◆ proc_error()

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

Definition at line 627 of file procfs.c.

References errmsg, func, procinfo::pathname, and perror_with_name().

Referenced by iterate_over_mappings(), proc_trace_syscalls_1(), proc_update_threads(), procfs_fetch_registers(), procfs_info_proc(), procfs_init_inferior(), procfs_pass_signals(), procfs_resume(), procfs_set_watchpoint(), procfs_store_registers(), procfs_wait(), and unconditionally_kill_inferior().

## ◆ proc_find_memory_regions()

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

Definition at line 3515 of file procfs.c.

References find_memory_regions_callback(), find_procinfo_or_die(), func, inferior_ptid, iterate_over_mappings(), and ptid_get_pid().

Referenced by procfs_target().

## ◆ proc_flags()

static long proc_flags | ( | procinfo * | pi | ) |
| static

Definition at line 689 of file procfs.c.

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

Referenced by do_attach(), do_detach(), proc_get_status(), procfs_info_proc(), procfs_init_inferior(), procfs_stopped_by_watchpoint(), and procfs_wait().

## ◆ proc_get_current_thread()

static int proc_get_current_thread | ( | procinfo * | pi | ) |
| static

Definition at line 1699 of file procfs.c.

References find_procinfo_or_die(), procinfo::pid, proc_get_status(), procinfo::prstatus, procinfo::status_valid, and procinfo::tid.

Referenced by do_attach(), invalidate_cache(), proc_get_status(), procfs_init_inferior(), and procfs_wait().

## ◆ proc_get_fpregs()

static gdb_fpregset_t* proc_get_fpregs | ( | procinfo * | pi | ) |
| static

Definition at line 1420 of file procfs.c.

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

Referenced by proc_set_fpregs(), procfs_fetch_registers(), and procfs_store_registers().

## ◆ proc_get_gregs()

static gdb_gregset_t* proc_get_gregs | ( | procinfo * | pi | ) |
| static

Definition at line 1407 of file procfs.c.

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

Referenced by proc_set_gregs(), procfs_fetch_registers(), and procfs_store_registers().

## ◆ proc_get_held_signals()

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

Definition at line 1155 of file procfs.c.

References find_procinfo_or_die(), procinfo::pid, proc_get_status(), procinfo::prstatus, procinfo::status_valid, and procinfo::tid.

Referenced by do_attach(), and procfs_init_inferior().

## ◆ proc_get_nthreads()

static int proc_get_nthreads | ( | procinfo * | pi | ) |
| static

Definition at line 1678 of file procfs.c.

References find_procinfo_or_die(), procinfo::pid, proc_get_status(), procinfo::prstatus, procinfo::status_valid, and procinfo::tid.

Referenced by procfs_info_proc().

## ◆ proc_get_status()

static int proc_get_status | ( | procinfo * | pi | ) |
| static

Definition at line 640 of file procfs.c.

References FD_STATUS, procinfo::fpregs_valid, procinfo::gregs_valid, open_procinfo_files(), proc_flags(), proc_get_current_thread(), PROC_PRETTYFPRINT_STATUS, proc_what(), proc_why(), procinfo::prstatus, read(), SEEK_SET, procinfo::status_fd, procinfo::status_valid, and procinfo::tid.

Referenced by proc_delete_dead_threads(), proc_flags(), proc_get_current_thread(), proc_get_fpregs(), proc_get_gregs(), proc_get_held_signals(), proc_get_nthreads(), proc_get_traced_faults(), proc_get_traced_signals(), proc_get_traced_sysentry(), proc_get_traced_sysexit(), proc_nsysarg(), proc_parent_pid(), proc_set_current_signal(), proc_sysargs(), proc_watchpoint_address(), proc_what(), proc_why(), and procfs_thread_alive().

## ◆ proc_get_traced_faults()

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

Definition at line 1209 of file procfs.c.

References find_procinfo_or_die(), procinfo::pid, proc_get_status(), procinfo::prstatus, procinfo::status_valid, and procinfo::tid.

Referenced by do_attach(), and procfs_init_inferior().

## ◆ proc_get_traced_signals()

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

Definition at line 1182 of file procfs.c.

References find_procinfo_or_die(), procinfo::pid, proc_get_status(), procinfo::prstatus, procinfo::status_valid, and procinfo::tid.

Referenced by do_attach(), and procfs_init_inferior().

## ◆ proc_get_traced_sysentry()

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

Definition at line 1236 of file procfs.c.

References find_procinfo_or_die(), procinfo::pid, proc_get_status(), procinfo::prstatus, procinfo::status_valid, and procinfo::tid.

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

## ◆ proc_get_traced_sysexit()

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

Definition at line 1263 of file procfs.c.

References find_procinfo_or_die(), procinfo::pid, proc_get_status(), procinfo::prstatus, procinfo::status_valid, and procinfo::tid.

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

## ◆ proc_iterate_over_threads()

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

Definition at line 1797 of file procfs.c.

References find_procinfo_or_die(), func, cleanup::next, procinfo::next, procinfo::pid, procinfo::thread_list, and procinfo::tid.

Referenced by proc_update_threads(), procfs_make_note_section(), procfs_resume(), and procfs_update_thread_list().

## ◆ 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

Definition at line 784 of file procfs.c.

References _, procinfo::ctl_fd, find_procinfo_or_die(), FLAG_RESET, FLAG_SET, procinfo::pid, procinfo::status_valid, and warning().

Referenced by proc_set_async(), proc_set_run_on_last_close(), proc_unset_async(), proc_unset_inherit_on_fork(), and proc_unset_run_on_last_close().

## ◆ 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

Definition at line 1533 of file procfs.c.

References find_procinfo_or_die(), procinfo::pid, proc_get_status(), procinfo::prstatus, procinfo::status_valid, and procinfo::tid.

Referenced by unconditionally_kill_inferior().

## ◆ 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

Definition at line 1319 of file procfs.c.

References procinfo::ctl_fd, find_procinfo_or_die(), gdb_signal_from_host(), get_last_target_status(), inferior_ptid, target_waitstatus::kind, procinfo::pid, proc_get_status(), procinfo::prstatus, ptid_equal(), target_waitstatus::sig, TARGET_WAITKIND_STOPPED, procinfo::tid, and target_waitstatus::value.

Referenced by do_detach(), and proc_run_process().

## ◆ proc_set_fpregs()

static int proc_set_fpregs | ( | procinfo * | pi | ) |
| static

Definition at line 1470 of file procfs.c.

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

Referenced by invalidate_cache(), and procfs_store_registers().

## ◆ proc_set_gregs()

static int proc_set_gregs | ( | procinfo * | pi | ) |
| static

Definition at line 1434 of file procfs.c.

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

Referenced by invalidate_cache(), and procfs_store_registers().

## ◆ proc_set_held_signals()

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

Definition at line 1122 of file procfs.c.

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

Referenced by do_detach().

## ◆ 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

Definition at line 1013 of file procfs.c.

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

Referenced by do_detach(), and procfs_debug_inferior().

## ◆ proc_set_traced_signals()

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

Definition at line 978 of file procfs.c.

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

Referenced by do_detach(), procfs_debug_inferior(), and procfs_pass_signals().

## ◆ proc_set_traced_sysentry()

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

Definition at line 1046 of file procfs.c.

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

Referenced by do_detach(), proc_trace_syscalls_1(), and procfs_debug_inferior().

## ◆ proc_set_traced_sysexit()

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

Definition at line 1084 of file procfs.c.

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

Referenced by do_detach(), proc_trace_syscalls_1(), procfs_debug_inferior(), and procfs_set_exec_trap().

## ◆ 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

Definition at line 3736 of file procfs.c.

References _, error(), error_no_arg(), find_procinfo_or_die(), inferior_ptid, proc_trace_syscalls_1(), and ptid_get_pid().

Referenced by proc_trace_sysentry_cmd(), proc_trace_sysexit_cmd(), proc_untrace_sysentry_cmd(), and proc_untrace_sysexit_cmd().

## ◆ proc_trace_syscalls_1()

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

Definition at line 3705 of file procfs.c.

References FLAG_SET, proc_error(), proc_get_traced_sysentry(), proc_get_traced_sysexit(), proc_set_traced_sysentry(), and proc_set_traced_sysexit().

Referenced by proc_trace_syscalls().

## ◆ 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

Definition at line 1740 of file procfs.c.

References create_procinfo(), do_cleanups(), do_closedir_cleanup(), find_procinfo_or_die(), make_cleanup(), MAX_PROC_NAME_SIZE, procinfo::pathname, procinfo::pid, proc_delete_dead_threads(), proc_error(), proc_iterate_over_threads(), procinfo::threads_valid, and procinfo::tid.

Referenced by procfs_update_thread_list().

## ◆ proc_wait_for_stop()

static int proc_wait_for_stop | ( | procinfo * | pi | ) |
| static

Definition at line 902 of file procfs.c.

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

Referenced by procfs_init_inferior(), and procfs_wait().

## ◆ proc_warn()

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

Definition at line 620 of file procfs.c.

References errmsg, func, procinfo::pathname, and print_sys_errmsg().

Referenced by do_detach(), invalidate_cache(), procfs_set_exec_trap(), and procfs_xfer_memory().

## ◆ proc_watchpoint_address()

static int proc_watchpoint_address | ( | procinfo * | pi,
|  | CORE_ADDR * | addr
| ) |  |
| static

Definition at line 728 of file procfs.c.

References builtin_type::builtin_data_ptr, builtin_type(), gdbarch_pointer_to_address(), proc_get_status(), procinfo::prstatus, procinfo::status_valid, and target_gdbarch().

Referenced by procfs_stopped_data_address().

## ◆ proc_what()

static int proc_what | ( | procinfo * | pi | ) |
| static

Definition at line 713 of file procfs.c.

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

Referenced by do_attach(), proc_get_status(), procfs_info_proc(), procfs_stopped_by_watchpoint(), and procfs_wait().

## ◆ proc_why()

static int proc_why | ( | procinfo * | pi | ) |
| static

Definition at line 701 of file procfs.c.

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

Referenced by do_attach(), proc_get_status(), procfs_info_proc(), procfs_stopped_by_watchpoint(), and procfs_wait().

## ◆ procfs_address_to_host_pointer()

static void* procfs_address_to_host_pointer | ( | CORE_ADDR | addr | ) |
| static

Definition at line 1554 of file procfs.c.

References builtin_type::builtin_data_ptr, builtin_type(), gdb_assert, gdbarch_address_to_pointer(), target_gdbarch(), and TYPE_LENGTH.

Referenced by proc_set_watchpoint().

## ◆ procfs_attach()

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

Definition at line 1898 of file procfs.c.

References _, do_attach(), error(), get_exec_file(), inferior_ptid, parse_pid_to_attach(), pid, pid_to_ptid(), printf_filtered(), push_target(), target_is_pushed(), and target_pid_to_str().

Referenced by procfs_target().

## ◆ procfs_can_use_hw_breakpoint()

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

Definition at line 3309 of file procfs.c.

References builtin_type::builtin_data_ptr, builtin_type(), target_gdbarch(), and TYPE_LENGTH.

Referenced by procfs_use_watchpoints().

## ◆ procfs_corefile_thread_callback()

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

Definition at line 3860 of file procfs.c.

References procfs_corefile_thread_data::note_data, procfs_corefile_thread_data::note_size, procfs_corefile_thread_data::obfd, procinfo::pid, procfs_do_thread_registers(), ptid_build(), procfs_corefile_thread_data::stop_signal, and procinfo::tid.

Referenced by procfs_make_note_section().

## ◆ 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

Definition at line 3084 of file procfs.c.

References _, add_thread_silent(), error(), fork_inferior(), pid, pid_to_ptid(), procfs_init_inferior(), and procfs_set_exec_trap().

Referenced by procfs_target().

## ◆ procfs_debug_inferior()

static int procfs_debug_inferior | ( | procinfo * | pi | ) |
| static

Definition at line 1843 of file procfs.c.

References proc_set_traced_faults(), proc_set_traced_signals(), proc_set_traced_sysentry(), proc_set_traced_sysexit(), status, sysset_t_alloc(), and xfree().

Referenced by do_attach(), and procfs_init_inferior().

## ◆ procfs_detach()

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

Definition at line 1927 of file procfs.c.

References _, detach_inferior(), do_detach(), gdb_flush(), gdb_stdout, get_exec_file(), inf_child_maybe_unpush_target(), inferior_ptid, null_ptid, pid, pid_to_ptid(), printf_filtered(), ptid_get_pid(), and target_pid_to_str().

Referenced by procfs_target().

## ◆ 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

Definition at line 3815 of file procfs.c.

References fill_fpregset(), fill_gregset(), get_thread_regcache(), inferior_ptid, make_scoped_restore(), regcache::ptid(), ptid_get_lwp(), ptid_get_pid(), and target_fetch_registers().

Referenced by procfs_corefile_thread_callback().

## ◆ procfs_fetch_registers()

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

Definition at line 2085 of file procfs.c.

References _, regcache::arch(), error(), find_procinfo_or_die(), gdbarch_fp0_regnum(), gdbarch_pc_regnum(), gdbarch_sp_regnum(), pid, proc_error(), proc_get_fpregs(), proc_get_gregs(), ptid_get_lwp(), ptid_get_pid(), regcache_get_ptid(), regnum, supply_fpregset(), supply_gregset(), target_pid_to_str(), and selftests::ptid::tid.

Referenced by procfs_target().

## ◆ 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 |  | ) |

Definition at line 3807 of file procfs.c.

References procinfo::pid, pid_to_ptid(), and procinfo_list.

Referenced by rw_common(), sol_thread_resume(), sol_thread_wait(), and sol_thread_xfer_partial().

## ◆ 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

Definition at line 3607 of file procfs.c.

References _, cleanup::arg, create_procinfo(), do_cleanups(), do_destroy_procinfo_cleanup(), error(), FD_CTL, find_procinfo(), inferior_ptid, info_proc_mappings(), IP_ALL, IP_MAPPINGS, IP_MINIMAL, make_cleanup(), mappings, null_cleanup(), open_procinfo_files(), procinfo::pid, pid, printf_filtered(), proc_error(), proc_flags(), proc_get_nthreads(), proc_prettyprint_flags(), proc_prettyprint_why(), proc_what(), proc_why(), ptid_get_pid(), selftests::ptid::tid, and procinfo::tid.

Referenced by procfs_target().

## ◆ procfs_init_inferior()

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

Definition at line 2929 of file procfs.c.

References _, create_procinfo(), dead_procinfo(), FD_CTL, gdb_startup_inferior(), KILL, open_procinfo_files(), pid, pid_to_ptid(), proc_error(), proc_flags(), proc_get_current_thread(), proc_get_held_signals(), proc_get_traced_faults(), proc_get_traced_signals(), proc_get_traced_sysentry(), proc_get_traced_sysexit(), proc_set_run_on_last_close(), proc_wait_for_stop(), procfs_debug_inferior(), ptid_build(), push_target(), procinfo::saved_entryset, procinfo::saved_exitset, procinfo::saved_fltset, procinfo::saved_sighold, procinfo::saved_sigset, signals, START_INFERIOR_TRAPS_EXPECTED, target_is_pushed(), and thread_change_ptid().

Referenced by procfs_create_inferior().

## ◆ 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

Definition at line 3368 of file procfs.c.

References gdbarch_have_nonsteppable_watchpoint(), inferior_ptid, procfs_set_watchpoint(), target_gdbarch(), and target_have_steppable_watchpoint.

Referenced by procfs_use_watchpoints().

## ◆ 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

Definition at line 2890 of file procfs.c.

References find_procinfo(), inferior_ptid, null_ptid, ptid_equal(), ptid_get_pid(), target_mourn_inferior(), and unconditionally_kill_inferior().

Referenced by procfs_target().

## ◆ procfs_make_note_section()

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

Definition at line 3900 of file procfs.c.

References current_target, fill_gregset(), find_procinfo_or_die(), find_stop_signal(), get_current_regcache(), get_exec_file(), get_inferior_args(), inferior_ptid, procfs_corefile_thread_data::note_data, procfs_corefile_thread_data::note_size, procfs_corefile_thread_data::obfd, proc_iterate_over_threads(), procfs_corefile_thread_callback(), ptid_get_pid(), procfs_corefile_thread_data::stop_signal, TARGET_OBJECT_AUXV, target_read_alloc(), and xfree().

Referenced by procfs_target().

## ◆ procfs_mourn_inferior()

static void procfs_mourn_inferior | ( | struct target_ops * | ops | ) |
| static

Definition at line 2906 of file procfs.c.

References destroy_procinfo(), find_procinfo(), generic_mourn_inferior(), inf_child_maybe_unpush_target(), inferior_ptid, null_ptid, ptid_equal(), and ptid_get_pid().

Referenced by procfs_target().

## ◆ procfs_notice_thread()

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

Definition at line 3180 of file procfs.c.

References add_thread(), in_thread_list(), is_exited(), procinfo::pid, ptid_build(), and procinfo::tid.

Referenced by procfs_update_thread_list().

## ◆ procfs_pass_signals()

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

Definition at line 2814 of file procfs.c.

References find_procinfo_or_die(), gdb_signal_from_host(), inferior_ptid, proc_error(), proc_set_traced_signals(), ptid_get_pid(), and signals.

Referenced by procfs_target().

## ◆ 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

Definition at line 2734 of file procfs.c.

References _, find_procinfo(), find_procinfo_or_die(), gdb_signal_to_host(), procinfo::ignore_next_sigstop, inferior_ptid, invalidate_cache(), proc_error(), proc_iterate_over_threads(), proc_run_process(), proc_set_async(), ptid_get_lwp(), ptid_get_pid(), procinfo::tid, and warning().

Referenced by procfs_target().

## ◆ procfs_set_exec_trap()

static void procfs_set_exec_trap | ( | void |  | ) |
| static

Definition at line 3014 of file procfs.c.

References _, create_procinfo(), FD_CTL, gdb_flush(), gdb_stderr, open_procinfo_files(), perror_with_name(), proc_set_traced_sysexit(), proc_unset_inherit_on_fork(), proc_unset_run_on_last_close(), proc_warn(), and sysset_t_alloc().

Referenced by procfs_create_inferior().

## ◆ procfs_set_watchpoint()

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

Definition at line 3253 of file procfs.c.

References AFTER_WATCHFLAG, EXEC_WATCHFLAG, find_procinfo_or_die(), hw_access, hw_execute, hw_read, hw_write, inferior_ptid, proc_error(), proc_set_watchpoint(), ptid_get_pid(), READ_WATCHFLAG, and WRITE_WATCHFLAG.

Referenced by procfs_insert_watchpoint(), and procfs_remove_watchpoint().

## ◆ procfs_stopped_by_watchpoint()

static int procfs_stopped_by_watchpoint | ( | struct target_ops * | ops | ) |
| static

Definition at line 3335 of file procfs.c.

References find_procinfo_or_die(), inferior_ptid, proc_flags(), proc_what(), proc_why(), and ptid_get_pid().

Referenced by procfs_use_watchpoints().

## ◆ procfs_stopped_data_address()

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

Definition at line 3359 of file procfs.c.

References find_procinfo_or_die(), inferior_ptid, proc_watchpoint_address(), and ptid_get_pid().

Referenced by procfs_use_watchpoints().

## ◆ procfs_store_registers()

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

Definition at line 2135 of file procfs.c.

References _, regcache::arch(), error(), fill_fpregset(), fill_gregset(), find_procinfo_or_die(), gdbarch_fp0_regnum(), gdbarch_pc_regnum(), gdbarch_sp_regnum(), pid, proc_error(), proc_get_fpregs(), proc_get_gregs(), proc_set_fpregs(), proc_set_gregs(), ptid_get_lwp(), ptid_get_pid(), regcache_get_ptid(), regnum, target_pid_to_str(), and selftests::ptid::tid.

Referenced by procfs_target().

## ◆ procfs_target()

struct target_ops* procfs_target | ( | void |  | ) |

Definition at line 159 of file procfs.c.

References inf_child_target(), OPS_MAGIC, proc_find_memory_regions(), procfs_attach(), procfs_create_inferior(), procfs_detach(), procfs_fetch_registers(), procfs_files_info(), procfs_info_proc(), procfs_interrupt(), procfs_kill_inferior(), procfs_make_note_section(), procfs_mourn_inferior(), procfs_pass_signals(), procfs_pid_to_str(), procfs_resume(), procfs_store_registers(), procfs_thread_alive(), procfs_update_thread_list(), procfs_wait(), procfs_xfer_partial, tc_schedlock, target_ops::to_attach, target_ops::to_auxv_parse, target_ops::to_create_inferior, target_ops::to_detach, target_ops::to_fetch_registers, target_ops::to_files_info, target_ops::to_find_memory_regions, target_ops::to_has_thread_control, target_ops::to_info_proc, target_ops::to_interrupt, target_ops::to_kill, target_ops::to_magic, target_ops::to_make_corefile_notes, target_ops::to_mourn_inferior, target_ops::to_pass_signals, target_ops::to_pid_to_str, target_ops::to_resume, target_ops::to_store_registers, target_ops::to_thread_alive, target_ops::to_update_thread_list, target_ops::to_wait, and target_ops::to_xfer_partial.

Referenced by _initialize_amd64_sol2_nat(), and _initialize_sparc_sol2_nat().

## ◆ 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

Definition at line 3194 of file procfs.c.

References find_procinfo_or_die(), inferior_ptid, proc_iterate_over_threads(), proc_update_threads(), procfs_notice_thread(), prune_threads(), and ptid_get_pid().

Referenced by procfs_target().

## ◆ procfs_use_watchpoints()

void procfs_use_watchpoints | ( | struct target_ops * | t | ) |

Definition at line 3413 of file procfs.c.

References procfs_can_use_hw_breakpoint(), procfs_insert_watchpoint(), procfs_region_ok_for_hw_watchpoint(), procfs_remove_watchpoint(), procfs_stopped_by_watchpoint(), procfs_stopped_data_address(), target_ops::to_can_use_hw_breakpoint, target_ops::to_insert_watchpoint, target_ops::to_region_ok_for_hw_watchpoint, target_ops::to_remove_watchpoint, target_ops::to_stopped_by_watchpoint, and target_ops::to_stopped_data_address.

Referenced by _initialize_amd64_sol2_nat(), and _initialize_sparc_sol2_nat().

## ◆ procfs_wait()

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

Definition at line 2221 of file procfs.c.

References _, add_thread(), create_procinfo(), delete_thread(), error(), find_inferior_pid(), find_procinfo(), find_procinfo_or_die(), flags, procinfo::fpregs_valid, procinfo::gregs_valid, in_thread_list(), arm-linux::inf, inferior_ptid, info_verbose, procinfo::pid, pid_to_ptid(), print_thread_events, printf_filtered(), printf_unfiltered(), proc_error(), proc_flags(), proc_get_current_thread(), proc_nsysarg(), proc_prettyprint_flags(), proc_prettyprint_syscall(), proc_prettyprint_why(), proc_run_process(), proc_sysargs(), proc_unset_async(), proc_wait_for_stop(), proc_what(), proc_why(), ptid_build(), ptid_equal(), ptid_get_lwp(), ptid_get_pid(), status, procinfo::status_valid, store_waitstatus(), syscall_is_exec(), syscall_is_exit(), syscall_is_lwp_create(), syscall_is_lwp_exit(), target_continue_no_signal(), target_pid_to_str(), TARGET_WAITKIND_SPURIOUS, and TARGET_WAITKIND_STOPPED.

Referenced by procfs_target().

## ◆ 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

Definition at line 2612 of file procfs.c.

References procinfo::as_fd, FD_AS, find_procinfo_or_die(), inferior_ptid, open_procinfo_files(), proc_warn(), PROCFS_NOTE, ptid_get_pid(), read(), SEEK_SET, TARGET_XFER_E_IO, and TARGET_XFER_OK.

Referenced by procfs_xfer_partial().

## ◆ 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

Definition at line 2587 of file procfs.c.

References target_ops::beneath, memory_xfer_auxv, offset, procfs_xfer_memory(), TARGET_OBJECT_AUXV, TARGET_OBJECT_MEMORY, and target_ops::to_xfer_partial.

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