From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7042 invoked by alias); 4 Aug 2003 14:17:56 -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 7029 invoked from network); 4 Aug 2003 14:17:53 -0000 Received: from unknown (HELO localhost.redhat.com) (24.157.166.107) by sources.redhat.com with SMTP; 4 Aug 2003 14:17:53 -0000 Received: from redhat.com (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id 0D8A42B7F; Mon, 4 Aug 2003 10:17:51 -0400 (EDT) Message-ID: <3F2E6B0E.8010209@redhat.com> Date: Mon, 04 Aug 2003 14:17:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:1.0.2) Gecko/20030223 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Kris Warkentin Cc: "Gdb-Patches@Sources.Redhat.Com" Subject: Re: [patch] create sniffer for Neutrino core files References: <0d4901c34720$aaa71cb0$0202040a@catdog> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2003-08/txt/msg00032.txt.bz2 > This is leading in the direction of being able to sniff out QNX binaries > without adding anything to our file format. Earlier we were considering > adding a .note.qnxnto.ident to our binaries so that gdb could recognize and > use the appropriate OSABI. Our architect doesn't like adding to/changing > our binaries so he wants me to try to do it this way. The theory is, we > KNOW if we're attached to a remote Neutrino machine. We KNOW if we've got a > Neutrino core file. We KNOW if we're running on native Neutrino. > > Given all that we know, we shouldn't need to do anything to our binaries but > rather just have an osabi sniffer that TELLS gdb that it should use > GDB_OSABI_QNXNTO. This patch will tell us that we've got a core file so now > all I need is a sniffer for the other two. > > Anyone see any problems with this? Having just posted something similar to i386, no definitly not. Andrew > ChangeLog: > > * nto-tdep.c (nto_core_sniffer): New function to detect QNX core file. > (regset_core_fns): Use nto_core_sniffer instead of default_core_sniffer. > > $ cvs diff -u nto-tdep.c > Index: nto-tdep.c > =================================================================== > RCS file: /cvs/src/src/gdb/nto-tdep.c,v > retrieving revision 1.6 > diff -u -r1.6 nto-tdep.c > --- nto-tdep.c 17 Jun 2003 18:30:48 -0000 1.6 > +++ nto-tdep.c 10 Jul 2003 20:10:58 -0000 > @@ -293,12 +293,20 @@ > /* Do nothing. */ > } > > +static int > +nto_core_sniffer(struct core_fns *our_fns, bfd *abfd) > +{ > + if (bfd_get_section_by_name (abfd, ".qnx_core_info")) > + return 1; > + return default_core_sniffer(our_fns, abfd); > +} > + > /* Register that we are able to handle ELF file formats using standard > procfs "regset" structures. */ > static struct core_fns regset_core_fns = { > bfd_target_elf_flavour, /* core_flavour */ > default_check_format, /* check_format */ > - default_core_sniffer, /* core_sniffer */ > + nto_core_sniffer, /* core_sniffer */ > fetch_core_registers, /* core_read_registers */ > NULL /* next */ > }; > > >