From: Jack Wathey <wathey@salk.edu>
To: axp-list@redhat.com
Subject: gdb and core files revisited
Date: Sat, 10 Apr 1999 11:08:10 -0700 (PDT) [thread overview]
Message-ID: <199904101808.LAA04983@helmholtz.salk.edu> (raw)
Dear fellow Alpha-Linux folks,
Back in January 1998, when I was using RedHat 4.2, I posted to this
list a trivial C program to demonstrate that gdb did not understand
an elf core file generated on an Alpha, although it worked fine on
a Pentium machine.
I had hoped that by now some brilliant and benevolent soul would have
fixed this, but after upgrading to RedHat 5.2 and a 2.2 kernel, I find
that gdb is still broken in this way. Yes, I know that gdb works if you
run the crashing program from within gdb and wait for it to re-encounter
the offending code, and this is how I've managed to survive for the last
year. But I write some fairly substantial stochastic simulations that
run for days. If a program like that crashes because of some insidious
bug that chokes on a rare set of circumstances, after running for many
hours or even days, then it is a major pain to rerun it for that length
of time under gdb just to find out where the crash occurred.
Is it really asking too much to have a debugger that can read and
understand a core file?
I've spent about 3 days digging through the internals of gdb, trying
to fix this, but it is just beyond my meager brain. Has anyone,
anywhere (possibly Debian types?), managed to get gdb to work with
a core file on an Alpha Linux machine running a 2.2 kernel? If so,
please tell me how.
If not, I'd be grateful for suggestions as to who (gdb maintainers,
kernel developers, others?) is most likely to be able to fix this
problem, so that I can make some kind of official bug report to them.
TIA,
Jack
My little test program follows:
---------------------- start Makefile ------------------------------
CFLAGS = -g
crash:
------------------------ end Makefile ------------------------------
---------------------- start crash.c -------------------------------
main() {
int i;
int *p_int = 0;
i = *p_int;
return( 0 );
}
------------------------ end crash.c -------------------------------
To run it, create the files Makefile and crash.c by snipping out the
text as shown. Then type "make", and "crash". The program "crash"
will do exactly that, dumping a core file in the process. [You may need
first to do something like "limit coredumpsize 10m", if your
coredumpsize is limited to 0 by default.]
If I do this experiment on my Alpha and then run "gdb crash core",
I get this:
GNU gdb 4.17.0.4 with Linux/x86 hardware watchpoint and FPU support
Copyright 1998 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or 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.
This GDB was configured as "alpha-redhat-linux"...
Core was generated by `crash'.
Couldn't fetch registers from core file: File in wrong format
Couldn't fetch register set 2 from core file: File in wrong format
Reading symbols from /lib/libc.so.6.1...done.
Reading symbols from /lib/ld-linux.so.2...done.
Couldn't fetch registers from core file: File in wrong format
Couldn't fetch register set 2 from core file: File in wrong format
#0 0x0 in ?? ()
(gdb)
next reply other threads:[~1999-04-10 18:29 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
1999-04-10 18:08 Jack Wathey [this message]
1999-04-12 4:11 ` gdb and core files revisited Mikolaj J. Habryn
1999-04-14 8:01 ` Richard Henderson
1999-04-14 8:47 ` Mikolaj J. Habryn
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox