Date: Mon, 2 Apr 2001 14:17:10 +0400 From: egor duda X-Mailer: The Bat! (v1.45) Personal Organization: deo X-Priority: 3 (Normal) Message-ID: <923311812.20010402141710@logos-m.ru> To: Eli Zaretskii CC: gdb AT sources DOT redhat DOT com, sandmann AT clio DOT rice DOT edu, djgpp-workers AT delorie DOT com Subject: Re: Adding support for core files to DJGPP In-reply-To: <200104020813.KAA27119@is.elta.co.il> References: <200103300906 DOT EAA18026 AT indy DOT delorie DOT com> <12289438285 DOT 20010330142921 AT logos-m DOT ru> <200104020813 DOT KAA27119 AT is DOT elta DOT co DOT il> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Reply-To: djgpp-workers AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp-workers AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk Hi! Monday, 02 April, 2001 Eli Zaretskii eliz AT is DOT elta DOT co DOT 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 AT logos-m DOT ru ICQ 5165414 FidoNet 2:5020/496.19