[PATCH 10/10] Extended-remote fork event documentation

Don Breazeal
2014-08-07T18:01:12Z

This patch adds documentation for fork events on extended-remote linux targets in the gdb manual and the NEWS file.

Thanks,
--Don

gdb/
2014-08-06 Don Breazeal <donb@codesourcery.com>
* NEWS: Describe new gdbserver support for fork events and new
fork event support in RSP.

gdb/doc/
2014-08-06 Don Breazeal <donb@codesourcery.com>
* gdb.texinfo (Forks): Describe fork debugging support in gdbserver.
(Set Catchpoints): Describe fork catchpoint support in gdbserver.
(Stop Reply Packets): Describe fork event support in RSP.

---
gdb/NEWS | 15 +++++++++++++++
gdb/doc/gdb.texinfo | 33 +++++++++++++++++++++++++++++----
2 files changed, 44 insertions(+), 4 deletions(-)

diff --git a/gdb/NEWS b/gdb/NEWS
index d603cf7..c3b1d23 100644
--- a/gdb/NEWS
+++ b/gdb/NEWS
@@ -14,6 +14,21 @@
confirmation if the program had stopped for a signal and the user
switched threads meanwhile.

+* Remote fork events
+
+ GDBserver extended-remote Linux targets now support fork events.
+ This enables follow-fork-mode, detach-on-fork, catch fork, and
+ catch vfork for those targets with Linux kernels 2.5.60 and later.
+
+* New remote packets
+
+T Stop Reply Packet's reason
+ The T stop reply packet supports new stop reasons 'fork', 'vfork'
+ and 'vforkdone'. The 'fork' and 'vfork' reasons signify that the
+ specified inferior has executed a fork or vfork. The 'vforkdone'
+ reason signifies that a vforked child process has executed either
+ an exec or an exit.
+
*** Changes in GDB 7.8

* New command line options
diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
index 8d9148c..07c151b 100644
--- a/gdb/doc/gdb.texinfo
+++ b/gdb/doc/gdb.texinfo
@@ -3107,6 +3107,9 @@ create additional processes using the @code{fork} or @code{vfork} functions.
Currently, the only platforms with this feature are HP-UX (11.x and later
only?) and @sc{gnu}/Linux (kernel version 2.5.60 and later).

+The fork debugging commands are supported in both native mode and when
+connected to @code{gdbserver} using @kbd{target extended-remote}.
+
By default, when a program forks, @value{GDBN} will continue to debug
the parent process and the child process will run unimpeded.

@@ -4395,13 +4398,15 @@ Again, in this case @value{GDBN} would not be able to display syscall's names.

@item fork
@kindex catch fork
-A call to @code{fork}. This is currently only available for HP-UX
-and @sc{gnu}/Linux.
+A call to @code{fork}. This is currently only available for native
+HP-UX and @sc{gnu}/Linux, and when connected to @code{gdbserver} running
+on @sc{gnu}/Linux with @kbd{target extended-remote}.

@item vfork
@kindex catch vfork
-A call to @code{vfork}. This is currently only available for HP-UX
-and @sc{gnu}/Linux.
+A call to @code{vfork}. This is currently only available for native
+HP-UX and @sc{gnu}/Linux, and when connected to @code{gdbserver} running
+on @sc{gnu}/Linux with @kbd{target extended-remote}.

@item load @r{[}regexp@r{]}
@itemx unload @r{[}regexp@r{]}
@@ -34721,6 +34726,26 @@ The packet indicates that the loaded libraries have changed.
@value{GDBN} should use @samp{qXfer:libraries:read} to fetch a new
list of loaded libraries. The @var{r} part is ignored.

+@cindex fork events, remote reply
+@item fork
+The packet indicates that @code{fork} was called, and @var{r}
+is the ptid of the new child process. This packet is only
+applicable to targets that support fork events.
+
+@cindex vfork events, remote reply
+@item vfork
+The packet indicates that @code{vfork} was called, and @var{r}
+is the ptid of the new child process. This packet is only
+applicable to targets that support vfork events.
+
+@cindex vforkdone events, remote reply
+@item vforkdone
+The packet indicates that a child process created by a vfork
+has either called @code{exec} or terminated, so that the
+address spaces of the parent and child process are no longer
+shared. The @var{r} part is ignored. This packet is only
+applicable to targets that support vforkdone events.
+
@cindex replay log events, remote reply
@item replaylog
The packet indicates that the target cannot continue replaying
--
1.7.0.4