Received: from eggs.gnu.org ([2001:4830:134:3::10]:59580) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c07jI-0005wQ-5B for qemu-devel@nongnu.org; Fri, 28 Oct 2016 10:02:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c07jC-0005VQ-Cn for qemu-devel@nongnu.org; Fri, 28 Oct 2016 10:01:56 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35532) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1c07jC-0005Ua-5S for qemu-devel@nongnu.org; Fri, 28 Oct 2016 10:01:50 -0400 References: <1476445983-16661-1-git-send-email-imbrenda@linux.vnet.ibm.com> <1476445983-16661-3-git-send-email-imbrenda@linux.vnet.ibm.com> <6ff5fd4e-d371-f204-371a-07edcb545e93@redhat.com> <91243842-10e9-666b-83e8-e271322371f7@linux.vnet.ibm.com> From: Pedro Alves Message-ID: <77a33e01-6293-8112-7fe2-4790ca13f736@redhat.com> Date: Fri, 28 Oct 2016 15:01:44 +0100 MIME-Version: 1.0 In-Reply-To: <91243842-10e9-666b-83e8-e271322371f7@linux.vnet.ibm.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v2 2/2] gdbstub: Fix vCont behaviour List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Claudio Imbrenda , Christian Borntraeger , qemu-devel@nongnu.org Cc: Peter Maydell , Paolo Bonzini On 10/28/2016 02:35 PM, Claudio Imbrenda wrote: > On 27/10/16 13:40, Pedro Alves wrote: >> I'm not a qemu gdbstub expert, but FYI, seeing this reminded me to pus= h >> to gdb's master a (getting old) gdb patch that clarifies how vCont act= ions >> should be interpreted: >> >> https://sourceware.org/ml/gdb-patches/2016-02/msg00493.html >> >> It's already live at: >> >> https://sourceware.org/gdb/current/onlinedocs/gdb/Packets.html >> >> (The "already running" case is for non-stop mode, which qemu >> probably doesn't support.) >=20 > From the new specifications I seem to understand that if I specify a > default as first action, then no further actions will be considered, > since it matches all threads? Right. >=20 > e.g. vCont;c;s:1 will ignore the s:1 because the c was specified > earlier and it matches all threads, and therefore it's the leftmost > match? do I understand correctly? Yes. Note that GDB never ever sent a vCont like that. It's always put the default action last. So in practice, it doesn't change any behavior. OTOH, stubs can be simpler, given there's no need to special-case the default action. (Also, with this definition we can safely break a big vCont packet in multiple smaller ones, in non-stop mode: vCont;s:1;c =3D=3D vCont;s:1 + vCont;c vCont;c;s:1 =3D=3D vCont;c + vCont;s:1 vCont;s:1;s:2;s:3;s:3;s:4;...s:N;c =3D=3D vCont;s:1;s:2;s:3 + vCont;s:4;= ...s:N;c etc. ) >=20 > Or does the default only match any thread without an explicit match? > (which is how I interpreted the old spec) Maybe I should just remove all mentions of a "default" from the text? Like: diff --git c/gdb/doc/gdb.texinfo w/gdb/doc/gdb.texinfo index d636a16..df548dc 100644 --- c/gdb/doc/gdb.texinfo +++ w/gdb/doc/gdb.texinfo @@ -35538,9 +35538,8 @@ syntax described in @ref{thread-id syntax}. If m= ultiprocess extensions (@pxref{multiprocess extensions}) are supported, actions can be specified to match all threads in a process by using the @samp{p@var{pid}.-1} form of the @var{thread-id}. An action with no -@var{thread-id} is called the default action and matches all threads. -Specifying multiple default actions is an error; specifying no actions -is also an error. +@var{thread-id} matches all threads. Specifying no actions is an +error. I.e., go from this: ~~~ For each inferior thread, the leftmost action with a matching thread-id is applied. Threads that don=92t match any action remain in their current state. Thread IDs are specified using the syntax described in thread-id syntax. If multiprocess extensions (see multiprocess extensions) are supported, actions can be specified to match all threads in a process by using the =91ppid.-1=92 form of the thread-id. An action with no thread-id is called the default action and matches all threads. Specifying multiple default actions is an error; specifying no actions is also an error. ~~~ To this: ~~~ For each inferior thread, the leftmost action with a matching thread-id is applied. Threads that don=92t match any action remain in their current state. Thread IDs are specified using the syntax described in thread-id syntax. If multiprocess extensions (see multiprocess extensions) are supported, actions can be specified to match all threads in a process by using the =91ppid.-1=92 form of the thread-id. An action with no thread-id matches all threads. Specifying no actions is an error. ~~~ Would that help ? Thanks, Pedro Alves