From nobody Sat Nov 8 05:40:39 2025 Delivered-To: importer@patchew.org Received-SPF: temperror (zoho.com: Error in retrieving data from DNS) 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; spf=temperror (zoho.com: Error in retrieving data from DNS) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1550008367697124.96859281690138; Tue, 12 Feb 2019 13:52:47 -0800 (PST) Received: from localhost ([127.0.0.1]:46644 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gtfyl-0008GH-8R for importer@patchew.org; Tue, 12 Feb 2019 16:52:35 -0500 Received: from eggs.gnu.org ([209.51.188.92]:41054) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gtfuH-0005bE-Go for qemu-devel@nongnu.org; Tue, 12 Feb 2019 16:47:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gtfuG-0004i4-Ge for qemu-devel@nongnu.org; Tue, 12 Feb 2019 16:47:57 -0500 Received: from relay1.mentorg.com ([192.94.38.131]:63008) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gtfu9-00047A-Es; Tue, 12 Feb 2019 16:47:53 -0500 Received: from svr-orw-mbx-03.mgc.mentorg.com ([147.34.90.203]) by relay1.mentorg.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-SHA384:256) id 1gtftk-0004R3-1J from Sandra_Loosemore@mentor.com ; Tue, 12 Feb 2019 13:47:24 -0800 Received: from anura.Home (147.34.91.1) by svr-orw-mbx-03.mgc.mentorg.com (147.34.90.203) with Microsoft SMTP Server (TLS) id 15.0.1320.4; Tue, 12 Feb 2019 13:47:21 -0800 From: Sandra Loosemore To: Date: Tue, 12 Feb 2019 14:47:13 -0700 Message-ID: <1550008033-26540-1-git-send-email-sandra@codesourcery.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-ClientProxiedBy: SVR-ORW-MBX-07.mgc.mentorg.com (147.34.90.207) To svr-orw-mbx-03.mgc.mentorg.com (147.34.90.203) X-detected-operating-system: by eggs.gnu.org: Windows NT kernel [generic] [fuzzy] X-Received-From: 192.94.38.131 Subject: [Qemu-devel] [PATCH] gdbstub: Send a reply to the vKill packet. 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: qemu-trivial@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Per the GDB remote protocol documentation https://sourceware.org/gdb/current/onlinedocs/gdb/Packets.html#index-vKill-= packet the debug stub is expected to send a reply to the 'vKill' packet. At least some versions of GDB crash if the gdb stub simply exits without sending a reply. This patch fixes QEMU's gdb stub to conform to the expected behavior. Note that QEMU's existing handling of the legacy 'k' packet is correct: in that case GDB does not expect a reply, and QEMU does not send one. Signed-off-by: Sandra Loosemore --- gdbstub.c | 1 + 1 file changed, 1 insertion(+) diff --git a/gdbstub.c b/gdbstub.c index 70cf330..eb129f6 100644 --- a/gdbstub.c +++ b/gdbstub.c @@ -1363,6 +1363,7 @@ static int gdb_handle_packet(GDBState *s, const char = *line_buf) break; } else if (strncmp(p, "Kill;", 5) =3D=3D 0) { /* Kill the target */ + put_packet(s, "OK"); error_report("QEMU: Terminated via GDBstub"); exit(0); } else { --=20 2.8.1