From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9321 invoked by alias); 1 Apr 2008 17:07:53 -0000 Received: (qmail 9313 invoked by uid 22791); 1 Apr 2008 17:07:52 -0000 X-Spam-Check-By: sourceware.org Received: from de01egw01.freescale.net (HELO de01egw01.freescale.net) (192.88.165.102) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 01 Apr 2008 17:07:25 +0000 Received: from de01smr01.freescale.net (de01smr01.freescale.net [10.208.0.31]) by de01egw01.freescale.net (8.12.11/az33egw01) with ESMTP id m31H7HP4021823; Tue, 1 Apr 2008 10:07:17 -0700 (MST) Received: from ld0159-tx32 (ld0159-tx32.am.freescale.net [10.82.19.109]) by de01smr01.freescale.net (8.13.1/8.13.0) with ESMTP id m31H7Gqe015301; Tue, 1 Apr 2008 12:07:16 -0500 (CDT) Date: Tue, 01 Apr 2008 17:07:00 -0000 From: "Anmol P. Paralkar" To: Daniel Jacobowitz cc: gdb@sourceware.org Subject: Re: Regenerate config/features/rs6000 In-Reply-To: <20080401010823.GA1649@caradoc.them.org> Message-ID: References: <47F16D39.4040608@eagercon.com> <20080331234135.GA29623@caradoc.them.org> <47F17A97.1000408@eagercon.com> <20080401010823.GA1649@caradoc.them.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2008-04/txt/msg00001.txt.bz2 On Mon, 31 Mar 2008, Daniel Jacobowitz wrote: > On Mon, Mar 31, 2008 at 04:58:15PM -0700, Michael Eager wrote: >> Daniel Jacobowitz wrote: >>> On Mon, Mar 31, 2008 at 04:01:13PM -0700, Michael Eager wrote: >>>> How are the C files generated from the xml files? >>> >>> It's described in the comments in features/Makefile (you have to set >>> CFILES and use a specific target). >> >> Apparently, there's a circular dependency: you have to have >> build a gdb so you can generate the feature file which is needed >> to build gdb. > > Yes, there is. You've got to add XML support separately from > requiring the C precompiled features. > > -- > Daniel Jacobowitz > CodeSourcery > Hello, I recently tried this out; perhaps the following sketch helps: Assume that you are adding support for 'newarch' (say under powerpc). First, "declare" newarch to GDB: bfd/archures.c .#define bfd_mach_ppc_newarch newarchval bfd/bfd-in2.h #define bfd_mach_ppc_newarch newarchval bfd/cpu-powerpc.c const bfd_arch_info_type bfd_powerpc_archs[] = { ... &bfd_powerpc_archs[ bfd_arch_info_type that you are adding>] }, { 32, /* 32 bits in a word */ 32, /* 32 bits in an address */ 8, /* 8 bits in a byte */ bfd_arch_powerpc, bfd_mach_ppc_, "powerpc", "powerpc:", 3, FALSE, /* not the default */ powerpc_compatible, bfd_default_scan, NULL }, } gdb/rs6000-tdep.c static struct variant variants[] = { ... {"", "PowerPC ", bfd_arch_powerpc, bfd_mach_ppc_, NULL /* For now this is NULL. we'll change this after we generate gdb/features/rs6000/powerpc-.c */, ... } Build GDB. Create gdb/features/rs6000/.xml We are now ready to generate .c from .xml Use the newly built GDB (at this stage you should be able to do a: 'set architecture powerpc:' and see the effect with a: 'show architecture'). cd gdb/features gmake GDB=/bin/powerpc-linux-gnu-gdb XMLTOC="./rs6000/powerpc-.xml" ./rs6000/powerpc-.c If all goes well, you should have gdb/features/rs6000/powerpc-.c now. Go back to gdb/rs6000-tdep.c #include "features/rs6000/powerpc-.c" ... static struct variant variants[] = { ... {"", "PowerPC ", bfd_arch_powerpc, bfd_mach_ppc_, &tdesc_powerpc_, /* Note! */ ... } ... void _initialize_rs6000_tdep (void) { ... initialize_tdesc_powerpc_ (); ... } That should be it. You should now be able to: 'set tdesc filename /gdb/features/rs6000/.xml' ... Regards, Anmol.