From nobody Tue Feb 10 09:10:30 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1512998659730494.59253288833975; Mon, 11 Dec 2017 05:24:19 -0800 (PST) Received: from localhost ([::1]:52995 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eOO47-0002IX-3z for importer@patchew.org; Mon, 11 Dec 2017 08:24:15 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33334) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eOO24-0000Eq-VI for qemu-devel@nongnu.org; Mon, 11 Dec 2017 08:22:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eOO24-0001ng-3Q for qemu-devel@nongnu.org; Mon, 11 Dec 2017 08:22:08 -0500 Received: from mail.ispras.ru ([83.149.199.45]:43356) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eOO23-0001n5-SE for qemu-devel@nongnu.org; Mon, 11 Dec 2017 08:22:08 -0500 Received: from Misha-PC.lan02.inno (unknown [85.142.117.226]) by mail.ispras.ru (Postfix) with ESMTPSA id 18FE654006A; Mon, 11 Dec 2017 16:22:07 +0300 (MSK) From: Mihail Abakumov To: qemu-devel@nongnu.org Date: Mon, 11 Dec 2017 16:21:52 +0300 Message-ID: <151299851239.4808.11884579603571802758.stgit@Misha-PC.lan02.inno> In-Reply-To: <151299847127.4808.14646046517426494416.stgit@Misha-PC.lan02.inno> References: <151299847127.4808.14646046517426494416.stgit@Misha-PC.lan02.inno> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 83.149.199.45 Subject: [Qemu-devel] [PATCH v4 06/46] windbg: added WindbgState 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: sw@weilnetz.de, lprosek@redhat.com, dovgaluk@ispras.ru, rkagan@virtuozzo.com, pbonzini@redhat.com, den@openvz.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Added definition of the WindbgState struct and its initialization. Signed-off-by: Mihail Abakumov Signed-off-by: Pavel Dovgalyuk Signed-off-by: Dmitriy Koltunov --- windbgstub.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/windbgstub.c b/windbgstub.c index 3830446988..0863da73fd 100755 --- a/windbgstub.c +++ b/windbgstub.c @@ -10,10 +10,38 @@ */ =20 #include "qemu/osdep.h" +#include "qapi/error.h" +#include "chardev/char.h" +#include "chardev/char-fe.h" +#include "qemu/cutils.h" #include "exec/windbgstub.h" #include "exec/windbgstub-utils.h" =20 +typedef struct WindbgState { + bool is_loaded; + + uint32_t ctrl_packet_id; + uint32_t data_packet_id; +} WindbgState; + +static WindbgState *windbg_state; + +static void windbg_exit(void) +{ + g_free(windbg_state); +} + int windbg_server_start(const char *device) { + if (windbg_state) { + WINDBG_ERROR("Multiple instances of windbg are not supported."); + exit(1); + } + + windbg_state =3D g_new0(WindbgState, 1); + windbg_state->ctrl_packet_id =3D RESET_PACKET_ID; + windbg_state->data_packet_id =3D INITIAL_PACKET_ID; + + atexit(windbg_exit); return 0; }