From patchwork Tue Oct 17 13:10:32 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mikhail Abakumov X-Patchwork-Id: 826994 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3yGbZN4j0Pz9sBZ for ; Wed, 18 Oct 2017 00:26:52 +1100 (AEDT) Received: from localhost ([::1]:39244 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e4RtS-0000GW-Dd for incoming@patchwork.ozlabs.org; Tue, 17 Oct 2017 09:26:50 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33660) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e4Rdo-0003ww-Op for qemu-devel@nongnu.org; Tue, 17 Oct 2017 09:10:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e4Rdj-0005XU-VE for qemu-devel@nongnu.org; Tue, 17 Oct 2017 09:10:40 -0400 Received: from mail.ispras.ru ([83.149.199.45]:56836) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e4Rdj-0005Wt-NG for qemu-devel@nongnu.org; Tue, 17 Oct 2017 09:10:35 -0400 Received: from Misha-PC.lan02.inno (unknown [85.142.117.226]) by mail.ispras.ru (Postfix) with ESMTPSA id 9872554006B; Tue, 17 Oct 2017 16:10:34 +0300 (MSK) From: Mihail Abakumov To: qemu-devel@nongnu.org Date: Tue, 17 Oct 2017 16:10:32 +0300 Message-ID: <150824583198.6816.6831787773022564675.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 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 18/43] windbg: windbg_vm_stop 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Added function for stop vm. Also, ExceptionStateChange data is generated and sent here. Signed-off-by: Mihail Abakumov Signed-off-by: Pavel Dovgalyuk Signed-off-by: Dmitriy Koltunov --- windbgstub.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/windbgstub.c b/windbgstub.c index b71449e369..dc9eba3e3c 100755 --- a/windbgstub.c +++ b/windbgstub.c @@ -71,7 +71,6 @@ static uint32_t compute_checksum(uint8_t *data, uint16_t len) return checksum; } -__attribute__ ((unused)) /* unused yet */ static void windbg_send_data_packet(uint8_t *data, uint16_t byte_count, uint16_t type) { @@ -116,6 +115,16 @@ static void windbg_send_control_packet(uint16_t type) windbg_state->ctrl_packet_id ^= 1; } +static void windbg_vm_stop(void) +{ + CPUState *cpu = qemu_get_cpu(0); + vm_stop(RUN_STATE_PAUSED); + + SizedBuf buf = kd_gen_exception_sc(cpu); + windbg_send_data_packet(buf.data, buf.size, PACKET_TYPE_KD_STATE_CHANGE64); + SBUF_FREE(buf); +} + static void windbg_process_data_packet(ParsingContext *ctx) {} @@ -129,7 +138,7 @@ static void windbg_ctx_handler(ParsingContext *ctx) break; case RESULT_BREAKIN_BYTE: - vm_stop(RUN_STATE_PAUSED); + windbg_vm_stop(); break; case RESULT_CONTROL_PACKET: