Linux kernel Oops on GDB/OOCD single-step

Hi Guys,

I’ve been playing with openocd and beaglebone, trying to get it working with GDB.
Let me know your ideas about the following. For my experiment, I am debugging the Linux kernel.
Everything goes well, and I can even set hbreakpoints and halt, backtrace etc. However, when I try to single step, I get a kernel Oops.

The actual address that is to be stepped in o is “C0132100”, however from the kernel Oops, it appears that the address is “80132100”.
It does appear that the address is MMU converted before actually being used to set a breakpoint.

Any ideas around how this can be avoided, and the single step done directly on physical address (C0132100)?

Incidentally I get the same backtrace if I try to set a software break point (break) instead of hardware (hbreak).

bash-4.2# [ 39.468662] Unable to handle kernel paging request at virtual address 80132100
[ 39.477730] pgd = ce67c000
[ 39.480721] [80132100] *pgd=00000000
[ 39.484540] Internal error: Oops: 5 [#1] SMP ARM
[ 39.489426] Modules linked in:
[ 39.492687] CPU: 0 PID: 785 Comm: systemd-udevd Not tainted 3.10.0-rc3-00014-g15fc9e3-dirty #10
[ 39.501873] task: ce59eac0 ti: ce6de000 task.ti: ce6de000
[ 39.507594] PC is at vfs_read+0x1c/0x154
[ 39.511745] LR is at SyS_read+0x50/0x7c
[ 39.515806] pc : [] lr : [] psr: 600f0013
[ 39.515806] sp : ce6dff48 ip : c01320b8 fp : ce6dff74
[ 39.527919] r10: 00000080 r9 : ce6de000 r8 : bec74cd8
[ 39.533440] r7 : ce6dff78 r6 : 00000000 r5 : 00000000 r4 : ce6d30c0
[ 39.540332] r3 : ce6dff78 r2 : 00000080 r1 : bec74cd8 r0 : 801320bc
[ 39.547229] Flags: nZCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment user
[ 39.554763] Control: 10c5387d Table: 8e67c019 DAC: 00000015
[ 39.560832] Process systemd-udevd (pid: 785, stack limit = 0xce6de240)

Thanks,
Joel

Correction:
Single-step for virtual address (C0132100)

Thanks,
Joel

Ok, Software breakpoints don’t work with GDB over OOCD/JTAG. Why? I don’t know, but it has something to do with the Address translation. Using software breakpoint always results in an Oops indicating an MMU/paging fault.