From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 4GqWD5SgBWL8QQAAWB0awg (envelope-from ) for ; Thu, 10 Feb 2022 18:32:36 -0500 Received: by simark.ca (Postfix, from userid 112) id 3D5D01F3C6; Thu, 10 Feb 2022 18:32:36 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI autolearn=ham autolearn_force=no version=3.4.2 Received: from 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 RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id A94D51ECEB for ; Thu, 10 Feb 2022 18:32:35 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 344A0385842F for ; Thu, 10 Feb 2022 23:32:35 +0000 (GMT) Received: from outbound-ss-761.bluehost.com (outbound-ss-761.bluehost.com [74.220.211.250]) by sourceware.org (Postfix) with ESMTPS id 2A9EA3858C2C for ; Thu, 10 Feb 2022 23:31:56 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 2A9EA3858C2C 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 cmgw15.mail.unifiedlayer.com (unknown [10.0.90.130]) by progateway8.mail.pro1.eigbox.com (Postfix) with ESMTP id 149A11005DDA3 for ; Thu, 10 Feb 2022 23:31:55 +0000 (UTC) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTP id IIuontdVWkku4IIuonAX8r; Thu, 10 Feb 2022 23:31:55 +0000 X-Authority-Reason: nr=8 X-Authority-Analysis: v=2.4 cv=Y8c9DjSN 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=pUfWA_-l1yX-vmwvp1kA: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=DWsRY0L7VVr1GxQf9nMizTK/ELHUhxiQZA0cn7/Hfcc=; b=ELsUUIVo5gvHttV5PmsuAwdPBZ wFGeO9feZZ8qvsxClfOXB3L1ow94KYDeZ82VA8K73JGtwkTLvnQJle8mBqwxRuL5xWHPJBqorM95r TK4Z5vjm0hqNTEhuCC2QpiS7Q; 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-7O; Thu, 10 Feb 2022 16:31:54 -0700 From: Tom Tromey To: gdb-patches@sourceware.org Subject: [PATCH 1/3] Remove LA_PRINT_TYPE Date: Thu, 10 Feb 2022 16:31:50 -0700 Message-Id: <20220210233152.2181913-2-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-7O 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: 2 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes 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: , Cc: Tom Tromey Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" This removes the LA_PRINT_TYPE macro, in favor of using ordinary method calls. --- gdb/guile/scm-type.c | 3 ++- gdb/language.h | 3 --- gdb/python/py-type.c | 5 +++-- gdb/symmisc.c | 18 +++++++++--------- gdb/typeprint.c | 5 +++-- 5 files changed, 17 insertions(+), 17 deletions(-) diff --git a/gdb/guile/scm-type.c b/gdb/guile/scm-type.c index 987660ceaf9..27d00f12a95 100644 --- a/gdb/guile/scm-type.c +++ b/gdb/guile/scm-type.c @@ -108,7 +108,8 @@ tyscm_type_name (struct type *type) { string_file stb; - LA_PRINT_TYPE (type, "", &stb, -1, 0, &type_print_raw_options); + current_language->print_type (type, "", &stb, -1, 0, + &type_print_raw_options); return stb.release (); } catch (const gdb_exception &except) diff --git a/gdb/language.h b/gdb/language.h index bfdade398e4..3930f5bd223 100644 --- a/gdb/language.h +++ b/gdb/language.h @@ -755,9 +755,6 @@ extern enum language set_language (enum language); the current setting of working_lang, which the user sets with the "set language" command. */ -#define LA_PRINT_TYPE(type,varstring,stream,show,level,flags) \ - (current_language->print_type(type,varstring,stream,show,level,flags)) - #define LA_PRINT_CHAR(ch, type, stream) \ (current_language->printchar (ch, type, stream)) #define LA_PRINT_STRING(stream, elttype, string, length, encoding, force_ellipses, options) \ diff --git a/gdb/python/py-type.c b/gdb/python/py-type.c index 9df667d2811..8613534d060 100644 --- a/gdb/python/py-type.c +++ b/gdb/python/py-type.c @@ -1025,8 +1025,9 @@ typy_str (PyObject *self) try { - LA_PRINT_TYPE (type_object_to_type (self), "", &thetype, -1, 0, - &type_print_raw_options); + current_language->print_type (type_object_to_type (self), "", + &thetype, -1, 0, + &type_print_raw_options); } catch (const gdb_exception &except) { diff --git a/gdb/symmisc.c b/gdb/symmisc.c index 160278b50a9..114d6bc5e53 100644 --- a/gdb/symmisc.c +++ b/gdb/symmisc.c @@ -525,8 +525,8 @@ print_symbol (struct gdbarch *gdbarch, struct symbol *symbol, { if (symbol->type ()->name ()) { - LA_PRINT_TYPE (symbol->type (), "", outfile, 1, depth, - &type_print_raw_options); + current_language->print_type (symbol->type (), "", outfile, 1, depth, + &type_print_raw_options); } else { @@ -536,8 +536,8 @@ print_symbol (struct gdbarch *gdbarch, struct symbol *symbol, : (symbol->type ()->code () == TYPE_CODE_STRUCT ? "struct" : "union")), symbol->linkage_name ()); - LA_PRINT_TYPE (symbol->type (), "", outfile, 1, depth, - &type_print_raw_options); + current_language->print_type (symbol->type (), "", outfile, 1, depth, + &type_print_raw_options); } fprintf_filtered (outfile, ";\n"); } @@ -548,11 +548,11 @@ print_symbol (struct gdbarch *gdbarch, struct symbol *symbol, if (symbol->type ()) { /* Print details of types, except for enums where it's clutter. */ - LA_PRINT_TYPE (symbol->type (), symbol->print_name (), - outfile, - symbol->type ()->code () != TYPE_CODE_ENUM, - depth, - &type_print_raw_options); + current_language->print_type (symbol->type (), symbol->print_name (), + outfile, + symbol->type ()->code () != TYPE_CODE_ENUM, + depth, + &type_print_raw_options); fprintf_filtered (outfile, "; "); } else diff --git a/gdb/typeprint.c b/gdb/typeprint.c index f7a2ebac398..c15a9c6b59f 100644 --- a/gdb/typeprint.c +++ b/gdb/typeprint.c @@ -392,7 +392,8 @@ void type_print (struct type *type, const char *varstring, struct ui_file *stream, int show) { - LA_PRINT_TYPE (type, varstring, stream, show, 0, &default_ptype_flags); + current_language->print_type (type, varstring, stream, show, 0, + &default_ptype_flags); } /* Print TYPE to a string, returning it. The caller is responsible for @@ -578,7 +579,7 @@ whatis_exp (const char *exp, int show) printf_filtered (" */\n"); } - LA_PRINT_TYPE (type, "", gdb_stdout, show, 0, &flags); + current_language->print_type (type, "", gdb_stdout, show, 0, &flags); printf_filtered ("\n"); } -- 2.31.1