From nobody Fri May 3 20:21:17 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=gmail.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1548876356142832.6182019729532; Wed, 30 Jan 2019 11:25:56 -0800 (PST) Received: from localhost ([127.0.0.1]:43094 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1govUY-0008HU-O7 for importer@patchew.org; Wed, 30 Jan 2019 14:25:46 -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) 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) 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) 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+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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: KONRAD Frederic Reviewed-by: Luc Michel 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) =20 put_packet(s, buf); break; + } else if (strncmp(p, "Kill;", 5) =3D=3D 0) { + /* Kill the target */ + error_report("QEMU: Terminated via GDBstub"); + exit(0); } else { goto unknown_command; } --=20 2.11.0