For debug info, I have these config options enabled:
/Volumes/git/linux (master)*$ grep CONFIG_DEBUG build/.config | grep -v ^#
CONFIG_DEBUG_ALIGN_RODATA=y
CONFIG_DEBUG_KERNEL=y
CONFIG_DEBUG_INFO=y
CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT=y
CONFIG_DEBUG_LL_INCLUDE="mach/debug-macro.S"
However the vmlinux file only includes debug info for .c and .h files and not .S files.
Is there a standard way to get debug info for the assembly files included in vmlinux?
update 8/2/2022:
I found that in scripts/Makefile.debug if you use LLVM/clang then debug info is excluded from assembly files for some reason.
ifndef CONFIG_AS_IS_LLVM
KBUILD_AFLAGS += -Wa,-gdwarf-2
endif
and removing the ifndef line fixed the missing debug info for me.
Why is ifndef CONFIG_AS_IS_LLVM there?
if building with llvm clang, remove
ifndef CONFIG_AS_IS_LLVMandendiffrom around theKBUILD_AFLAGS