Skip to contentSkip to conversation

scripts/gdb: Fix gdb 'lx-symbols' command

PATCH RESEND Applied Khalid Masum 4 participants 4 messages Jul 21, 2022 GDB kernel debugging helper scripts

lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/1 scripts/gdb: Fix gdb 'lx-symbols' command

Currently the command 'lx-symbols' in gdb exits with the errorFunction "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.

---
 scripts/gdb/linux/symbols.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/gdb/linux/symbols.py +1 -1
index 46f7542db08c..dc07b6d12e30 100644
@@ -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")
Signature · 6 lines
2.36.1

_______________________________________________
Linux-kernel-mentees mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees
Reviewed-by on v1 1/1
#1 lore raw

Hi,

Quoted 18 lines · Khalid Masum

Currently the command 'lx-symbols' in gdb exits with the errorFunction "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.

---
 scripts/gdb/linux/symbols.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/gdb/linux/symbols.py +0 -0
index 46f7542db08c..dc07b6d12e30 100644

scripts/gdb/linux/symbols.py lx-symbols command.""" · line 183

Quoted 5 lines
scripts/gdb/linux/symbols.py +1 -1
@@ -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/")

_______________________________________________
Linux-kernel-mentees mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees

#2 lore raw
Quoted 16 lines · Doug Anderson

Hi,

Quoted 13 lines · Khalid Masum

Currently the command 'lx-symbols' in gdb exits with the errorFunction "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.

---
 scripts/gdb/linux/symbols.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 13 lines

scripts/gdb/linux/symbols.py lx-symbols command.""" · line 183

Quoted 10 lines
scripts/gdb/linux/symbols.py +1 -1
index 46f7542db08c..dc07b6d12e30 100644
@@ -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/")

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
_______________________________________________
Linux-kernel-mentees mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees

#3 lore raw
Quoted 4 lines · Luis Chamberlain

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