From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2273 invoked by alias); 28 Oct 2003 21:59:27 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 2265 invoked from network); 28 Oct 2003 21:59:26 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sources.redhat.com with SMTP; 28 Oct 2003 21:59:26 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.11.6/8.11.6) with ESMTP id h9SLxQM24006 for ; Tue, 28 Oct 2003 16:59:26 -0500 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [172.16.52.156]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id h9SLxQ612815 for ; Tue, 28 Oct 2003 16:59:26 -0500 Received: from localhost.localdomain (vpn50-2.rdu.redhat.com [172.16.50.2]) by pobox.corp.redhat.com (8.12.8/8.12.8) with ESMTP id h9SLxPju002568; Tue, 28 Oct 2003 16:59:25 -0500 Received: (from kev@localhost) by localhost.localdomain (8.11.6/8.11.6) id h9SLxJF03765; Tue, 28 Oct 2003 14:59:19 -0700 Date: Tue, 28 Oct 2003 21:59:00 -0000 From: Kevin Buettner Message-Id: <1031028215919.ZM3764@localhost.localdomain> In-Reply-To: Andrew Cagney "[patch/rfc,rfa:ppc64] Add osabi wildcard support" (Oct 23, 7:25pm) References: <3F986371.9060708@redhat.com> To: Andrew Cagney , gdb-patches@sources.redhat.com Subject: Re: [patch/rfc,rfa:ppc64] Add osabi wildcard support MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2003-10/txt/msg00820.txt.bz2 On Oct 23, 7:25pm, Andrew Cagney wrote: > The attached patch adds the ability to specify a wildcard machine when > registering an OSABI / arch / machine. It then updates PPC64 GNU/Linux > to specify that wild card (-1) instead of zero as the default machine. > > Looking at the PPC64 GNU/Linux code: > > gdbarch_register_osabi (bfd_arch_powerpc, 0, GDB_OSABI_LINUX, > ppc_linux_init_abi); > > I believe that the call is attempting to register ppc_linux_init_abi as > the OSABI handler for all arch/machine conbinations. The problem is > that machine "0" gets turned into bfd_mach_ppc or bfd_mach_ppc64 > dependant on how GDB is built, and they are both incompatible with each > other and incompatible . And that in turn restricts the support to just > one half of the ISA family making it impossible for GDB to debug both 32 > and 64 bit :-( > > I know of two ways to fix this. First is the attached patch which > modifies osabi.[hc] so that a wildcard machine (-1) can be specified vis: > > gdbarch_register_osabi (bfd_arch_powerpc, -1, GDB_OSABI_LINUX, > ppc_linux_init_abi); > > and the second is to explicitly register both of these architecture > variants vis: > > gdbarch_register_osabi (bfd_arch_powerpc, bfd_mach_ppc, ... > gdbarch_register_osabi (bfd_arch_powerpc, bfd_mach_ppc64, ... > > (possibly also splitting ppc_linux_init_abi into ppc_linux_init_abi_32 > and ppc_linux_init_abi_32). > > There are pros and cons to both. > > The former will always match, making the code somewhat future proof, the > later is far simplier. > > preferences? At the moment, I prefer the explicit registration of architecture variants. I'd prefer to wait on adding the wildcard mechanism until a more compelling need for it is demonstrated. Kevin