英文:
How to build debug symbols from source?
问题
我想使用Kdump和Crash来调试我的内核。然而,我的内核是从源代码构建的。我无法通过apt-get install linux-image-$(uname -r)-dbg
获取调试符号。我应该如何从源代码构建-dbg
版本?
我的操作系统是Ubuntu 20.04,内核版本是v5.15.0。
英文:
I want to use Kdump and Crash to debug my kernel. However, my kernel was built from source. I can't get debug symbols through apt-get install linux-image-$(uname -r)-dbg
. How could I build -dbg
from source?
My OS is Ubuntu 20.04 and kernel is v5.15.0.
答案1
得分: 1
你可以通过启用 CONFIG_DEBUG_INFO
轻松编译内核并包含调试符号。如果你正在使用 make menuconfig
,它将位于“Kernel hacking” -> “Compile-time checks and compiler options” -> “Compiler a kernel with debug info” 下。
如果你想将调试符号拆分到不同的 .dwo
文件中,还可以启用 CONFIG_DEBUG_INFO_SPLIT
(在相同的菜单位置)。这应该与 linux-image-$(uname -r)-dbg
软件包包含的内容差不多。
英文:
You can easily compile the kernel with debug symbols by enabling CONFIG_DEBUG_INFO
. If you are using make menuconfig
it's going to be under "Kernel hacking" -> "Compile-time checks and compiler options" -> "Compiler a kernel with debug info".
If you want to have the debug symbols split in a different .dwo
file you can also enable CONFIG_DEBUG_INFO_SPLIT
(same location in the menu). This should be more or less the same thing that the linux-image-$(uname -r)-dbg
package contains.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论