From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22018 invoked by alias); 17 Nov 2005 14:46:19 -0000 Received: (qmail 22001 invoked by uid 22791); 17 Nov 2005 14:46:16 -0000 Received: from sibelius.xs4all.nl (HELO sibelius.xs4all.nl) (82.92.89.47) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Thu, 17 Nov 2005 14:46:16 +0000 Received: from elgar.sibelius.xs4all.nl (root@elgar.sibelius.xs4all.nl [192.168.0.2]) by sibelius.xs4all.nl (8.13.4/8.13.4) with ESMTP id jAHEkE8d030428; Thu, 17 Nov 2005 15:46:14 +0100 (CET) Received: from elgar.sibelius.xs4all.nl (kettenis@localhost.sibelius.xs4all.nl [127.0.0.1]) by elgar.sibelius.xs4all.nl (8.13.4/8.13.3) with ESMTP id jAHEkDg4020038; Thu, 17 Nov 2005 15:46:13 +0100 (CET) Received: (from kettenis@localhost) by elgar.sibelius.xs4all.nl (8.13.4/8.13.4/Submit) id jAHEkDim026595; Thu, 17 Nov 2005 15:46:13 +0100 (CET) Date: Thu, 17 Nov 2005 16:02:00 -0000 Message-Id: <200511171446.jAHEkDim026595@elgar.sibelius.xs4all.nl> From: Mark Kettenis To: randolph@tausq.org CC: gdb-patches@sources.redhat.com In-reply-to: <437C7E07.5050804@tausq.org> (message from Randolph Chung on Thu, 17 Nov 2005 20:56:39 +0800) Subject: Re: [hppa-hpux] Core file support for hppa64-hp-hpux11.11 References: <437C76DE.5020108@tausq.org> <200511171244.jAHCi9RY004505@elgar.sibelius.xs4all.nl> <437C7E07.5050804@tausq.org> Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2005-11/txt/msg00283.txt.bz2 > Date: Thu, 17 Nov 2005 20:56:39 +0800 > From: Randolph Chung > > Well, the osabi sniffer doesn't say that it's a corefile, it just says > it's a HPUX ELF file. As for whether "elf64-hppa" means hpux, currently > bfd/elf64-hppa.c only supports two targets, hpux and linux, and linux is > "elf64-hppa-linux". I know this is not very nice. Do you have any other > suggestions? Ok, so your problem is that the core file is marked as "UNIX - System V", so there's no way to tell that this is a HP-UX core file. What I'd do, is create BFD sections out of those HP_CORE_XXX program headers, and then in GDB, check for one of those sections. There's one program header that looks particularly promising: HP_CORE_KERNEL. That one contains the string HP-UX. That'd certainly convince me that this is a HP-UX core file. Actually I think it makes sense to modify your BFD patch such that it gives all HP_CORE_XXX program headers a sensible name: /* Support HP specific sections for core files. */ static bfd_boolean elf64_hppa_section_from_phdr (bfd *abfd, Elf_Internal_Phdr *hdr, int index, const char *typename) { switch (hdr->p_type) { case PT_HP_CORE_VERSION: typename = "core.version"; break; case PT_HP_CORE_KERNEL: typename = "core.kernel"; break; case PT_HP_CORE_PROC: ... } if (hdr->p_type == PT_HP_CORE_PROC) { int sig; if (bfd_seek (abfd, hdr->p_offset, SEEK_SET) != 0) return FALSE; if (bfd_bread (&sig, 4, abfd) != 4) return FALSE; elf_tdata (abfd)->core_signal = sig; /* gdb uses the ".reg" section to read register contents. */ if (!_bfd_elfcore_make_pseudosection (abfd, ".reg", hdr->p_filesz, hdr->p_offset)) return FALSE; } if (hdr->p_type == PT_HP_CORE_LOADABLE || hdr->p_type == PT_HP_CORE_STACK || hdr->p_type == PT_HP_CORE_MMF) hdr->p_type = PT_LOAD; return _bfd_elf_make_section_from_phdr (abfd, hdr, index, typename); }