From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id /ozmKr66X2q+VCEAWB0awg (envelope-from ) for ; Tue, 21 Jul 2026 14:30:22 -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=LpvaDlr5; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 9E39F1E09E; Tue, 21 Jul 2026 14:30:22 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-5.1 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_INVALID,DKIM_SIGNED,MAILING_LIST_MULTI,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 14DED1E033 for ; Tue, 21 Jul 2026 14:30:22 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 242B94BA2E2C for ; Tue, 21 Jul 2026 18:30:20 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 242B94BA2E2C 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=LpvaDlr5 Received: from omta040.useast.a.cloudfilter.net (omta040.useast.a.cloudfilter.net [44.202.169.39]) by sourceware.org (Postfix) with ESMTPS id BFBE04BA2E0B for ; Tue, 21 Jul 2026 18:29:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org BFBE04BA2E0B 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 BFBE04BA2E0B Authentication-Results: sourceware.org; arc=none smtp.remote-ip=44.202.169.39 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1784658592; cv=none; b=HmlliUASB01vHW4CTENP3YtDL64rPmrxvQIL0yNKglnuo1kqNlpCCX+5ByAu4PC+BJV6ukJJllzqTaPRa5aVKBlRHKXX/DpMujl+S1nua+q/o19s57oaJrYF3V8anwXo92mDhVQMkJUCJCR59ZTaWNXsOS5PpwVEQlmSZQA8xL0= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1784658592; c=relaxed/simple; bh=3kiSRCMXAku6NSK1c0DFHDUbcaaBKXxecM/5KYBETSs=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=JhzIbuvSiYaS134mSOthuwQQ3u918gd3C3skHGQmZANrQr7X52iLK6490YIhmYpwNKgmNNUGSC+8/lRAZ4u281XzExCHXxORsBvvpFWD+VDla6J5xkY6ajU1boJk8H+lVq1Pg19A0GNH7TCF6TOtRbMYRJfeYaD6kTPi6Fqxgok= 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=LpvaDlr5 reason="signing key too small" DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BFBE04BA2E0B Received: from eig-obgw-6002b.ext.cloudfilter.net ([10.0.30.203]) by cmsmtp with ESMTPS id m6KawGIhHuFzgmFE0wUTcc; Tue, 21 Jul 2026 18:29:52 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id mFDzw9itURY4ImFDzwlMyq; Tue, 21 Jul 2026 18:29:51 +0000 X-Authority-Analysis: v=2.4 cv=WNl/XmsR c=1 sm=1 tr=0 ts=6a5fbaa0 a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=RAioF0-LDSMA:10 a=ItBw4LHWJt0A:10 a=zd2uoN0lAAAA:8 a=8Q84ZVGRl9_80_NLPq0A:9 a=DCx65vhANUyCzuf5D8fC:22 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Type:MIME-Version:Message-ID:Date:References:In-Reply-To :Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: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=8c7aVxaXtDEz8nnR2qPzY1ZtzLFxwcwyRUawU9zfwQw=; b=LpvaDlr57ED64SOOOMQlsKqG0x 4YzWnhqf1QwdZ1DX2da1aL5rLZW0QAnMxpMS/gDUzWwuMxB/+QmymyKnHaXJdctNwLho1GnOuK9kn BvWh9tLL5npe9YMUaoVY1qJR/; Received: from 75-166-225-82.hlrn.qwest.net ([75.166.225.82]:41036 helo=bapiya) by box5379.bluehost.com with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.99.2) (envelope-from ) id 1wmFDz-00000003Upo-0RlI; Tue, 21 Jul 2026 12:29:51 -0600 From: Tom Tromey To: Tankut Baris Aktemur Cc: Subject: Re: [PATCH 05/16] gdb: inline address_space_{name, type_instance_flags}_to_{type_instance_flags, name} In-Reply-To: <20260713-users-aktemur-type-instance-flags-v1-5-779cad0c85ec@amd.com> (Tankut Baris Aktemur's message of "Mon, 13 Jul 2026 09:00:04 -0500") References: <20260713-users-aktemur-type-instance-flags-v1-0-779cad0c85ec@amd.com> <20260713-users-aktemur-type-instance-flags-v1-5-779cad0c85ec@amd.com> X-Attribution: Tom Date: Tue, 21 Jul 2026 12:29:49 -0600 Message-ID: <87fr1ctcv6.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain 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: 1wmFDz-00000003Upo-0RlI X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 75-166-225-82.hlrn.qwest.net (bapiya) [75.166.225.82]:41036 X-Source-Auth: tom+tromey.com X-Email-Count: 8 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfK16y48nRCtiNsuZ9evMCjW3q65+5bqtcvEEHmMPa1TASn9lvg/wKg/Bo0cY6+90cyakcvQ2N2aWpqFdWhbbqZ+2mMIhGqNt4yxVKQtjphGvZMRNeZl8 8qCvN3I6d7yV6nal7ciVk2SA96tM9XGhji4za9SVqs9OehWyvxpx6zSgxtujVEDd/MbmZBb4Fr5UcuqSfa4M5kJF44f9K8xR2F0= 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 >>>>> Tankut Baris Aktemur writes: > Inline the functions and remove them. This is a step towards > separating the handling of two concepts. > In type-stack.c, which is used by the parser to convert user inputs > into types, "@code" and "@data" and architecture-specific address > class names are treated the same, too, blurring the difference and > their storage in type instance flags. While we inline the use of > address_space_name_to_type_instance_flags there, we also separate the > two topics by defining different tokens. The patch still pushes type > instance flags into the type stack. The subsequent patch will further > clean this up to store address class and address space ids. On the one hand, this seems like a mild step backward in the sense that if we ever wanted to support these things in non-C languages, it would have to be reimplemented there. OTOH, nobody has seen fit to do that in the last 20 years or whatever it is. > + enum type_pieces piece; > + int int_val; > + unsigned int aclass; > + > + /* Check for Harvard address space delimiters. */ > + if (streq (string, "code")) > + { > + piece = tp_harvard_aspace_identifier; > + int_val = TYPE_INSTANCE_FLAG_CODE_SPACE; > + } > + else if (streq (string, "data")) > + { > + piece = tp_harvard_aspace_identifier; > + int_val = TYPE_INSTANCE_FLAG_DATA_SPACE; > + } > + else if (gdbarch_address_class_name_to_id_p (gdbarch) > + && gdbarch_address_class_name_to_id (gdbarch, > + string, > + aclass)) > + { > + piece = tp_aclass_identifier; > + int_val = (enum type_instance_flag_value) (aclass << 4); > + } > + else > + error (_("Unknown address space/class specifier: \"%s\""), string); > + > + element.piece = piece; > insert_into (slot, element); > - element.int_val > - = address_space_name_to_type_instance_flags (gdbarch, string); > + element.int_val = int_val; I think the various 'if' branches might as well just assign directly to element.*; and 'aclass' can be moved into the if like else if (unsigned int aclass = 0; gdbarch_address_class_name_to_id_p (...) && ...) I didn't read the whole series yet but if we're going to use different words, as is done in that error message, then some spot in the manual ought to explain this. Tom