Skip to content

Commit 2c259a9

Browse files
Etienne Buiraakpm00
authored andcommitted
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. Link: https://lkml.kernel.org/r/Zy5ALByQtpO-ddh4@Z926fQmE5jqhFMgp6 Signed-off-by: Etienne Buira <etienne.buira@free.fr> Cc: Andrew Ballance <andrewjballance@gmail.com> Cc: Kieran Bingham <kbingham@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
1 parent 45dac19 commit 2c259a9

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

scripts/gdb/linux/modules.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919
module_type = utils.CachedType("struct module")
2020

2121

22+
def has_modules():
23+
return utils.gdb_eval_or_none("modules") is not None
24+
2225
def module_list():
2326
global module_type
2427
modules = utils.gdb_eval_or_none("modules")

scripts/gdb/linux/symbols.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,9 @@ def invoke(self, arg, from_tty):
178178

179179
self.load_all_symbols()
180180

181+
if not modules.has_modules():
182+
return
183+
181184
if hasattr(gdb, 'Breakpoint'):
182185
if self.breakpoint is not None:
183186
self.breakpoint.delete()

0 commit comments

Comments
 (0)