The functions and definitions of this section make up the intrinsic support for debugger interfaces. They provide interfaces to the status of all the threads, and allow the debugger some control over the application. My intent is to offer a logically complete interface to the target context without building the entire debugger into uCR. I only include the debug support necessary to write the debugger elsewhere, so that uCR doesn't bloat from code not needed in production.
The specific debugger interface is built on top of these functions and the others already described. Although it is impossible to make a debugger free of target specifics, these functions handle many of those specifics that can be abstracted at this level. uCR comes with the code for interfacing with GDB, including patches to GDB to support remote debugging for your target.
Because faults generally do not interrupt in places they are not supposed to, uCR does not include a way to turn them off. After all, an illegal instruction is dificult to ignore. TRACE faults can be a little different, though. If no special action is taken, then it is possible for a TRACE fault to happen anywhere, anytime; including critical code. Since the intent is to allow a debugger to run in a thread, trace faults need to be allowed to switch threads, thus possibly enabling interrupts while stepping through protected code. This is very bad, so whenever interrupts are disabled, hardware instruction tracing is also turned off.