Commit a06f9f6d authored by Sam Ravnborg's avatar Sam Ravnborg

kbuild: Added CONFIG_DEBUG_INFO

When CONFIG_DEBUG_INFO is set to Y, -g will be added to CFLAGS.
Several architectures already put -g in CFLAGS, often via a patch
to the top-level makefile.
This option is put in the kernel hacking menu, guarded by CONFIG_DEBUG_KERNEL.

Added CONFIG_DEBUG_INFO in Kconfig for the architectures that
already had CONFIG_DEBUG_KERNEL
parent 30d35a76
...@@ -308,6 +308,10 @@ ifndef CONFIG_FRAME_POINTER ...@@ -308,6 +308,10 @@ ifndef CONFIG_FRAME_POINTER
CFLAGS += -fomit-frame-pointer CFLAGS += -fomit-frame-pointer
endif endif
ifdef CONFIG_DEBUG_INFO
CFLAGS += -g
endif
# #
# INSTALL_PATH specifies where to place the updated kernel and system map # INSTALL_PATH specifies where to place the updated kernel and system map
# images. Uncomment if you want to place them anywhere other than root. # images. Uncomment if you want to place them anywhere other than root.
......
...@@ -870,6 +870,15 @@ config DEBUG_SEMAPHORE ...@@ -870,6 +870,15 @@ config DEBUG_SEMAPHORE
verbose debugging messages. If you suspect a semaphore problem or a verbose debugging messages. If you suspect a semaphore problem or a
kernel hacker asks for this option then say Y. Otherwise say N. kernel hacker asks for this option then say Y. Otherwise say N.
config DEBUG_INFO
bool "Compile the kernel with debug info"
depends on DEBUG_KERNEL
help
If you say Y here the resulting kernel image will include
debugging info resulting in a larger kernel image.
Say Y here only if you plan to use gdb to debug the kernel.
If you don't debug the kernel, you can say N.
endmenu endmenu
source "security/Kconfig" source "security/Kconfig"
......
...@@ -1082,6 +1082,15 @@ config KALLSYMS ...@@ -1082,6 +1082,15 @@ config KALLSYMS
symbolic stack backtraces. This increases the size of the kernel symbolic stack backtraces. This increases the size of the kernel
somewhat, as all symbols have to be loaded into the kernel image. somewhat, as all symbols have to be loaded into the kernel image.
config DEBUG_INFO
bool "Compile the kernel with debug info"
depends on DEBUG_KERNEL
help
If you say Y here the resulting kernel image will include
debugging info resulting in a larger kernel image.
Say Y here only if you plan to use gdb to debug the kernel.
If you don't debug the kernel, you can say N.
# These options are only for real kernel hackers who want to get their hands dirty. # These options are only for real kernel hackers who want to get their hands dirty.
config DEBUG_LL config DEBUG_LL
bool "Kernel low-level debugging functions" bool "Kernel low-level debugging functions"
......
...@@ -553,6 +553,15 @@ config KALLSYMS ...@@ -553,6 +553,15 @@ config KALLSYMS
symbolic stack backtraces. This increases the size of the kernel symbolic stack backtraces. This increases the size of the kernel
somewhat, as all symbols have to be loaded into the kernel image. somewhat, as all symbols have to be loaded into the kernel image.
config DEBUG_INFO
bool "Compile the kernel with debug info"
depends on DEBUG_KERNEL
help
If you say Y here the resulting kernel image will include
debugging info resulting in a larger kernel image.
Say Y here only if you plan to use gdb to debug the kernel.
If you don't debug the kernel, you can say N.
# These options are only for real kernel hackers who want to get their hands dirty. # These options are only for real kernel hackers who want to get their hands dirty.
config DEBUG_LL config DEBUG_LL
bool "Kernel low-level debugging functions" bool "Kernel low-level debugging functions"
......
...@@ -1404,6 +1404,15 @@ config DEBUG_HIGHMEM ...@@ -1404,6 +1404,15 @@ config DEBUG_HIGHMEM
This options enables addition error checking for high memory systems. This options enables addition error checking for high memory systems.
Disable for production systems. Disable for production systems.
config DEBUG_INFO
bool "Compile the kernel with debug info"
depends on DEBUG_KERNEL
help
If you say Y here the resulting kernel image will include
debugging info resulting in a larger kernel image.
Say Y here only if you plan to use gdb to debug the kernel.
If you don't debug the kernel, you can say N.
config KALLSYMS config KALLSYMS
bool "Load all symbols for debugging/kksymoops" bool "Load all symbols for debugging/kksymoops"
help help
......
...@@ -825,6 +825,15 @@ config IA64_DEBUG_IRQ ...@@ -825,6 +825,15 @@ config IA64_DEBUG_IRQ
and restore instructions. It's useful for tracking down spinlock and restore instructions. It's useful for tracking down spinlock
problems, but slow! If you're unsure, select N. problems, but slow! If you're unsure, select N.
config DEBUG_INFO
bool "Compile the kernel with debug info"
depends on DEBUG_KERNEL
help
If you say Y here the resulting kernel image will include
debugging info resulting in a larger kernel image.
Say Y here only if you plan to use gdb to debug the kernel.
If you don't debug the kernel, you can say N.
endmenu endmenu
source "security/Kconfig" source "security/Kconfig"
......
...@@ -1292,6 +1292,15 @@ config DEBUG_BUGVERBOSE ...@@ -1292,6 +1292,15 @@ config DEBUG_BUGVERBOSE
bool "Verbose BUG() reporting" bool "Verbose BUG() reporting"
depends on DEBUG_KERNEL depends on DEBUG_KERNEL
config DEBUG_INFO
bool "Compile the kernel with debug info"
depends on DEBUG_KERNEL
help
If you say Y here the resulting kernel image will include
debugging info resulting in a larger kernel image.
Say Y here only if you plan to use gdb to debug the kernel.
If you don't debug the kernel, you can say N.
endmenu endmenu
source "security/Kconfig" source "security/Kconfig"
......
...@@ -319,6 +319,15 @@ config KALLSYMS ...@@ -319,6 +319,15 @@ config KALLSYMS
symbolic stack backtraces. This increases the size of the kernel symbolic stack backtraces. This increases the size of the kernel
somewhat, as all symbols have to be loaded into the kernel image. somewhat, as all symbols have to be loaded into the kernel image.
config DEBUG_INFO
bool "Compile the kernel with debug info"
depends on DEBUG_KERNEL
help
If you say Y here the resulting kernel image will include
debugging info resulting in a larger kernel image.
Say Y here only if you plan to use gdb to debug the kernel.
If you don't debug the kernel, you can say N.
endmenu endmenu
source "security/Kconfig" source "security/Kconfig"
......
...@@ -1502,6 +1502,15 @@ config KGDB ...@@ -1502,6 +1502,15 @@ config KGDB
debugger. See <http://kgdb.sourceforge.net/> for more information. debugger. See <http://kgdb.sourceforge.net/> for more information.
Unless you are intending to debug the kernel, say N here. Unless you are intending to debug the kernel, say N here.
config DEBUG_INFO
bool "Compile the kernel with debug info"
depends on DEBUG_KERNEL
help
If you say Y here the resulting kernel image will include
debugging info resulting in a larger kernel image.
Say Y here only if you plan to use gdb to debug the kernel.
If you don't debug the kernel, you can say N.
choice choice
prompt "Serial Port" prompt "Serial Port"
depends on KGDB depends on KGDB
......
...@@ -444,6 +444,15 @@ config PPCDBG ...@@ -444,6 +444,15 @@ config PPCDBG
bool "Include PPCDBG realtime debugging" bool "Include PPCDBG realtime debugging"
depends on DEBUG_KERNEL depends on DEBUG_KERNEL
config DEBUG_INFO
bool "Compile the kernel with debug info"
depends on DEBUG_KERNEL
help
If you say Y here the resulting kernel image will include
debugging info resulting in a larger kernel image.
Say Y here only if you plan to use gdb to debug the kernel.
If you don't debug the kernel, you can say N.
endmenu endmenu
source "security/Kconfig" source "security/Kconfig"
......
...@@ -283,6 +283,15 @@ config KALLSYMS ...@@ -283,6 +283,15 @@ config KALLSYMS
symbolic stack backtraces. This increases the size of the kernel symbolic stack backtraces. This increases the size of the kernel
somewhat, as all symbols have to be loaded into the kernel image. somewhat, as all symbols have to be loaded into the kernel image.
config DEBUG_INFO
bool "Compile the kernel with debug info"
depends on DEBUG_KERNEL
help
If you say Y here the resulting kernel image will include
debugging info resulting in a larger kernel image.
Say Y here only if you plan to use gdb to debug the kernel.
If you don't debug the kernel, you can say N.
config DEBUG_SPINLOCK_SLEEP config DEBUG_SPINLOCK_SLEEP
bool "Sleep-inside-spinlock checking" bool "Sleep-inside-spinlock checking"
help help
......
...@@ -965,6 +965,15 @@ config DEBUG_DCFLUSH ...@@ -965,6 +965,15 @@ config DEBUG_DCFLUSH
bool "D-cache flush debugging" bool "D-cache flush debugging"
depends on DEBUG_KERNEL depends on DEBUG_KERNEL
config DEBUG_INFO
bool "Compile the kernel with debug info"
depends on DEBUG_KERNEL
help
If you say Y here the resulting kernel image will include
debugging info resulting in a larger kernel image.
Say Y here only if you plan to use gdb to debug the kernel.
If you don't debug the kernel, you can say N.
config STACK_DEBUG config STACK_DEBUG
bool "Stack Overflow Detection Support" bool "Stack Overflow Detection Support"
......
...@@ -563,6 +563,15 @@ config INIT_DEBUG ...@@ -563,6 +563,15 @@ config INIT_DEBUG
Fill __init and __initdata at the end of boot. This helps debugging Fill __init and __initdata at the end of boot. This helps debugging
illegal uses of __init and __initdata after initialization. illegal uses of __init and __initdata after initialization.
config DEBUG_INFO
bool "Compile the kernel with debug info"
depends on DEBUG_KERNEL
help
If you say Y here the resulting kernel image will include
debugging info resulting in a larger kernel image.
Say Y here only if you plan to use gdb to debug the kernel.
If you don't debug the kernel, you can say N.
config KALLSYMS config KALLSYMS
bool "Load all symbols for debugging/kksymoops" bool "Load all symbols for debugging/kksymoops"
help help
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment