I'm trying to debug Linux Kernel 5.15.47 and a kernel module that I am building. I'm using gdb and unfortunately, everytime I load up the vmlinux file in gdb in preparation for remote debugging using qemu, I am presented with the following error. Note, I tried using GDB on the qemu VM as well (so no remote debugging) and the error still happens there too.
I don't see much discussion around something similar so I figured I would ask if anyone has a work around for this?
(gdb) file vmlinux
Reading symbols from vmlinux...
Traceback (most recent call last):
File "/home/administrator/Kernels/built/linux-5.15.47/vmlinux-gdb.py", line 34, in <module>
import linux.proc
File "/home/administrator/Kernels/built/linux-5.15.47/scripts/gdb/linux/proc.py", line 15, in <module>
from linux import constants
File "/home/administrator/Kernels/built/linux-5.15.47/scripts/gdb/linux/constants.py", line 10, in <module>
LX_hrtimer_resolution = gdb.parse_and_eval("hrtimer_resolution")
gdb.error: 'hrtimer_resolution' has unknown type; cast it to its declared type
(gdb) lx-symbols /home/administrator/<module>/src
loading vmlinux
Traceback (most recent call last):
File "/home/administrator/Kernels/built/linux-5.15.47/vmlinux-gdb.py", line 34, in <module>
import linux.proc
File "/home/administrator/Kernels/built/linux-5.15.47/scripts/gdb/linux/proc.py", line 15, in <module>
from linux import constants
File "/home/administrator/Kernels/built/linux-5.15.47/scripts/gdb/linux/constants.py", line 10, in <module>
LX_hrtimer_resolution = gdb.parse_and_eval("hrtimer_resolution")
gdb.error: 'hrtimer_resolution' has unknown type; cast it to its declared type
No source file named kernel/module.c.
The kernel/module.c file does exist that it is complaining about.