gdb 6.5 does not open linux kernel core file properly

Vivek Goyal vgoyal at in.ibm.com
Tue May 1 06:42:31 EDT 2007


Hi,

I am using gdb to open a linux kernel core file generated for x86_64
platform. But gdb is not analyzing the dumps properly. Its getting the
wrong symbol values. For example, following case prints two different values
for same symbol panic_timeout.


#gdb vmlinux
(gdb) p &panic_timeout
$1 = (int *) 0xffffffff808a1fa8


#gdb vmlinux vmcore
(gdb) p &panic_timeout
$1 = (int *) 0xffffffff008aaebf

First one is the right value. Why gdb is giving incorrect results while
opened with vmcore?

I am using GNU gdb Red Hat Linux (6.5-5.fc6rh).

This problem is not present in gdb 6.4. It works perfectly fine.

Note, this vmlinux file is of ET_DYN type. It has been compiled as an
executable and then an external program changes elf type to ET_DYN because
this is a fully relocatable executable and can be loaded at any physical 
address.

Any idea, what's wrong.

vmlinux ELF header is as follows.

ELF Header:
  Magic:   7f 45 4c 46 02 01 01 00 00 00 00 00 00 00 00 00
  Class:                             ELF64
  Data:                              2's complement, little endian
  Version:                           1 (current)
  OS/ABI:                            UNIX - System V
  ABI Version:                       0
  Type:                              DYN (Shared object file)
  Machine:                           Advanced Micro Devices X86-64
  Version:                           0x1
  Entry point address:               0x200000
  Start of program headers:          64 (bytes into file)
  Start of section headers:          61579848 (bytes into file)
  Flags:                             0x0
  Size of this header:               64 (bytes)
  Size of program headers:           56 (bytes)
  Number of program headers:         5
  Size of section headers:           64 (bytes)
  Number of section headers:         51
  Section header string table index: 48

vmcore ELF header and PT_LOAD headers are as follows.

ELF Header:
  Magic:   7f 45 4c 46 02 01 01 00 00 00 00 00 00 00 00 00
  Class:                             ELF64
  Data:                              2's complement, little endian
  Version:                           1 (current)
  OS/ABI:                            UNIX - System V
  ABI Version:                       0
  Type:                              CORE (Core file)
  Machine:                           Advanced Micro Devices X86-64
  Version:                           0x1
  Entry point address:               0x0
  Start of program headers:          64 (bytes into file)
  Start of section headers:          0 (bytes into file)
  Flags:                             0x0
  Size of this header:               64 (bytes)
  Size of program headers:           56 (bytes)
  Number of program headers:         6
  Size of section headers:           0 (bytes)
  Number of section headers:         0
  Section header string table index: 0
There are no sections in this file.

Program Headers:
  Type           Offset             VirtAddr           PhysAddr
                 FileSiz            MemSiz              Flags  Align
  NOTE           0x0000000000000190 0x0000000000000000 0x0000000000000000
                 0x0000000000000b20 0x0000000000000b20         0
  LOAD           0x0000000000000cb0 0xffffffff80200000 0x0000000000200000
                 0x0000000000742000 0x0000000000742000  RWE    0
  LOAD           0x0000000000742cb0 0xffff810000000000 0x0000000000000000
                 0x00000000000a0000 0x00000000000a0000  RWE    0
  LOAD           0x00000000007e2cb0 0xffff810000100000 0x0000000000100000
                 0x0000000000f00000 0x0000000000f00000  RWE    0
  LOAD           0x00000000016e2cb0 0xffff810009000000 0x0000000009000000
                 0x00000000c6f8dc80 0x00000000c6f8dc80  RWE    0
  LOAD           0x00000000c8670930 0xffff810100000000 0x0000000100000000
                 0x0000000130000000 0x0000000130000000  RWE    0

Thanks
Vivek
 



More information about the kexec mailing list