This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH]


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  <kettenis@gnu.org>

	* 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,


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]