Skip to content

Commit

Permalink
scripts/gdb: account for changes in module data structure
Browse files Browse the repository at this point in the history
Commit 7523e4d ("module: use a structure to encapsulate layout.")
factored out the module_layout structure.  Adjust the symbol loader and
the lsmod command to this.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Reviewed-by: Kieran Bingham <kieran.bingham@linaro.org>
Tested-by: Kieran Bingham <kieran.bingham@linaro.org> (qemu-{ARM,x86})
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Jiri Kosina <jkosina@suse.cz>
Cc: Jason Wessel <jason.wessel@windriver.com>
Cc: <stable@vger.kernel.org>	[4.4+]
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
jan-kiszka authored and torvalds committed Mar 22, 2016
1 parent 72bf92e commit ad4db3b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions scripts/gdb/linux/modules.py
Expand Up @@ -73,10 +73,11 @@ def invoke(self, arg, from_tty):
" " if utils.get_long_type().sizeof == 8 else ""))

for module in module_list():
layout = module['core_layout']
gdb.write("{address} {name:<19} {size:>8} {ref}".format(
address=str(module['module_core']).split()[0],
address=str(layout['base']).split()[0],
name=module['name'].string(),
size=str(module['core_size']),
size=str(layout['size']),
ref=str(module['refcnt']['counter'])))

source_list = module['source_list']
Expand Down
2 changes: 1 addition & 1 deletion scripts/gdb/linux/symbols.py
Expand Up @@ -108,7 +108,7 @@ def _section_arguments(self, module):

def load_module_symbols(self, module):
module_name = module['name'].string()
module_addr = str(module['module_core']).split()[0]
module_addr = str(module['core_layout']['base']).split()[0]

module_file = self._get_module_file(module_name)
if not module_file and not self.module_files_updated:
Expand Down

0 comments on commit ad4db3b

Please sign in to comment.