From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (qmail 2582 invoked from network); 10 Apr 1999 18:29:18 -0000 Received: from mail.redhat.com (199.183.24.239) by lists.redhat.com with SMTP; 10 Apr 1999 18:29:18 -0000 Received: from helmholtz.salk.edu (helmholtz.salk.edu [198.202.70.34]) by mail.redhat.com (8.8.7/8.8.7) with ESMTP id OAA14829 for ; Sat, 10 Apr 1999 14:08:10 -0400 Received: (from wathey@localhost) by helmholtz.salk.edu (8.7.5/8.7.3) id LAA04983 for axp-list@redhat.com; Sat, 10 Apr 1999 11:08:10 -0700 (PDT) Date: Sat, 10 Apr 1999 11:08:10 -0700 (PDT) From: Jack Wathey Message-Id: <199904101808.LAA04983@helmholtz.salk.edu> To: axp-list@redhat.com Subject: gdb and core files revisited 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)