From patchwork Fri Mar 14 07:22:41 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Hui Zhu X-Patchwork-Id: 80 Return-Path: X-Original-To: siddhesh@wilcox.dreamhost.com Delivered-To: siddhesh@wilcox.dreamhost.com Received: from homiemail-mx23.g.dreamhost.com (caibbdcaabja.dreamhost.com [208.113.200.190]) by wilcox.dreamhost.com (Postfix) with ESMTP id 2940C3600D0 for ; Fri, 14 Mar 2014 00:22:53 -0700 (PDT) Received: by homiemail-mx23.g.dreamhost.com (Postfix, from userid 14314964) id D1E9061C8492F; Fri, 14 Mar 2014 00:22:52 -0700 (PDT) X-Original-To: gdb@patchwork.siddhesh.in Delivered-To: x14314964@homiemail-mx23.g.dreamhost.com Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by homiemail-mx23.g.dreamhost.com (Postfix) with ESMTPS id A6D4A61C8492F for ; Fri, 14 Mar 2014 00:22:52 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:message-id:date:from:mime-version:to:cc :subject:content-type:content-transfer-encoding; q=dns; s= default; b=MEpiR3N3n45II4aOshYWnke2TEv/7GdEFRU5k+tEoPjdytZYrvEEk Pj08GkMGBKDOM8AjhGMLKSCV0qapWj47JpRSuLjs9WnK86kN4BIs0v80wFaMzL2+ IZYxX3sXBm6ji0LAFD7dtaMNA6m7Hs6uOTnlTmiFQMLFhqV5ppyP3k= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:message-id:date:from:mime-version:to:cc :subject:content-type:content-transfer-encoding; s=default; bh=s QZ+xH5kQ5/eA/+/UP0qMThmXa0=; b=ZUvGbvJ3RdjkEgUm8ZHEd6v5pTRXGKdp4 iSIpJ2YEODwVEN/cwO/owK4ki4SaM/zw/ZAWLnGfUU9dVKlp6BZEpsgRWn0Fbm0f R/7+m37olaMKyowsJ8JDlKy9Gu5vW5d4jtTGTUDP2PusnYjVSymFIhA6qYauMxav 9aUglgqTfo= Received: (qmail 17290 invoked by alias); 14 Mar 2014 07:22:49 -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 17274 invoked by uid 89); 14 Mar 2014 07:22:48 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL, BAYES_00 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, 14 Mar 2014 07:22:47 +0000 Received: from svr-orw-exc-10.mgc.mentorg.com ([147.34.98.58]) by relay1.mentorg.com with esmtp id 1WOMS4-0003LE-3l from Hui_Zhu@mentor.com ; Fri, 14 Mar 2014 00:22:44 -0700 Received: from SVR-ORW-FEM-03.mgc.mentorg.com ([147.34.97.39]) by SVR-ORW-EXC-10.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.4675); Fri, 14 Mar 2014 00:22:44 -0700 Received: from localhost.localdomain (147.34.91.1) by svr-orw-fem-03.mgc.mentorg.com (147.34.97.39) with Microsoft SMTP Server id 14.2.247.3; Fri, 14 Mar 2014 00:22:42 -0700 Message-ID: <5322AE41.4050008@mentor.com> Date: Fri, 14 Mar 2014 15:22:41 +0800 From: Hui Zhu User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 MIME-Version: 1.0 To: gdb-patches ml CC: Eli Zaretskii Subject: [PATCH/doc] Remove fixme of packet "k" X-IsSubscribed: yes X-DH-Original-To: gdb@patchwork.siddhesh.in Current introduction of 'k' is: ‘k’ Kill request. FIXME: There is no description of how to operate when a specific thread context has been selected (i.e. does 'k' kill only that thread?). I checked the code about this part: In GDB side: static void remote_kill (struct target_ops *ops) { volatile struct gdb_exception ex; /* Catch errors so the user can quit from gdb even when we aren't on speaking terms with the remote system. */ TRY_CATCH (ex, RETURN_MASK_ERROR) { putpkt ("k"); } if (ex.reason < 0) { if (ex.error == TARGET_CLOSE_ERROR) { /* If we got an (EOF) error that caused the target to go away, then we're done, that's what we wanted. "k" is susceptible to cause a premature EOF, given that the remote server isn't actually required to reply to "k", and it can happen that it doesn't even get to reply ACK to the "k". */ return; } /* Otherwise, something went wrong. We didn't actually kill the target. Just propagate the exception, and let the user o:r higher layers decide what to do. */ throw_exception (ex); } /* We've killed the remote end, we get to mourn it. Since this is target remote, single-process, mourning the inferior also unpushes remote_ops. */ target_mourn_inferior (); } static void extended_remote_kill (struct target_ops *ops) { int res; int pid = ptid_get_pid (inferior_ptid); struct remote_state *rs = get_remote_state (); res = remote_vkill (pid, rs); if (res == -1 && !(rs->extended && remote_multi_process_p (rs))) { /* Don't try 'k' on a multi-process aware stub -- it has no way to specify the pid. */ putpkt ("k"); #if 0 getpkt (&rs->buf, &rs->buf_size, 0); if (rs->buf[0] != 'O' || rs->buf[0] != 'K') res = 1; #else /* Don't wait for it to die. I'm not really sure it matters whether we do or not. For the existing stubs, kill is a noop. */ res = 0; #endif } if (res != 0) error (_("Can't kill process")); target_mourn_inferior (); } In gdbserver side: fprintf (stderr, "Killing all inferiors\n"); for_each_inferior (&all_processes, kill_inferior_callback); /* When using the extended protocol, we wait with no program running. The traditional protocol will exit instead. */ if (extended_protocol) { last_status.kind = TARGET_WAITKIND_EXITED; last_status.value.sig = GDB_SIGNAL_KILL; return 0; } else exit (0); So make a patch update doc of 'k' to: ‘k’ Kill all processes. The ‘k’ packet has no reply. Thanks, Hui 2014-03-14 Hui Zhu * gdb.texinfo (Packets): Update introduction of 'k'. --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -33952,11 +33952,9 @@ step packet}. @item k @cindex @samp{k} packet -Kill request. +Kill all processes. -FIXME: @emph{There is no description of how to operate when a specific -thread context has been selected (i.e.@: does 'k' kill only that -thread?)}. +The @samp{k} packet has no reply. @item m @var{addr},@var{length} @cindex @samp{m} packet