From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 4R1eF4Da0WhEmg4AWB0awg (envelope-from ) for ; Mon, 22 Sep 2025 19:23:44 -0400 Authentication-Results: simark.ca; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=uofr.net header.i=@uofr.net header.a=rsa-sha256 header.s=selector-1 header.b=tsghUMnD; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 5ADCF1E0BA; Mon, 22 Sep 2025 19:23:44 -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.1 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_INVALID,DKIM_SIGNED,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 server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (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 E1F501E04C for ; Mon, 22 Sep 2025 19:23:43 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 740A53858410 for ; Mon, 22 Sep 2025 23:23:43 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 740A53858410 Authentication-Results: sourceware.org; dkim=fail reason="signature verification failed" (1024-bit key, unprotected) header.d=uofr.net header.i=@uofr.net header.a=rsa-sha256 header.s=selector-1 header.b=tsghUMnD Received: from uofr.net (uofr.net [50.116.51.30]) by sourceware.org (Postfix) with ESMTPS id 542733858C62 for ; Mon, 22 Sep 2025 23:18:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 542733858C62 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=malsyned.net Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=malsyned.net ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 542733858C62 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=50.116.51.30 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1758583108; cv=none; b=eQ6aHVyPe323/JCy3HylrgwMNp9njKzyg56QICRd59CZVJ8U7wkaHy77rWgw07CZOqATc7tJBaoO7PpwxQgLow3LIYuLKU3RGC8G1S4P7ExRvexsavLtNU6S+3AlgVS+Cyh+NEmlJmJIW7kaSmZzet4Vh9Ep76FMnTWjxIVyvHY= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1758583108; c=relaxed/simple; bh=siQPV67ETizCv0+1IdUw/5SeHdy91xIs758doy5FLms=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=uJCWpbZGZ7UvlBIEm/f9f69C8tnPlKVNbYFPZiJ2tjRzkKk1xH4pyEOPxVJ1dsaOW8Hh/1caYWAT4hysX84VwQEW6+oNgoDcCrUZum+MtmfnZNuZBVcQg4mKyk2rzohv2xAkgljkci0Va4gzy99etTPz3yfMrDDChhG/oCgFIvc= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 542733858C62 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=uofr.net; s=selector-1; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To :Message-ID:Date:Subject:To:From:Sender:Reply-To:Cc:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=Erxwzyjmo+5XnGMj1NRNhgy6/iOa/LUhbNyIJgLsG8Y=; b=tsghUMnDXXfSxTzYD0BX6yOd5T b3YibmIqjgwQr53nnaPaZ/cNbu9bOSFrpmzTJZ1SZ0BTlbCViSxFhmyfAkc3S3qXKYMOOdlhgBGki z9qhGnwU71Nsh4ZNhBaRaISvU1kkSeu8qLZk0OOIJB5FcX2TdiMinn90TzzpNZinfD2k=; Received: from c-75-67-96-172.hsd1.ma.comcast.net ([75.67.96.172] helo=malsyned.hsd1.ma.comcast.net) by uofr.net with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1v0pnf-00B0ww-1Y for gdb-patches@sourceware.org; Mon, 22 Sep 2025 19:18:28 -0400 From: "Dennis Lambe Jr." To: gdb-patches@sourceware.org Subject: [RFC][PATCH 4/5] [PR gdb/33469] mi-interp: on_param_changed: pass async = true to redirect() Date: Mon, 22 Sep 2025 19:18:19 -0400 Message-ID: <20250922231820.2667505-5-malsyned@malsyned.net> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20250922231820.2667505-1-malsyned@malsyned.net> References: <20250922231820.2667505-1-malsyned@malsyned.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 When frame filters are enabled and a stack unwinder does something to cause an async record to be emitted, -stack-list-frames output is incorrect. A comma is missing from the first async record, and a spurious comma is inserted before the first frame= of the frame list. This happens because async record emitters like mi_interp::on_param_changed() are written as though calling mi_out::do_redirect() ensures that a comma will be emitted by the next following mi_ui_out::field_string() call. It's not guaranteed, though. It usually works out by coincidence because the emitter methods are called when no other output record is mid-creation. Pass async = true to the ui_out_redirect_pop constructor to back up and reset ui_out state related to list generation. RFC: This version of this patch only changes mi_interp::on_param_changed(), because that's the async record my code was emitting when I found this bug and that I have good test cases for. I'm interested in revving this patch set to change other async record emitters in mi-interp.c based on comments on this version. --- gdb/mi/mi-interp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gdb/mi/mi-interp.c b/gdb/mi/mi-interp.c index 8373e1a9ea8..10c1e70ce1e 100644 --- a/gdb/mi/mi-interp.c +++ b/gdb/mi/mi-interp.c @@ -800,7 +800,8 @@ mi_interp::on_param_changed (const char *param, const char *value) gdb_printf (this->event_channel, "cmd-param-changed"); - ui_out_redirect_pop redir (mi_uiout, this->event_channel); + ui_out_redirect_pop redir (mi_uiout, this->event_channel, + /* async = */ true); mi_uiout->field_string ("param", param); mi_uiout->field_string ("value", value); -- 2.51.0