From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2588 invoked by alias); 14 Aug 2003 00:32:28 -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 2581 invoked from network); 14 Aug 2003 00:32:26 -0000 Received: from unknown (HELO takamaka.act-europe.fr) (209.53.17.87) by sources.redhat.com with SMTP; 14 Aug 2003 00:32:26 -0000 Received: by takamaka.act-europe.fr (Postfix, from userid 507) id 9952AD2DAF; Wed, 13 Aug 2003 17:32:22 -0700 (PDT) Date: Thu, 14 Aug 2003 00:32:00 -0000 From: Joel Brobecker To: gdb-patches@sources.redhat.com Subject: [commit/RFC/multiarch/hpux] HPUX_ELF osabi init routine incorrectly registered Message-ID: <20030814003222.GK971@gnat.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="P+33d92oIH25kiaB" Content-Disposition: inline User-Agent: Mutt/1.4i X-SW-Source: 2003-08/txt/msg00231.txt.bz2 --P+33d92oIH25kiaB Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 1291 Hello, I noticed while working on the hppa64 target that the HPUX_ELF gdbarch initialization routine was not called during the gdbarch initialization. It turns out that we where using the default bfd arch_info descriptor which corresponds to a 32bit ABI. So when we checked the compatibility between the arch_info that we registered and the arch_info determined by the sniffer, we determined that they do not match, and therefore did not call the assiocated initialization routine. I fixed the problem the best way I can, by using a hard-coded number corresponding to the arch_info that corresponds to hppa2.0w. I don't know BFD too well yet, but it looks like we should really be defining new #defines in archures.c for each hppa machine numbers, and then use them here instead of my hard-coded value. I added a FIXME to remind us, and will send a patch to binutils shortly. In them meantime, this fixes the problem. Any opinions, maybe? 2003-08-13 J. Brobecker * hppa-hpux-tdep.c (_initialize_hppa_hpux_tdep): Use the correct bfd arch_info when registering the GDB_OSABI_HPUX_ELF initialization routine. Tested on hppa64-hpux11. (I have some other no-brainer patches coming, but I keep being interrupted by other tasks :-(). -- Joel --P+33d92oIH25kiaB Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="osabi.diff" Content-length: 857 Index: hppa-hpux-tdep.c =================================================================== RCS file: /cvs/src/src/gdb/hppa-hpux-tdep.c,v retrieving revision 1.8 diff -u -p -r1.8 hppa-hpux-tdep.c --- hppa-hpux-tdep.c 27 Jul 2003 17:27:17 -0000 1.8 +++ hppa-hpux-tdep.c 14 Aug 2003 00:19:24 -0000 @@ -118,6 +118,9 @@ _initialize_hppa_hpux_tdep (void) { gdbarch_register_osabi (bfd_arch_hppa, 0, GDB_OSABI_HPUX_SOM, hppa_hpux_som_init_abi); - gdbarch_register_osabi (bfd_arch_hppa, 0, GDB_OSABI_HPUX_ELF, + /* FIXME brobecker 2003-08-13: The machine number 25 corresponds to + the hppa2.0w bfd arch_info. A #define should probably be defined + in bfd, instead of using this hard-coded number. */ + gdbarch_register_osabi (bfd_arch_hppa, 25, GDB_OSABI_HPUX_ELF, hppa_hpux_elf_init_abi); } --P+33d92oIH25kiaB--