I've already finishing compiling the kernel from source,

but how to compile it with debug symbols,what additional steps to I need to take?

1 Answer 1


You need CONFIG_DEBUG_INFO=y on the config.

More exactly, the question is Compile the kernel with debug info (DEBUG_INFO) [N/y/?] and it's under the Kernel debugging (DEBUG_KERNEL) [Y/n/?] header. You may need to enable some other option below this one to get to the right one.

  • How to debug the kernel with gdb after that?
    – yum
    Mar 24, 2011 at 2:53
  • I found this on google but YMMV.
    – coredump
    Mar 24, 2011 at 3:13
  • I've already compiled the kernel with CONFIG_DEBUG_INFO=y,but gdb /usr/src/linux- /proc/kcore still can't read symbols:Reading symbols from /usr/src/linux- debugging symbols found)...done.
    – yum
    Mar 25, 2011 at 3:31
  • kernel.org/pub/linux/kernel/people/jwessel/kdb seems to be a solid guide to attaching the debugger to a kernel.
    – whitey04
    Apr 30, 2015 at 22:39
  • 1
    Here is a wonderfull guide to debug kernel techvolve.blogspot.com/2014/04/… . Sep 4, 2018 at 7:12

Not the answer you're looking for? Browse other questions tagged .