From patchwork Fri Jun 7 09:05:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 166132 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp450435ili; Fri, 7 Jun 2019 03:24:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqwkjavEIpzWAIzwS6AUTwBOoQxyL75/J4XlAmQOgWjq6QCWeRHpx3Uv8ifhHQwTSLpJqpae X-Received: by 2002:ac8:4601:: with SMTP id p1mr45392263qtn.181.1559903087028; Fri, 07 Jun 2019 03:24:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559903087; cv=none; d=google.com; s=arc-20160816; b=mT8YOklxJQGfRDz5RtPLsxm6qxgfm87QyNYVp7m9t7HJu66dQLeEKyTMEowXkL41Du 4oNZYhT25I6Dc3rFLkM2fzaRjcR9ueHAsluo4LLVfnPeD8ZHmtJdaCjWFx6GAGs/PYOq iQdK5BuS2rvzpAC4rdVosToYE9ByzYrLzhBsvUfHXz4avcRJVKS0D276gqsXgrHVt/wX 9Y6Z8sdBFFaq9ydr/erXTwFrDQyyFdgh2Jqx6e1vOUiyXeNEVQTrogQ6T/nJyEZd1leV fGJhm3EHXTWAe/5vFHvcmXUdslsBL+IquuAoZeMOXY6mYw1W1TGW1z7AVL7NlU8Sj6Dw oiqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=s9ykN90cdyqM5hfEHGBlKQoeXXY56iNyeD+K4udZ73Y=; b=fntGZl8GxcJXBogZmEgwqXSiW+7Xh8nySVrBE+1rYcI/kGWvOryVCjqXB2ju1nYnNX U4BGhs8E/PZ2pJDM5D+/ccwabVNMSgkN6eY8ofmnxxQ5AgTMPPSgl/mgiswaEbEji1uw UpXA3EIRVZbYEjlb5ya85bZXdWsqRKKEtCcSpU2We9LACzDJtsY2783YY+i40wr+BbgO o7x7qF2jGayuo0A96daQxiBngU7W5D7oSLz3QoCSoYtiz8YUIRtlxP48jOy5O8pwu6Nk Se6P1Rx37ah/k49rkbmp1c8R4mzz+nZQXfJ8BTXnxCSuooDNDLX4HaiISshaPVCXZ3s0 fLSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=vj2US+qP; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.47 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.47]) by mx.google.com with ESMTPS id l15si949951qkk.72.2019.06.07.03.24.46 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 07 Jun 2019 03:24:47 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.47 as permitted sender) client-ip=209.51.188.47; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=vj2US+qP; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.47 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:47990 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hZC3C-0001pY-Jx for patch@linaro.org; Fri, 07 Jun 2019 06:24:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45000) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hZB51-0008AF-6a for qemu-devel@nongnu.org; Fri, 07 Jun 2019 05:22:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hZB50-0005sX-1O for qemu-devel@nongnu.org; Fri, 07 Jun 2019 05:22:35 -0400 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]:35360) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hZB4z-0005qj-PR for qemu-devel@nongnu.org; Fri, 07 Jun 2019 05:22:33 -0400 Received: by mail-wm1-x329.google.com with SMTP id c6so1192218wml.0 for ; Fri, 07 Jun 2019 02:22:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=s9ykN90cdyqM5hfEHGBlKQoeXXY56iNyeD+K4udZ73Y=; b=vj2US+qPlr/1a88Hkvj1ieEJKJI9eddVak3pwQR7q3BR53iXEv+sKGuzgN+aaPus1E qsE4KSi4C29159YPVRjSp99hoyXU93wXCHoSv1qHOdj5O3m10VXhYfMYmjrfLyOzNTPV 8aWwIp8RU0e5spGoTms1RAb2kr3R3ETJx5k+MaAENiWDQ7tWJkjD31LbPm52moHy3ii1 WUI/z93TrSawfxphGXzlF1rp9xjoIQhGcXZRz1tnAdtMsA0fy02OoIyK/0Cxi5K35JVs 7bjF+iWptPJcngEWmpvpOimgdekQXwM3ptvpozzOZ5bS5aKbJr41USbA5pDhnl7doEko J7BA== 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=s9ykN90cdyqM5hfEHGBlKQoeXXY56iNyeD+K4udZ73Y=; b=JlDYFFJZlDeItjgNSM3Np2381BxKktbO0x88UFPj40dvwULhnbeUe0aCf9QvjRhlBS 6LhNogoRBUyRTUeOt3jFX4wk+dNZymUMAp9NsBs7TfP/UY5FNqffBBw90ggymaWcEhn7 SocFQzVDsxHhyQ01IeuOO0omi5GWGaiejzVE+yMbDC3yNupkco9H69AWWj5dRnO74uXT toqxoM91geSiTatXcF42IIlp3V62EJCbeFWdd7aktgNSHbkKZpOc/FPXw11u9a0t5B19 CM+6Qy6qFEcYQfdIFDu5Oz6BLIXkxhAaZ80UqKZDINIlMmm+MO2PQBKimKc+ubEH8gyh Y9rA== X-Gm-Message-State: APjAAAWp6T2ixGfvdWnXIKY7haKYZEzMJItjCjAKDv5kcAHSZKzZPC+b 7i2VXhvPpbzlX3KNeNBGvS7ijA== X-Received: by 2002:a7b:cc0a:: with SMTP id f10mr3064252wmh.81.1559899352706; Fri, 07 Jun 2019 02:22:32 -0700 (PDT) Received: from zen.linaroharston ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id n5sm1298995wrj.27.2019.06.07.02.22.28 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Fri, 07 Jun 2019 02:22:30 -0700 (PDT) Received: from zen.linaroharston. (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id BC2901FFC7; Fri, 7 Jun 2019 10:05:55 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Date: Fri, 7 Jun 2019 10:05:46 +0100 Message-Id: <20190607090552.12434-48-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190607090552.12434-1-alex.bennee@linaro.org> References: <20190607090552.12434-1-alex.bennee@linaro.org> 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::329 Subject: [Qemu-devel] [PULL 47/52] gdbstub: Implement step (s pkt) with new infra X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-devel@nongnu.org, Jon Doron Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Jon Doron Signed-off-by: Jon Doron Reviewed-by: Alex Bennée Message-Id: <20190529064148.19856-16-arilou@gmail.com> Signed-off-by: Alex Bennée -- 2.20.1 diff --git a/gdbstub.c b/gdbstub.c index 1871077cd7..6fd276892a 100644 --- a/gdbstub.c +++ b/gdbstub.c @@ -1808,6 +1808,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; @@ -1940,13 +1950,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 = {