From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id YgO0AojZsWod4C8AWB0awg (envelope-from ) for ; Mon, 21 Sep 2026 21:27:36 -0400 Authentication-Results: simark.ca; dkim=pass (2048-bit key; unprotected) header.d=tenstorrent.com header.i=@tenstorrent.com header.a=rsa-sha256 header.s=google header.b=FyOjow7Q; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id EB3E21E033; Mon, 21 Sep 2026 21:27:35 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED, RCVD_IN_VALIDITY_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_BLOCKED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [38.145.34.32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id EF7541E033 for ; Mon, 21 Sep 2026 21:27:33 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 2C10A4B9DB67 for ; Tue, 22 Sep 2026 01:27:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2C10A4B9DB67 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=tenstorrent.com header.i=@tenstorrent.com header.a=rsa-sha256 header.s=google header.b=FyOjow7Q Received: from mail-lr2-x0f.google.com (mail-lr2-x0f.google.com [IPv6:2a00:1450:4864:38::f]) by sourceware.org (Postfix) with ESMTPS id 0B9E44B9DB4C for ; Tue, 22 Sep 2026 01:27:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0B9E44B9DB4C Authentication-Results: sourceware.org; dmarc=pass (p=reject dis=none) header.from=tenstorrent.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tenstorrent.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 0B9E44B9DB4C Authentication-Results: sourceware.org; arc=pass smtp.remote-ip=2a00:1450:4864:38::f ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1790040428; cv=pass; b=YvWN3uAKR6UnPt9b+oHVFTjRGvToFH2whPoY46RC80pyi6bXkC87YQ3A8oh20VcNxDTNWmGVAkGBK0UaTPD0h+l/asrhwovC3d+l/1cztX/oWd3zLGMlK9FYutSCtb0ja2aoanDtGQmOH91qIhMENjF2oOVQAxckOUPbXbEzU84= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1790040428; c=relaxed/simple; bh=/7cmD1KBK0oOF2U1x1JCVB7W6An5Fhgv0+D5icmYF7c=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=eB/6C5c0veg9pL6UX46poOslKt85kTlSMmZa6zrFaVAqNKJKa2778LAE4c+LxWIVC3IaACLJS2CbctxwF0dt+/6jD9mKHoIQUdmIrHB6mz/GW80jB+xDozI32RI6FESvW+rogGSkv4ExB8eEwWZPB55Vff/umHciUCwGEkXfraE= ARC-Authentication-Results: i=2; sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=tenstorrent.com header.i=@tenstorrent.com header.a=rsa-sha256 header.s=google header.b=FyOjow7Q DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0B9E44B9DB4C Received: by mail-lr2-x0f.google.com with SMTP id 38308e7fff4ca-3a61240473fso18860551fa.3 for ; Mon, 21 Sep 2026 18:27:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1790040427; cv=none; d=google.com; s=arc-20260327; b=ifPB7t2uVGTkrZxnGSFx4plvDs7BiA2FyRfaUjepsSb7XoC6ch4iBkixcIJC4tMXtK O7bcFqMILaPl3dkbrXcxfsskjLzdJkGFQNCc5bF/tLv361SATr4riO8VKs7JP6nJ43PL /vbIRqC7+KBcgoTRdhifAqOXsPj/DsRZ+D3wgqarViK0yV+iveUQl7xawmIF67GGd96T Tu52UjSgwaJ58sRpzawbz3mfgZghJ9hcb3sA6eDO0OqJIenoM0AuQnPTRCRtHfZ0lMYt 2P2XsEssrT5Oi9950oe9Dq1mNXeL2myg5xkjjF7PQ8JuS0g6Bi9Y7D759Rkiyf07h/cB 8ibw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=888cmZ7eIefQgmJUKho2/EM246V7n2F6RtSdM90R1AE=; fh=9WqBlQQXC07nsM8azBMuUGAvzvQaVafBRYq/Srm/JCw=; b=P7bO4AX4ze/ULrY45U6aiGtPrFRKbRfm16J7hyv4JDuiw6CVKURJp4WyVSmY/+t5Y0 nYFJAfZ7LGZoRs7dAXnkFsI3tfia0HX3QgkOHF1SjD691VGNzEGMjFXEXHfTsFkq2igZ s6tn6JYvifsiSmO5nHwGkPaKdeBS4IZNsNhUgHXT/wWFSlHdgDhiiOdNtoil7i1AaZz7 efbiK0VZ4oMCanwSA6JMLhQYEfQKfpp0+FyfehUj1AsjDfyt0MhT4c7pBCsiYyIjrHd+ eMJafyd+8JJhTEjvm+JQrsChHxhVvvuAODzUGFkbFBgzZg7GzmPzk+hkAq87794iauJl r1zQ==; darn=sourceware.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tenstorrent.com; s=google; t=1790040427; x=1790645227; darn=sourceware.org; h=content-transfer-encoding:content-type:cc:to:subject:message-id :date:from:in-reply-to:references:mime-version:from:to:cc:subject :date:message-id:reply-to:content-type; bh=888cmZ7eIefQgmJUKho2/EM246V7n2F6RtSdM90R1AE=; b=FyOjow7QAEBGsLy7+IK8sXewAAbBGsRqgcXzBD1f/u1tn6SVluC8xdKcDm976G8LmR oEBSFFe2iSP/6D+6VqblEYZ7WIDkqran8QQgXaShD4b0PrbfScyaMP32qYBS3GWaH3IK zPxogvFa1a45avaM1mmrlUWn/pU8Ig/YWR5SXZqdX/A7zyOcV+E0oK3hbKy03nRARqfo uVsgJ4GIZjgYWsq++4AXyq6VapFAm8pbH+dsTTQmEVtfx/7mG44GS1fl9zC/f0TRqid3 BbuAAdschjSRvOq44JDQMcqU2CfB91VTQXofGKyWkReSgcMrmULO248lMytTnDbcPooi oB1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1790040427; x=1790645227; h=content-transfer-encoding:content-type:cc:to:subject:message-id :date:from:in-reply-to:references:mime-version:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=888cmZ7eIefQgmJUKho2/EM246V7n2F6RtSdM90R1AE=; b=phPNECKL/+z5wVIIVqEXazftjRZn04B52Qp3Pbj2N6tDkGZF7LaskaHn8//4vKpdih BlZJJ3ruhDeUj2vInUvhzx8uxkqplOGeIrU0a1ecNiqId9sQlexnxYxb7Aefhg9+rJuS iLRb9NbxXT62f78obfSLoFG14fMj7flz2o3UB4e0++ZP67t0dBLMFdf1dzJcxy7LKChp 5tRc6E9diVLy1Iod65rQiCrnWe2nfh1YYhiKCtneg85l4l6/pAVnc3/EauQKSKJh+idU JxV5QBkV1ZMsac8UQnK1AW734cM5OFy9PUD2PPqvZuJO2M5Lobx58rmPJakIkUJLM7oi bbPw== X-Gm-Message-State: AFuF++kSkxGIVjwkDHOHxAsB8KYYtS6QDbgiEadvTXjnmKhyP2Zaqr9g 3VKl27zJQnPQRgkDhxnGOmtEbqbeglxezv6cEhumLDCuEkWxVRAw8NKt6iHMVYZ3oKFvbXywbah vI+V0kGtXu45dX53jTiVDpXqLeFjV6MJVyI38PHzj3q4aIT4cR+W1CAzN5Q== X-Gm-Gg: AYBFou1OKXNPbvAt15d3QYS6UudqXkMLcWDUTvcmymqyf+DoD74OzyoHAIvHvXd2WqO TNozcn8NsyLEz0GgYkj3/ckMl5BDsCtpWg0orT/sKJ7W2GjJrWRQwpnU4nhXv5jgg5u3L7tFiEd fkzEI0UhChsj1ah9dRsEjL75+lB/qDMsFZbe5HHZXoYGdtMnBqiTPWgPjhwkCwDPur7QhXfXeD+ pcoE2XYyy8K17i1KqDMFmOMZ9VB+nFph/XO6vXOXqCjprVxViKSDF/9jeVP1mjIISSk6IUImCNM vsowrjAraZJDDU4zyu3dYki7OrP5Hqzw4oL1Xz6NvOaq4MXuomqy57ZfTLK1FM9EcReCryqg6xe kPluepd0ym3HMzNppPlM= X-Received: by 2002:a05:651c:985:b0:3a4:8510:f45b with SMTP id 38308e7fff4ca-3a5fbeb81d5mr22766231fa.8.1790040426754; Mon, 21 Sep 2026 18:27:06 -0700 (PDT) MIME-Version: 1.0 References: <20260916002831.1775922-1-antonb@tenstorrent.com> <87tsnputjs.fsf@tromey.com> In-Reply-To: <87tsnputjs.fsf@tromey.com> From: Anton Blanchard Date: Tue, 22 Sep 2026 11:26:54 +1000 X-Gm-Features: AcwNN1Uf8KOBJNTwgnw7g5rQ7dIMnk8bp3jCuuserg6Nabegh_-IqrtWsAFAIl0 Message-ID: Subject: Re: [EXT] Re: [PATCH] RISC-V: Use hardware single step when available To: Tom Tromey Cc: gdb-patches@sourceware.org, npiggin@gmail.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org Hi Tom, On Thu, Sep 17, 2026 at 1:04=E2=80=AFAM Tom Tromey wrote: > > >>>>> "Anton" =3D=3D Anton Blanchard writes: > > Anton> If the target supports hardware single-stepping use it instead of > Anton> inserting software breakpoints. We continue to use software breakp= oints > Anton> for stepping over LR/SC atomic sequences. > > I'm definitely not the person to review RISC-V bugs. > > That said, I'm curious about two things. > > First, if the target advertises that it can single-step, should that > include stepping over atomic sequences? IOW could this also be deferred > to, say, gdbserver to handle properly? The problem is that we have multiple types of targets that support hardware single-stepping. Simulators (eg QEMU) can single-step through an lr/sc sequence, but in-band single stepping (eg via ptrace) and some hardware debuggers cannot because the reservation clears on an exception. I chose the most conservative option (similar to ARM), but Nick Piggin let me know about this patch where he exposes an option to configure it: https://sourceware.org/pipermail/gdb/2024-February/051080.html He also suggested adding a qSupported flag to automatically configure this, which QEMU can set. Thanks, Anton > Second, I wonder why target_can_do_single_step isn't called at some > higher level. > > Anyway I see that arm-linux-tdep.c -- but not arm-tdep.c, > mysteriously -- does what you've done here. And I don't have any > objection or anything, just questions. > > Tom