Re: magic file entry to understand core dumps

Axel Kohlmeyer (
Fri, 19 Jul 1996 18:05:11 +0200

>>>>> "Marty" == "Marty Leisner" <> writes:

Marty> In message <>, you write:
>>>>>>> "JM" == Jared Mauch <> writes:
JM> core: ELF 32-bit LSB core file i386 (386 and up) Version 1
>> He wanted an addition to the magic file to show the program which dumped
>> core, as the a.out entry does. However, a quick check shows that it isn't a
>> simple offset... anyone have better knowledge of the format?

Marty> Like I said, a cheesy program would be worthwhile...gdb does it, but you
Marty> first have to know the program which cored for gdb to spit out the
Marty> command line..

Marty> Is this a generic elf problem?

have you ever tried 'strings core | head' ?

ugly, but it works. the name of the executable and the command line is
stored in a few sections at the beginning of the core dump, AFAIK.
problem is: they are not of constant length. you have to hack the
'file' sources to make 'file' spitting out the command line (and the signal,
that generated the core dump).

Axel Kohlmeyer email:
Abteilung fuer Theoretische Chemie Universitaet Ulm D-89069 Ulm/Donau