* [PATCH] scripts/gdb: Account for changes in module data structure
@ 2016-03-13 19:27 Jan Kiszka
2016-03-14 9:56 ` Kieran Bingham
0 siblings, 1 reply; 2+ messages in thread
From: Jan Kiszka @ 2016-03-13 19:27 UTC (permalink / raw)
To: Andrew Morton, Linux Kernel Mailing List; +Cc: Kieran Bingham
From: Jan Kiszka <jan.kiszka@siemens.com>
Commit 7523e4dc50 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>
---
Probably too late for 4.5, still a regression.
scripts/gdb/linux/modules.py | 5 +++--
scripts/gdb/linux/symbols.py | 2 +-
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/scripts/gdb/linux/modules.py b/scripts/gdb/linux/modules.py
index 25db8cf..0a35d6d 100644
--- a/scripts/gdb/linux/modules.py
+++ b/scripts/gdb/linux/modules.py
@@ -73,10 +73,11 @@ class LxLsmod(gdb.Command):
" " 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']
diff --git a/scripts/gdb/linux/symbols.py b/scripts/gdb/linux/symbols.py
index 627750c..9a0f892 100644
--- a/scripts/gdb/linux/symbols.py
+++ b/scripts/gdb/linux/symbols.py
@@ -108,7 +108,7 @@ lx-symbols command."""
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:
--
2.1.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] scripts/gdb: Account for changes in module data structure
2016-03-13 19:27 [PATCH] scripts/gdb: Account for changes in module data structure Jan Kiszka
@ 2016-03-14 9:56 ` Kieran Bingham
0 siblings, 0 replies; 2+ messages in thread
From: Kieran Bingham @ 2016-03-14 9:56 UTC (permalink / raw)
To: Jan Kiszka, Andrew Morton, Linux Kernel Mailing List; +Cc: Peter Griffin
On 13/03/16 19:27, Jan Kiszka wrote:
> From: Jan Kiszka <jan.kiszka@siemens.com>
>
> Commit 7523e4dc50 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>
Testing this has shown me that the module ko search path can find old
modules versions in preference to newer ones, but that does not block
this patch and can be investigated separately :
Reviewed-by: Kieran Bingham <kieran.bingham@linaro.org>
Tested-by: Kieran Bingham <kieran.bingham@linaro.org> (qemu-{ARM,x86})
--
Regards
Kieran
> ---
>
> Probably too late for 4.5, still a regression.
>
> scripts/gdb/linux/modules.py | 5 +++--
> scripts/gdb/linux/symbols.py | 2 +-
> 2 files changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/scripts/gdb/linux/modules.py b/scripts/gdb/linux/modules.py
> index 25db8cf..0a35d6d 100644
> --- a/scripts/gdb/linux/modules.py
> +++ b/scripts/gdb/linux/modules.py
> @@ -73,10 +73,11 @@ class LxLsmod(gdb.Command):
> " " 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']
> diff --git a/scripts/gdb/linux/symbols.py b/scripts/gdb/linux/symbols.py
> index 627750c..9a0f892 100644
> --- a/scripts/gdb/linux/symbols.py
> +++ b/scripts/gdb/linux/symbols.py
> @@ -108,7 +108,7 @@ lx-symbols command."""
>
> 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:
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-03-14 9:56 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-13 19:27 [PATCH] scripts/gdb: Account for changes in module data structure Jan Kiszka
2016-03-14 9:56 ` Kieran Bingham
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox