From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8634 invoked by alias); 17 Feb 2010 16:19:47 -0000 Received: (qmail 8623 invoked by uid 22791); 17 Feb 2010 16:19:46 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from sibelius.xs4all.nl (HELO glazunov.sibelius.xs4all.nl) (83.163.83.176) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 17 Feb 2010 16:19:38 +0000 Received: from glazunov.sibelius.xs4all.nl (kettenis@localhost [127.0.0.1]) by glazunov.sibelius.xs4all.nl (8.14.3/8.14.3) with ESMTP id o1HGIGLb026049; Wed, 17 Feb 2010 17:18:16 +0100 (CET) Received: (from kettenis@localhost) by glazunov.sibelius.xs4all.nl (8.14.3/8.14.3/Submit) id o1HGIEjC003873; Wed, 17 Feb 2010 17:18:14 +0100 (CET) Date: Wed, 17 Feb 2010 16:19:00 -0000 Message-Id: <201002171618.o1HGIEjC003873@glazunov.sibelius.xs4all.nl> From: Mark Kettenis To: dan@codesourcery.com CC: hjl.tools@gmail.com, mark.kettenis@xs4all.nl, gdb-patches@sourceware.org In-reply-to: <20100217154553.GL9493@caradoc.them.org> (message from Daniel Jacobowitz on Wed, 17 Feb 2010 10:45:54 -0500) Subject: Re: PATCH: Enable x86 XML target descriptions References: <20100210200303.GA19632@lucon.org> <20100217145820.GA20676@lucon.org> <201002171522.o1HFMpBN006203@glazunov.sibelius.xs4all.nl> <6dc9ffc81002170741h3611c369mb3efd2b5bcdb8a34@mail.gmail.com> <20100217154553.GL9493@caradoc.them.org> Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2010-02/txt/msg00427.txt.bz2 > Date: Wed, 17 Feb 2010 10:45:54 -0500 > From: Daniel Jacobowitz > > On Wed, Feb 17, 2010 at 07:41:48AM -0800, H.J. Lu wrote: > > > Also, you should split i386_linux_register_name(), > > > i386_linix_register_type() i386_linux_init_orig_eax() into seperate > > > i386 and amd64 versions, and get rid of all the #ifdef BFD64's in the > > > *-tdep.c files.  There has been a clear split between 32-bit and > > > 64-bit versions of the *-tdep.c code and this diff blurrs that. > > > > I am not sure it is easy to do, especially for register description. > > I have an impression that tdesc_use_registers should only be called > > once per arch. i386 and amd64 belong to the same bfd_arch_i386. > > So? You can still call set_gdbarch_register_name. > > > I can try to minimize BFD64. But I am afraid that I can't totally avoid it. > > Is that acceptable? > > No, amd64 support really should be in its own file. So I guess a potential way of handling this, is to leave the set_gdbarch_num_regs/set_gdbarch_register_name/set_gdbarch_register_type calls as they are now, add a tdesc member to "struct gdbarch_tdep", initialize that in the xxx_init_abi() functions (if a target description is available), possibly overriding a less-specific setting, and call tdesc_use_registers at the very end of i386_gdbarch_init() if the tdesc member of "struct gdbarch_tdep" is non-NULL.