I´ve spent the last week or so trying to debug some code and finally decided to buy a JTAGICE mkII. Reading the manual prior to ordering, I stumbled over the breakpoints section in the introduction chapter:
The AVR OCD system distinguishes between two types of breakpoints; Software and Hardware breakpoints.
A software breakpoint is a break instruction placed in Flash memory. When this instruction is executed, it will break the program execution. To continue execution a "start" command has to be given from the OCD logic. Note that ATmega128 has no support for the BREAK instruction. When placing a breakpoint on an instruction in AVR Studio, this instruction is physically rewritten as a break instruction in the AVR Flash memory. When reaching this instruction the operation is halted. When starting the execution, the "pending" instruction is executed before continuing to execute instructions from the Flash memory.
In the JTAG OCD logic there are 4 registers capable of storing one memory address each. The JTAGICE mkII reserves one of these registers for internal use. The 3 others can be combined in different ways to generate valid break conditions. The Frontend Software chapter describes in detail the different ways of combining these registers.
Since a Software breakpoint requires a reprogramming of the entire page where it is located, hardware breakpoints are recommended for breakpoints that are often modified.
As luck would have it, I´m using the ATmega128 in my current project. At the same time, these would be my first attempts at using JTAG and in-circuit debugging at all.
The question is: Did this limitation of the ATmega128 not supporting the break instruction have effects on your debugging needs? Which ones? What were your workarounds/solutions?