From patchwork Fri Oct 31 23:28:48 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Don Breazeal X-Patchwork-Id: 3525 Received: (qmail 30121 invoked by alias); 31 Oct 2014 23:30:23 -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 30043 invoked by uid 89); 31 Oct 2014 23:30:22 -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, RCVD_IN_DNSWL_NONE 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; Fri, 31 Oct 2014 23:30:19 +0000 Received: from svr-orw-fem-06.mgc.mentorg.com ([147.34.97.120]) by relay1.mentorg.com with esmtp id 1XkLe4-0002Bt-LJ from Don_Breazeal@mentor.com for gdb-patches@sourceware.org; Fri, 31 Oct 2014 16:30:16 -0700 Received: from build4-lucid-cs (147.34.91.1) by SVR-ORW-FEM-06.mgc.mentorg.com (147.34.97.120) with Microsoft SMTP Server id 14.3.181.6; Fri, 31 Oct 2014 16:30:15 -0700 Received: by build4-lucid-cs (Postfix, from userid 1905) id 5BAA640DDD; Fri, 31 Oct 2014 16:30:15 -0700 (PDT) From: Don Breazeal To: Subject: [PATCH 10/16 v3] Extended-remote fork event documentation Date: Fri, 31 Oct 2014 16:28:48 -0700 Message-ID: <1414798134-11536-8-git-send-email-donb@codesourcery.com> In-Reply-To: <1408580964-27916-1-git-send-email-donb@codesourcery.com> References: <1408580964-27916-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 01cdc36..1c07663 100644 --- a/gdb/NEWS +++ b/gdb/NEWS @@ -59,6 +59,21 @@ SGI Irix-6.x mips-*-irix6* VAX running (4.2 - 4.3 Reno) BSD vax-*-bsd* VAX running Ultrix vax-*-ultrix* +* 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 15c2908..9787623 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. @@ -4387,13 +4390,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{]} @@ -34700,6 +34705,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