From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 47228 invoked by alias); 18 Mar 2016 00:12:59 -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 47216 invoked by uid 89); 18 Mar 2016 00:12:58 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=presently X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Fri, 18 Mar 2016 00:12:57 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id 7AB6D460; Fri, 18 Mar 2016 00:12:56 +0000 (UTC) Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u2I0CsLb008277; Thu, 17 Mar 2016 20:12:55 -0400 Subject: Re: [PATCH] gdb/remote: Don't use vKill if multi-process features are disabled To: Andrew Burgess References: <1458252144-3496-1-git-send-email-andrew.burgess@embecosm.com> <56EB2DD1.4090103@redhat.com> <20160317232658.GY14100@embecosm.com> Cc: gdb-patches@sourceware.org From: Pedro Alves Message-ID: <56EB4806.7070505@redhat.com> Date: Fri, 18 Mar 2016 00:12:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <20160317232658.GY14100@embecosm.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2016-03/txt/msg00321.txt.bz2 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;")) { Thanks, Pedro Alves