1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-06-01 10:38:13 +00:00

Kernel: Add ENABLE_EXTRA_KERNEL_DEBUG_SYMBOLS option to set Og and ggdb3

When debugging kernel code, it's necessary to set extra flags. Normal
advice is to set -ggdb3. Sometimes that still doesn't provide enough
debugging information for complex functions that still get optimized.
Compiling with -Og gives the best optimizations for debugging, but can
sometimes be broken by changes that are innocuous when the compiler gets
more of a chance to look at them. The new CMake option enables both
compile options for kernel code.
This commit is contained in:
Andrew Kaster 2021-05-23 14:20:22 -06:00 committed by Andreas Kling
parent 7fb05c5c23
commit dda8afcb90
3 changed files with 8 additions and 1 deletions

View file

@ -1,4 +1,9 @@
add_compile_options(-Os)
if (ENABLE_EXTRA_KERNEL_DEBUG_SYMBOLS)
add_compile_options(-Og)
add_compile_options(-ggdb3)
else()
add_compile_options(-Os)
endif()
if ("${SERENITY_ARCH}" STREQUAL "i686")
set(KERNEL_ARCH i386)