I use AVR Studio 4, JTAGIce MkII-CN, gcc for debugging. It works generally OK but sometimes happens after some unspecific interruption (reset, power cycle, etc.) that AVR Studio breakpoint remains transformed into BREAK instruction and it causes the program always breaks at this instruction and cannot go over any way (visible in Disassembler window).
I cannot investigate where the instruction is written because it survives even reboot of MCU, AVR Studio and JTAGICE debugger, the BREAK still persist there. Only reflashing MCU helps and I can go on.
Does on-chip-debugging-engine modifies flash and remembers original instruction? I'm not sure if it works beyond debugging because BREAK is probably ignored and missing original instruction is hardly detectable.
Note: I'm not sure just now what was result of reading flash and verifying against original.