From patchwork Wed Jan 30 19:24:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Max Filippov X-Patchwork-Id: 10789195 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2745313BF for ; Wed, 30 Jan 2019 19:25:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 190262F8B5 for ; Wed, 30 Jan 2019 19:25:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0CD072F8E5; Wed, 30 Jan 2019 19:25:32 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.2 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,FROM_LOCAL_NOVOWEL,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 03FF72F8B5 for ; Wed, 30 Jan 2019 19:25:30 +0000 (UTC) Received: from localhost ([127.0.0.1]:43094 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1govUH-0008HU-R2 for patchwork-qemu-devel@patchwork.kernel.org; Wed, 30 Jan 2019 14:25:29 -0500 Received: from eggs.gnu.org ([209.51.188.92]:33551) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1govTY-0007sT-Te for qemu-devel@nongnu.org; Wed, 30 Jan 2019 14:24:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1govTX-0005x9-Ng for qemu-devel@nongnu.org; Wed, 30 Jan 2019 14:24:44 -0500 Received: from mail-lj1-x244.google.com ([2a00:1450:4864:20::244]:33740) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1govTX-0005nq-Fs for qemu-devel@nongnu.org; Wed, 30 Jan 2019 14:24:43 -0500 Received: by mail-lj1-x244.google.com with SMTP id v1-v6so626982ljd.0 for ; Wed, 30 Jan 2019 11:24:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=8hbffBt2PMfs04/Fr7Y45Yr1eidAL/IpZ+Rk/8lzk7k=; b=k7kJflk6muAtU6l3+RmRcpi96+hwpk0JRtBDlV1G0vd+ejGotXZa3hPcCMSf20CrGL 64dWFavYJDTF1Kadk1Cz+rY8B7lRoWrMUunc0IwX+mQ0NwfULUZ4S+DX4u0oe5NLtqwE NIQAJyV9j4UvIJZ37Ps8epAug4DjRZMKVAndz2rCi+PsGw3BCq1lpLLss8TdyqYvRPQm 34Bhp/tMfrg522oOFkg0inGcDT02BjZ9mtSvnnfBx2uToJBfiC0TIVYn8ESPjJHURkq6 7Q3T2PFKzk8mhQ9icKSM/aYk7iwoRc3p8rN2CJvWQ8usqZuNm6CF8jayzsz4xkbhSq4+ z2cQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=8hbffBt2PMfs04/Fr7Y45Yr1eidAL/IpZ+Rk/8lzk7k=; b=d8yfCvbYNl9F8uoFRvuWbDiJjp9zLSL+MzoJK+xzi6bvAKjk/oeSZD5r8kqmjxUpLo 9WFeLvdnqct8uA4aqlcmnSYap5myZ6UeMBOZhPePlciPi4gvr+2sw8g+qHQ/up0juC7E XEsZjiVb7wO7h0PdsCogsP/Br/9pO0aZ8h0OHjb2k493ZyGgdQWBOuOHoW88P9bTjIc5 ibLBZuITntLkgcyVt8UMZjGyw/kLo7ykRuCApblU58sv26Sc5chy8MsRGa7zdYrOy9a+ KJ6xeMLYQqTpkwkxBf281so2uGjntHVkY2gfyDWEo5sMo5FtXKj3ahPxkBKLTIy56fXp s0Tw== X-Gm-Message-State: AHQUAuYVvZn/lrGcb9OJbykEAezquE3CPMy63AzODbsHt0l9vX6HxoUA KxXIB3zc57viXzOmfKESqqw1JiUXz5o= X-Google-Smtp-Source: AHgI3IbBfg3HiO2jZUEPnYqs17braqdlTJ0QEnYeU4x3G5Gk5q7cd0WsQ7gA7H+XEFGvbW2H4qqIAg== X-Received: by 2002:a2e:b00a:: with SMTP id y10-v6mr2005937ljk.109.1548876263280; Wed, 30 Jan 2019 11:24:23 -0800 (PST) Received: from octofox.cadence.com (jcmvbkbc-1-pt.tunnel.tserv24.sto1.ipv6.he.net. [2001:470:27:1fa::2]) by smtp.gmail.com with ESMTPSA id f8sm490973lfe.72.2019.01.30.11.24.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 30 Jan 2019 11:24:22 -0800 (PST) From: Max Filippov To: qemu-devel@nongnu.org Date: Wed, 30 Jan 2019 11:24:03 -0800 Message-Id: <20190130192403.13754-1-jcmvbkbc@gmail.com> X-Mailer: git-send-email 2.11.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::244 Subject: [Qemu-devel] [PATCH v2] gdbstub: allow killing QEMU via vKill command X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , KONRAD Frederic , Luc Michel , Max Filippov Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP With multiprocess extensions gdb uses 'vKill' packet instead of 'k' to kill the inferior. Handle 'vKill' the same way 'k' was handled in the presence of single process. Fixes: 7cf48f6752e5 ("gdbstub: add multiprocess support to (f|s)ThreadInfo and ThreadExtraInfo") Cc: Luc Michel Signed-off-by: Max Filippov Reviewed-by: Luc Michel Reviewed-by: KONRAD Frederic Tested-By: KONRAD Frederic --- Changes v1->v2: - terminate QEMU in the vKill packet handler regardless of whatever the PID is or how many processes are attached [Luc Michel] gdbstub.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gdbstub.c b/gdbstub.c index bfc7afb50968..96ffcd9d9d1d 100644 --- a/gdbstub.c +++ b/gdbstub.c @@ -1383,6 +1383,10 @@ static int gdb_handle_packet(GDBState *s, const char *line_buf) put_packet(s, buf); break; + } else if (strncmp(p, "Kill;", 5) == 0) { + /* Kill the target */ + error_report("QEMU: Terminated via GDBstub"); + exit(0); } else { goto unknown_command; }