From patchwork Fri Apr 26 04:35:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jon Doron X-Patchwork-Id: 1091288 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="HLKvgcbY"; 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 44r2854XsYz9s47 for ; Fri, 26 Apr 2019 15:06:13 +1000 (AEST) Received: from localhost ([127.0.0.1]:39392 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hJt3r-0001ow-Je for incoming@patchwork.ozlabs.org; Fri, 26 Apr 2019 01:06:11 -0400 Received: from eggs.gnu.org ([209.51.188.92]:45317) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hJsmm-0000dE-1d for qemu-devel@nongnu.org; Fri, 26 Apr 2019 00:48:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hJsax-0004Ma-3v for qemu-devel@nongnu.org; Fri, 26 Apr 2019 00:36:20 -0400 Received: from mail-wm1-x342.google.com ([2a00:1450:4864:20::342]:35593) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hJsav-0004Fx-6v for qemu-devel@nongnu.org; Fri, 26 Apr 2019 00:36:18 -0400 Received: by mail-wm1-x342.google.com with SMTP id y197so2376291wmd.0 for ; Thu, 25 Apr 2019 21:36:15 -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=9IF4rsqYBB5CcGAeM/Zis8CV+HM8l1BP4iU1qHaXB5E=; b=HLKvgcbYz5oBPXP2GpJ5HgTkUYRiZAg/mFOG7RjmjJcSr+ZHJCK7Bw4ohI57lQPO9N bPGcPJO0L0O/Fzd39NMxWQTvT954J0z6NjZrOjrX+EQOyIAHmNS4oj4m7yBlsuW1Mh8b G47styCjvpgzioz8hNLhS7qqZhJQRCgwJ5M5Q90dZz7DkeAk90OmXNmbz3/SeZkKcyIx 33ckdLYbmHoGUnieYXPylSgJw4AvbMbF1EoWEhkyOhz/+0kLhumDhKG6Iegyfc1q1Dar 0l03EuLJtfbzUES5P42U+vAlkpfv+TasV4tEuqxImDI8FOTZn6WFz/Unzss8b+pYSeIp 8tzA== 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=9IF4rsqYBB5CcGAeM/Zis8CV+HM8l1BP4iU1qHaXB5E=; b=BYC4orNQ9lph/jhLdFGs4J0QgXzHT+SmWqY8wlQS0g6KfSoAEx13eP3kYRmYGkuatS sNmK2LF4QBoFknFzdkJtddeg0j/Q1VJjqFl2tvVA1DSdPBndO5wLAf8D2ubxvKNmZ4vB iA/iLBiyJQ8TLcqBLeJoodCSYT8cGPNSKC5v00bX459eAXfyTUtJl5q2mKuL0Rz5IxjG NV8JtXRv6OUf6mrWPXBOfUcPDbOiCLpQ4qOA8Di4eyG0THH4y5aXGGPpsCyIret0Tiu1 nL9ZsZ1+A8ItNWKqsPjaDvrJQg5kvmZHsapN8bCNDzbjUKHQc3y42Uye7IwIJETcSlZ8 BhkQ== X-Gm-Message-State: APjAAAUEQ6nZP0KWbWE439429fFSrW2uYB/veoOtj9CE++gehVL3TMfd CyMdKN8PucnQSeY7p8/tde7ECBqb X-Google-Smtp-Source: APXvYqz8m2Sr6cGpDFTo6ikiMamPTXHa/khDgLP5rjt9APzij6a3FmxuNdU9CQ+0kLgH3VASc7joQA== X-Received: by 2002:a1c:6783:: with SMTP id b125mr5815868wmc.79.1556253374335; Thu, 25 Apr 2019 21:36:14 -0700 (PDT) Received: from localhost.localdomain (bzq-79-178-247-46.red.bezeqint.net. [79.178.247.46]) by smtp.gmail.com with ESMTPSA id h5sm3467088wmf.38.2019.04.25.21.36.12 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 25 Apr 2019 21:36:13 -0700 (PDT) From: Jon Doron To: qemu-devel@nongnu.org Date: Fri, 26 Apr 2019 07:35:41 +0300 Message-Id: <20190426043558.6888-5-arilou@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190426043558.6888-1-arilou@gmail.com> References: <20190426043558.6888-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::342 Subject: [Qemu-devel] [PATCH v7 04/21] gdbstub: Implement continue (c 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: 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 c47ef7dd9c..89f1ab6524 100644 --- a/gdbstub.c +++ b/gdbstub.c @@ -1522,6 +1522,16 @@ static void handle_thread_alive(GdbCmdContext *gdb_ctx, void *user_ctx) put_packet(gdb_ctx->s, "OK"); } +static void handle_continue(GdbCmdContext *gdb_ctx, void *user_ctx) +{ + if (gdb_ctx->num_params) { + gdb_set_cpu_pc(gdb_ctx->s, gdb_ctx->params[0].val_ull); + } + + gdb_ctx->s->signal = 0; + gdb_continue(gdb_ctx->s); +} + static int gdb_handle_packet(GDBState *s, const char *line_buf) { CPUState *cpu; @@ -1558,13 +1568,16 @@ static int gdb_handle_packet(GDBState *s, const char *line_buf) gdb_breakpoint_remove_all(); break; case 'c': - if (*p != '\0') { - addr = strtoull(p, (char **)&p, 16); - gdb_set_cpu_pc(s, addr); + { + static const GdbCmdParseEntry continue_cmd_desc = { + .handler = handle_continue, + .cmd = "c", + .cmd_startswith = 1, + .schema = "L0" + }; + cmd_parser = &continue_cmd_desc; } - s->signal = 0; - gdb_continue(s); - return RS_IDLE; + break; case 'C': s->signal = gdb_signal_to_target (strtoul(p, (char **)&p, 16)); if (s->signal == -1)