From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id ZbxkLrOQkmEyHgAAWB0awg (envelope-from ) for ; Mon, 15 Nov 2021 11:54:11 -0500 Received: by simark.ca (Postfix, from userid 112) id AE8C31F0C1; Mon, 15 Nov 2021 11:54:11 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-3.8 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, NICE_REPLY_A 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 0D7091ECEB for ; Mon, 15 Nov 2021 11:54:11 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 2D9FA3857C75 for ; Mon, 15 Nov 2021 16:54:10 +0000 (GMT) Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id 659D33858D39 for ; Mon, 15 Nov 2021 16:53:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 659D33858D39 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=simark.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=simark.ca Received: from [172.16.0.95] (192-222-180-24.qc.cable.ebox.net [192.222.180.24]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id D53A31ECEB; Mon, 15 Nov 2021 11:53:58 -0500 (EST) Subject: Re: [PATCH] gdb: fix gdbarch_tdep ODR violation To: Pedro Alves , Simon Marchi , gdb-patches@sourceware.org References: <20211112204233.4108340-1-simon.marchi@efficios.com> <02f10a33-9657-5e16-e753-4b0476a4da1d@palves.net> From: Simon Marchi Message-ID: <2f790289-e834-b294-47d7-d6de5f008099@simark.ca> Date: Mon, 15 Nov 2021 11:53:58 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: <02f10a33-9657-5e16-e753-4b0476a4da1d@palves.net> Content-Type: text/plain; charset=utf-8 Content-Language: tl Content-Transfer-Encoding: 7bit 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: , Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" On 2021-11-15 11:47 a.m., Pedro Alves wrote: > On 2021-11-12 20:42, Simon Marchi via Gdb-patches wrote: >> + aarch64_gdbarch_tdep *tdep >> + = (aarch64_gdbarch_tdep *) gdbarch_tdep (gdbarch); > > I'd think it would be nicer if we added a small wrapper function to each module, like: > > static aarch64_gdbarch_tdep * > aarch64_gdbarch_tdep (struct gdbarch *gdbarch) > { > return (aarch64_gdbarch_tdep *) gdbarch_tdep (gdbarch); > } > > and then we we'd get rid of all the casts and duplicated type names at the callers, like: > > auto *tdep = aarch64_gdbarch_tdep (gdbarch); > > That'd essentially require touching again most lines you already touched, so, yeah, for some > other rainy day... > Hmm good idea. Perhaps with some sed commands it might not be so bad, I'll see. Simon