From patchwork Thu Aug 21 00:29:18 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Don Breazeal X-Patchwork-Id: 2469 Received: (qmail 2725 invoked by alias); 21 Aug 2014 00:33:35 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 2714 invoked by uid 89); 21 Aug 2014 00:33:34 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL, BAYES_00 autolearn=ham version=3.3.2 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 21 Aug 2014 00:33:33 +0000 Received: from svr-orw-exc-10.mgc.mentorg.com ([147.34.98.58]) by relay1.mentorg.com with esmtp id 1XKGJm-0001Zo-BJ from donb@codesourcery.com for gdb-patches@sourceware.org; Wed, 20 Aug 2014 17:33:30 -0700 Received: from SVR-ORW-FEM-04.mgc.mentorg.com ([147.34.97.41]) by SVR-ORW-EXC-10.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.4675); Wed, 20 Aug 2014 17:33:30 -0700 Received: from build4-lucid-cs (147.34.91.1) by svr-orw-fem-04.mgc.mentorg.com (147.34.97.41) with Microsoft SMTP Server id 14.2.247.3; Wed, 20 Aug 2014 17:33:29 -0700 Received: by build4-lucid-cs (Postfix, from userid 1905) id 7F7C340D74; Wed, 20 Aug 2014 17:33:29 -0700 (PDT) From: Don Breazeal To: Subject: [PATCH 10/16 v2] Extended-remote fork event documentation Date: Wed, 20 Aug 2014 17:29:18 -0700 Message-ID: <1408580964-27916-11-git-send-email-donb@codesourcery.com> In-Reply-To: <1407434395-19089-1-git-send-email-donb@codesourcery.com> References: <1407434395-19089-1-git-send-email-donb@codesourcery.com> MIME-Version: 1.0 X-IsSubscribed: yes This patch adds documentation for fork events on extended-remote linux targets in the gdb manual and the NEWS file. [This patch was approved by Eli: https://sourceware.org/ml/gdb-patches/2014-08/msg00157.html] Thanks --Don gdb/ 2014-08-20 Don Breazeal * gdb/NEWS: Describe new gdbserver support for fork events and new fork event support in RSP. gdb/doc 2014-08-20 Don Breazeal * gdb/doc/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