[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: gdb cannot read core dumps on newer kernels




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




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index] []