]> Git Repo - linux.git/commitdiff
gdb: lx-symbols: do not error out on monolithic build
authorEtienne Buira <[email protected]>
Fri, 8 Nov 2024 16:45:32 +0000 (17:45 +0100)
committerAndrew Morton <[email protected]>
Fri, 15 Nov 2024 06:51:14 +0000 (22:51 -0800)
This avoids spurious message:
(gdb) lx-symbols
loading vmlinux
No source file named kernel/module/main.c.

Link: https://lkml.kernel.org/r/Zy5ALByQtpO-ddh4@Z926fQmE5jqhFMgp6
Signed-off-by: Etienne Buira <[email protected]>
Cc: Andrew Ballance <[email protected]>
Cc: Kieran Bingham <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
scripts/gdb/linux/modules.py
scripts/gdb/linux/symbols.py

index 298dfcc25eaea1bcb218bdaf364e9f0cfc7d7e4d..fa15f872ddbe8fd711c4c090306cf7923ce04f83 100644 (file)
@@ -19,6 +19,9 @@ from linux import cpus, utils, lists, constants
 module_type = utils.CachedType("struct module")
 
 
+def has_modules():
+    return utils.gdb_eval_or_none("modules") is not None
+
 def module_list():
     global module_type
     modules = utils.gdb_eval_or_none("modules")
index e8316beb17a714588fa5358a8b514a9d383fecbf..f6c1b063775a7189b62e8d8abce27d557eb7f5ad 100644 (file)
@@ -178,6 +178,9 @@ lx-symbols command."""
 
         self.load_all_symbols()
 
+        if not modules.has_modules():
+            return
+
         if hasattr(gdb, 'Breakpoint'):
             if self.breakpoint is not None:
                 self.breakpoint.delete()
This page took 0.055948 seconds and 4 git commands to generate.