nilrt-debug: fix debug kernel missing debug symbols#1042
Conversation
There was a problem hiding this comment.
Pull request overview
Updates the NILRT debug kernel config fragment to reliably produce kernel debug symbols by explicitly disabling CONFIG_DEBUG_INFO_NONE and selecting DWARF5 debug info, addressing newer kernel config behaviors that can otherwise suppress debug symbol generation.
Changes:
- Explicitly disables
CONFIG_DEBUG_INFO_NONEin the debug kernel fragment. - Forces DWARF5 debug info selection (and disables DWARF4/toolchain default format options).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Explicitly disable CONFIG_DEBUG_INFO_NONE which defaults to enabled in newer kernels, preventing debug info. Enable CONFIG_DEBUG_INFO_DWARF5 to select valid debug format required for symbol generation in 6.x kernels. - Update debug.cfg to align with new Kconfig behavior - Ensure debug symbols are generated in vmlinux binary - Verified using file and readelf for debug sections Signed-off-by: Jatin Bharti <jatin.bharti@emerson.com>
ed876aa to
a14bc68
Compare
rajendra-desai-ni
left a comment
There was a problem hiding this comment.
- Work item is not linked
- Did you build the kernel using
packagegroup-ni-debug-kerneland verified the installation with packagegroup IPK? If so, can you also add this it in the testing section? - Update commit title to
nilrt-debug: fix missing debug kernel symbolsor something since the changes are specific to debug kernel.
| CONFIG_EARLY_PRINTK=y | ||
| CONFIG_HARDLOCKUP_DETECTOR=y | ||
| # Debug info for new built kernel | ||
| CONFIG_DEBUG_INFO_NONE=n |
There was a problem hiding this comment.
How did you obtain the new configs? The right way to do this is to append this to nati_x86_64_defconfig in kernel sources, run make nati_x86_64_defconfig, make savedefconfig, then diff the generated defconfig with the original nati_x86_64_defconfig and add new symbols here. Was this process followed?
Summary of Changes
Work Item - https://dev.azure.com/ni/DevCentral/_boards/board/t/RTOS/Work%20Items?System.AssignedTo=%40me&workitem=3858245
Updated the debug kernel configuration fragment to explicitly disable CONFIG_DEBUG_INFO_NONE and select CONFIG_DEBUG_INFO_DWARF5. Newer kernel configuration behavior can result in CONFIG_DEBUG_INFO_NONE remaining enabled, preventing debug symbol generation even when CONFIG_DEBUG_INFO=y is configured.
This change ensures that the NILRT debug kernel is built with DWARF debug information required for vmcore analysis and symbolized crash debugging.
Justification
A user reported that after installing packagegroup-ni-debug-kernel, the running debug kernel still had:
CONFIG_DEBUG_INFO_NONE=y
which prevented generation of kernel debug symbols and limited vmcore/crash analysis.
Investigation confirmed that the debug kernel configuration fragment did not explicitly disable CONFIG_DEBUG_INFO_NONE or select a DWARF debug format. Updating the fragment restores generation of debug information in the resulting debug kernel build.
Testing
Reproduced the issue on PXI and cRIO targets where the released debug kernel reported CONFIG_DEBUG_INFO_NONE=y, preventing generation of kernel debug symbols. Rebuilt linux-nilrt-debug with the updated configuration and verified that the resulting kernel enables CONFIG_DEBUG_INFO=y, disables CONFIG_DEBUG_INFO_NONE, and selects CONFIG_DEBUG_INFO_DWARF5=y. Booted the rebuilt debug kernel on a cRIO target and confirmed the updated configuration is present on the running system.
Additional validation screenshots are attached below showing the rebuilt debug kernel running on target with CONFIG_DEBUG_INFO enabled and verification that the generated vmlinux contains debug information.
bitbake packagefeed-ni-core)Procedure