From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22108 invoked by alias); 30 Oct 2003 19:36:29 -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 22069 invoked from network); 30 Oct 2003 19:36:27 -0000 Received: from unknown (HELO walton.kettenis.dyndns.org) (213.93.115.144) by sources.redhat.com with SMTP; 30 Oct 2003 19:36:27 -0000 Received: from elgar.kettenis.dyndns.org (elgar.kettenis.dyndns.org [192.168.0.2]) by walton.kettenis.dyndns.org (8.12.6p3/8.12.6) with ESMTP id h9UJaMmX000308 for ; Thu, 30 Oct 2003 20:36:22 +0100 (CET) (envelope-from kettenis@elgar.kettenis.dyndns.org) Received: from elgar.kettenis.dyndns.org (localhost [127.0.0.1]) by elgar.kettenis.dyndns.org (8.12.6p3/8.12.6) with ESMTP id h9UJaLaw007545 for ; Thu, 30 Oct 2003 20:36:21 +0100 (CET) (envelope-from kettenis@elgar.kettenis.dyndns.org) Received: (from kettenis@localhost) by elgar.kettenis.dyndns.org (8.12.6p3/8.12.6/Submit) id h9UJaHRb007542; Thu, 30 Oct 2003 20:36:17 +0100 (CET) Date: Thu, 30 Oct 2003 19:36:00 -0000 Message-Id: <200310301936.h9UJaHRb007542@elgar.kettenis.dyndns.org> From: Mark Kettenis To: gdb-patches@sources.redhat.com Subject: [PATCH] X-SW-Source: 2003-10/txt/msg00857.txt.bz2 This marks core files produced by "gcore" as "FreeBSD". Otherwise FreeBSD/amd64 won't recognize them as such. FreeBSD/i386 already does this in most cases because of bfd/elf32-i386.c:elf_i386_post_process_headers, and FreeBSD/amd64 should probably do something similar, but setting it here shouldn't hurt. Mark Index: ChangeLog from Mark Kettenis * fbsd-proc.c (fbsd_make_corefile_notes): Put a "FreeBSD" label in the ELF header. Index: fbsd-proc.c =================================================================== RCS file: /cvs/src/src/gdb/fbsd-proc.c,v retrieving revision 1.4 diff -u -p -r1.4 fbsd-proc.c --- fbsd-proc.c 29 Oct 2003 22:47:37 -0000 1.4 +++ fbsd-proc.c 30 Oct 2003 19:26:27 -0000 @@ -127,6 +127,11 @@ fbsd_make_corefile_notes (bfd *obfd, int gregset_t gregs; fpregset_t fpregs; char *note_data = NULL; + Elf_Internal_Ehdr *i_ehdrp; + + /* Put a "FreeBSD" label in the ELF header. */ + i_ehdrp = elf_elfheader (obfd); + i_ehdrp->e_ident[EI_OSABI] = ELFOSABI_FREEBSD; fill_gregset (&gregs, -1); note_data = elfcore_write_prstatus (obfd, note_data, note_size,