From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id MaL5Mw6ESWqIASgAWB0awg (envelope-from ) for ; Sat, 04 Jul 2026 18:07:10 -0400 Authentication-Results: simark.ca; dkim=fail reason="signature verification failed" (768-bit key; unprotected) header.d=tromey.com header.i=@tromey.com header.a=rsa-sha256 header.s=default header.b=g+ZEucx+; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id CCDDE1E098; Sat, 04 Jul 2026 18:07:10 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-3.8 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_INVALID,DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_BL_SPAMCOP_NET, RCVD_IN_DNSWL_MED 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 667941E024 for ; Sat, 04 Jul 2026 18:07:10 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 32DF34BA903A for ; Sat, 4 Jul 2026 22:07:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 32DF34BA903A Authentication-Results: sourceware.org; dkim=fail reason="signature verification failed" (768-bit key, unprotected) header.d=tromey.com header.i=@tromey.com header.a=rsa-sha256 header.s=default header.b=g+ZEucx+ Received: from omta40.uswest2.a.cloudfilter.net (omta40.uswest2.a.cloudfilter.net [35.89.44.39]) by sourceware.org (Postfix) with ESMTPS id BAA1D4BA23E7 for ; Sat, 4 Jul 2026 22:05:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org BAA1D4BA23E7 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=tromey.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tromey.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org BAA1D4BA23E7 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=35.89.44.39 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1783202725; cv=none; b=E1/ghLR1h8qCUZ/VYw4GYEKXFkaPd2TVn21RjyTUYSGxhySswMOq4Ns5eOp7aLS7qsK0LSMjHYazMwYoT/EKgVHBx8gunRJeuKh7nVr+2F0ALSOq+mICChptSRXfOhdYfAyMjZrKuEZ3dYKLEuMs+YyhlyOc/hfew4Vp2kKaLpg= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1783202725; c=relaxed/simple; bh=MvObNtp2aNQfcfcPDJcX6OmpvuRcswiFR/gkKwdDx3I=; h=DKIM-Signature:From:Date:Subject:MIME-Version:Message-Id:To; b=ZlBjra+4J5ObmS/RRvfLynx7sw6EdpNM29yp1BXjA6icsOvYkcakzX0+PtOvBepI49xXPTter57Ypq2Ro/QILbr7/mpF5S1eozdRG9daEkxuXqXkt8loSGSvVDbrAXMjGPn5jELJ9j4iWcfd71+SQC/AX72CntEVTtn7j328m4o= ARC-Authentication-Results: i=1; sourceware.org; dkim=policy (768-bit key, unprotected) header.d=tromey.com header.i=@tromey.com header.a=rsa-sha256 header.s=default header.b=g+ZEucx+ reason="signing key too small" DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BAA1D4BA23E7 Received: from eig-obgw-6002b.ext.cloudfilter.net ([10.0.30.203]) by cmsmtp with ESMTPS id fyznwhT1wjgweg8UFwe6vL; Sat, 04 Jul 2026 22:05:23 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id g8UFwbhFaRY4Ig8UFw4CbM; Sat, 04 Jul 2026 22:05:23 +0000 X-Authority-Analysis: v=2.4 cv=WNl/XmsR c=1 sm=1 tr=0 ts=6a4983a3 a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=IkcTkHD0fZMA:10 a=RAioF0-LDSMA:10 a=ItBw4LHWJt0A:10 a=KaXV8R_Atm-rMmgp8iQA:9 a=QEXdDO2ut3YA:10 a=DCx65vhANUyCzuf5D8fC:22 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Cc:To:In-Reply-To:References:Message-Id: Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date:From:Sender: Reply-To: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=dJEfQOSZHXcrox0g1DgAx3YYM0piZhWCOH9oyUch7Ao=; b=g+ZEucx+zURVYlXvx6NtzmMTCk NWOc/kLXKNTxn+AkP+5B0M23ob48UtLGnP0CFG6WuSGxJlAZveKuVjRSl2pG0mjWbBn3GRvay0iBt ToulyQF1f8y970WWEq5QuGNgy; Received: from 75-166-225-82.hlrn.qwest.net ([75.166.225.82]:38412 helo=[192.168.122.1]) by box5379.bluehost.com with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.99.2) (envelope-from ) id 1wg8UE-00000000OSH-3QJA; Sat, 04 Jul 2026 16:05:22 -0600 From: Tom Tromey Date: Sat, 04 Jul 2026 16:05:19 -0600 Subject: [PATCH 5/9] Return value_print_options from varobj_formatted_print_options MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20260704-print-opts-cleanup-v1-5-fb54a5112a8d@tromey.com> References: <20260704-print-opts-cleanup-v1-0-fb54a5112a8d@tromey.com> In-Reply-To: <20260704-print-opts-cleanup-v1-0-fb54a5112a8d@tromey.com> To: gdb-patches@sourceware.org Cc: Tom Tromey X-Mailer: b4 0.14.3 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box5379.bluehost.com X-AntiAbuse: Original Domain - sourceware.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tromey.com X-BWhitelist: no X-Source-IP: 75.166.225.82 X-Source-L: No X-Exim-ID: 1wg8UE-00000000OSH-3QJA X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 75-166-225-82.hlrn.qwest.net ([192.168.122.1]) [75.166.225.82]:38412 X-Source-Auth: tom+tromey.com X-Email-Count: 6 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfIcExC4Gf0jn1y5PgN4511ADERW28GAa5cu1fvAk1xFXzO0Ar4sQyXsi+rLxtDLivdTgsECTGpzY7xWtulqn/dVal6yOh2uPY0D/L73KMb6QRMaaz6H1 d9Ht4tV6iZq86vhEnHswUCXjE1ZygSMandmrm1DmdJ4HzTDuxFpVAV53BFSQVhY1M3fp49TO6GTTgfIHy/8ToL/cHqtId0jT0Y8= 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 This changes varobj_formatted_print_options to return the value_print_options object. --- gdb/ada-varobj.c | 5 +---- gdb/varobj.c | 19 +++++++++---------- gdb/varobj.h | 4 ++-- 3 files changed, 12 insertions(+), 16 deletions(-) diff --git a/gdb/ada-varobj.c b/gdb/ada-varobj.c index d526d4c1857..6d4cf166b87 100644 --- a/gdb/ada-varobj.c +++ b/gdb/ada-varobj.c @@ -922,10 +922,7 @@ static std::string ada_value_of_variable (const struct varobj *var, enum varobj_display_formats format) { - struct value_print_options opts; - - varobj_formatted_print_options (&opts, format); - + value_print_options opts = varobj_formatted_print_options (format); return ada_varobj_get_value_of_variable (var->value.get (), var->type, &opts); } diff --git a/gdb/varobj.c b/gdb/varobj.c index 92a1f5ae578..14eae8d920f 100644 --- a/gdb/varobj.c +++ b/gdb/varobj.c @@ -642,8 +642,7 @@ varobj_get_iterator (struct varobj *var) #if HAVE_PYTHON if (var->dynamic->pretty_printer) { - value_print_options opts; - varobj_formatted_print_options (&opts, var->format); + value_print_options opts = varobj_formatted_print_options (var->format); return py_varobj_get_iterator (var, var->dynamic->pretty_printer, &opts); } #endif @@ -2100,13 +2099,14 @@ my_value_of_variable (struct varobj *var, enum varobj_display_formats format) return std::string (); } -void -varobj_formatted_print_options (struct value_print_options *opts, - enum varobj_display_formats format) +value_print_options +varobj_formatted_print_options (enum varobj_display_formats format) { - *opts = get_formatted_print_options (format_code[(int) format]); - opts->deref_ref = false; - opts->raw = !pretty_printing; + value_print_options opts + = get_formatted_print_options (format_code[(int) format]); + opts.deref_ref = false; + opts.raw = !pretty_printing; + return opts; } std::string @@ -2114,7 +2114,6 @@ varobj_value_get_print_value (struct value *value, enum varobj_display_formats format, const struct varobj *var) { - struct value_print_options opts; struct type *type = NULL; long len = 0; gdb::unique_xmalloc_ptr encoding; @@ -2128,7 +2127,7 @@ varobj_value_get_print_value (struct value *value, string_file stb; std::string thevalue; - varobj_formatted_print_options (&opts, format); + value_print_options opts = varobj_formatted_print_options (format); #if HAVE_PYTHON if (gdb_python_initialized) diff --git a/gdb/varobj.h b/gdb/varobj.h index 1fab22d1c9e..57161a31c66 100644 --- a/gdb/varobj.h +++ b/gdb/varobj.h @@ -347,8 +347,8 @@ extern std::string enum varobj_display_formats format, const struct varobj *var); -extern void varobj_formatted_print_options (struct value_print_options *opts, - enum varobj_display_formats format); +extern value_print_options + varobj_formatted_print_options (enum varobj_display_formats format); extern void varobj_restrict_range (const std::vector &children, int *from, int *to); -- 2.49.0