* gdb cannot read core dumps on newer kernels
@ 1998-12-30 17:16 Christian Groessler
1998-12-30 21:13 ` Richard Henderson
0 siblings, 1 reply; 6+ messages in thread
From: Christian Groessler @ 1998-12-30 17:16 UTC (permalink / raw)
To: axp-list
Hello,
I'm having problems with core files generated from 2.1.131 kernels (2.0.35
do work):
[chris@alpha:~]$ ./segv
Segmentation fault (core dumped)
[chris@alpha:~]$ ls -l core
-rw------- 1 chris chris 172032 Dec 30 17:59 core
[chris@alpha:~]$ file core
core: ELF 64-bit LSB core file Alpha, version 1, stripped
[chris@alpha:~]$ gdb segv core
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 `./segv'.
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)
It doesn't find the register values in the core file.
I also tried recompiling gdb, but it doesn't work either.
Does anybody have an idea on how to fix this?
regards & thanks for your help,
chris
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: gdb cannot read core dumps on newer kernels
1998-12-30 17:16 gdb cannot read core dumps on newer kernels Christian Groessler
@ 1998-12-30 21:13 ` Richard Henderson
1998-12-31 17:43 ` Peter Rye
0 siblings, 1 reply; 6+ messages in thread
From: Richard Henderson @ 1998-12-30 21:13 UTC (permalink / raw)
To: axp-list
On Wed, Dec 30, 1998 at 06:16:06PM +0100, Christian Groessler wrote:
> I also tried recompiling gdb, but it doesn't work either.
> Does anybody have an idea on how to fix this?
GDB needs to be taught that elf_prstatus can be one of two sizes;
mid 2.1 struct timeval was changed to be POSIX compliant. Everything
but this was handled with new syscall numbers.
r~
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: gdb cannot read core dumps on newer kernels
1998-12-30 21:13 ` Richard Henderson
@ 1998-12-31 17:43 ` Peter Rye
1998-12-31 22:26 ` Richard Henderson
0 siblings, 1 reply; 6+ messages in thread
From: Peter Rye @ 1998-12-31 17:43 UTC (permalink / raw)
To: rth; +Cc: axp-list
>>>>> "Richard" == Richard Henderson <rth@cygnus.com> writes:
Richard> On Wed, Dec 30, 1998 at 06:16:06PM +0100, Christian Groessler
Richard> wrote:
>> I also tried recompiling gdb, but it doesn't work either. Does
>> anybody have an idea on how to fix this?
Richard> GDB needs to be taught that elf_prstatus can be one of two
Richard> sizes; mid 2.1 struct timeval was changed to be POSIX
Richard> compliant. Everything but this was handled with new syscall
Richard> numbers.
Thanks for the information. Although I didn't post the original question,
this problem has been something that I have tried in vain to solve for a
while now.
Unfortunately I cannot find "elf_prstatus" in the source for gdb, although
there are plenty of references to "prstatus" in both elfcore.h and
elf-bfd.h, as well as references to "bfd_prstatus" in elfcore.h. There are
also references to "prstatus_t" in the configure file.
I presume that this is a relatively easy thing to fix if you have a few
more clues about programming development tools than I do. If possible, I
wonder if you would mind expanding a little on which files need to be
patched etc.
Thanks very much.
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: gdb cannot read core dumps on newer kernels
1998-12-31 17:43 ` Peter Rye
@ 1998-12-31 22:26 ` Richard Henderson
0 siblings, 0 replies; 6+ messages in thread
From: Richard Henderson @ 1998-12-31 22:26 UTC (permalink / raw)
To: Peter Rye, rth; +Cc: axp-list
On Thu, Dec 31, 1998 at 05:43:22PM -0000, Peter Rye wrote:
> Unfortunately I cannot find "elf_prstatus" in the source for gdb...
It isn't. It's in <linux/elfcore.h>; I forget the exact path
by which this gets pulled in. This is fairly losing, and just
the way it's "always been done".
> I presume that this is a relatively easy thing to fix if you have a few
> more clues about programming development tools than I do. If possible, I
> wonder if you would mind expanding a little on which files need to be
> patched etc.
You'll be modifying elf_backend_data in bfd/elf-bfd.h, and elfxx-target.h
to make what is currently elfcore_grok_prstatus switched on the target.
You'll copy that function to elf64-alpha.c and tweek it to handle two
different prstatus_t layouts.
r~
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: gdb cannot read core dumps on newer kernels
@ 1999-01-02 11:05 Christian Groessler
1999-01-03 23:26 ` Richard Henderson
0 siblings, 1 reply; 6+ messages in thread
From: Christian Groessler @ 1999-01-02 11:05 UTC (permalink / raw)
To: Richard Henderson, prye; +Cc: axp-list
Thanks for the hints, Richard, especially that the struct timeval has
changed.
So my initial assumption that some data structures have changed in newer
kernels was right, but my try to fix it with a simple recompile of gdb
didn' work.
The recompilataion (on RH 5.2) used also the old definition of struct
timeval
(with int members) instead of the new (with long members), because (I found
out
that) there are 2 types of struct timeval on the system: The C lib's and
the kernel's.
The C lib's which was used by the compilation had the int members, whereas
the core dump contains a elf_prstatus with a struct with long members.
I managed with a quick hack to build a gdb which understands the new core
dumps. (I simply copied /usr/include/sys/procfs.h to the gdb directory,
modified
it to have the big timevals, and changed bfd/elfcore.h to use this file).
I'm a little bit scared that there are 2 different definitions of struct
timeval.
I followed the select() call, as it uses a struct timeval parameter, but it
works, because the lib doesn't use the native linux select() syscall, but
the
OSF compatibility syscall (which needs a small (int members) timeval).
I don't know of other syscalls using struct timeval, if someone knows one,
please tell me, I want to check this out.
So gdb should be modified to understand old and new core dumps
simultaneously.
But I have to admit, I couldn't quite follow your instructions on what to
change, Richard:
On 31/12/98 23:26:30 Richard Henderson wrote:
>
>On Thu, Dec 31, 1998 at 05:43:22PM -0000, Peter Rye wrote:
>> I presume that this is a relatively easy thing to fix if you have a few
>> more clues about programming development tools than I do. If possible, I
>> wonder if you would mind expanding a little on which files need to be
>> patched etc.
>
>You'll be modifying elf_backend_data in bfd/elf-bfd.h, and elfxx-target.h
>to make what is currently elfcore_grok_prstatus switched on the target.
I assume you mean changing one of the functions in elf_backend_data (Which
one?).
Or adding a new one?
And I didn't find "elfcore_grok_prstatus" anywhere....
>
>You'll copy that function to elf64-alpha.c and tweek it to handle two
>different prstatus_t layouts.
How would I distinguish between the two?
regards,
chris
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: gdb cannot read core dumps on newer kernels
1999-01-02 11:05 Christian Groessler
@ 1999-01-03 23:26 ` Richard Henderson
0 siblings, 0 replies; 6+ messages in thread
From: Richard Henderson @ 1999-01-03 23:26 UTC (permalink / raw)
To: cpg; +Cc: axp-list
On Sat, Jan 02, 1999 at 12:05:32PM +0100, Christian Groessler wrote:
> I don't know of other syscalls using struct timeval, if someone knows one,
> please tell me, I want to check this out.
#define __NR_select 358
#define __NR_gettimeofday 359
#define __NR_settimeofday 360
#define __NR_getitimer 361
#define __NR_setitimer 362
#define __NR_utimes 363
#define __NR_getrusage 364
#define __NR_wait4 365
#define __NR_adjtimex 366
All were added to know about the larger timeval.
> I assume you mean changing one of the functions in elf_backend_data (Which
> one?).
> Or adding a new one?
Adding a new one.
> And I didn't find "elfcore_grok_prstatus" anywhere....
elf.c, iirc.
> How would I distinguish between the two?
The size of the note section is different.
r~
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~1999-01-03 23:44 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1998-12-30 17:16 gdb cannot read core dumps on newer kernels Christian Groessler
1998-12-30 21:13 ` Richard Henderson
1998-12-31 17:43 ` Peter Rye
1998-12-31 22:26 ` Richard Henderson
-- strict thread matches above, loose matches on Subject: below --
1999-01-02 11:05 Christian Groessler
1999-01-03 23:26 ` Richard Henderson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox