From patchwork Thu May 2 07:26:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jon Doron X-Patchwork-Id: 1094012 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=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="d6Tl1moU"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44vnD53pd8z9s3l for ; Thu, 2 May 2019 17:37:41 +1000 (AEST) Received: from localhost ([127.0.0.1]:46630 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hM6Hj-0002iT-DX for incoming@patchwork.ozlabs.org; Thu, 02 May 2019 03:37:39 -0400 Received: from eggs.gnu.org ([209.51.188.92]:59566) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hM69R-0004I1-Mj for qemu-devel@nongnu.org; Thu, 02 May 2019 03:29:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hM69L-0002QV-EF for qemu-devel@nongnu.org; Thu, 02 May 2019 03:29:04 -0400 Received: from mail-wr1-x442.google.com ([2a00:1450:4864:20::442]:46889) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hM69D-0000da-Ez for qemu-devel@nongnu.org; Thu, 02 May 2019 03:28:54 -0400 Received: by mail-wr1-x442.google.com with SMTP id r7so1752238wrr.13 for ; Thu, 02 May 2019 00:27:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=EShIhnyclfVo57FnSdW5zX6W2mQ/1wfNmEis7PfWfkY=; b=d6Tl1moUDm3a0ILDdl9JL/Wjh7Gt04bZJpeAZWL+5jinMNPsbKJCjs3V0bRi0Tyt4h udn9sH1oV1TqTMnI65p3Ie3yk2uNIeaF88IaThARkm8L7pvSYGAZlqwr2+FS86HraXzr VzVV6GlKOsUI+ixbbyJj20fLEOCb24tIfJBgEwp3xcHCsr+9DciBr3V8zVm2+xSkHn9k I47Wa69+MoVXRNKnsTo0Btw6/JWZDfcUkO7OEHVkeYFaADLVWZMQprsFUMfo8GwGXANc vWoVyvC+qv/epwzGGMGR4oRDAyx4yVY3THCYaAMRuxPJfO0bULVMW7OeRi/Fyu9fnU1l J2sA== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=EShIhnyclfVo57FnSdW5zX6W2mQ/1wfNmEis7PfWfkY=; b=eFZnae8qKmQDuSxPrFQdwnz+/POvMhoSRVho8Iyx5lMfU2kewT0Pv0eOSzn+dFGVO/ ItGrXyOccRvKJDJd7yFZk3oFosf/J1k6MbnsD9Ebx6aaUhZ1GnUgtU551XesayO5yw+q 2gwms51iyUsHPbIVls2JhQ0bOpgZWCpYvApJNC+HRWea07yMV0iNbaVmfwsdYKcV4pFf ZpMqu40Qs7rFO4X865i0vuAZoIVtDHELhWK7UWesRb0pAcRtWFgO6Z+cqw199agc7bF2 St6i4CEnK2JI8k3EsdPdI7t0oSeGnzc95c8MrXPg0jIH6dat7MUYw+BXKVRAat2AJ4Nv imlw== X-Gm-Message-State: APjAAAXYbPTWCtMN9jACDbM0aFvtHzvIwWRYYho3PEeyvkn1DOs3MMgs uiIF76/XZ2iCTNNWQ4HF0orH0Ias X-Google-Smtp-Source: APXvYqzNzeodl/noHVTersfyFO4OFGgz/0f6chq4x8cdR8Yc5svZD5lajj5nlSAtPoiDIUXgFcJSyg== X-Received: by 2002:a5d:6988:: with SMTP id g8mr1605893wru.117.1556782042747; Thu, 02 May 2019 00:27:22 -0700 (PDT) Received: from localhost.localdomain ([176.230.64.186]) by smtp.gmail.com with ESMTPSA id z5sm8769289wre.70.2019.05.02.00.27.21 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 02 May 2019 00:27:22 -0700 (PDT) From: Jon Doron To: qemu-devel@nongnu.org Date: Thu, 2 May 2019 10:26:30 +0300 Message-Id: <20190502072641.4667-17-arilou@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190502072641.4667-1-arilou@gmail.com> References: <20190502072641.4667-1-arilou@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::442 Subject: [Qemu-devel] [PATCH v8 16/27] gdbstub: Implement step (s pkt) with new infra 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: liran.alon@oracle.com, alex.bennee@linaro.org, Jon Doron Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Jon Doron --- gdbstub.c | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/gdbstub.c b/gdbstub.c index 9fe130f30d..9b0556f8be 100644 --- a/gdbstub.c +++ b/gdbstub.c @@ -1805,6 +1805,16 @@ static void handle_file_io(GdbCmdContext *gdb_ctx, void *user_ctx) gdb_continue(gdb_ctx->s); } +static void handle_step(GdbCmdContext *gdb_ctx, void *user_ctx) +{ + if (gdb_ctx->num_params) { + gdb_set_cpu_pc(gdb_ctx->s, (target_ulong)gdb_ctx->params[0].val_ull); + } + + cpu_single_step(gdb_ctx->s->c_cpu, sstep_flags); + gdb_continue(gdb_ctx->s); +} + static int gdb_handle_packet(GDBState *s, const char *line_buf) { CPUState *cpu; @@ -1937,13 +1947,16 @@ static int gdb_handle_packet(GDBState *s, const char *line_buf) } break; case 's': - if (*p != '\0') { - addr = strtoull(p, (char **)&p, 16); - gdb_set_cpu_pc(s, addr); + { + static const GdbCmdParseEntry step_cmd_desc = { + .handler = handle_step, + .cmd = "s", + .cmd_startswith = 1, + .schema = "L0" + }; + cmd_parser = &step_cmd_desc; } - cpu_single_step(s->c_cpu, sstep_flags); - gdb_continue(s); - return RS_IDLE; + break; case 'F': { static const GdbCmdParseEntry file_io_cmd_desc = {