diff options
Diffstat (limited to 'scripts/gdb/linux/modules.py')
-rw-r--r-- | scripts/gdb/linux/modules.py | 5 |
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") | |||
21 | 21 | ||
22 | def module_list(): | 22 | def module_list(): |
23 | global module_type | 23 | global module_type |
24 | modules = utils.gdb_eval_or_none("modules") | ||
25 | if modules is None: | ||
26 | return | ||
27 | |||
24 | module_ptr_type = module_type.get_type().pointer() | 28 | module_ptr_type = module_type.get_type().pointer() |
25 | modules = gdb.parse_and_eval("modules") | ||
26 | 29 | ||
27 | for module in lists.list_for_each_entry(modules, module_ptr_type, "list"): | 30 | for module in lists.list_for_each_entry(modules, module_ptr_type, "list"): |
28 | yield module | 31 | yield module |