I would like to debug kernel modules on the EVM. I have found that KGDB is now part of the main kernel and can compile the kgdboc module in with the following settings . .config.
CONFIG_HAVE_ARCH_KGDB=y
CONFIG_KGDB=y
CONFIG_KGDB_SERIAL_CONSOLE=y
# CONFIG_KGDB_TESTS is not set
CONFIG_KGDB_KDB=y
CONFIG_KDB_KEYBOARD=y
I am using ttyS0 as the console and as the kgdb debug port.
I configure kgdboc using
echo ttyS0 > /sys/module/kgdboc/parameters/kgdboc
I then trigger kgdb using
echo g > /proc/sysrq-trigger
I get this output which shows something happened
SysRq : DEBUG
Unable to handle kernel NULL pointer dereference at virtual address 00000000
pgd = cbd00000
[00000000] *pgd=8cb9b031, *pte=00000000, *ppte=00000000
Internal error: Oops: 80000007 [#1]
last sysfs file: /sys/module/kgdboc/parameters/kgdboc
KGDB: re-enter exception: ALL breakpoints killed
---[ end trace c97b6aac639fbca9 ]---
Then the shell restarts and I am not able to issue any kdb commands.
I have tried using kgdboe but the source is not in the SDK so I am unable to take that route. Will it work if I get the source?
I have also attempted to use a JTag debugger with openocd but there is not an openocd config file vaialble for this platform.