Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
* 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
* 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

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 --
1999-01-02 11:05 gdb cannot read core dumps on newer kernels Christian Groessler
1999-01-03 23:26 ` Richard Henderson
  -- strict thread matches above, loose matches on Subject: below --
1998-12-30 17:16 Christian Groessler
1998-12-30 21:13 ` Richard Henderson
1998-12-31 17:43   ` Peter Rye
1998-12-31 22: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