How to debug Linux kernel with JTAG + GDB?
I've successfully established a JTAG connection and serial port connection to my development board. I've followed the below diagram (with a little bit of difference).
my GDB_client is on my Linux host but my OpenOCD is on my windows host and they communicate with each other using GDB_server over network. they communicate with each other easily and I can load applications to my board via GDB on my Linux over JTAG.
this is my platform specifications:
According to this guide: Loading a kernel in memory Once you are used to using gdb to debug kernels you will want to use gdb to directly load kernels onto your target. The most practical way of doing this is to set a hardware breakpoint at the start of the kernel and reset your board using the JTAG reset signal. Your boot loader will initialize your board and the execution will stop at the start of the kernel. After that you can load a kernel into memory and run it.
I put beak point on the starting point of my kernel, but the problem is that it won't stop on the breakpoint to let me load the vmlinux file to my memory.
This is what I'm doing:
I've also tried this but again, it didn't stop on the breakpoint:
UPDATE:
Sometimes it works and sometimes it won't. It seems after resetting my board, I should swiftly pause my program using gdb and again resume it to make it work. Why is this happening?