From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 8eeyAX2B2WmaTBEAWB0awg (envelope-from ) for ; Fri, 10 Apr 2026 19:02:21 -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=S7qoPaRD; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 01E911E0BC; Fri, 10 Apr 2026 19:02:20 -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 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 5E5E41E04F for ; Fri, 10 Apr 2026 19:02:20 -0400 (EDT) Received: from vm01.sourceware.org (localhost [127.0.0.1]) by sourceware.org (Postfix) with ESMTP id 3BA434BA23C4 for ; Fri, 10 Apr 2026 23:02:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3BA434BA23C4 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=S7qoPaRD Received: from omta40.uswest2.a.cloudfilter.net (omta40.uswest2.a.cloudfilter.net [35.89.44.39]) by sourceware.org (Postfix) with ESMTPS id AEF2C4BA2E2A for ; Fri, 10 Apr 2026 22:59:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org AEF2C4BA2E2A 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 AEF2C4BA2E2A Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=35.89.44.39 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1775861983; cv=none; b=HH2BvCa0Mgr0eM/KI3+yKNJkPOdNKNWIzfF2bz9s3GMGojszsR7z2cIcGzUbCGCXxO46RiPUYEfK+JTSrj5OD6sNycYC0J9BRvmdbaVG/g0jEhPBt8pzAPnrD47cRIDl+As8cc7wIdT9lSX4LT1W2kUUPWz3gliJDbbaw/H2im8= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1775861983; c=relaxed/simple; bh=CqCkH2Vjp0g9UtmP70NdxmGTb4o7Ch6hHI6LFE4jvtA=; h=DKIM-Signature:From:Date:Subject:MIME-Version:Message-Id:To; b=g+p/2pevBMh6QzKeSjtozf0SjpBK/W2L0V5csnzBU5JCXMlv2Y/Q9QdF/lGdlRdd/RJrjWIs97wS/YUbBsQzZMcvt+BYX/Nqeo5PNtA4yJBOx5TatFw1ckp9+3GwLGGNVYJC9kdcBVV0X+jSXU0CbIYito56+/FxDeLZvbTC2zA= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AEF2C4BA2E2A Received: from eig-obgw-6001b.ext.cloudfilter.net ([10.0.30.143]) by cmsmtp with ESMTPS id BJVWwOGv6shqQBKpCw0ogx; Fri, 10 Apr 2026 22:59:42 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id BKpBwsAxuYA8xBKpBwS1y3; Fri, 10 Apr 2026 22:59:42 +0000 X-Authority-Analysis: v=2.4 cv=VJfdn8PX c=1 sm=1 tr=0 ts=69d980de a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=IkcTkHD0fZMA:10 a=A5OVakUREuEA:10 a=ItBw4LHWJt0A:10 a=BPlRGDPdTNpuC6ItH6QA:9 a=3ZKOabzyN94A:10 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=OS+eNB+pnBcBnO7gPcYZFOhybXn8gF5b3y4Umi2ewjM=; b=S7qoPaRD2I35Zv7YpXbQ2Ikffs NWmLCJ2IC5MT65ctwfIrrm3YS8AtuCGxG8mOTVGdPaDSZCkHipHQm8GYh84SkkFrL45V0x5+TJnr9 32X+D1bICtmWuvyJCEp7qL0/b; Received: from 75-166-225-82.hlrn.qwest.net ([75.166.225.82]:49954 helo=[192.168.122.1]) by box5379.bluehost.com with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1wBKpB-00000001tnB-20WG; Fri, 10 Apr 2026 16:59:41 -0600 From: Tom Tromey Date: Fri, 10 Apr 2026 16:59:44 -0600 Subject: [PATCH 4/5] Use function style with throw_error MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20260410-unify-exceptions-v1-4-ea64dae971a8@tromey.com> References: <20260410-unify-exceptions-v1-0-ea64dae971a8@tromey.com> In-Reply-To: <20260410-unify-exceptions-v1-0-ea64dae971a8@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: 1wBKpB-00000001tnB-20WG 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]:49954 X-Source-Auth: tom+tromey.com X-Email-Count: 5 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfB5cf+lWbHDK5K2s0tRdWkrJm7KikgpfPPIctWIvSnMOOit8evV9Q5LanhESAGcLwVXgDbk0ZUn4n8H+TV9uVn8qnAYqQRKYKvwEgzNXjNS0p4V1gTD4 aM1J1rQ0fAd+RfaUj6VJXj7TBWpTRX6PM362b7agn4ZZeqd4cvcwM0Exn8LHIa4cLqliXa3kWCJFamYlkKJoa13cZRD90SZyUCo= 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 some calls to throw_error to use function_name_style. --- gdb/infcall.c | 1 + gdb/linespec.c | 12 +++++++----- gdb/valarith.c | 7 +++++-- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/gdb/infcall.c b/gdb/infcall.c index a1328479d0a..8b26f541de6 100644 --- a/gdb/infcall.c +++ b/gdb/infcall.c @@ -29,6 +29,7 @@ #include "language.h" #include "objfiles.h" #include "cli/cli-cmds.h" +#include "cli/cli-style.h" #include "command.h" #include "dummy-frame.h" #include "ada-lang.h" diff --git a/gdb/linespec.c b/gdb/linespec.c index 493ad47e76a..bd3b1c9386a 100644 --- a/gdb/linespec.c +++ b/gdb/linespec.c @@ -1553,12 +1553,13 @@ symbol_not_found_error (const char *symbol, const char *filename) { if (filename) throw_error (NOT_FOUND_ERROR, - _("Function \"%s\" not defined in \"%ps\"."), - symbol, + _("Function \"%ps\" not defined in \"%ps\"."), + styled_string (function_name_style.style (), symbol), styled_string (file_name_style.style (), filename)); else throw_error (NOT_FOUND_ERROR, - _("Function \"%s\" not defined."), symbol); + _("Function \"%ps\" not defined."), + styled_string (function_name_style.style (), symbol)); } } @@ -1597,8 +1598,9 @@ undefined_label_error (const char *function, const char *label) { if (function != NULL) throw_error (NOT_FOUND_ERROR, - _("No label \"%s\" defined in function \"%s\"."), - label, function); + _("No label \"%s\" defined in function \"%ps\"."), + label, + styled_string (function_name_style.style (), function)); else throw_error (NOT_FOUND_ERROR, _("No label \"%s\" defined in current function."), diff --git a/gdb/valarith.c b/gdb/valarith.c index 673bdee2d11..ed5b5d8adf9 100644 --- a/gdb/valarith.c +++ b/gdb/valarith.c @@ -30,6 +30,7 @@ #include "gdbarch.h" #include "rust-lang.h" #include "ada-lang.h" +#include "cli/cli-style.h" /* Forward declarations. */ static struct value *value_subscripted_rvalue (struct value *array, @@ -559,7 +560,8 @@ value_x_binop (struct value *arg1, struct value *arg2, enum exp_opcode op, argvec.slice (1, 2 - static_memfuncp)); } throw_error (NOT_FOUND_ERROR, - _("member function %s not found"), tstr); + _("member function %ps not found"), + styled_string (function_name_style.style (), tstr)); } /* We know that arg1 is a structure, so try to find a unary user @@ -672,7 +674,8 @@ value_x_unop (struct value *arg1, enum exp_opcode op, enum noside noside) argvec.slice (1, nargs)); } throw_error (NOT_FOUND_ERROR, - _("member function %s not found"), tstr); + _("member function %ps not found"), + styled_string (function_name_style.style (), tstr)); } -- 2.49.0