In MIPS, when a breakpoint is hit in a delay slot then the PC points to the previous branch/jump instruction. In this case, CAUSE.BD bit is set and we can correct the PC accordingly.
However doing a single step at this point will continue execution from the current PC and not from the target of previous branch/jump instruction.
Solution to this is to not allow breakpoint in a delay slot and move it to previous branch/jump instruction (which will have same effect).
When user tries to set breakpoint by address then this patch checks if the instruction at that address is a delay slot instruction and if it is then the breakpoint is moved to its previous instruction.