Hello,
As the title says, I was remote debugging a LKM(imx219), with KGDB config sets to:
CONFIG_KGDB=y
CONFIG_KGDB_SERIAL_CONSOLE=y
CONFIG_FRAME_POINTER=y
KDB wasn’t set though.
So the kernel module was loaded at boot time and the kernel params kgdboc=ttyS0,115200 nokaslr
were added following the existing quiet
in file extlinux.conf
.
After the target booting up, I got the module loading addr by cmd # cat /sys/module/imx219/sections/.text
, which gave 0xffffff80_00fb6000
, then I issued cmd # echo g >/proc/sysrq-trigger
waiting for gdb to kick in, after that, gdb was pulled up on host and was configured:
# gdb [kernel_out]/vmlinux
(gdb) set serial baud 115200
(gdb) set remotetimeout 100
(gdb) tar rem /dev/ttyUSB0
(gdb) add-symbol-file [kernel_out]/drivers/media/i2c/imx219.ko 0xffffff80_00fb6000
(gdb) b imx219_power_on
(gdb) c
Target got back from halting and everything went well till this point. Then gsteamer
was launched and func imx219_power_on
was called seen from dmesg
, however, the breakpoint set in gdb
never got hit.
More info on the setup:
gdb version is 8.0
module folder Makefile was updated to subdir-ccflags-y += -Werror -DDEBUG -g
host and target was connected by a USB to TTL serial cable.
Any of the settings are incorrect, or did I miss anything?
Thank you.