From nobody Tue Feb 10 20:14:37 2026 Delivered-To: importer@patchew.org Received-SPF: temperror (zoho.com: Error in retrieving data from DNS) 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=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 (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1508246402984616.921570064716; Tue, 17 Oct 2017 06:20:02 -0700 (PDT) Received: from localhost ([::1]:39194 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e4Rmd-0002xG-6S for importer@patchew.org; Tue, 17 Oct 2017 09:19:47 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:32804) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e4Rcf-0002sd-9y for qemu-devel@nongnu.org; Tue, 17 Oct 2017 09:09:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e4RcZ-0004jP-DE for qemu-devel@nongnu.org; Tue, 17 Oct 2017 09:09:29 -0400 Received: from mail.ispras.ru ([83.149.199.45]:56504) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e4RcZ-0004im-5y for qemu-devel@nongnu.org; Tue, 17 Oct 2017 09:09:23 -0400 Received: from Misha-PC.lan02.inno (unknown [85.142.117.226]) by mail.ispras.ru (Postfix) with ESMTPSA id 735DD54006B; Tue, 17 Oct 2017 16:09:21 +0300 (MSK) From: Mihail Abakumov To: qemu-devel@nongnu.org Date: Tue, 17 Oct 2017 16:09:19 +0300 Message-ID: <150824575888.6816.8665703540737889367.stgit@Misha-PC.lan02.inno> In-Reply-To: <150824572545.6816.5099701189660002212.stgit@Misha-PC.lan02.inno> References: <150824572545.6816.5099701189660002212.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 v2 05/43] windbg: added helper features 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_6 Z_629925259 SPT_0 Added some helper features for windbgstub. Signed-off-by: Mihail Abakumov Signed-off-by: Pavel Dovgalyuk Signed-off-by: Dmitriy Koltunov --- include/exec/windbgstub-utils.h | 34 ++++++++++++++++++++++++++++++++++ include/exec/windbgstub.h | 6 ++++++ 2 files changed, 40 insertions(+) diff --git a/include/exec/windbgstub-utils.h b/include/exec/windbgstub-util= s.h index 2390597f1f..1c27ee4ce8 100755 --- a/include/exec/windbgstub-utils.h +++ b/include/exec/windbgstub-utils.h @@ -13,7 +13,41 @@ #define WINDBGSTUB_UTILS_H =20 #include "qemu/osdep.h" +#include "qemu/error-report.h" +#include "log.h" +#include "cpu.h" #include "exec/windbgstub.h" #include "exec/windbgkd.h" =20 +#ifndef TARGET_I386 +#error Unsupported Architecture +#endif +#ifdef TARGET_X86_64 /* Unimplemented yet */ +#error Unsupported Architecture +#endif + +# define WINDBG_DEBUG(...) do { \ + if (WINDBG_DEBUG_ON) { \ + qemu_log(WINDBG ": " __VA_ARGS__); \ + qemu_log("\n"); \ + } \ +} while (false) + +#define WINDBG_ERROR(...) error_report(WINDBG ": " __VA_ARGS__) + +#define FMT_ADDR "addr:0x" TARGET_FMT_lx +#define FMT_ERR "Error:%d" + +#define UINT8_P(ptr) ((uint8_t *) (ptr)) +#define UINT32_P(ptr) ((uint32_t *) (ptr)) +#define PTR(var) UINT8_P(&var) + +#define sizeof_field(type, field) sizeof(((type *) NULL)->field) + +#define READ_VMEM(cpu, addr, type) ({ \ + type _t; \ + cpu_memory_rw_debug(cpu, addr, PTR(_t), sizeof(type), 0); \ + _t; \ +}) + #endif diff --git a/include/exec/windbgstub.h b/include/exec/windbgstub.h index 1a6e1cc6e5..21bc552e58 100755 --- a/include/exec/windbgstub.h +++ b/include/exec/windbgstub.h @@ -12,6 +12,12 @@ #ifndef WINDBGSTUB_H #define WINDBGSTUB_H =20 +#define WINDBG "windbg" + +#ifndef WINDBG_DEBUG_ON +#define WINDBG_DEBUG_ON false +#endif + int windbg_server_start(const char *device); =20 #endif