From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gproxy1-pub.mail.unifiedlayer.com (gproxy1-pub.mail.unifiedlayer.com [69.89.25.95]) by sourceware.org (Postfix) with ESMTPS id 759DD3858C3A for ; Thu, 10 Feb 2022 23:31:56 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 759DD3858C3A Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=tromey.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tromey.com Received: from cmgw14.mail.unifiedlayer.com (unknown [10.0.90.129]) by progateway3.mail.pro1.eigbox.com (Postfix) with ESMTP id DFFF0100478AA for ; Thu, 10 Feb 2022 23:31:55 +0000 (UTC) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTP id IIupnR3xj2s5dIIupn7CRf; Thu, 10 Feb 2022 23:31:55 +0000 X-Authority-Reason: nr=8 X-Authority-Analysis: v=2.4 cv=BOh2EHcG c=1 sm=1 tr=0 ts=6205a06b a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=dLZJa+xiwSxG16/P+YVxDGlgEgI=:19 a=oGFeUVbbRNcA:10:nop_rcvd_month_year a=Qbun_eYptAEA:10:endurance_base64_authed_username_1 a=Ek9o5C1wsDNWHwpDnmEA:9 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: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=P8JcnpJb059ScQZL8Okrzv/Xn2pautWFZURu9RmzhqM=; b=yDgxY/Soek/oOKb6GNi0GOYysf sCI+Fe1X1hM+7yfA7S+cbzp6IZiYACSrxk7igKOCeDDiYb2NoRiiu93VWxznp5unsJLJRP07202vE 9xUnqR3mgbW0vDmkFs2y5s6F+; Received: from c-73-181-19-44.hsd1.co.comcast.net ([73.181.19.44]:37350 helo=prentzel..) by box5379.bluehost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1nIIuo-001dcp-Rw; Thu, 10 Feb 2022 16:31:54 -0700 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH 3/3] Remove LA_PRINT_STRING Date: Thu, 10 Feb 2022 16:31:52 -0700 Message-Id: <20220210233152.2181913-4-tom@tromey.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220210233152.2181913-1-tom@tromey.com> References: <20220210233152.2181913-1-tom@tromey.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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: 73.181.19.44 X-Source-L: No X-Exim-ID: 1nIIuo-001dcp-Rw X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: c-73-181-19-44.hsd1.co.comcast.net (prentzel..) [73.181.19.44]:37350 X-Source-Auth: tom+tromey.com X-Email-Count: 4 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-Spam-Status: No, score=-3031.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, JMQ_SPF_NEUTRAL, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Feb 2022 23:31:57 -0000 This removes the LA_PRINT_STRING macro, in favor of using ordinary method calls. --- gdb/c-valprint.c | 6 +++--- gdb/language.h | 9 --------- gdb/valprint.c | 7 +++---- gdb/varobj.c | 4 ++-- 4 files changed, 8 insertions(+), 18 deletions(-) diff --git a/gdb/c-valprint.c b/gdb/c-valprint.c index 047e5687b0a..0d30700c06d 100644 --- a/gdb/c-valprint.c +++ b/gdb/c-valprint.c @@ -277,7 +277,7 @@ c_value_print_array (struct value *val, ++temp_len) ; - /* Force LA_PRINT_STRING to print ellipses if + /* Force printstr to print ellipses if we've printed the maximum characters and the next character is not \000. */ if (temp_len == options->print_max && temp_len < len) @@ -292,8 +292,8 @@ c_value_print_array (struct value *val, len = temp_len; } - LA_PRINT_STRING (stream, unresolved_elttype, valaddr, len, - NULL, force_ellipses, options); + current_language->printstr (stream, unresolved_elttype, valaddr, len, + NULL, force_ellipses, options); } else { diff --git a/gdb/language.h b/gdb/language.h index 4eb414bbe12..f2885000259 100644 --- a/gdb/language.h +++ b/gdb/language.h @@ -750,15 +750,6 @@ extern void language_info (); extern enum language set_language (enum language); -/* This page contains functions that return things that are - specific to languages. Each of these functions is based on - the current setting of working_lang, which the user sets - with the "set language" command. */ - -#define LA_PRINT_STRING(stream, elttype, string, length, encoding, force_ellipses, options) \ - (current_language->printstr (stream, elttype, string, length, \ - encoding, force_ellipses,options)) - /* Test a character to decide whether it can be printed in literal form or needs to be printed in another representation. For example, in C the literal form of the character with octal value 141 is 'a' diff --git a/gdb/valprint.c b/gdb/valprint.c index 07bc324be5d..d6ec64845f4 100644 --- a/gdb/valprint.c +++ b/gdb/valprint.c @@ -2767,10 +2767,9 @@ val_print_string (struct type *elttype, const char *encoding, But if we fetch something and then get an error, print the string and then the error message. */ if (err == 0 || bytes_read > 0) - { - LA_PRINT_STRING (stream, elttype, buffer.get (), bytes_read / width, - encoding, force_ellipsis, options); - } + current_language->printstr (stream, elttype, buffer.get (), + bytes_read / width, + encoding, force_ellipsis, options); if (err != 0) { diff --git a/gdb/varobj.c b/gdb/varobj.c index 80216a455e8..5617131da20 100644 --- a/gdb/varobj.c +++ b/gdb/varobj.c @@ -2232,8 +2232,8 @@ varobj_value_get_print_value (struct value *value, /* If the THEVALUE has contents, it is a regular string. */ if (!thevalue.empty ()) - LA_PRINT_STRING (&stb, type, (gdb_byte *) thevalue.c_str (), - len, encoding.get (), 0, &opts); + current_language->printstr (&stb, type, (gdb_byte *) thevalue.c_str (), + len, encoding.get (), 0, &opts); else if (string_print) /* Otherwise, if string_print is set, and it is not a regular string, it is a lazy string. */ -- 2.31.1