I tried to debug linux kernel on Beagleboard XM with insight and flyswatters2. After I run arm-linux-gnueabi-insight vmlinux, I see the kernel is downloaded to the target via jtag flyswatter2. When it is done, a message box “Make breakpoint pending on future shared library load?” is popped up. If I click “Yes”, the insight would crash, otherwise I stop at header.S, then step, but it hangs at “beq __error_a” here is from gdb window
My attempts to use openocd + flyswatter to debug a kernel failed as well [1] and I neither get any kind of useful help from the OpenOCD folds nor from tincantools.
All the instructions I came across are either outdated or do not even attempt to debug a kernel.
Debugging u-boot seems to work, but as soon as we enter the beautiful world of virtual vs. physical memory things start to break so instead of buying many flyswatters I bought a few BDIs, which work for kernel debugging.
This is how I managed to do some debugging in u-boot:
telnet localhost 4444
amdm37x_dbginit dm37x.cpu
reset halt
bp 0x402009cc 4 hw
bp
poll
resume
when the breakpoint is hit remove it
rbp 0x402009cc
connect with gdb
arm-linux-gnueabi-gdb /home/student/beagle-xm/u-boot-build-mainline-student-v2013.04/spl/u-boot-spl
we should be on a breakpoint from the flyswatter
issue the following commands in gdb
target remote localhost:3333
info break
break __udelay
c
c
disable 1
info break
I use kgdg/gdb to debug the linux kernel and it works really well,
in fact, its one of the things I love most about my beagleboard is the ability to debug the kernel.
I compile the beagleboard kernel with kgdb support enabled and run gdb on my laptop to debug the kernel.
I can set breakpoints and single step through the kernel , I recommend this approach.
I use kgdg/gdb to debug the linux kernel and it works really well,
in fact, its one of the things I love most about my beagleboard is the ability to debug the kernel.
Yes this works indeed, but being a software only solution it’s a bit limited. What I mean is with a JTAG device you can really stop hardware blocks like timers. You can’t do this with software. This means that for real low level software like manipulating registers I typically stay away from kdb/kgdb.
On the other hand to find out where the kernel oopsed kdb/kgdb are quite helpful. BTW ftdump (the one built into kdb) does not seem to work at the moment on the beagle-xm.
Other debugging alternatives could be kprobes and friends.
Kai if you tell us in more detail what you are trying to debug maybe we could help a bit more here.
I tried to debug 2.6.39. Once Insight debugger downloading is finished, the debugger hangs, Here is openOCD debug message (-d 3)
As I told you before I did not manage to get openOCD/flyswatter 2 to work for kernel debugging. Similar to my experiments it’s freaking out when the MMU is turned on.
What I still don’t understand is which problem you are trying to solve. Do you just want to debug a Linux kernel for the fun of it or do you have a specific problem and need to debug it somehow?
If your problem is that you want to make openOCD/flyswatter 2 work for the beagle-xm you might want to try the openOCD mailing list [1]