* [PATCH] scripts/gdb: use mem instead of core_layout to get the module address [not found] <CGME20230412112345eucas1p10c0ab064156268c9021abe9fc6bf1fd3@eucas1p1.samsung.com> @ 2023-04-12 11:15 ` Pankaj Raghav [not found] ` <CGME20230412112608eucas1p2e8aa819cf92ccc2bacfe0ff9bfcd7a6f@eucas1p2.samsung.com> 2023-04-12 17:06 ` Luis Chamberlain 0 siblings, 2 replies; 5+ messages in thread From: Pankaj Raghav @ 2023-04-12 11:15 UTC (permalink / raw) To: jan.kiszka, kbingham; +Cc: gost.dev, linux-kernel, song, mcgrof, p.raghav commit ac3b43283923 ("module: replace module_layout with module_memory") changed the struct module data structure from module_layout to module_memory. The core_layout member which is used while loading modules are not available anymore leading to the following error while running gdb: (gdb) lx-symbols loading vmlinux Python Exception <class 'gdb.error'>: There is no member named core_layout. Error occurred in Python: There is no member named core_layout. Replace core_layout with its new counterpart mem[MOD_TEXT]. Fixes: ac3b43283923 ("module: replace module_layout with module_memory") Signed-off-by: Pankaj Raghav <p.raghav@samsung.com> --- scripts/gdb/linux/modules.py | 2 +- scripts/gdb/linux/symbols.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/gdb/linux/modules.py b/scripts/gdb/linux/modules.py index 441b23239896..6ec51e913070 100644 --- a/scripts/gdb/linux/modules.py +++ b/scripts/gdb/linux/modules.py @@ -73,7 +73,7 @@ class LxLsmod(gdb.Command): " " if utils.get_long_type().sizeof == 8 else "")) for module in module_list(): - layout = module['core_layout'] + layout = module['mem'][0] gdb.write("{address} {name:<19} {size:>8} {ref}".format( address=str(layout['base']).split()[0], name=module['name'].string(), diff --git a/scripts/gdb/linux/symbols.py b/scripts/gdb/linux/symbols.py index dc07b6d12e30..3a7976401e00 100644 --- a/scripts/gdb/linux/symbols.py +++ b/scripts/gdb/linux/symbols.py @@ -109,7 +109,7 @@ lx-symbols command.""" def load_module_symbols(self, module): module_name = module['name'].string() - module_addr = str(module['core_layout']['base']).split()[0] + module_addr = str(module['mem'][0]['base']).split()[0] module_file = self._get_module_file(module_name) if not module_file and not self.module_files_updated: -- 2.39.2 ^ permalink raw reply [flat|nested] 5+ messages in thread
[parent not found: <CGME20230412112608eucas1p2e8aa819cf92ccc2bacfe0ff9bfcd7a6f@eucas1p2.samsung.com>]
* Re: [PATCH] scripts/gdb: use mem instead of core_layout to get the module address [not found] ` <CGME20230412112608eucas1p2e8aa819cf92ccc2bacfe0ff9bfcd7a6f@eucas1p2.samsung.com> @ 2023-04-12 11:26 ` Pankaj Raghav 2023-04-12 17:52 ` Florian Fainelli 0 siblings, 1 reply; 5+ messages in thread From: Pankaj Raghav @ 2023-04-12 11:26 UTC (permalink / raw) To: jan.kiszka, kbingham; +Cc: gost.dev, linux-kernel, song, mcgrof On 2023-04-12 13:15, Pankaj Raghav wrote: > commit ac3b43283923 ("module: replace module_layout with module_memory") > changed the struct module data structure from module_layout to > module_memory. The core_layout member which is used while loading > modules are not available anymore leading to the following error while > running gdb: > > (gdb) lx-symbols > loading vmlinux > Python Exception <class 'gdb.error'>: There is no member named core_layout. > Error occurred in Python: There is no member named core_layout. > > Replace core_layout with its new counterpart mem[MOD_TEXT]. > > Fixes: ac3b43283923 ("module: replace module_layout with module_memory") > Signed-off-by: Pankaj Raghav <p.raghav@samsung.com> > --- I had one question: - Is there a way to import enum? I currently hard code 0 but it will better if we can use the MOD_TEXT enum instead. > scripts/gdb/linux/modules.py | 2 +- > scripts/gdb/linux/symbols.py | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a/scripts/gdb/linux/modules.py b/scripts/gdb/linux/modules.py > index 441b23239896..6ec51e913070 100644 > --- a/scripts/gdb/linux/modules.py > +++ b/scripts/gdb/linux/modules.py > @@ -73,7 +73,7 @@ class LxLsmod(gdb.Command): > " " if utils.get_long_type().sizeof == 8 else "")) > > for module in module_list(): > - layout = module['core_layout'] > + layout = module['mem'][0] > gdb.write("{address} {name:<19} {size:>8} {ref}".format( > address=str(layout['base']).split()[0], > name=module['name'].string(), > diff --git a/scripts/gdb/linux/symbols.py b/scripts/gdb/linux/symbols.py > index dc07b6d12e30..3a7976401e00 100644 > --- a/scripts/gdb/linux/symbols.py > +++ b/scripts/gdb/linux/symbols.py > @@ -109,7 +109,7 @@ lx-symbols command.""" > > def load_module_symbols(self, module): > module_name = module['name'].string() > - module_addr = str(module['core_layout']['base']).split()[0] > + module_addr = str(module['mem'][0]['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] 5+ messages in thread
* Re: [PATCH] scripts/gdb: use mem instead of core_layout to get the module address 2023-04-12 11:26 ` Pankaj Raghav @ 2023-04-12 17:52 ` Florian Fainelli 2023-04-12 20:06 ` Pankaj Raghav 0 siblings, 1 reply; 5+ messages in thread From: Florian Fainelli @ 2023-04-12 17:52 UTC (permalink / raw) To: Pankaj Raghav, jan.kiszka, kbingham; +Cc: gost.dev, linux-kernel, song, mcgrof On 4/12/23 04:26, Pankaj Raghav wrote: > On 2023-04-12 13:15, Pankaj Raghav wrote: >> commit ac3b43283923 ("module: replace module_layout with module_memory") >> changed the struct module data structure from module_layout to >> module_memory. The core_layout member which is used while loading >> modules are not available anymore leading to the following error while >> running gdb: >> >> (gdb) lx-symbols >> loading vmlinux >> Python Exception <class 'gdb.error'>: There is no member named core_layout. >> Error occurred in Python: There is no member named core_layout. >> >> Replace core_layout with its new counterpart mem[MOD_TEXT]. >> >> Fixes: ac3b43283923 ("module: replace module_layout with module_memory") >> Signed-off-by: Pankaj Raghav <p.raghav@samsung.com> >> --- > > I had one question: > - Is there a way to import enum? I currently hard code 0 but it will better if we can > use the MOD_TEXT enum instead. You should be able to with updating constants.py.in and using LX_GDBPARSED() -- Florian ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] scripts/gdb: use mem instead of core_layout to get the module address 2023-04-12 17:52 ` Florian Fainelli @ 2023-04-12 20:06 ` Pankaj Raghav 0 siblings, 0 replies; 5+ messages in thread From: Pankaj Raghav @ 2023-04-12 20:06 UTC (permalink / raw) To: Florian Fainelli, jan.kiszka, kbingham Cc: gost.dev, linux-kernel, song, mcgrof >>> Replace core_layout with its new counterpart mem[MOD_TEXT]. >>> >>> Fixes: ac3b43283923 ("module: replace module_layout with module_memory") >>> Signed-off-by: Pankaj Raghav <p.raghav@samsung.com> >>> --- >> >> I had one question: >> - Is there a way to import enum? I currently hard code 0 but it will better if we can >> use the MOD_TEXT enum instead. > > You should be able to with updating constants.py.in and using LX_GDBPARSED() Thanks a lot. This helps. ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] scripts/gdb: use mem instead of core_layout to get the module address 2023-04-12 11:15 ` [PATCH] scripts/gdb: use mem instead of core_layout to get the module address Pankaj Raghav [not found] ` <CGME20230412112608eucas1p2e8aa819cf92ccc2bacfe0ff9bfcd7a6f@eucas1p2.samsung.com> @ 2023-04-12 17:06 ` Luis Chamberlain 1 sibling, 0 replies; 5+ messages in thread From: Luis Chamberlain @ 2023-04-12 17:06 UTC (permalink / raw) To: Pankaj Raghav; +Cc: jan.kiszka, kbingham, gost.dev, linux-kernel, song On Wed, Apr 12, 2023 at 01:15:08PM +0200, Pankaj Raghav wrote: > commit ac3b43283923 ("module: replace module_layout with module_memory") > changed the struct module data structure from module_layout to > module_memory. The core_layout member which is used while loading > modules are not available anymore leading to the following error while > running gdb: > > (gdb) lx-symbols > loading vmlinux > Python Exception <class 'gdb.error'>: There is no member named core_layout. > Error occurred in Python: There is no member named core_layout. > > Replace core_layout with its new counterpart mem[MOD_TEXT]. > > Fixes: ac3b43283923 ("module: replace module_layout with module_memory") > Signed-off-by: Pankaj Raghav <p.raghav@samsung.com> > --- Jan, Kieran, That commit is in my modules-next tree, so I can take that fix in through my tree. Let me know if that is OK, and if you ACK the patch. Pankaj, thanks! Luis ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2023-04-12 20:06 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <CGME20230412112345eucas1p10c0ab064156268c9021abe9fc6bf1fd3@eucas1p1.samsung.com>
2023-04-12 11:15 ` [PATCH] scripts/gdb: use mem instead of core_layout to get the module address Pankaj Raghav
[not found] ` <CGME20230412112608eucas1p2e8aa819cf92ccc2bacfe0ff9bfcd7a6f@eucas1p2.samsung.com>
2023-04-12 11:26 ` Pankaj Raghav
2023-04-12 17:52 ` Florian Fainelli
2023-04-12 20:06 ` Pankaj Raghav
2023-04-12 17:06 ` Luis Chamberlain
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®