[NTOSKRNL] Completely disable optimizations when using GDB
authorJérôme Gardou <jerome.gardou@reactos.org>
Wed, 21 Oct 2020 10:32:54 +0000 (12:32 +0200)
committerJérôme Gardou <jerome.gardou@reactos.org>
Wed, 21 Oct 2020 11:11:20 +0000 (13:11 +0200)
ntoskrnl/CMakeLists.txt

index 57a387f..e1823f7 100644 (file)
@@ -39,6 +39,8 @@ if(MSVC)
     add_target_link_flags(ntoskrnl "/SECTION:INIT,D")
 else()
     if(GDB)
+        # Completely disable optimizations when debugging the kernel
+        target_compile_options(ntoskrnl PRIVATE -O0)
         set_image_base(ntoskrnl 0x00800000)
     else()
         set_image_base(ntoskrnl 0x80800000)