summaryrefslogtreecommitdiff
path: root/scripts/gdb/linux/modules.py
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/gdb/linux/modules.py')
-rw-r--r--scripts/gdb/linux/modules.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/scripts/gdb/linux/modules.py b/scripts/gdb/linux/modules.py
index 62557ddf56f1..441b23239896 100644
--- a/scripts/gdb/linux/modules.py
+++ b/scripts/gdb/linux/modules.py
@@ -21,8 +21,11 @@ module_type = utils.CachedType("struct module")
def module_list():
global module_type
+ modules = utils.gdb_eval_or_none("modules")
+ if modules is None:
+ return
+
module_ptr_type = module_type.get_type().pointer()
- modules = gdb.parse_and_eval("modules")
for module in lists.list_for_each_entry(modules, module_ptr_type, "list"):
yield module