0

I have a kernel image and would like to debug with kgdb. The .config also not available, otherwise I could check the flags in it.

In /proc/sys/ folder also there is no entry about kgdb.

Is there any way to check whether that image is kgdb enabled or not?

C. Ross
  • 31,137
  • 42
  • 147
  • 238
Jeyaram
  • 9,158
  • 7
  • 41
  • 63

1 Answers1

2

If your kernel image was compiled with the options

CONFIG_IKCONFIG=y
CONFIG_IKCONFIG_PROC=y

then you can get the kernel image's configuration from /proc/config.gz or by using

/pathtokernelsource/scripts/extract-ikconfig pathtokernelimage > /tmp/config

From there you can search for CONFIG_KGDB using grep or zgrep depending on whether you are viewing the compressed or uncompressed configuration file.

/pathtokernelsource/scripts/extract-vmlinux pathtokernelimage > /tmp/vmlinux will also extract the vmlinux executable from the image.

If this has symbols them you can search for kgdb_arch_init or kgdb_arch_* in either the output of nm on this file or in the System.map for your kernel image as Mats Petersson mentioned in the comments.

Appleman1234
  • 15,946
  • 45
  • 67