Re: magic file entry to understand core dumps

Jared Mauch (
Tue, 23 Jul 1996 23:17:44 -0400 (EDT)

This is not a kernel issue, this is a userland thing.

Please take it to such userland lists. The thing I hate
the most is when people ask, and continue to discuss non kernel related
issues on the kernel lists. Please read my response also:

Andrew C. Esh graced my mailbox with this long sought knowledge:
> I think we are diverging. And besides, I don't like the "strings"
> solution. "gdb" and "file" should do their job.

I can't speak for file, but..

> Check this out: (The C code was given in one of the original reports.)
> [andrewes@andrewes andrewes]$ cat test.c
> main()
> {
> printf("%d\n", 0/0);
> }
> [andrewes@andrewes andrewes]$ gcc -g -o test test.c
> [andrewes@andrewes andrewes]$ ./test
> Floating point exception (core dumped)
> [andrewes@andrewes andrewes]$ gdb -c core ./test
> GDB is free software and you are welcome to distribute copies of it
> under certain conditions; type "show copying" to see the conditions.
> There is absolutely no warranty for GDB; type "show warranty" for details.

Perhaps using the latest version of gdb would help you... 4.16 can
read linux elf files.

> GDB 4.15.1 (i486-unknown-linux),
> Copyright 1995 Free Software Foundation, Inc...
> Couldn't fetch registers from core file: File in wrong format
> Couldn't fetch registers from core file: File in wrong format
> #0 0x0 in ?? ()
> (gdb) list
> 1 main()
> 2 {
> 3 printf("%d\n", 0/0);
> 4 }
> (gdb) quit
> Note that I gave it the executable name. So, the specific original
> problem was the above, "File in wrong format", error. I've had it for
> months. I had hoped that upgrades to libraries, or gdb would solve it,
> but it hasn't. Note my gdb version number is 4.15.1.

- Jared