toolchain
toolchain copied to clipboard
Breakpoints should not be allowed in delay slot of user space applications
In GDB for userspace there are problem with handling breakpoint set in delay slot. Unlike baremetal tool chain where BRK instruction is used, GDB for Linux uses TRAP_S which is not so useful, and due to specifics of user-kernel transition DE bit will be lost. User space GDB implements software single step to avoid halting in delay slot. However it doesn't help if user has set breakpoint manually at the delay slot - GDB doesn’t prevent this and flow gets broken.
Upon further examination, GDB has a hook-function single_step_through_delay_slot, which is not implemented for ARC. Another hook (implemented by other targets) is adjust_breakpoint_address. It looks like that the adjust_breakpoint_address can be used to move BP from delay slot to the parent branch instruction. On the other hand single_step_through_delay_slot would allow debugger to step over this delay slot.
See STAR 9000732940 for more info.