June 2017
Intermediate to advanced
478 pages
13h 14m
English
The best way to show you how it works is with a simple example.
You need to tell kgdb which serial port to use, either through the kernel command line or at runtime via sysfs. For the first option, add kgdboc=<tty>,<baud rate> to the command line, as shown here:
kgdboc=ttyO0,115200
For the second option, boot the device up and write the terminal name to the file /sys/module/kgdboc/parameters/kgdboc, as shown here:
# echo ttyO0 > /sys/module/kgdboc/parameters/kgdboc
Note that you cannot set the baud rate in this way. If it is the same tty as the console, then it is set already. If not use, stty or a similar program.
Now you can start GDB on the host, selecting the vmlinux file that matches the running kernel:
Read now
Unlock full access