From mboxrd@z Thu Jan 1 00:00:00 1970 From: egor duda To: Eli Zaretskii Cc: gdb@sources.redhat.com, sandmann@clio.rice.edu, djgpp-workers@delorie.com Subject: Re: Adding support for core files to DJGPP Date: Mon, 02 Apr 2001 03:20:00 -0000 Message-id: <923311812.20010402141710@logos-m.ru> References: <200103300906.EAA18026@indy.delorie.com> <12289438285.20010330142921@logos-m.ru> <200104020813.KAA27119@is.elta.co.il> X-SW-Source: 2001-04/msg00011.html Hi! Monday, 02 April, 2001 Eli Zaretskii eliz@is.elta.co.il wrote: >> all committed pages in process address space are written to .mem >> sections EZ> I don't see .mem sections mentioned anywhere in the SysV ABI documents EZ> available from http://www.sco.com/developer/devspecs/ . Did I miss EZ> something? Is there any other documentation about ELF available EZ> somewhere, where these sections are documented? i think ".mem/" sections is just a common convention gdb supports. System V ABI specification explicitly says (at http://www.sco.com/developer/gabi/latest/ch4.eheader.html ) "Although the core file contents are unspecified, type ET_CORE is reserved to mark the file." so i suppose the best way is to use the gdb and/or cygwin's dumper sources. actually, all you have to do is sprintf (sect_name, ".mem/%u", sect_no); sect_flags = SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD; sect_size = memory_block_size; sect_vma = (bfd_vma) (memory_block_base_address); and then write memory region contents to section via bfd_set_section_contents (). >> winsup/utils/dumper.cc -- utility to create core file. EZ> Does this mean that the segfaulting application itself doesn't write EZ> the core file? no, "kernel", i.e. cygwin1.dll in case of cygwin, is doing the job. when application triggers exception that is supposed to cause core dump, cygwin1.dll calls external utility passing crashed program pid and path to it. this utility scans crashed program address space and writes needed portions of it to the core file. so crashed program address space isn't changed while core is being dumped. Egor. mailto:deo@logos-m.ru ICQ 5165414 FidoNet 2:5020/496.19