I have been trying to figure out how to give support for software breakpoints thumb-2 for arm cortex-8.
The hardware I am using for tests is TI OMAP3 beaglebone.
I am not the best person to do that but anyway while no other volunteer decide to help I will keep trying.
What do I know about the problem.
- openocd knows that the board is running in thumb state.
Debug: 1481 22479 armv4_5.c:395 arm_set_cpsr(): set CPSR 0x400001b3: Supervisor mode, Thumb state
-
While gdb find thumb (16 bits) instructions, the breakpoints succeed.
-
gdb find a thumb-2 instruction and requires a 32 bits software breakpoint.
Debug: 1629 24548 gdb_server.c:2050 gdb_input_inner(): received packet: ‘Z0,80008100,3’
Debug: 1630 24548 gdb_server.c:1394 gdb_breakpoint_watchpoint_packet(): -
Debug: 1631 24548 gdb_server.c:1413 gdb_breakpoint_watchpoint_packet(): =======> gdb watch/breakpoint type(0)
Debug: 1632 24548 cortex_a.c:1986 cortex_a8_read_memory(): Reading memory at address 0x80008100; size 3; count 1
Debug: 1633 24548 cortex_a.c:1939 cortex_a8_read_phys_memory(): Reading memory at real address 0x80008100; size 3; count 1
Error: 1634 24548 cortex_a.c:1408 cortex_a8_set_breakpoint(): Error @ cortex_a8 read_memory:-601
Error: 1635 24548 breakpoints.c:96 breakpoint_add_internal(): can’t add breakpoint: unknown reason
Debug: 1636 24548 gdb_server.c:1163 gdb_error(): Reporting -601 to GDB as generic error
And here is the key point: gdb is trying to install a break point type 3 (32-bit Thumb-2 mode breakpoint) that at this time is not supported by openocd.
My first simple idea was consider type 3 (thumb-2 breakpoint 32 bits) breakpoint as the same like type 4 (ARM breakpoint 32 bits) so that openocd can handle memory in the same way but unfortunately it doesn’t work and I don’t know why. Any suggestion or explanation is welcome.