Commit 2c259a91 authored by Etienne Buira's avatar Etienne Buira Committed by Andrew Morton
Browse files

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: default avatarEtienne Buira <etienne.buira@free.fr>
Cc: Andrew Ballance <andrewjballance@gmail.com>
Cc: Kieran Bingham <kbingham@kernel.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent 45dac195
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -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")
+3 −0
Original line number Diff line number Diff line
@@ -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()