2022-07-21 09:33:16

by Khalid Masum

[permalink] [raw]
Subject: [PATCH RESEND] scripts/gdb: Fix gdb 'lx-symbols' command

Currently the command 'lx-symbols' in gdb exits with the error`Function
"do_init_module" not defined in "kernel/module.c"`. This occurs because
the file kernel/module.c was moved to kernel/module/main.c.

Fix this breakage by changing the path to "kernel/module/main.c" in
LoadModuleBreakpoint.

Signed-off-by: Khalid Masum <[email protected]>
---
scripts/gdb/linux/symbols.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/gdb/linux/symbols.py b/scripts/gdb/linux/symbols.py
index 46f7542db08c..dc07b6d12e30 100644
--- a/scripts/gdb/linux/symbols.py
+++ b/scripts/gdb/linux/symbols.py
@@ -180,7 +180,7 @@ lx-symbols command."""
self.breakpoint.delete()
self.breakpoint = None
self.breakpoint = LoadModuleBreakpoint(
- "kernel/module.c:do_init_module", self)
+ "kernel/module/main.c:do_init_module", self)
else:
gdb.write("Note: symbol update on module loading not supported "
"with this gdb version\n")
--
2.36.1


2022-07-21 17:01:28

by Doug Anderson

[permalink] [raw]
Subject: Re: [PATCH RESEND] scripts/gdb: Fix gdb 'lx-symbols' command

Hi,

On Thu, Jul 21, 2022 at 2:31 AM Khalid Masum <[email protected]> wrote:
>
> Currently the command 'lx-symbols' in gdb exits with the error`Function
> "do_init_module" not defined in "kernel/module.c"`. This occurs because
> the file kernel/module.c was moved to kernel/module/main.c.
>
> Fix this breakage by changing the path to "kernel/module/main.c" in
> LoadModuleBreakpoint.
>
> Signed-off-by: Khalid Masum <[email protected]>
> ---
> scripts/gdb/linux/symbols.py | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/scripts/gdb/linux/symbols.py b/scripts/gdb/linux/symbols.py
> index 46f7542db08c..dc07b6d12e30 100644
> --- a/scripts/gdb/linux/symbols.py
> +++ b/scripts/gdb/linux/symbols.py
> @@ -180,7 +180,7 @@ lx-symbols command."""
> self.breakpoint.delete()
> self.breakpoint = None
> self.breakpoint = LoadModuleBreakpoint(
> - "kernel/module.c:do_init_module", self)
> + "kernel/module/main.c:do_init_module", self)

Fixes: cfc1d277891e ("module: Move all into module/")
Reviewed-by: Douglas Anderson <[email protected]>

2022-07-21 17:05:45

by Luis Chamberlain

[permalink] [raw]
Subject: Re: [PATCH RESEND] scripts/gdb: Fix gdb 'lx-symbols' command

On Thu, Jul 21, 2022 at 09:24:31AM -0700, Doug Anderson wrote:
> Hi,
>
> On Thu, Jul 21, 2022 at 2:31 AM Khalid Masum <[email protected]> wrote:
> >
> > Currently the command 'lx-symbols' in gdb exits with the error`Function
> > "do_init_module" not defined in "kernel/module.c"`. This occurs because
> > the file kernel/module.c was moved to kernel/module/main.c.
> >
> > Fix this breakage by changing the path to "kernel/module/main.c" in
> > LoadModuleBreakpoint.
> >
> > Signed-off-by: Khalid Masum <[email protected]>
> > ---
> > scripts/gdb/linux/symbols.py | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/scripts/gdb/linux/symbols.py b/scripts/gdb/linux/symbols.py
> > index 46f7542db08c..dc07b6d12e30 100644
> > --- a/scripts/gdb/linux/symbols.py
> > +++ b/scripts/gdb/linux/symbols.py
> > @@ -180,7 +180,7 @@ lx-symbols command."""
> > self.breakpoint.delete()
> > self.breakpoint = None
> > self.breakpoint = LoadModuleBreakpoint(
> > - "kernel/module.c:do_init_module", self)
> > + "kernel/module/main.c:do_init_module", self)
>
> Fixes: cfc1d277891e ("module: Move all into module/")
> Reviewed-by: Douglas Anderson <[email protected]>

Acked-by: Luis Chamberlain <[email protected]>

This should go to Linus prior to the next rc. Linus, I think this is
with picking up now as I smell a final release soon.

FWIW a git grep of "kernel/module\.c" reveals no other code users of
this path.

Luis

2022-07-21 17:47:10

by Linus Torvalds

[permalink] [raw]
Subject: Re: [PATCH RESEND] scripts/gdb: Fix gdb 'lx-symbols' command

On Thu, Jul 21, 2022 at 9:33 AM Luis Chamberlain <[email protected]> wrote:
>
>
> This should go to Linus prior to the next rc. Linus, I think this is
> worth picking up now as I smell a final release soon.

Applied. Thanks,

Linus