From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25816 invoked by alias); 28 Jun 2005 01:43:33 -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 25806 invoked by uid 22791); 28 Jun 2005 01:43:30 -0000 Received: from nevyn.them.org (HELO nevyn.them.org) (66.93.172.17) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Tue, 28 Jun 2005 01:43:30 +0000 Received: from drow by nevyn.them.org with local (Exim 4.51) id 1Dn589-0001uI-4q; Mon, 27 Jun 2005 21:43:17 -0400 Date: Tue, 28 Jun 2005 01:43:00 -0000 From: Daniel Jacobowitz To: Michael Snyder Cc: GDB Patches , mark.kettenis@xs4all.nl Subject: Re: [RFA] Take III, part 2: am33 linux corefile support Message-ID: <20050628014317.GA6950@nevyn.them.org> Mail-Followup-To: Michael Snyder , GDB Patches , mark.kettenis@xs4all.nl References: <42C09C74.1010507@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <42C09C74.1010507@redhat.com> User-Agent: Mutt/1.5.8i X-SW-Source: 2005-06/txt/msg00374.txt.bz2 On Mon, Jun 27, 2005 at 05:40:20PM -0700, Michael Snyder wrote: > OK, here's this part again. Mark, I used the osabi mechanism > to register my corefile handlers, and I changed the typedefs > from unsigned char to gdb_byte. Could you explain why you needed a sniffer? > + /* "Sniff" a bfd, claim it if it's ours. > + It's ours if it's am33 flavor. */ > + > + static enum gdb_osabi > + am33_linux_elf_osabi_sniffer (bfd *abfd) > + { > + const struct bfd_arch_info *info = bfd_get_arch_info (abfd); > + int eflags = elf_elfheader (abfd) -> e_flags; > + /* We'll want to have a look at those, anyway... */ > + > + if (info->arch == bfd_arch_mn10300) > + if (info->mach == bfd_mach_am33 || info->mach == bfd_mach_am33_2) > + if (eflags & (E_MN10300_MACH_AM33 | E_MN10300_MACH_AM33_2) > + return GDB_OSABI_LINUX; > + > + return GDB_OSABI_UNKNOWN; > + } i.e. what's this covering that the generic sniffer won't. I can work out the answer to the question in terms of ELF header flags, but I assume you've got .note.ABI-tag like other Linux ports do. > + void > + _initialize_mn10300_linux_tdep (void) > + { > + gdbarch_register_osabi (bfd_arch_mn10300, 0, > + GDB_OSABI_LINUX, am33_linux_init_osabi); > + gdbarch_register_osabi_sniffer (bfd_arch_mn10300, > + bfd_target_elf_flavour, > + am33_linux_elf_osabi_sniffer); > + } If it's just to handle the am33 vs mn10300, you can use bfd_mach_am33 and bfd_mach_am33_2 as the second argument to gdbarch_register_osabi. Otherwise I've no complaints. -- Daniel Jacobowitz CodeSourcery, LLC