From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17191 invoked by alias); 26 Jan 2012 21:50:58 -0000 Received: (qmail 17176 invoked by uid 22791); 26 Jan 2012 21:50:57 -0000 X-SWARE-Spam-Status: No, hits=-6.6 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 26 Jan 2012 21:50:44 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q0QLohZE013562 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 26 Jan 2012 16:50:44 -0500 Received: from host2.jankratochvil.net (ovpn-116-47.ams2.redhat.com [10.36.116.47]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q0QLodVd003273 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Thu, 26 Jan 2012 16:50:42 -0500 Date: Thu, 26 Jan 2012 21:56:00 -0000 From: Jan Kratochvil To: Pedro Alves Cc: gdb-patches@sourceware.org Subject: [patch] protocol doc vs. gdbserver on H and pPID.-1 etc. [Re: [patch 2/2] Fix watchpoints for multi-inferior #2] Message-ID: <20120126215039.GA6943@host2.jankratochvil.net> References: <20120102164652.GB10231@host2.jankratochvil.net> <4F02020F.5090906@gmail.com> <20120120213110.GB424@host2.jankratochvil.net> <4F1EAFE6.30202@redhat.com> <20120125152240.GA26914@host2.jankratochvil.net> <4F203B6A.7090605@redhat.com> <4F204408.4090607@redhat.com> <4F205F3C.7090406@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4F205F3C.7090406@redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2012-01/txt/msg00921.txt.bz2 On Wed, 25 Jan 2012 20:59:56 +0100, Pedro Alves wrote: > Makes no sense setting the cont_thread to a process wildcard, there's no > such thing in the protocol. So this brings in a variant of your patch, > that fixes it early on, instead of late in the target, along with clearing > cont_thread on vRun. This behavior matches what what does gdbserver for the `H' packet - it also does not recognize pPID.-1. But gdb.texinfo implicitly says pPID.-1 should be recognized as pPID but that does not correspond to what gdbserver does. So I made somehow doc <-> gdbserver in sync and made it all more clear. Do you agree with it this way? (I do not think that patch of yours / idea of it comes from me, feel free to even remove my credit but I am also fine with the credit kept there.) No regressions on {x86_64,x86_64-m32,i686}-fedorarawhide-linux-gnu in gdbserver mode. Thanks, Jan gdb/doc/ 2012-01-26 Jan Kratochvil * gdb.texinfo (Packets): Document values for the `H' packet. Deprecate `Hc'. gdb/gdbserver/ 2012-01-26 Jan Kratochvil * server.c (cont_thread): New comment for it. (process_serial_event): Handle pPID.-1 values for 'H'. --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -33798,7 +33798,13 @@ it should be @samp{c} for step and continue operations (note that this is deprecated, supporting the @samp{vCont} command is a better option), @samp{g} for other operations. The thread designator @var{thread-id} has the format and interpretation described in -@ref{thread-id syntax}. +@ref{thread-id syntax} - value @samp{0} will act like @samp{-1} - to +choose all threads of all inferiors. @samp{pPID} (or equivalent +@samp{pPID.-1}) means to choose any single thread of that @samp{PID}. +It does not mean all threads of that @samp{PID} process - use +@samp{vCont} packet instead in such case. + +Use of @samp{Hc} is deprecated in favor of @xref{vCont packet}. Reply: @table @samp --- a/gdb/gdbserver/server.c +++ b/gdb/gdbserver/server.c @@ -29,7 +29,15 @@ #include #endif +/* Deprecated. See gdb.texinfo description of the `Hc' packet - use + 'vCont' packet instead. It can be null_ptid for no inferior, + minus_one_ptid for resuming all inferior or a specific thread ptid_t. + Particularly process wildcard (pid > 0 && lwp == -1) for resuming + whole one inferior is not supported. This variable is provided only + for backward compatibility with both clients and backend, backend + 'resume' method supports process wildcards instead. */ ptid_t cont_thread; + ptid_t general_thread; int server_waiting; @@ -2980,8 +2988,8 @@ process_serial_event (void) || ptid_equal (gdb_id, minus_one_ptid)) thread_id = null_ptid; else if (pid != 0 - && ptid_equal (pid_to_ptid (pid), - gdb_id)) + && (ptid_equal (pid_to_ptid (pid), gdb_id) + || ptid_equal (ptid_build (pid, -1, 0), gdb_id))) { struct thread_info *thread = (struct thread_info *) find_inferior (&all_threads,