From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id B9F853851C2C for ; Tue, 16 Jun 2020 02:08:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org B9F853851C2C Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=simark.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=simark@simark.ca Received: from [10.0.0.11] (173-246-6-90.qc.cable.ebox.net [173.246.6.90]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 3569F1E5F9; Mon, 15 Jun 2020 22:08:43 -0400 (EDT) Subject: Re: [PATCH v2 4/4] arc: Add arc-*-linux regformats To: Shahab Vahedi Cc: gdb-patches@sourceware.org, Shahab Vahedi , Anton Kolesov , Tom Tromey , Francois Bedard References: <20200326125206.13120-1-shahab.vahedi@gmail.com> <20200428160437.1585-1-shahab.vahedi@gmail.com> <20200428160437.1585-5-shahab.vahedi@gmail.com> <20200615233751.GC1816@gmail.com> From: Simon Marchi Message-ID: <4bed510c-613c-8521-1a22-13e9a950327d@simark.ca> Date: Mon, 15 Jun 2020 22:08:42 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 MIME-Version: 1.0 In-Reply-To: <20200615233751.GC1816@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: fr Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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: Tue, 16 Jun 2020 02:08:44 -0000 On 2020-06-15 7:37 p.m., Shahab Vahedi wrote: > On Thu, May 14, 2020 at 11:12:55AM -0400, Simon Marchi wrote: >> On 2020-04-28 12:04 p.m., Shahab Vahedi via Gdb-patches wrote: >>> From: Anton Kolesov >>> >>> gdb/ChangeLog: >>> 2020-04-28 Anton Kolesov >>> >>> * features/Makefile: Add new files and expedite registers. >>> * regformats/arc-arcompact-Linux.dat: New file. >>> * regformats/arc-v2-Linux.dat: Likewise. >> >> Can you explain why this is useful? I always forget, but I have the feeling >> that regformats are something we are going away from, and that if you support >> target descriptions, you don't need that... but I would need to refresh my >> memory. > > To my understanding, the values of "expedite" registers are always transferred > from the "server" to GDB client. With every step you take, or any stop you do, > GDB client will know about the value of "expedite" registers. In case of ARC, > those are the "program counter" and "stack pointer" registers. > I _think_ the "dat" files are the mechanism holding information about that. > After all it is generated from the XML and we also followed other targets > in doing so. It's true that these .dat files do that, but it's not the only way. They don't offer any flexibility for architectures that have optional set of registers, as it requires you to generate one format for each possible combination of these options. So the trend has been to move away from that, towards target descriptions assembled at runtime. I would encourage you to look at how aarch64 handles it, as it's one of the latest that was introduced. You'll notice that there is one xml file for each "feature". They are then assembled at runtime based on the features detected on the current hardware. The expedite registers are also taken care of, it's all in gdbserver/linux-aarch64-tdesc.cc. I'd prefer if we didn't add a new architecture that uses the old method. Simon