Re: magic file entry to understand core dumps

Axel Kohlmeyer (akohlmey@rincewind.chemie.uni-ulm.de)
Fri, 19 Jul 1996 18:05:11 +0200


>>>>> "Marty" == "Marty Leisner" <leisner@sdsp.mc.xerox.com> writes:

Marty> In message <199607182223.RAA03932@hubert.wustl.edu>, you write:
>>>>>>> "JM" == Jared Mauch <jared@wolverine.hq.cic.net> 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).

cheers,
axel.
=========================================================================
Axel Kohlmeyer email: axel.kohlmeyer@chemie.uni-ulm.de
Abteilung fuer Theoretische Chemie Universitaet Ulm D-89069 Ulm/Donau
=========================================================================