From nobody Mon Feb 9 01:20:31 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=1556255135; cv=none; d=zoho.com; s=zohoarc; b=HZlDcD7ySi3+fteGwd4Y4xO7vSAIj49XGdam1bqfYEzb4p6fG86CG94cn8XeAQDln3+QoX2fzq/udpqhVoH880rF0qPVje7gHeyt3M3sQHQW4RFHUYtA85kgWDQbtA/angysGS19PlUELZ+VvhMZzXSsR49ffrEf7lzKEFO5PQs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1556255135; 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=U4fLhEZHxeWF7Ph12MqOmpuk/185Eq0Ogcw/FW+Pwwg=; b=UtgYJ9iMHtTni4iE4Z9RUuyTg0tOClwAAxnkBnJa2sVPQAWZKaWE1PLPYjc5sjFuXgMWE1u+2IVxm65ZIZ5up3Ig69/Rcjb8VIG49e3Sh4dPesz8cOziO3xl/YgUKGdRcUDauU8LsgyPLxJt2EKt2HrmNpuZrfYjK4bH7FmdAVo= 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 1556255135979752.411205893099; Thu, 25 Apr 2019 22:05:35 -0700 (PDT) Received: from localhost ([127.0.0.1]:39370 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hJt3C-0001Cv-3z for importer@patchew.org; Fri, 26 Apr 2019 01:05:30 -0400 Received: from eggs.gnu.org ([209.51.188.92]:45320) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hJsmg-0000dG-CG for qemu-devel@nongnu.org; Fri, 26 Apr 2019 00:48:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hJsb2-0004QU-R0 for qemu-devel@nongnu.org; Fri, 26 Apr 2019 00:36:25 -0400 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]:39837) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hJsb0-0004O0-T5 for qemu-devel@nongnu.org; Fri, 26 Apr 2019 00:36:23 -0400 Received: by mail-wr1-x444.google.com with SMTP id a9so2450279wrp.6 for ; Thu, 25 Apr 2019 21:36:22 -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.19 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 25 Apr 2019 21:36:20 -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=U4fLhEZHxeWF7Ph12MqOmpuk/185Eq0Ogcw/FW+Pwwg=; b=Dr7LuTEp2/fDoRkLxFMZxphChvNFuBUshR8Fy8eNpE7AxQKfDJJdT2YcTEoNlA2ml+ +cW5z6JRGUT3UgWBSdc9pyJHrb79Y2Tamqc8lBGZoYgaxkZOL3rufHcRgO+OLz7/Xq97 TOBADuVyPPslF5ox3/P7KLRXx1XDzb6+Lk5uqICA4OxnomqBTl//gZvKNQqFUxTUJ/a3 v4cslLh1gkI/91qDk/wNnsSUQJZoBnjbeJrc2SM31YlAvqqds6HWPm2RDhBq6ck14u1o Cd96Qdt6PL49aAWVW7gjlFHJWvDuU9uoorYxs2zRJknCpp+/e/sESYK4pJNh2GrrELm1 1Pjg== 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=U4fLhEZHxeWF7Ph12MqOmpuk/185Eq0Ogcw/FW+Pwwg=; b=rqVlKU6iXp/5o+uDhqxWvNErQmTPImo+68PCu59guAcHIv7/9epeADPxEL39Ekzyok BYR0GVd26yjZVG/YE7qvWuXKgQrPa9J2IUPuE65Qe7gnD0uy1mO9Bile0SAzybMFXAQu NFfKpbwqF3Vxz62uTOLEG4wo/wnrvHjo4+afmAkdeGMtJy9ppBMXCQ/apXiFu+7xaBrL NaRJJmeya8ahz6nfwCwa3JNMJSTAJi9h8LpdVF8p/ZgPUYM0HNzTEz0854HeNc/Cxv4B oTXAILLWLCeBrkA4o6RcgTr8DumZ0XK7RznhLrf4q8mcnXTn+vIPUXX3udTpHtwqJyNN Rf6w== X-Gm-Message-State: APjAAAX5vjCHyXOuuPSrh3F9iuZbJJAFlOhfcMt8+rPm7fSNda3BKkYC 8X8qlcy8CUhsz5NnnKBEydy+m2Es X-Google-Smtp-Source: APXvYqxl15YLF/OFQ2bp8VCORUiQIpV0uUxg6nbtaHPAfZ0PXpyPhI7lRRK39cssODK7tuduJ8aF2A== X-Received: by 2002:adf:8062:: with SMTP id 89mr1807933wrk.107.1556253381069; Thu, 25 Apr 2019 21:36:21 -0700 (PDT) From: Jon Doron To: qemu-devel@nongnu.org Date: Fri, 26 Apr 2019 07:35:45 +0300 Message-Id: <20190426043558.6888-9-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::444 Subject: [Qemu-devel] [PATCH v7 08/21] gdbstub: Implement remove breakpoint (z 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 | 49 ++++++++++++++++++++++++++++++++----------------- 1 file changed, 32 insertions(+), 17 deletions(-) diff --git a/gdbstub.c b/gdbstub.c index 36c7353a22..b42425b24c 100644 --- a/gdbstub.c +++ b/gdbstub.c @@ -1611,6 +1611,29 @@ static void handle_insert_bp(GdbCmdContext *gdb_ctx,= void *user_ctx) put_packet(gdb_ctx->s, "E22"); } =20 +static void handle_remove_bp(GdbCmdContext *gdb_ctx, void *user_ctx) +{ + int res; + + if (gdb_ctx->num_params < 3) { + put_packet(gdb_ctx->s, "E22"); + return; + } + + res =3D gdb_breakpoint_remove(gdb_ctx->params[1].val_ull, + gdb_ctx->params[2].val_ull, + gdb_ctx->params[0].val_ul); + if (res >=3D 0) { + put_packet(gdb_ctx->s, "OK"); + return; + } else if (res =3D=3D -ENOSYS) { + put_packet(gdb_ctx->s, ""); + return; + } + + put_packet(gdb_ctx->s, "E22"); +} + static int gdb_handle_packet(GDBState *s, const char *line_buf) { CPUState *cpu; @@ -1877,23 +1900,15 @@ static int gdb_handle_packet(GDBState *s, const cha= r *line_buf) } break; case 'z': - type =3D strtoul(p, (char **)&p, 16); - if (*p =3D=3D ',') - p++; - addr =3D strtoull(p, (char **)&p, 16); - if (*p =3D=3D ',') - p++; - len =3D strtoull(p, (char **)&p, 16); - if (ch =3D=3D 'Z') - res =3D gdb_breakpoint_insert(addr, len, type); - else - res =3D gdb_breakpoint_remove(addr, len, type); - if (res >=3D 0) - put_packet(s, "OK"); - else if (res =3D=3D -ENOSYS) - put_packet(s, ""); - else - put_packet(s, "E22"); + { + static const GdbCmdParseEntry remove_bp_cmd_desc =3D { + .handler =3D handle_remove_bp, + .cmd =3D "z", + .cmd_startswith =3D 1, + .schema =3D "l?L?L0" + }; + cmd_parser =3D &remove_bp_cmd_desc; + } break; case 'H': { --=20 2.20.1