From patchwork Fri Jun 7 09:05:35 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: 166086 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp388983ili; Fri, 7 Jun 2019 02:18:15 -0700 (PDT) X-Google-Smtp-Source: APXvYqzWq4X0T2HxRt9ptttrE0By2RNRsOSMlilBLIzAVBSFYezRnbI1sCqmmvTZhq0v2d4N9sYb X-Received: by 2002:a37:6b07:: with SMTP id g7mr42504332qkc.217.1559899095341; Fri, 07 Jun 2019 02:18:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559899095; cv=none; d=google.com; s=arc-20160816; b=s3Kku7T8eZBZ4Y6sXbieiIlvEsGSPhP3dVuyLJKY0S05qEiwysBOBE0tt0VFlL/pHt 0Ew0QDUfEaWyLYx7PH+ZAj7EpA6q2tKs3N7Ytt3KR/iM2vFMtoNrx8e+8dcIJCg6BS6H J/giOwIqhoq5LkoWvyXyvYp6RyquNvkKBjLqHmCPvsyC0K4xmflDOnlgS48vgqkn43tm zvn4dzmePMTt24RHLbXoxpuXDmwM8d2kvmUKKG5r0vcZUoXXePp6ZXzlynNVYXeR6vfb I9+Q4klC7Pz1aKoyPaT6TYYRghxw4PtEucmFSgZJH4ervoRsML9oGkrIod484s2nHnTL ogBw== 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=AyGciPWCZWMMprrVh/RGj7LAohHD1vSZk+l1Mlrp9Kw=; b=aFfScda6f0RhAYVZEN4etlXqCUZAzgzU2WKS0sjxIhimm24h941hFlltjrAfxHYNra dER00ArYGWfcHWkic4kS41zzZIgl72CnunrCpG5kuwiy9X1C1nfTRNHjMmOWjBH0zS+Q pS/T9rtt+YF1o9B3J4WqxgW4OwRZiq91WsDbaTZo6VyYEylRo7YyiGzKSjR7e293tVdG vlq7HdmdWQm+rVm6yF6Fr2+39hsT3RBstPwoc9BKqYZDpHKo+d04Z9sbqGfgl7LndEKZ g73dV7Hy8DuG+irtGsnAevEFobu2F5eljdxRgXTSYGj+cJjkjkJrIrwIaUgudvgltb5h FTjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=tFPY1x1J; 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 h17si852954qkj.77.2019.06.07.02.18.15 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 07 Jun 2019 02:18:15 -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=tFPY1x1J; 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]:47398 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hZB0j-0005HT-B7 for patch@linaro.org; Fri, 07 Jun 2019 05:18:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39487) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hZAp8-0004CI-79 for qemu-devel@nongnu.org; Fri, 07 Jun 2019 05:06:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hZAp5-0004jg-Oz for qemu-devel@nongnu.org; Fri, 07 Jun 2019 05:06:09 -0400 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]:39156) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hZAp5-0004Yu-Hq for qemu-devel@nongnu.org; Fri, 07 Jun 2019 05:06:07 -0400 Received: by mail-wm1-x329.google.com with SMTP id z23so1125808wma.4 for ; Fri, 07 Jun 2019 02:06:04 -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=AyGciPWCZWMMprrVh/RGj7LAohHD1vSZk+l1Mlrp9Kw=; b=tFPY1x1JxMmCh30bEtwkP31PhjjlT9UsOl3sHffiKTuVf5HfuE69++inwzaWs7YRa8 DV7Xp1O9gsC6rLNtb4a2wF69pt4BN/s8gTMzQngKksgt96hSdwEtVu8iFwhY6cxD5aw6 lifuuYZWMzWE6s3LmMM5mRYRQiagPM4SSahkNz/eA6LFdahB2L1dCRqk5/hEOCBtpyYG X/neHW5OBgtFwiH5TM/l+qVhR0bSzAZE9TORLBo7ahqavIMWJ3NQ6nlorBEew+r+lhRf qY5ozHcids5OWSVXHXjKy6XFXBSe1TNlrToEHRHTyawhaolBE8rVu2RDWC3IqIHtGRmt ReSQ== 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=AyGciPWCZWMMprrVh/RGj7LAohHD1vSZk+l1Mlrp9Kw=; b=JJ9fh3x8AprmxW5dsnhhfKc9vyT7/ml+giBGj07Ez9Qkx1/TwPuhvj6dhg2nw0zynx DsSDTu+M8UbfMRMzcnM2Yl+o+8AFFgFurLXrjbuT1ggtuqAgVqoY0uJb6HKULcdLZUVN MIP7fbplBLNqjrOq2QjGhtVd2HOke/m4F0xDpj4M1WlE9LbpHxS9AlHfXWai/ZHZFy3z oHhN24kmVq0mSAZSmS8lE9lHMu/Cl+oUmUiy9JTOVXLmtwy+xfyl/doQRHmPHCNpUm0F DDLaUkZYBLcff6K2pNzj0l6CxIxe9P4rkKPqCQ1f/zhMEP1YsIWEcY25fglHK799093s +21g== X-Gm-Message-State: APjAAAUsXwSTssSg4zI8Jha2Ycx4m7Se3yyb4aCHVUuOWVQD+HWgGItS WnUp2QoH/wdEt1gxwHIHhH5RFA== X-Received: by 2002:a1c:9d86:: with SMTP id g128mr3118884wme.51.1559898363552; Fri, 07 Jun 2019 02:06:03 -0700 (PDT) Received: from zen.linaroharston ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id b2sm1549046wrp.72.2019.06.07.02.05.57 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Fri, 07 Jun 2019 02:06:01 -0700 (PDT) Received: from zen.linaroharston. (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id DFF0B1FFBC; Fri, 7 Jun 2019 10:05:54 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Date: Fri, 7 Jun 2019 10:05:35 +0100 Message-Id: <20190607090552.12434-37-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 36/52] gdbstub: Implement continue (c 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-5-arilou@gmail.com> Signed-off-by: Alex Bennée -- 2.20.1 diff --git a/gdbstub.c b/gdbstub.c index ad00f223f2..c3089a6b5a 100644 --- a/gdbstub.c +++ b/gdbstub.c @@ -1531,6 +1531,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; @@ -1567,13 +1577,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)