From 2d97a5d9d33aea87c3bd02fd1fa417f5d4e1fa05 Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Tue, 9 Jan 2018 13:35:17 -0800 Subject: [PATCH] Document support for 'info proc' on FreeBSD. Since the 'info proc' support on FreeBSD does not use /proc, reword the documentation for 'info proc' to not assume /proc. This includes renaming the node to 'Process Information' and suggesting that additional process information can be queried via different OS-specific interfaces. This is also cleans up the description of 'info proc' support for core files a bit as /proc is not used for core file support on any current platform. gdb/ChangeLog: * NEWS: Document that 'info proc' now works on FreeBSD. gdb/doc/ChangeLog: * gdb.texinfo (pwd): Update cross-reference for Process Information node and remove explicit /proc reference. (Native): Rename subsection from SVR4 Process Information to Process Information. (Process Information): Reword introduction to be less /proc centric. Document support for "info proc" on FreeBSD. --- gdb/ChangeLog | 4 +++ gdb/NEWS | 3 ++ gdb/doc/ChangeLog | 9 ++++++ gdb/doc/gdb.texinfo | 76 ++++++++++++++++++++++++++------------------- 4 files changed, 60 insertions(+), 32 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index c29a6ac6cd4..adb72ef846b 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,7 @@ +2018-01-09 John Baldwin + + * NEWS: Document that 'info proc' now works on FreeBSD. + 2018-01-09 John Baldwin * configure.ac: Check for kinfo_getfile in libutil. diff --git a/gdb/NEWS b/gdb/NEWS index 2f834c6ff47..f69173a245c 100644 --- a/gdb/NEWS +++ b/gdb/NEWS @@ -3,6 +3,9 @@ *** Changes since GDB 8.1 +* 'info proc' now works on running processes on FreeBSD systems and core + files created on FreeBSD systems. + *** Changes in GDB 8.1 * GDB now supports dynamically creating arbitrary register groups specified diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog index 5a3437cd32e..940f1d404c7 100644 --- a/gdb/doc/ChangeLog +++ b/gdb/doc/ChangeLog @@ -1,3 +1,12 @@ +2018-01-09 John Baldwin + + * gdb.texinfo (pwd): Update cross-reference for Process Information + node and remove explicit /proc reference. + (Native): Rename subsection from SVR4 Process Information to + Process Information. + (Process Information): Reword introduction to be less /proc + centric. Document support for "info proc" on FreeBSD. + 2018-01-03 Xavier Roirand * gdb.texinfo (Set Catchpoints): Add documentation for new diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo index 8bdafb0ba44..096c82cc821 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -2523,9 +2523,9 @@ Print the @value{GDBN} working directory. It is generally impossible to find the current working directory of the process being debugged (since a program can change its directory -during its run). If you work on a system where @value{GDBN} is -configured with the @file{/proc} support, you can use the @code{info -proc} command (@pxref{SVR4 Process Information}) to find out the +during its run). If you work on a system where @value{GDBN} supports +the @code {info proc} command (@pxref{Process Information}), you can +use the @code{info proc} command to find out the current working directory of the debuggee. @node Input/Output @@ -21712,7 +21712,7 @@ configurations. @menu * BSD libkvm Interface:: Debugging BSD kernel memory images -* SVR4 Process Information:: SVR4 process information +* Process Information:: Process information * DJGPP Native:: Features specific to the DJGPP port * Cygwin Native:: Features specific to the Cygwin port * Hurd Native:: Features specific to @sc{gnu} Hurd @@ -21759,24 +21759,32 @@ Set current context from proc address. This command isn't available on modern FreeBSD systems. @end table -@node SVR4 Process Information -@subsection SVR4 Process Information +@node Process Information +@subsection Process Information @cindex /proc @cindex examine process image @cindex process info via @file{/proc} -Many versions of SVR4 and compatible systems provide a facility called -@samp{/proc} that can be used to examine the image of a running -process using file-system subroutines. +Some operating systems provide interfaces to fetch additional +information about running processes beyond memory and per-thread +register state. If @value{GDBN} is configured for an operating system +with a supported interface, the command @code{info proc} is available +to report information about the process running your program, or about +any process running on your system. -If @value{GDBN} is configured for an operating system with this -facility, the command @code{info proc} is available to report -information about the process running your program, or about any -process running on your system. This includes, as of this writing, -@sc{gnu}/Linux and Solaris, for example. +One supported interface is a facility called @samp{/proc} that can be +used to examine the image of a running process using file-system +subroutines. This facility is supported on @sc{gnu}/Linux and Solaris +systems. -This command may also work on core files that were created on a system -that has the @samp{/proc} facility. +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 @sc{gnu}/Linux and FreeBSD +systems. @table @code @kindex info proc @@ -21800,36 +21808,40 @@ a process ID rather than a thread ID). @item info proc cmdline @cindex info proc cmdline Show the original command line of the process. This command is -specific to @sc{gnu}/Linux. +supported on @sc{gnu}/Linux and FreeBSD. @item info proc cwd @cindex info proc cwd Show the current working directory of the process. This command is -specific to @sc{gnu}/Linux. +supported on @sc{gnu}/Linux and FreeBSD. @item info proc exe @cindex info proc exe -Show the name of executable of the process. This command is specific -to @sc{gnu}/Linux. +Show the name of executable of the process. This command is supported +on @sc{gnu}/Linux and FreeBSD. @item info proc mappings @cindex memory address space mappings -Report the memory address space ranges accessible in the program, with -information on whether the process has read, write, or execute access -rights to each range. On @sc{gnu}/Linux systems, each memory range -includes the object file which is mapped to that range, instead of the -memory access rights to that range. +Report the memory address space ranges accessible in the program. On +Solaris and FreeBSD systems, each memory range includes information on +whether the process has read, write, or execute access rights to each +range. On @sc{gnu}/Linux and FreeBSD systems, each memory range +includes the object file which is mapped to that range. @item info proc stat @itemx info proc status @cindex process detailed status information -These subcommands are specific to @sc{gnu}/Linux systems. They show -the process-related information, including the user ID and group ID; -how many threads are there in the process; its virtual memory usage; -the signals that are pending, blocked, and ignored; its TTY; its -consumption of system and user time; its stack size; its @samp{nice} -value; etc. For more information, see the @samp{proc} man page -(type @kbd{man 5 proc} from your shell prompt). +Show additional process-related information, including the user ID and +group ID; virtual memory usage; the signals that are pending, blocked, +and ignored; its TTY; its consumption of system and user time; its +stack size; its @samp{nice} value; etc. These commands are supported +on @sc{gnu}/Linux and FreeBSD. + +For @sc{gnu}/Linux systems, see the @samp{proc} man page for more +information (type @kbd{man 5 proc} from your shell prompt). + +For FreeBSD systems, @code{info proc stat} is an alias for @code{info +proc status}. @item info proc all Show all the information about the process described under all of the -- 2.30.2