I got vmlinux.uimg and vmlinux from my friend. The vmlinux is build with Linux version 4.14.10. I have two machines:
- target (arm 32 bit architecture) and
- host (x86 architecture)
Both systems are connected with wire, port numbers are /dev/ttySAC3 and /dev/ttyUSB0 respectively. Target boot up by reading image file vmlinux.uimg from sd card. I want to debug this vmlinux from my host machine.
The steps I am following are:
- Start minicom in host.
Type
echo ttySAC3,115200 > /sys/module/kgdboc/parameters/kgdboc in minicom.I am getting "KGDB: Registered I/O driver kgdboc".
Type
echo g >/proc/sysrq-trigger in minicomI am getting "sysrq DEBUG and Entering KGDB".
- Close minicom.
- Go to vmlinux folder through terminal in host machine.
Type
gdb vmlinux[Note: this gdb I am using is 7.10 version for arm]
In GDB type
target remote /dev/ttyUSB0It give me a message
Remote debugging using /dev/ttyUSB0 0xc0d14f5 in sysrq_dbg_op()In GDB type
b do_mmap_pgoffI am getting a message
breakpoint 1 at xxxx: do_map_pgoff (4 location)In GDB type
contThis gives me a message
Continuing.and then does nothing..
The problems:
GDB
continueis not working as expected. I am expecting last step(9) to continue with target restart and hit the break point instead it is getting crash.GDB
stepandnextare not working as expected. Single stepping until exit fromsysrq_dbg_op()which has no line number information. "Warning: invalid remote reply".GDB 'run' is also not working. It display a message "The remote target does not support run"
How can I call a module on my target on which I have put breakpoint as I can not use minicom and gdb concurrently.
What all steps I should follow after I freeze the kernel.
What is wrong in this process?