It should also be noted that PMON makes use of the CPU's exception handling mechanism whenever a breakpoint occurs. Therefore, care must be taken in debugging exception handlers, to ensure that any necessary machine state is saved before a debug exception may occur. In particular, the EPC (Exception Program Counter), and SR (Status Register) must be saved, along with any other registers which may be used by the handler.
In practice, this means that breakpoints or single-stepping may safely be used within the body of an exception handler, provided it is written in such a way that all necessary state is saved as its initial action on entry. However neither of these features may be used during the first few instructions of the handler; these must be allowed to complete the task of saving essential machine state to the stack.
Navigation: Document Home | Document Contents | Document Index