From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11384 invoked by alias); 18 Mar 2016 06:28:14 -0000 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 Received: (qmail 11364 invoked by uid 89); 18 Mar 2016 06:28:13 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 spammy=straight, armed, 2016-03-18, 20160318 X-HELO: mail-wm0-f41.google.com Received: from mail-wm0-f41.google.com (HELO mail-wm0-f41.google.com) (74.125.82.41) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Fri, 18 Mar 2016 06:28:03 +0000 Received: by mail-wm0-f41.google.com with SMTP id p65so22887703wmp.0 for ; Thu, 17 Mar 2016 23:28:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=0T49aziJjaYTqTr8wmkxtNF3OlUvhX05vNue4Ve6U+0=; b=F1FjI9qgJfPHdBIpgrabcHESo+/L6xl9RVmtCgYIuFSbKUxoa7cZFErxX8361tU4ma ig7uDnp4HD3H3EolkIboKk/DYw3/Fp0C2vk2d1gOlb+YLxJ3MYFAHdrMel9ealA6nRWg zKDp9cblwL+Mue3CqMBoc6CtBkdQ5hgpWQt/Khk0lbwb01lHtxfTW1GPpIwHT0XSo93H ox30cpZwMlPQ/yEm/mQA7bxfNsCX9tQPBsXPSaGiYjpFsZ4+wCsooC7FQNrYhRNxXpMK hsYbkRaxBUcmKMKcLkwsE8d1llEmYrA26APi8Vm3gJx5eYVkGGlJzFT2PY+WEg/LWCo1 E5sQ== X-Gm-Message-State: AD7BkJJ3uvWAoJ+gYgW3wsx2Kh0YGSmakTMAImEpM21Un+lXseO3qj1op+3CBJ33F92amQ== X-Received: by 10.28.127.151 with SMTP id a145mr7429358wmd.53.1458282480282; Thu, 17 Mar 2016 23:28:00 -0700 (PDT) Received: from localhost ([46.189.28.226]) by smtp.gmail.com with ESMTPSA id u4sm10780510wjz.4.2016.03.17.23.27.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 17 Mar 2016 23:27:59 -0700 (PDT) Date: Fri, 18 Mar 2016 06:28:00 -0000 From: Andrew Burgess To: Pedro Alves Cc: gdb-patches@sourceware.org Subject: Re: [PATCH] gdb/remote: Don't use vKill if multi-process features are disabled Message-ID: <20160318062747.GZ14100@embecosm.com> References: <1458252144-3496-1-git-send-email-andrew.burgess@embecosm.com> <56EB2DD1.4090103@redhat.com> <20160317232658.GY14100@embecosm.com> <56EB4806.7070505@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <56EB4806.7070505@redhat.com> X-Editor: GNU Emacs [ http://www.gnu.org/software/emacs ] User-Agent: Mutt/1.5.24 (2015-08-30) X-IsSubscribed: yes X-SW-Source: 2016-03/txt/msg00322.txt.bz2 * Pedro Alves [2016-03-18 00:12:54 +0000]: > On 03/17/2016 11:26 PM, Andrew Burgess wrote: > > > The gdb remote protocol documentation is clear that the vKill command > > should not be used unless the multi-process feature is reported as > > supported by the remote target. > > Sorry, you were too fast... :-/ > > I recalled a reason to keep it. The original reason for the docs saying > that is that vKill includes a PID, and without multi-process extensions, > there's no known non-fake PID to send. (GDB is presently sending a > fake PID, as you've probably noticed). > > The other-than-the-pid advantage of vKill over "k", is that "k" has > no reply, and thus no way to return error, failure to kill, etc. > > Note gdbserver is making use of vKill with multi-process off: > > /* Kill process. Return 1 if successful, 0 if failure. */ > static int > handle_v_kill (char *own_buf) > { > int pid; > char *p = &own_buf[6]; > if (multi_process) > pid = strtol (p, NULL, 16); > else > pid = signal_pid; > if (pid != 0 && kill_inferior (pid) == 0) > > So we could just not include the "pid" part if multi-process > is off, similar to D vs D;pid. We'd still need the ";", due > to gdbserver's: > > if (startswith (own_buf, "vKill;")) > { OK, armed with this new insight I read the docs again, and now I see that indeed my initial interpretation was not correct. I see if I can come up with a wording that feels clearer. Thank you for setting me straight. Andrew