]> git.baikalelectronics.ru Git - kernel.git/commitdiff
scripts/gdb: change kernel config dumping method
authorKuan-Ying Lee <Kuan-Ying.Lee@mediatek.com>
Fri, 10 Jun 2022 07:14:57 +0000 (15:14 +0800)
committerMasahiro Yamada <masahiroy@kernel.org>
Sat, 11 Jun 2022 09:31:53 +0000 (18:31 +0900)
MAGIC_START("IKCFG_ST") and MAGIC_END("IKCFG_ED") are moved out
from the kernel_config_data variable.

Thus, we parse kernel_config_data directly instead of considering
offset of MAGIC_START and MAGIC_END.

Fixes: aac9c6823e61 ("kernel/configs: use .incbin directive to embed config_data.gz")
Signed-off-by: Kuan-Ying Lee <Kuan-Ying.Lee@mediatek.com>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
scripts/gdb/linux/config.py

index 90e1565b1967156b1fa4bf20d1b709d248bc8608..8843ab3cbaddc7a18e5d9812bff5caa5134442a8 100644 (file)
@@ -24,9 +24,9 @@ class LxConfigDump(gdb.Command):
             filename = arg
 
         try:
-            py_config_ptr = gdb.parse_and_eval("kernel_config_data + 8")
-            py_config_size = gdb.parse_and_eval(
-                    "sizeof(kernel_config_data) - 1 - 8 * 2")
+            py_config_ptr = gdb.parse_and_eval("&kernel_config_data")
+            py_config_ptr_end = gdb.parse_and_eval("&kernel_config_data_end")
+            py_config_size = py_config_ptr_end - py_config_ptr
         except gdb.error as e:
             raise gdb.GdbError("Can't find config, enable CONFIG_IKCONFIG?")