On 6/5/19 2:20 AM, Michael Rolnik wrote: > Hi Richard. > > I am still struggling with this one. > > The spec says. > The BREAK instruction is used by the On-chip Debug system, and is normally not > used in the application software. > When the BREAK instruction is executed, the AVR CPU is set in the Stopped > Mode. > This gives the On-chip Debugger access to internal resources. > If any Lock bits are set, or either the JTAGEN or OCDEN Fuses are > unprogrammed, > the CPU will treat the BREAK instruction as a NOP and will not enter the > Stopped mode.
Yep. > I read is as follows > - If user has an intention of using debugger, BREAK should be translated to > QEMU debug breakpoint > - If user has no intention of using debugger, BREAK should be translated into > NOP. I do not read it that way. The spec is talking about a specific implementation of debugging -- fuses, jtag and all. We do not need to implement breakpoints using any of those mechanisms, because we can insert breakpoints via on-the-side data structures and re-translation. r~