From nobody Mon Feb 9 00:42:21 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1556254547; cv=none; d=zoho.com; s=zohoarc; b=SbjmGuZUoCbR50FjpAbVx4lfWxc9pqvWpI2XuPsW+rkR08WDPuKmntQmsZeqb0AJRoULeYgfExE+CMEB++f4cE2/8W9kyuunh0bCbsgUwCuWzW7AwJMl0PNB13jGZbBRLZ+5UGaqPqkv7R2YEoIftX8mQxReOznYdcJHtdCmiTE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1556254547; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=x82aHJMzl8f+PCXWhu2ZX9N8tzch1kuJG+XquT6URF0=; b=Z9QxZzmbwzNBYzjfrVLP/gw69F4ZuRgtMgGaIXq2BK97Nyc5ewECPOafwlQ0RVkNa6Yxnft2KKwY78qq00w2VJFDwOzlW/pCpBA3IOVI9Spsbkiy5FWGeaj5sC+PePB6mPnmrxKpO41zXPzP7UsKLS5a/RS41Gux33mO1y9FydI= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1556254547194690.3054028108068; Thu, 25 Apr 2019 21:55:47 -0700 (PDT) Received: from localhost ([127.0.0.1]:39216 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hJsti-0007yV-Vs for importer@patchew.org; Fri, 26 Apr 2019 00:55:43 -0400 Received: from eggs.gnu.org ([209.51.188.92]:45320) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hJsmh-0000dG-JA for qemu-devel@nongnu.org; Fri, 26 Apr 2019 00:48:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hJsax-0004Mg-3w for qemu-devel@nongnu.org; Fri, 26 Apr 2019 00:36:22 -0400 Received: from mail-wm1-x342.google.com ([2a00:1450:4864:20::342]:40450) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hJsav-0004Ja-9L for qemu-devel@nongnu.org; Fri, 26 Apr 2019 00:36:18 -0400 Received: by mail-wm1-x342.google.com with SMTP id h11so2330683wmb.5 for ; Thu, 25 Apr 2019 21:36:17 -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.14 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); 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=x82aHJMzl8f+PCXWhu2ZX9N8tzch1kuJG+XquT6URF0=; b=X/EmV8BnohzDcZAzuZYpw9Fpqq3xw/P9Oow6QaJb5e7+PBkDTcFBODxzk5+KVwD2Tw Utf6tgRDXDY5tEyT2eVXekd/pOe51QNmvLW/pu60xQGnIp5xY6n5qTFKi82tfYw2/Tgf h35I0PKtRIWi99+Bww9QAgnh+bf3wW6ejxUX230Up/Gb14FqxP2WSr/t8uQXZwaQNvBg KUE+2dMsMdullZ6l+miIUcIQHyKQTB6oOxkhUhpNV8wNpu7ZRd4gEYP9TEDxFzHYn6PL 0WdOk1i3OILpjyb0XjHbEzfPjFaGUbrqmN26b1fj5ttzYafpQe7EyeRa93zpi+qd9l5v 76Bw== 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=x82aHJMzl8f+PCXWhu2ZX9N8tzch1kuJG+XquT6URF0=; b=A8QpU5hAYUUnXXVHXEY1u4qpYI8z6jmYGgDBLdlEfqmWPXXcWYPPwDCbNHUMsQkQNM CiiQZMuuE+ZR7Y1iX5HJK5KAPTEQPcQt6V093cvxk1GnBqr85q81kjckPNWEqKFyOggb Gz0ZphlNlDfkhmQGXWYiEKL5IW649uIRtY8CvDfOjW3LaLoa1u/9I1dxvAv/d51prxVJ 6qqnu9nNDxYISKe9EPi8VwpEaIeIiaCfwXoHvajlm+M/bXXefpjAPpZvFLdF4otYKMnp a3JkWfLmafbUAq5rPZ2oDpRTIM9iyn9gw6K918Qdc3EX1AfORSgC5YS5j/AD8/AbPKo/ vUug== X-Gm-Message-State: APjAAAWKns/QfV6ifr8rHCYuZHe4JsWjzCZpO9/bT1u46RNUGELgv9x0 f2DVU+nJsiD7BUx1TuWcHzBIMb6d X-Google-Smtp-Source: APXvYqxGZiRKnKcU5bToSN1Hl4A9I9F7jFpeCwG/sFUsWIRbf0c+uT7EjVVbF4SpbAXHuRqASEDRHQ== X-Received: by 2002:a1c:2e8c:: with SMTP id u134mr5996302wmu.146.1556253375826; Thu, 25 Apr 2019 21:36:15 -0700 (PDT) From: Jon Doron To: qemu-devel@nongnu.org Date: Fri, 26 Apr 2019 07:35:42 +0300 Message-Id: <20190426043558.6888-6-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 Content-Transfer-Encoding: quoted-printable 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 05/21] gdbstub: Implement continue with signal (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+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Signed-off-by: Jon Doron --- gdbstub.c | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/gdbstub.c b/gdbstub.c index 89f1ab6524..469aaeb875 100644 --- a/gdbstub.c +++ b/gdbstub.c @@ -1532,6 +1532,21 @@ static void handle_continue(GdbCmdContext *gdb_ctx, = void *user_ctx) gdb_continue(gdb_ctx->s); } =20 +static void handle_cont_with_sig(GdbCmdContext *gdb_ctx, void *user_ctx) +{ + unsigned long signal =3D 0; + + if (gdb_ctx->num_params) { + signal =3D gdb_ctx->params[0].val_ul; + } + + gdb_ctx->s->signal =3D gdb_signal_to_target(signal); + if (gdb_ctx->s->signal =3D=3D -1) { + gdb_ctx->s->signal =3D 0; + } + gdb_continue(gdb_ctx->s); +} + static int gdb_handle_packet(GDBState *s, const char *line_buf) { CPUState *cpu; @@ -1579,11 +1594,16 @@ static int gdb_handle_packet(GDBState *s, const cha= r *line_buf) } break; case 'C': - s->signal =3D gdb_signal_to_target (strtoul(p, (char **)&p, 16)); - if (s->signal =3D=3D -1) - s->signal =3D 0; - gdb_continue(s); - return RS_IDLE; + { + static const GdbCmdParseEntry cont_with_sig_cmd_desc =3D { + .handler =3D handle_cont_with_sig, + .cmd =3D "C", + .cmd_startswith =3D 1, + .schema =3D "l0" + }; + cmd_parser =3D &cont_with_sig_cmd_desc; + } + break; case 'v': if (strncmp(p, "Cont", 4) =3D=3D 0) { p +=3D 4; --=20 2.20.1