Star64_linux/scripts/gdb/linux
Kieran Bingham 958ef8a09a scripts/gdb: support !CONFIG_MODULES gracefully
If CONFIG_MODULES is not enabled, lx-lsmod tries to find a non-existent
symbol and generates an unfriendly traceback:

  (gdb) lx-lsmod
  Address    Module                  Size  Used by
  Traceback (most recent call last):
    File "scripts/gdb/linux/modules.py", line 75, in invoke
      for module in module_list():
    File "scripts/gdb/linux/modules.py", line 24, in module_list
      module_ptr_type = module_type.get_type().pointer()
    File "scripts/gdb/linux/utils.py", line 28, in get_type
      self._type = gdb.lookup_type(self._name)
  gdb.error: No struct type named module.
  Error occurred in Python command: No struct type named module.

Catch the error and return an empty module_list() for a clean command
output as follows:

  (gdb) lx-lsmod
  Address    Module                  Size  Used by
  (gdb)

Link: http://lkml.kernel.org/r/94d533819437408b85ae5864f939dd7ca6fbfcd6.1462865983.git.jan.kiszka@siemens.com
Signed-off-by: Kieran Bingham <kieran.bingham@linaro.org>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2016-05-23 17:04:14 -07:00
..
.gitignore scripts/gdb: ignore byte-compiled python files 2015-02-17 14:34:54 -08:00
__init__.py scripts/gdb: add empty package initialization script 2015-02-28 09:57:51 -08:00
constants.py.in scripts/gdb: provide linux constants 2016-05-23 17:04:14 -07:00
cpus.py scripts/gdb: convert CpuList to generator function 2015-02-17 14:34:55 -08:00
dmesg.py scripts/gdb: fix PEP8 compliance 2015-06-30 19:44:58 -07:00
lists.py scripts/gdb: provide kernel list item generators 2016-05-23 17:04:14 -07:00
Makefile scripts/gdb: provide linux constants 2016-05-23 17:04:14 -07:00
modules.py scripts/gdb: support !CONFIG_MODULES gracefully 2016-05-23 17:04:14 -07:00
proc.py scripts/gdb: add cmdline reader command 2016-03-22 15:36:02 -07:00
symbols.py scripts/gdb: account for changes in module data structure 2016-03-22 15:36:02 -07:00
tasks.py scripts/gdb: remove useless global instruction 2015-06-30 19:44:58 -07:00
utils.py scripts/gdb: provide exception catching parser 2016-05-23 17:04:14 -07:00