This is the mail archive of the gdb@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]

Re: Adding support for core files to DJGPP


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



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