Some operating systems provide interfaces to fetch additional
information about running processes beyond memory and per-thread
register state. If gdb is configured for an operating system
with a supported interface, the command info proc
is available
to report information about the process running your program, or about
any process running on your system.
One supported interface is a facility called ‘/proc’ that can be used to examine the image of a running process using file-system subroutines. This facility is supported on gnu/Linux and Solaris systems.
On FreeBSD systems, system control nodes are used to query process information.
In addition, some systems may provide additional process information in core files. Note that a core file may include a subset of the information available from a live process. Process information is currently avaiable from cores created on gnu/Linux and FreeBSD systems.
info proc
info proc
process-idOn some systems, process-id can be of the form
‘[pid]/tid’ which specifies a certain thread ID
within a process. If the optional pid part is missing, it means
a thread from the process being debugged (the leading ‘/’ still
needs to be present, or else gdb will interpret the number as
a process ID rather than a thread ID).
info proc cmdline
info proc cwd
info proc exe
info proc mappings
info proc stat
info proc status
For gnu/Linux systems, see the ‘proc’ man page for more information (type man 5 proc from your shell prompt).
For FreeBSD systems, info proc stat
is an alias for info
proc status
.
info proc all
info proc
subcommands.
set procfs-trace
procfs
API calls.
show procfs-trace
procfs
API call tracing.
set procfs-file
fileprocfs
API trace to the named
file. gdb appends the trace info to the previous
contents of the file. The default is to display the trace on the
standard output.
show procfs-file
procfs
API trace is written.
proc-trace-entry
proc-trace-exit
proc-untrace-entry
proc-untrace-exit
syscall
interface.
info pidlist
info meminfo