[<prev] [next>] [day] [month] [year] [list]
Message-ID: <Zy5ALByQtpO-ddh4@Z926fQmE5jqhFMgp6>
Date: Fri, 8 Nov 2024 17:45:32 +0100
From: Etienne Buira <etienne.buira@...e.fr>
To: Kieran Bingham <kbingham@...nel.org>,
Etienne Buira <etienne.buira@...e.fr>,
Andrew Morton <akpm@...ux-foundation.org>,
Andrew Ballance <andrewjballance@...il.com>,
linux-kernel@...r.kernel.org
Subject: [PATCH v2] gdb: lx-symbols: do not error out on monolithic build
This avoids spurious message:
(gdb) lx-symbols
loading vmlinux
No source file named kernel/module/main.c.
Signed-off-by: Etienne Buira <etienne.buira@...e.fr>
---
scripts/gdb/linux/modules.py | 3 +++
scripts/gdb/linux/symbols.py | 3 +++
2 files changed, 6 insertions(+)
diff --git a/scripts/gdb/linux/modules.py b/scripts/gdb/linux/modules.py
index 298dfcc25eae..fa15f872ddbe 100644
--- a/scripts/gdb/linux/modules.py
+++ b/scripts/gdb/linux/modules.py
@@ -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")
diff --git a/scripts/gdb/linux/symbols.py b/scripts/gdb/linux/symbols.py
index e8316beb17a7..f6c1b063775a 100644
--- a/scripts/gdb/linux/symbols.py
+++ b/scripts/gdb/linux/symbols.py
@@ -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()
--
2.45.2
Powered by blists - more mailing lists