Lines Matching defs:proc

1 /* Machine independent support for SVR4 /proc (process file system) for GDB.
57 * /proc file system, which is used on many versions of Unix
66 * /proc works by imitating a file system: you open a simulated file
71 * The most important thing to know about /proc and this module
72 * is that there are two very different interfaces to /proc:
75 * This module has to support both /proc interfaces. This means
86 /* Determine which /proc API we are using:
103 #include "proc-utils.h"
159 procfs_ops.to_longname = "Unix /proc child process";
161 "Unix /proc child process (started by the \"run\" command).";
212 * the unification of code that handles different versions of /proc.
286 syscall numbers. Instead, they're stored in /proc/PID/sysent
302 concerning a /proc process. There should be exactly one procinfo
314 implemented) "info proc" command, so that we can print useful
319 /* format strings for /proc paths */
321 # define MAIN_PROC_NAME_FMT "/proc/%d"
322 # define CTL_PROC_NAME_FMT "/proc/%d/ctl"
323 # define AS_PROC_NAME_FMT "/proc/%d/as"
324 # define MAP_PROC_NAME_FMT "/proc/%d/map"
325 # define STATUS_PROC_NAME_FMT "/proc/%d/status"
326 # define MAX_PROC_NAME_SIZE sizeof("/proc/99999/lwp/8096/lstatus")
328 /* the name of the proc status struct depends on the implementation */
332 /* format strings for /proc paths */
334 # define MAIN_PROC_NAME_FMT "/proc/%05d"
335 # define CTL_PROC_NAME_FMT "/proc/%05d"
336 # define AS_PROC_NAME_FMT "/proc/%05d"
337 # define MAP_PROC_NAME_FMT "/proc/%05d"
338 # define STATUS_PROC_NAME_FMT "/proc/%05d"
339 # define MAX_PROC_NAME_SIZE sizeof("/proc/ttttppppp")
341 /* the name of the proc status struct depends on the implementation */
356 several different fd's, depending on the version of /proc
359 int ctl_fd; /* File descriptor for /proc control file */
367 int status_fd; /* File descriptor for /proc status file */
368 int as_fd; /* File descriptor for /proc as file */
370 char pathname[MAX_PROC_NAME_SIZE]; /* Pathname to /proc entry */
548 * Pathnames for a process (<proc-id>):
549 * /proc/<proc-id>/ctl
550 * /proc/<proc-id>/status
551 * /proc/<proc-id>/as
552 * /proc/<proc-id>/map
554 * /proc/<proc-id>/lwp/<lwp-id>/lwpctl
555 * /proc/<proc-id>/lwp/<lwp-id>/lwpstatus
566 * /proc/<proc-id>
718 sprintf (pi->pathname, "/proc/%05d/lwp/%d", pid, tid);
880 Extract syscall numbers and names from /proc/<pid>/sysent. Initialize
901 sprintf (pathname, "/proc/%d/sysent", pi->pid);
905 error ("load_syscalls: Can't open /proc/%d/sysent", pi->pid);
911 error ("load_syscalls: Error reading /proc/%d/sysent", pi->pid);
916 error ("load_syscalls: /proc/%d/sysent contains no syscalls!", pi->pid);
925 error ("load_syscalls: Error reading /proc/%d/sysent", pi->pid);
1025 /* =================== /proc "MODULE" =================== */
1028 * This "module" is the interface layer between the /proc system API
1031 * that we need to use from the /proc API.
1034 * there are two very different implementations of the /proc API.
1359 * === /proc are more inconsistent than usual. MVS
1363 * PR_RLC -- traced process runs when last /proc file closed.
1364 * PR_KLC -- traced process is killed when last /proc file closed.
1494 * when debugger closes all /proc fds.
1527 * closes all /proc fds (or debugger exits or dies).
2792 * Send a signal to the proc or lwp with the semantics of "kill()".
2948 sprintf (pathname, "/proc/%d/ldt", pi->pid);
3010 /* =============== END, non-thread part of /proc "MODULE" =============== */
3374 /* =================== END, /proc "MODULE" =================== */
3469 Not all systems with /proc have all the exec* syscalls with the same
3580 sprintf (errmsg, "do_attach: couldn't open /proc file for process %d",
3603 /* Save some of the /proc state to be restored if we detach. */
3673 * Since the /proc interface cannot give us individual registers,
3730 /proc, this makes sure that registers contains all the registers
3744 * Since the /proc interface will not read individual registers,
3874 * Translate /proc eventcodes (or possibly wait eventcodes)
3922 /* /proc file not found; presumably child has terminated. */
3945 This block will analyze the /proc status, and translate it
3948 If we actually had to call wait because the /proc file
4598 printf_filtered ("\tUsing the running image of %s %s via /proc.\n",
4807 /* Save some of the /proc state to be restored if we detach. */
4906 Not all systems with /proc have all the exec* syscalls with the same
5104 int proc, thread;
5107 proc = PIDGET (ptid);
5110 if ((pi = find_procinfo (proc, thread)) == NULL)
5135 int proc, thread;
5138 proc = PIDGET (ptid);
5140 pi = find_procinfo (proc, thread);
5143 sprintf (buf, "Process %d", proc);
5166 /* Translate from GDB's flags to /proc's */
5353 sprintf (pathname, "/proc/%d/map", pi->pid);
5420 sprintf (name, "/proc/%d/object/%s", pi->pid, map->pr_mapname);
5556 * Callback function, does the actual work for 'info proc mappings'.
5586 * Implement the "info proc mappings" subcommand.
5617 * Implement the "info proc" command.
5678 proc_error (process, "info proc, open_procinfo_files", __LINE__);
5733 proc_error (pi, "proc-trace, get_traced_sysset", __LINE__);
5743 proc_error (pi, "proc-trace, set_traced_sysentry", __LINE__);
5748 proc_error (pi, "proc-trace, set_traced_sysexit", __LINE__);
5783 add_info ("proc", info_proc_cmd,
5784 "Show /proc process information about any running process.\n\
5787 add_com ("proc-trace-entry", no_class, proc_trace_sysentry_cmd,
5789 add_com ("proc-trace-exit", no_class, proc_trace_sysexit_cmd,
5791 add_com ("proc-untrace-entry", no_class, proc_untrace_sysentry_cmd,
5793 add_com ("proc-untrace-exit", no_class, proc_untrace_sysexit_cmd,