Commit 7359608a authored by Stefano Garzarella's avatar Stefano Garzarella Committed by Linus Torvalds

scripts/gdb: fix lx-symbols 'gdb.error' while loading modules

Commit ed66f991 ("module: Refactor section attr into bin attribute")
removed the 'name' field from 'struct module_sect_attr' triggering the
following error when invoking lx-symbols:

  (gdb) lx-symbols
  loading vmlinux
  scanning for modules in linux/build
  loading @0xffffffffc014f000: linux/build/drivers/net/tun.ko
  Python Exception <class 'gdb.error'> There is no member named name.:
  Error occurred in Python: There is no member named name.

This patch fixes the issue taking the module name from the 'struct
attribute'.

Fixes: ed66f991 ("module: Refactor section attr into bin attribute")
Signed-off-by: default avatarStefano Garzarella <sgarzare@redhat.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Reviewed-by: default avatarJan Kiszka <jan.kiszka@siemens.com>
Reviewed-by: default avatarKieran Bingham <kbingham@kernel.org>
Link: http://lkml.kernel.org/r/20200722102239.313231-1-sgarzare@redhat.comSigned-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent bb971537
...@@ -96,7 +96,7 @@ lx-symbols command.""" ...@@ -96,7 +96,7 @@ lx-symbols command."""
return "" return ""
attrs = sect_attrs['attrs'] attrs = sect_attrs['attrs']
section_name_to_address = { section_name_to_address = {
attrs[n]['name'].string(): attrs[n]['address'] attrs[n]['battr']['attr']['name'].string(): attrs[n]['address']
for n in range(int(sect_attrs['nsections']))} for n in range(int(sect_attrs['nsections']))}
args = [] args = []
for section_name in [".data", ".data..read_mostly", ".rodata", ".bss", for section_name in [".data", ".data..read_mostly", ".rodata", ".bss",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment