Re: magic file entry to understand core dumps

Johnie Stafford (
Thu, 18 Jul 96 20:11 CDT

>>>>> "jm" == Jared Mauch <> writes:

jm> Works for me:
jm> lunar:~> make test
jm> cc test.c -o test
jm> ./test
jm> lunar:~> ./test
jm> Floating exception (core dumped)
jm> lunar:~> file core
jm> core: ELF 32-bit LSB core file i386 (386 and up) Version 1
jm> lunar:~> cat test.c
jm> main()
jm> {
jm> printf("%d\n", 0/0);
jm> }
jm> lunar:~>

jm> Marty Leisner graced my mailbox with this long sought knowledge:
>> Does anyone have a magic line to correctly decode a linux elf
>> core dump?
>> I looked in gdb but got pretty confused...(but it seems to understand
>> the core file).
>> It would be worthwhile to write a cheezy program to print the command
>> name of the core dump if file can't do it...

I think he was looking more for the output that Solaris has:

js@kraken$ ./test
Arithmetic Exception (core dumped)
js@kraken$ file core
core: ELF 32-bit MSB core file SPARC Version 1, from 'test'
This has the name of the offending command in the output file.


 Johnie Stafford           |  Internet E-mail:
 KB5YVF - Lafayette, LA    | Ham Radio Packet:
                           |          WWW URL:
  for lifetime email -- mail