Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756007AbcC2G6m (ORCPT ); Tue, 29 Mar 2016 02:58:42 -0400 Received: from hotel311.server4you.de ([85.25.146.15]:55753 "EHLO hotel311.server4you.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755239AbcC2G6j (ORCPT ); Tue, 29 Mar 2016 02:58:39 -0400 From: Daniel Wagner To: Jan Kiszka Cc: linux-kernel@vger.kernel.org, Daniel Wagner , Jiri Kosina , Rusty Russell Subject: [PATCH v2] scripts/gdb: Fix loading of modules information Date: Tue, 29 Mar 2016 08:58:25 +0200 Message-Id: <1459234705-8668-1-git-send-email-wagi@monom.org> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1459233699-5541-1-git-send-email-wagi@monom.org> References: <1459233699-5541-1-git-send-email-wagi@monom.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1895 Lines: 50 From: Daniel Wagner The module_core symbols is not available due to 7523e4dc5057 ("module: use a structure to encapsulate layout.") The base address of the module is now stored inside struct module_layout. Signed-off-by: Daniel Wagner Cc: Jiri Kosina Cc: Rusty Russell --- Obviously, it's too early to send patches. This times it even works. scripts/gdb/linux/modules.py | 3 ++- scripts/gdb/linux/symbols.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/gdb/linux/modules.py b/scripts/gdb/linux/modules.py index 25db8cf..a1ec0f3 100644 --- a/scripts/gdb/linux/modules.py +++ b/scripts/gdb/linux/modules.py @@ -73,8 +73,9 @@ class LxLsmod(gdb.Command): " " if utils.get_long_type().sizeof == 8 else "")) for module in module_list(): + module_layout=module['core_layout'] gdb.write("{address} {name:<19} {size:>8} {ref}".format( - address=str(module['module_core']).split()[0], + address=str(module_layout['base']), name=module['name'].string(), size=str(module['core_size']), ref=str(module['refcnt']['counter']))) diff --git a/scripts/gdb/linux/symbols.py b/scripts/gdb/linux/symbols.py index 627750c..8650ede 100644 --- a/scripts/gdb/linux/symbols.py +++ b/scripts/gdb/linux/symbols.py @@ -108,7 +108,8 @@ lx-symbols command.""" def load_module_symbols(self, module): module_name = module['name'].string() - module_addr = str(module['module_core']).split()[0] + module_layout = module['core_layout'] + module_addr = str(module_layout['base']) module_file = self._get_module_file(module_name) if not module_file and not self.module_files_updated: -- 2.5.5